Questions tagged [unload]
The unload tag has no usage guidance.
109
questions
0
votes
1
answer
30
views
Speller: memory leak
this is my program
// Implements a dictionary's functionality
#include <ctype.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include ...
0
votes
0
answers
55
views
How can I fix this double free in speller?
I've posted this question previously but I tried to post various functions from my code without posting the whole code at once, because I thought that was better etiquette or something. However, the ...
0
votes
0
answers
34
views
Speller: Valgrind tests fail; problem may be with load
My spell checker seems to run pretty well, except the unload function never ran properly. It compiles, but executing it prints out the misspellings but then prints the message, "double free ...
0
votes
1
answer
36
views
PS5 - Speller - Unload function
I have been going through the Pset5 (Speller) and I am currently stuck. Right now, I am just trying to have a functional code, so I am not worried about how optmized my functions (specially the Hash ...
0
votes
1
answer
19
views
pset5 speller different unload algorithms
I just finished pset5 but I had a question about why a (what i think is) recursive method doesnt work but the one i went with does.
if you skip and look in unload youll see a "destroy" ...
0
votes
1
answer
57
views
PSET5 - 3 conceptual questions (debug not needed)
Question 1 (hash) – is it even remotely possible to reverse engineer the hash function when given lots of output?
For example if the underlying hash function is something simple like tolower(word[0]) %...
0
votes
1
answer
37
views
PSET5 unload error
bool unload(void)
{
// TODO
int i = 0;
for (i = 0; i < N; i++)
{
node *cursor = table[i];
if (cursor != NULL)
{
node *tmp = cursor;
...
0
votes
1
answer
195
views
pset5 - speller "double free detected" when I run check 50 but program does nothing during self tests
I am currently doing Speller. I have written all the functions and the program compiles but during self testing it is printing "misspelled words" and stays stuck at a blinking cursor. It ...
0
votes
1
answer
39
views
pset5 unload + valgrind
I tried to solve problem with memory usage but did not figure out where is the problem.
Dictionary unloads successfully but still issue with memory access exists.
I think that problem with ...
0
votes
1
answer
27
views
Unload function pset5
I've completed the pset5 and got all the check50 marks correct, except the valgrind one. What is weird is that Valgrind also say that i've freed everything correctly. Here is the error message that I ...
1
vote
1
answer
45
views
Speller - unload is giving me 1000000 errors in valgrind
so I don't know what I should do with my unload function to make it work properly? Because valgrind isn't happy at all and it's giving 1000000 errors (literally). The load function works perfectly (I ...
0
votes
3
answers
68
views
PSet 5 Speller: How can the program tell if the dictionary has been successfully freed?
I'm pretty sure I'm just being dumb, but I've been wracking my brain and I'm drawing a blank. I've completed 5/6 of the functions in Speller, but the unload function has me stumped- the description ...
0
votes
1
answer
31
views
Pset5 - Speller - Seg fault
I'm getting a segmentation fault when running this. Valgrind reports no errors, but a leak of 1,080 bytes at two blocks, with 5 allocs and only 3 free'd. Below is my load function and below that are ...
0
votes
1
answer
103
views
PSET5/Speller - Valgrind error: conditional jump, relates to table[i] array, but I've already initialized that (or have I?)?
I posted something similar a couple of days ago but have made progress since then. Specifically I found a couple of posts answered by Cliff B indicating the problem users had was that they hadn't ...
0
votes
2
answers
41
views
In PSET5/ Speller - Unload Valgrind says Conditional jump or move depends on uninitialised value(s)
So my code passes all the Check50 tests apart from the memory one. I have been playing around with this for ages, but don't understand what the problem is. Here's what valgrind says.
And here's the ...
0
votes
1
answer
78
views
Trying to fix a segfault in unload , pset5, speller
So when I originally wrote my code for the dictionary.c, I forgot to create the header nodes for each 'bucket' in the hash table. It ran well when every first node of each linked list had a letter, ...
1
vote
1
answer
147
views
speller - unload returns false .....?
unload returns false and i am not sure why....
when i run Valgrind i get this:
HEAP SUMMARY:
==7885== in use at exit: 608 bytes in 2 blocks
==7885== total heap usage: 143,096 allocs, 143,094 ...
0
votes
1
answer
70
views
recursive function on speller causing a "conditional jump" error on valgrind?
I am trying to implement a recursive subfunction for speller. It works, but when I run check50, I'm told that there is a "Conditional jump or move depends on uninitialised value(s): (file: ...
0
votes
1
answer
471
views
Pset5 - Speller - memory leak?
My programme runs and I'm passing all the checks bar the last one.
When I run the check with --log I get this response:
:( program is free of memory errors
valgrind tests failed; rerun with --log ...
0
votes
1
answer
132
views
PSET 5 Speller - Unload leaking a ton of memory
I've been trying to read other questions on stack exchange about it and do research on it but I really couldn't find a solution for my unload problem. It doesn't seem to unload much. I tried a lot of ...
0
votes
1
answer
256
views
PSET 5 Speller Failing free memory of errors final check
So i am so close to finally completing this present and i still have some final errors to go through. Valgrind is saying that it is still leaking memory for some reason and i cant find the reason why.
...
0
votes
1
answer
75
views
PSET 5 Unload Segmentation Fault
I've been stuck on this problem set for a while now. Valgrind is telling me I have a problem in my unload function, which is "Conditional jump or move depends on uninitialised value(s)". I can't find ...
0
votes
1
answer
390
views
CS50 Pset5 error: conditional jump or move depends on uninitialised value(s)
valgrind is showing me an error that I have trouble understanding. The error is "conditional jump or move depends on uninitialised value(s)". Valgrind is directing me to line 125 of my code, which is ...
0
votes
2
answers
45
views
PSET5 - Valgrind error - no enough bytes are being freed
I've been on this pset for some time now and everythin seems to be working except that there are some memory leaks and I really can't understand why. I've checked a lot of other people's codes but I ...
0
votes
2
answers
170
views
Pset5 Memory leak in unload()
I've been working on speller for about two weeks now and I've finally got the programm to work, but valgrind cam up with a few memory errors. I've managed to solve most of them on my own, but the leak ...
0
votes
1
answer
207
views
Pset 5 Speller valgrind error
I am trying to fix the last error in my code pointed out by check 50. I think the problem is in my unload but can't say for sure. Here's my code. I know I have some basic functionalities wrong but ...
0
votes
1
answer
33
views
PSET5 Unload() recursive sub-function causes 112 bytes to leak - why?
I've already fixed this issue playing around with my code, but I cannot seem to understand why this (former) version of my recursive function leaks 112 bytes (2 nodes).
Can anyone please help me ...
3
votes
1
answer
1k
views
Help with PSet 5 2020 - Speller - Check & Unload Functions (EDIT: logic error in Load Function)
EDIT: Fixed the problem. The issue was not with the check or unload function but with the load function which had a small but very significant logic error. Figured it out with some great help from a ...
0
votes
0
answers
47
views
PSET 5 - Valgrind - Invalid read of 8 - Unload
So close to submission!
- However, when I check using valgrind the ouptut is:
==22743== Invalid read of size 8
==22743== at 0x40135C: unload (dictionary.c:123)
==22743== by 0x400E59: main (...
0
votes
1
answer
58
views
Speller seg faults in unload function
I've tried to fiddle around with my unload function for a while and don't understand why I'm getting a seg fault. It seems that the unload function is running through completely at least once, but ...
0
votes
1
answer
500
views
pset5 speller unload function
I tried two methods but still, have a memory leak and also I didn't know how I know every step succeed or not. it supposes return true if free all memory and return false is not where I must write ...
0
votes
1
answer
153
views
And one more "Invalid read of size" problem
So I've managed to write a program, which compiles, cleared all the segmentation fauls, made it to do all the required tasks correctly, like creating a hash table, cheacking for the misspelled words ...
0
votes
1
answer
83
views
Stuck with Unload using trie
I could not unload the dictionary, and still don't understand why. It seems that it is not freeing what I think. I would really appreciate some help, here is my code:
// Unloads dictionary from ...
0
votes
1
answer
36
views
dictionary.c trie: setting variable to NULL doesn't set element to NULL
Working on the unload function in speller (dictionary.c)...
My current test dictionary simply contains a letter c, as I'm just trying to make sure one iteration will work.
So I should (and do, ...
0
votes
1
answer
330
views
valgrind in speller unload says I am using a variable without a value, when I assign it in the previous line
I just finished my pset5 and when I try to run valgrind with help50, it appears that
Looks like you're trying to use a variable that might not have a value? Take a closer look at line 115 of ...
0
votes
1
answer
132
views
PSET4 unload() don't work
I'm not sure if my unload() function worked properly. I tried to use Valgrind and it said memory leaked 8mb. I tried check50 and it said I have a memory leak.
Also, the time takes very long, it ...
0
votes
1
answer
306
views
Unload works on small dictionary, but not on large? (speller.c / hash table method)
When testing with the small dictionary, it unloads as expected however when testing with the large dictionary, I receive the error "Could not unload dictionaries/large."
The only difference that I've ...
0
votes
1
answer
659
views
Pset5 Speller (using hash table) unload multiple errors
I have successfully implemented pset5 speller using a hash table, but am facing some residual issues with the unload() function. I am unable to resolve a number of errors that are identified by ...
0
votes
1
answer
556
views
Pset4 - Speller - Unload broken?
I seem to have the load/size functions on point. I'm trying to implement unload before I move on to check, but my valgrind keeps telling me I have a ton of memory left (~8,011,460 bytes) and points ...
0
votes
1
answer
457
views
Speller (pset 4 2019) - Can't fix memory leak in hashtable
I've been working on speller, and all my code does the job fine but I can't get rid of the memory leak valgrind is giving me.
It seems to be something to do with my load function. I think it's my ...
0
votes
1
answer
80
views
pset5 (trie) valgrind memory leak
I'm having trouble with the last step of pset5, valgrind. When I run it with the test text I get: Looks like you're trying to access 8 bytes of memory that isn't yours? Did you try to index into an ...
0
votes
2
answers
155
views
PSet5 Unload(): *** Error in `./speller': double free or corruption (top): 0x0000000002bcb610 *** Aborted
I have been trying to solve this problem for about 3 weeks now...after multiple iterations I just cannot seem to find what I am doing wrong in the load or unload functions to trigger this error. Below ...
0
votes
1
answer
55
views
PSet5: Segfault in unload
My code compiles, but when I run it it returns the following message and segfault.
dictionary.c:183:9: runtime error: index 27 out of bounds for type 'struct node *[27]'
dictionary.c:185:15: runtime ...
0
votes
1
answer
129
views
Pset5 unload: how can I update Trie's data inside a recursive function?
few people suggested to use a recursive method of unloading a Trie data structure, but I am struggling with it a bit.
I am stuck on the part on how can I update the root node ( the main node which ...
0
votes
1
answer
85
views
Pset5 Memory leak with trie scructure
after almost 2 month of working I am finishing the pset5 but...
I get memory leaks. valgrind plus help50 is giving me this:
Looks like you're trying to access 8 bytes of memory that isn't yours? ...
0
votes
1
answer
117
views
Problem in unload
I am having problem in my unload. While running valgrind it shows no leaks, but the program wont acquiesce check50. Here is the unload function:
//free the memory
bool freenode(node *first)
{
//...
0
votes
1
answer
46
views
find the leak! pset5
I have run ./test which processes this function:
bool unload(void)
{
//free up memory from linked list
for (int i = 0; i < 26; i++)
{
if (hashtable[i] != NULL)
{
...
0
votes
1
answer
224
views
Pset5 trie unload -recursive function does not free memory
im close to finish this problem set , but i cannot figure out the working recursive function, especially if backtracking may work in this form of implementation:
void rec_unload(node *trv)
{
for(...
0
votes
1
answer
179
views
PSET5 Speller.c. Unload function returns segmentation fault
I am using a trie data structure for speller. I used a recursive function to unload the memory, so I could backtrack up the data structure after removing the last of the arrays of all null pointers . ...
0
votes
1
answer
223
views
pset5 speller valgrind show leak in load function
my speller code works very well with all texts
but when i ran valgrind there was heap leak in load() specifically in new_node malloc
can you help me figure out why?
there is my code for load() and ...