Questions tagged [valgrind]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
1 answer
94k 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 ...
  • 65
5 votes
2 answers
11k 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 ...
2 votes
1 answer
374 views

CS50 PSET5 Memory Leak (updated)

I had posted a question here two days ago regarding memory leak in problem set 5 and haven't had it resolved yet. Please refer to my question, available here: CS50 PSET5 Memory Leak (please note that ...
  • 121
2 votes
1 answer
492 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
1 answer
809 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 ...
  • 243
1 vote
1 answer
147 views

CS50 pset5 Memory Leak (trie structure)

So I've written the functions for pset5 using a trie and it seems to work fine. It gives the same number of misspelled words etc. as the cs50 one, but it seems that there are some memory leak problems....
  • 13
1 vote
1 answer
186 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 ...
1 vote
2 answers
49 views

Valgrind issue on PSET5 - Edited

sorry that this is a repost of a deleted question. I made a mistake in reading the specifications and didn't realise I wasn't able to alter the function declarations in dictionary.c & .h. The ...
  • 13
1 vote
1 answer
138 views

Pset5 SPELLER, CHECK50 errors and memory leak

I've been strugling with this pset for nearly two weeks. Today I finally managed to make it work. When I test this program it works good with given files, but check50 says that it's not working ...
  • 50
1 vote
1 answer
53 views

pset5 speller running valgrind says I'm accessing 8 bytes of memory that isn't mine

So I used a trie to implement speller, and when I run valgrind on my speller.c, it says that around my unload() function and my freeTrie() function I am accessing 8 bytes of memory that isn't mine. I ...
1 vote
1 answer
42 views

Memory leak and erratic behavior with code

Right now, I have been stuck for a while on the speller problem of pset7, due to some erratic behavior of my code. On some versions of it, many words appeared to be misspelled, but not all of them; ...
1 vote
1 answer
304 views

Pset5 Speller Valgrind error

I got Pset5 Speller to work correctly but I am getting a Valgrind error as follows 568 bytes in 1 blocks are still reachable in loss record 1 of 1: (file: dictionary.c, line: 108) for all the words. ...
  • 13
1 vote
1 answer
80 views

Valgrind memory leak, WORDS MISSPELLED: 1 pset5

Looks like your program leaked 1,120 bytes of memory. Did you forget to free memory that you allocated via malloc? Take a closer look at line 48 of dictionary.c. Its weard because i am freeing the ...
  • 13
1 vote
1 answer
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
1 answer
37 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 ...
  • 139
1 vote
2 answers
75 views

PSET 5 SPELLER - Passing Valgrind but not Check50

I am very close to solving this, my code is returning 0 errors from Valgrind when I run that on its own, but its not passing the memory errors parameter in check50, so I'm very confused. Any help ...
1 vote
1 answer
157 views

Valgrind output help with speller

I've got my speller working fine and without errors, but it does not currently pass check50 as Valgrind finds few issues. My problem is that I do not understand at all what they are, what is causing ...
  • 15
1 vote
1 answer
1k views

PSET5 SPELLER: valgrind error: conditional jump or move depends on uninitialised value(s): but program runs correctly

When I run valgrind on my speller code I get errors that all look similar to this: ==4398== Conditional jump or move depends on uninitialised value(s) ==4398== at 0x401260: load (dictionary....
1 vote
1 answer
261 views

Pset5 Problem with Valgrind

I have completed pset5 and passed check50. But when i run it with valgrind, it is showing the following errors:- ==12042== Memcheck, a memory error detector ==12042== Copyright (C) 2002-2013, and ...
1 vote
1 answer
110 views

Code passed check50, but the output does not match staff output and the code fails valgrind

``Thanks for your help so far on pset5. I have been able to implement pset5, the code is working properly, passed check50 but the output does not match the staff output. For instance, when tested with ...
  • 29
1 vote
1 answer
70 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:
1 vote
1 answer
530 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 ...
  • 13
1 vote
2 answers
799 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 ...
1 vote
1 answer
308 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 ...
  • 151
1 vote
1 answer
50 views

Pset5 Speller -- Conditional jump or move depends on uninitialised value(s); Uninitialised value was created by a stack allocation;

My code is able to pass all the tests in check50 except the valgrind one. Here is the error when I run the valgrind. Could someone help me, please? // Implements a dictionary's functionality #...
1 vote
0 answers
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 ...
  • 55
1 vote
2 answers
170 views

Pset5 - Code for dictionary.c works but valgrind returns memory leak

I chose to implement speller with a hash table and the code seems to be working fine and passes check50 except for a memory leak. I read other posts reporting similar issues and I think that the issue ...
  • 40
0 votes
2 answers
951 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
1 answer
1k views

How does valgrind work?

Can anyone explain to me how valgrind works exactly? I mean, how does it know when memory is leaking, allocated and freed?
  • 15
0 votes
1 answer
833 views

Pset5 : Speller: Valgrind : Blocks are still reachable

I have my code running well. But Valgrind still shows 568 bytes as reachable. Detailed Valgrind log is here: ==5709== ==5709== HEAP SUMMARY: ==5709== in use at exit: 568 bytes in 1 blocks ==5709=...
  • 111
0 votes
2 answers
416 views

Valgrind error in PSET6

I implemented the tree data structure for pset6. It's all doing it right. On checking with valgrind it is even freeing the memory. The valgrind shows that all the blocks were freed. But the error ...
0 votes
2 answers
113 views

Speller Valgrind Issues

I've been trying to finish up the speller pset, and while everything works well, I keep getting a memory leak. When I rerun check50 with --log, I get: checking for valgrind errors... 56 bytes in 1 ...
0 votes
2 answers
156 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 ...
  • 19
0 votes
1 answer
875 views

Pset 5 - Big Board error but program passes check50 and no valgrind errors

Have finished Pset5 and succesfully passed check50. Valgrind also shows no errors. However, when I want to submit for Big Board, to see how my program runs against those of others I get a error ...
  • 119
0 votes
2 answers
49 views

pset5 speller passess all checks except valgrind. no memory leaks but errors raised. confused

// Implements a dictionary's functionality #include <stdbool.h> #include <cs50.h> #include <stdlib.h> #include <stdio.h> #include "dictionary.h" #include <strings....
0 votes
2 answers
67 views

Speller program runs accurately with memory leaks. When I add free() to correct memory leak, program stops executing

My speller program runs and produces accurate outputs. It passes all but one of the check50 checks. It fails because it has a memory leak. I added free() to the load loop where I am allocating ...
0 votes
2 answers
136 views

Valgrind - 2 memory leaks | Recover.c | Pset-4

Valgrind encountered two errors in the following code. I'm not able to get why is this happening even when I close files and free allocs. Please help if you can. #include <stdio.h> #include <...
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
1 answer
847 views

Valgrind says no leaks possible. However has lots of errors

My code passes check50 apart from the memory leak section. Valgrind shows no leaks are possible but lots of errors: ==21401== HEAP SUMMARY: ==21401== in use at exit: 0 bytes in 0 blocks ==21401== ...
  • 3
0 votes
1 answer
142 views

CS50 pset5 program is free of memory errors valgrind tests failed;

I'm just minutes away from solving my problem in pset5. But I'm getting the following error from valgrind. ==12523== HEAP SUMMARY: ==12523== in use at exit: 0 bytes in 0 blocks ==12523== total ...
0 votes
1 answer
33 views

How is my (custom) program leaking memory? I am preparing myself for pset5

I'm trying to understand how memory allocation and pointers work, since i find pset5 overwhelming. I made a simple program that reads characters from an array, and let them be written into both a new ...
0 votes
1 answer
486 views

PSET5 check50 Speller HELP please!

I checked50 and this showed up program is free of memory errors valgrind tests failed; rerun with --log for more information. What did I do wrong? Valgrind showed no error... #include <...
0 votes
2 answers
239 views

Pset5 - Valgrind causes 9544106 errors, Uninitialised value was created by a heap allocation

Im unsure if there is any error in my recursion in unloading/unload to free all memory. (But i doubt so because help50 tells me all my memory were freed- 367,084 allocs, 367,084 frees) I checked ...
0 votes
1 answer
608 views

Pset5 Speller Invalid read of size 8

after working on pset 5 speller for awhile, I've finally managed to make it run without any errors! However, the code's still incorrect when I check with check50 and valgrind. When I run valgrind ...
0 votes
1 answer
217 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
1 answer
425 views

Pset5 Speller - seems working but fails check50

My speller "seems" to work well as compared to the staff's solution: find the correct number of WORDS MISSPELLED (644 of austinpower.txt), correct number of WORDS IN DICTIONARY (143091 of dictionaries/...
  • 3
0 votes
2 answers
680 views

Pset5 - Speller - Load (loading only 1 word in dictionary)

I'm still trying to cope up with Pset5 So what I have: program shows 14 from 17 words in text as misspelled and is ended with *** Error in `./speller': free(): corrupted unsorted chunks: ...
0 votes
2 answers
102 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
1 answer
476 views

pset5 check function and const char* word

I think the biggest issue is at the beginning of check. In the first example, I tried altering its declaration (I know I shouldn't) and since words is not a constant anymore, it gets modified by ...
  • 21
0 votes
1 answer
121 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
2 3 4 5