Questions tagged [valgrind]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
129 views

Pset4: Valgrind memory issue?

My code comes up with all green smiles on check50, but valgrind shows memory leaks. I don't think I fully understand pointers or malloc, yet. Here's my code: -code- Here's valgrind: ~/workspace/...
0
votes
1answer
110 views

CS50 PSET5 Trie Segmentation Fault

When I try to use speller.c with the large dictionary and the text 'hi', it says it could not load/open. When I use a large dictionary, it occasionally gives me a segmentation fault. Valgrind says: ==...
1
vote
1answer
185 views

PSET5: Why is my code working without fully implemented Unload function

My code is working fine and Check50 is also passing it. However I have not implemented Unload function and I am wondering why Valgrind or Check50 showing any error? All i did was changed return False ...
0
votes
1answer
68 views

Pset6 - CS50. Segmentation fault for free(index)

For pset6, implementing a server, almost everything works except the indexing function. I get a segmentation error after the use of this function when trying to free(index). This is the returned ...
1
vote
1answer
64 views

Pset4: resize check50 passed, but valgrind reports a segmentation fault

My code passed the check50 and it runs well. But valgrind reported a segfault. And I don't know why. Here are the report and the relevant code:
0
votes
1answer
69 views

Parse: Valgrind giving 4 unconditional jump errors on a test case file

I am doing pset6 and for the parse function I have first started to create about the same inputs in a seperate file and with printfs I have tried to slowly tackle the parse funtion by manually giving ...
0
votes
2answers
875 views

(pset5) valgrind - 1 block not freed

I've grinding away at this one problem for a couple of days now, and can't quite work out what's going wrong. My code passes check50. The output is fine. I'm relatively happy with how quickly it runs. ...
0
votes
1answer
145 views

Pset5 unload trie 244 bytes lost

So, I'm finishing up pset5 and I'm now just trying to make sure theres no memory leaks. Unfortunaly there are 244 bytes being lost and I'm not sure why they're being lost. This is my free code: bool ...
0
votes
1answer
134 views

Problem with valgrind pset5

Could anyone help me to cope with valgrind in my pset5, please? here is my code: dictionary.c /** * dictionary.c * * Computer Science 50 * Problem Set 5 * * Implements a dictionary's ...
0
votes
1answer
609 views

per valgrind: multiple invalid read and invalid write; invalid free(); “still reachable: 568 bytes in 1 blocks”

My recover.c seems to recover all images correctly (per check50) but still seems to have issues with a couple of things per valgrind (output copied at the bottom). As background, I am using a ...
0
votes
1answer
165 views

pset4 recover.c valgrind claims there is unfreed memory. I'd like to know how/why?

I just finished recover.c in pset4. It compiles, runs, and creates all the jpgs just fine, but valgrind gives me the following leak summary (full leak summary at bottom): ==15709== LEAK SUMMARY: ==...
4
votes
2answers
8k views

Conditional jump or move depends on uninitialised value(s)

I just finish debugging my code for pset5 dictionary.c, It's working correctly, It passed check50 too. Now the problem I am encountering is in valgrind my heap is all freed, But wherever in ...
0
votes
1answer
209 views

Implementing a trie. Updated load function in dictionary.c causes more problems with valgrind

I've been trying to fix an error that valgrind indicated came from my load() function. So in the beginning I implemented load() like this: http://pastebin.com/57a2HPMg Doing so only produced 1 error ...
0
votes
1answer
68 views

pset6 valgrind issues

I have been unable to decipher what valgrind is trying to say regarding my parse code.If some one could please throw some light. Posting some part of my parse function parse() { ...
0
votes
1answer
2k views

Can't figure out memory leak pointed out by valgrind in dictionary.c

Having implemented the functions within dictionary.c, I tried running speller.c but was given the error double free or corruption (!prev). And so I ran speller.c through valgrind and got the message ...
0
votes
1answer
71 views

Valgrind problems in Pset5

I finished pset5 and check50 says it's correct. But valgrind says it has some errors. I'm having a hard time finding them and I could use some help. Code: unsigned int dict_size = 0; node* hashtable[...
0
votes
1answer
43 views

valgrind complains about char* used in load-pset5

Hello everyone I have just completed pset5 and the only issue I have is that valgrind is throwing an error about a malloc'd char* I use in my implementation of load. I know where the error is, but I ...
0
votes
1answer
191 views

pset5 dictionary and valgrind

I am currently working on pset5 and having some issues with errors that were identified by valgrind. My dictionary program seems to run fine- it passes the check50 and it is almost as fast as the ...
0
votes
1answer
95 views

How to troubleshoot PSET6 after compilation

The following is the output when I run "./server public" It took me forever to get the code to the point where it would compile, and I am trying to run valgrind, but valgrind didn't find any problems....
0
votes
2answers
358 views

Too much misspelled in pset5 dictionary

Through my code, I got 19190 misspelled. It seems I have a problem in check though. Anyone who can find any problem here?? dictionary.h /** * dictionary.h * * Computer Science 50 * Problem Set ...
1
vote
1answer
507 views

PSET5 Valgrind memory leak in load() and errors in many contexts

I'm trying to implement a trie for pset5. The program compiles, and appears to spit out the right output, except Valgrind seems to have a LOT of issues with it! First, there's the memory leak, which ...
0
votes
2answers
1k views

Still reachable memory?

I'm having trouble figuring out where I need to free the malloc'ed code- Here is what I have for both load and unload. Everything else seems to have been freed except for two things, and everything I ...
0
votes
1answer
230 views

pset5 segfault in unload

FINAL EDIT My function that frees the memory works properly; the problem lies in node creation. I now have a separate problem where the program segfaults when run normally, but it cannot be ...
0
votes
1answer
1k views

Valgrind still reachable memory

For my pset5 speller program valgrind is saying that i have still reachable memory. This is the output: HEAP SUMMARY: ==24516== in use at exit: 352 bytes in 1 blocks ==24516== total heap usage: ...
0
votes
1answer
86 views

pset5: I am leaking all of my memory. What am I missing?

This problem set is becoming my bane. I have spent hours on it and I am still getting the same issues with valgrind (definitely losing 7 million bytes). I think my issues lie with load and check and ...
0
votes
2answers
272 views

PSET5 - Help with Valgrind? error : “uninitialised value(s)”

I have ran speller in valgrind to see if there was memory leaks and its appears that all memory allocated have been freed. But, I get many errors of type : "Conditional jump or move depends on ...
0
votes
1answer
266 views

PSET5: Massive leak memory detected when using Valgrind, “Conditional jump or move depends on uninitialised value(s)”

Before starting explaining my issue, I know there are threads talking about Conditional jump or move depends on uninitialised value(s) errors prompted after executing Valgrind but unfortunately, none ...
0
votes
1answer
3k views

speller unload pset5

Getting a double free error with gdb and valgrind points to my unload function as the cause in particular this part cursor = cursor->next; but I am not sure what's wrong with it. From what I can ...
0
votes
1answer
211 views

PSET4 recover, segmentation fault

I found with Valgrind that in my code line 79 there is a segmentation fault in the fwrite function, but I can't find the reason why that is. So after 6 straight hours I thought that some help might be ...
0
votes
1answer
2k views

PSET5 - UNLOAD - Trie, Valgrind Errors

Valgrind is telling me that I have 17 allocs and 17 frees; however, it is also telling me that I have 112 bytes in 1 block that are definitely lost. Here is the code from my unload functions: void ...
0
votes
1answer
215 views

Can't free malloc used in check

My pset5 speller is complete works with all check 50. Hell it's even faster then the staff's speller. BUT valgrind is not happy. I am unable to free malloc function used in check. if i do it before ...
0
votes
1answer
190 views

pset 5 memory leak - how struct definition may be related

I saw a similar question about memory leaks with speller "pset5 valgrind memory leaks", but that poster found a solution that doesn't seem to work at all for my program. Just like that user, I get ...
1
vote
2answers
681 views

pset5 speller valgrind still reachable

I'm using a trie data structure to tackle the spell checker. The code works fine and is almost as fast as the staff's implementation. Even check50 is happy about it. But when I run valgrind it throws ...
0
votes
1answer
101 views

Use of uninitialised value on function argument

On Pset5, I get this error on Valgring and I cannot figure out how to resolve it... ==26776== Use of uninitialised value of size 4 ==26776== at 0x80494AB: trim (dictionary.c:334) ==26776== by ...
0
votes
2answers
394 views

pset5 valgrind not happy with load (also, using malloc vs calloc on trie)

First, valgrind flags the file pointer at the fopen call, and also the malloc call to the root pointer. It designates both still reachable in loss record. Second, since for pset5 I check for an end ...
0
votes
1answer
2k views

ERROR SUMMARY: 194 errors from 1 contexts Spellchecker

I'm posting a new question to a similiar one posted here: Valgrind error in PSET6 My question is almost exactly the same, except that unfortunately unlike the OP, I wasn't able to fix the remaining ...
0
votes
1answer
613 views

Can't make Valgrind happy in Speller (pset5)

I'm working through ./speller in pset5, mainly the load() function. My function loads the dictionary without any issues, and Valgrind even shows no memory leaks. The problem is I have a ridiculous ...
0
votes
0answers
67 views

Valgrind Error on Find

I know it's not required to run valgrind on find in pset3, but I was seeing some funky things in check50 and tried it out. The following errors appear: ==7866== 1 errors in context 1 of 2: ==7866== ...
0
votes
1answer
164 views

pset5 load function in dictionary,error in valgrind

Good afternoon everyone! I have one problem, new you can see part of load function: node* root = calloc(1, sizeof(node)); node* cursor = calloc(1, sizeof(node)); int amount_of_words = 0; ...
1
vote
1answer
299 views

Unload speller: conditional move uninitialised value

I think it has been asked before, but I cannot find a proper solution. Speller works. Check50 gives green light, but in valgrind I get an error while unloading. It states that there are conditional ...
0
votes
1answer
916 views

Conditional jump or moves depends on uninitialized values

I am getting the following valerind error. ==9649== Conditional jump or move depends on uninitialised value(s) ==9649== at 0x80493AD: check (dictionary.c:152) ==9649== by 0x8048A6D: main (...
0
votes
1answer
779 views

Pset4 recover not passing check50, but I can see the recovered .jpg files

I have run my program and it works! I get 16 .jpg files, all of which I can see when I open them. When I run check50, however it fails on jpg 000.jpg and 001.jpg through 014.jpg, but not 015.jpg?! ...
6
votes
1answer
80k views

How to fix the “conditional jump or move depends on uninitialized value” valgrind error?

Need help again. I've got my linked list working. It copies a list of words from a file into a linked list. Now I want to make a hash table so that all words starting with the letter 'A' go into a ...
0
votes
1answer
174 views

recover.c errors in Valgrind

I implemented pset4's recover.c and it worked fine, recovering all of the images. However, when I went to check it with valgrind to see if it didn't leak any memory it spit out a bunch of errors and ...
1
vote
1answer
1k views

Correct use of fopen, fclose, file pointers

I found this problem while working on recover.c. My program recovers all the image files, check50 says everything's cool, but when I run Valgrind, it gives me a ton of errors. After some tests, I ...
1
vote
0answers
2k views

Valgrind says “Invalid read of size 4” while freeing memory recursively in a trie

My PSET "mispelling" works fine and contains no memory leak but when I run the program with Valgrind it says Invalid read of size 4. My unload function calls a deleteTrie function which looks like ...
2
votes
1answer
437 views

Memory leaks found in system programs

I used Valgrind to check for memory leaks in several system programs, including ls, gedit and Make. I discovered that these programs do have memory leaks. Is this a serious problem whenever I use ...
1
vote
1answer
728 views

valgrind messages about “unititialised value(s)” - are they an issue?

My speller program functions fine, but when I run it in valgrind, I get a lot of messages saying Conditional jump or move depends on uninitialised value(s). Looking into this a little, I think this ...
0
votes
1answer
57 views

valgrind free and leaks

In the continued lecture of week 5, it is stated that if we don't free memory in our programs, this can lead to a memory leak. But, just to be clear, when my program exit, all the memory used by my ...
0
votes
0answers
72 views

pset4 getting slow

Definitely I have some memory problems, could someone help me to fix it? The game is working fine except that gets very slow when I reach half of the game.