Questions tagged [unload]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
25 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
1answer
58 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
1answer
37 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
1answer
74 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
1answer
50 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
1answer
50 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
2answers
36 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
2answers
74 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
1answer
107 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
1answer
24 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
1answer
564 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
0answers
39 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
1answer
38 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
1answer
252 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
1answer
34 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
1answer
56 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
1answer
24 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
1answer
117 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
1answer
125 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
1answer
159 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
1answer
525 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
1answer
451 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
1answer
403 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
1answer
67 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
2answers
119 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
1answer
51 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
1answer
113 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
1answer
78 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
1answer
97 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
1answer
36 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
1answer
197 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
1answer
155 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
1answer
189 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 ...
0
votes
1answer
107 views

pset5 2017 unload() trie segmentation fault and undefined behavior

Having a lot of trouble with unload(). I've scrapped nearly working functions several times just in the hopes that starting over will fix things. I cannot figure out why my code keeps leading to the ...
0
votes
1answer
74 views

pset5 speller unload - node allocation quirk

Most of this pset5 has gone smoothly, but unload() has caused me problems. When I'm navigating down my data structure (trie) to locate a node with all NULL children, the last index has a memory ...
0
votes
3answers
65 views

Segmentation error on PSET5 unload function

I'm working on the unload function for pset5 - speller and ran into segmentation errors with the first clear function below (dictionary.c unload function calls the recursive function clear). I ...
0
votes
1answer
71 views

pset5 trie leak on unload

The programme compiles fine but when i run help50 for leaks i get the following, though i have freed the children. i appreciate the help: ==11548== For counts of detected and suppressed errors, rerun ...
0
votes
0answers
45 views

can’t pass valgrind in pset5

I don’t know where is the error and when i use help50 that what i get and here is the code unsigned long hash(char* str); int count ; int table_size = 18788; typedef struct node { char word[...
0
votes
1answer
117 views

PSET5: Unloading function doesn't work

I've decided to implement the trie data structure and got everything working except the unloading part. I've written another function for it and it isn't working. I think it only frees the first few ...
0
votes
1answer
118 views

Pset5 Last frown to turn upside down!

I've been slogging away at speller for about 2 weeks now and im tripping over the last hurdle. heres what my check50 was spitting out https://cs50.me/checks/41dd8b60a432fa6adcd672274f3452ba6eedfda3 ...
0
votes
1answer
517 views

pset5 dictionary c. trie please help Unload()

i ve been working struggling so much... please, a hint why i can make it work. I don t know how to return the result and make sure that the conditions are followed. here are my codes for unload : ...
0
votes
1answer
110 views

pset5 unload base case

I haven't written any code yet, although I've written pseudocode for this problem, and I keep coming back to the issue of base case. I built a trie and now want to recursively unload it. I think I've ...
0
votes
1answer
74 views

PSET5 Speller (unload) - “Process recieved SIGABRT: aborted”

I can't seem to find the problem with my code, can anyone help me? //recursive function for unload - to unload a node, first unload all its //children, then unload the node itself bool recursive(...
0
votes
1answer
223 views

pset5 speller unload (trie) leaking memory

My unload function is leaking memory. Valgrind says that 8,960 bytes in 40 blocks were definitely lost, and 38,752 bytes in 173 blocks were indirectly lost. I'm not sure why...my unload function makes ...
0
votes
1answer
63 views

Pset5 Unload Giving Double Free or Corruption error

My title pretty much explains the problem. I can tell that the problem probably exists where I called free (marked in my code). Here's the code below: bool unload(void) { node* trav = head; ...
0
votes
2answers
103 views

My unload only gets one free

I've rewritten my code a bunch of times and it clicks in my head...buuuuut it doesn't actually work. I'm not doing the actual cs50 problem because I prefer to start smaller then adapt to cs50. I'm ...
0
votes
1answer
66 views

Segfault on unload. Pset5 Speller

Just got my speller working. Except for the unload func. I feel that idea is right, but maybe the implementation is wrong. Words are not that long, so i figured that recursive solution wouldn't result ...
0
votes
2answers
95 views

pset5. Can't trace memory leak

Load function (with a trie data structure) //DEBUG unsigned int allocs = 0; // define node and create root typedef struct node { bool is_word; struct node* children[27]; } node; node* root; ...
0
votes
1answer
40 views

PSET5 *** Error in `/home/ubuntu/workspace/pset5/speller/speller': double free or corruption (!prev): 0x0000000000603250 ***

Upon writing unload, I get the following error *** Error in `/home/ubuntu/workspace/pset5/speller/speller': double free or corruption (!prev): 0x0000000000603250 *** In the GDB console, I get ...
0
votes
1answer
982 views

PSET 5 - Just trying to understand what valgrind is telling me

I've successfully completed my program, but since this is my first time working with malloc() and free(), I wanted to make sure that I understood what valgrind was giving me as feedback. So first off ...