Skip to main content

Questions tagged [valgrind]

The tag has no usage guidance.

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

Speller valgrind test failing

I am working on the speller problem, I got every test except for valgrind to pass. Here is the valgrind error: running valgrind --show-leak-kinds=all --xml=yes --xml-file=/tmp/tmpbhs1m7v4 -- ./speller ...
TomasSadone's user avatar
0 votes
1 answer
122 views

Valgrind output of Speller task. (debuginfo reader: Possibly corrupted debuginfo file)

I've just completed Speller task. When I run the task with valgrind on command line I encounter some kind of error, which I don't know how to deal with. I'm going to attach the error image and ...
Shahin Karimli's user avatar
0 votes
1 answer
36 views

check50 indicates that my code has memory errors but executing valgrind in terminal says my code has zero memory errors

what is the problem with my code #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { //check for usage if (...
Michael's user avatar
0 votes
1 answer
47 views

pset5 speller valgrind test fails

in check50 my code fails last test (valgrind test) fails it says: "Use of uninitialised value of size 8: (file: dictionary.c, line: 41)" i starred line 41 below, I tried both using if(!...
Emre Kırmızı's user avatar
0 votes
1 answer
340 views

Recover runs, but leaks 472 bytes in 1 block

The code for recover (pset4) works fine, and has passed check50, except for the last check - no memory leaks. Valgrind shoots back: ==5482== Memcheck, a memory error detector ==5482== Copyright (C) ...
Hamster1303's user avatar
0 votes
0 answers
33 views

(pset5)I get a segmentation foult, even though check50 says that everything is allright

as per the title — I get a segfoult and can't check my times, even though check50 claims that the code is practically ready to submit. Here's my code, followed by valgrind results: // Implements a ...
Two-FaceFIL's user avatar
0 votes
1 answer
22 views

Segmentation fault in pset4 recover when reading file

I tried solving recover.c. But when I tried to run it (without valgrind), I got segmentation fault. When I ran it again with valgrind, it told me that the culprit is in line 40, where I read the file ...
IgorArnaut's user avatar
0 votes
1 answer
77 views

Getting segmentation fault when running speller.c

I am trying to solve speller and I always get segmentation fault every time I run it. I checked the error on valgrind and it told me that the culprit is in line 108, where I allocate a new node. How ...
IgorArnaut's user avatar
0 votes
2 answers
53 views

Hello guys... Good day. I'm currently on the pset 4 (recover). program is working well, but the (valgrind) requirement in the check50 isn't checking

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { // Check that command-line arguments is 2 if (argc != 2) ...
Hendrix obuks's user avatar
0 votes
2 answers
215 views

Valgrind error in pset5 speller

newbie here this is my first post, I hope you guys can help me! I am stacked with speller, my program works apparently fine but the valgrind test outputs some errors that I can't understand. I have ...
turo's user avatar
  • 3
0 votes
1 answer
38 views

PSET 5 Speller Valgrind Memory

My code is functional according to check50 but I'm still leaking bad memory. Based on amount of memory lost, I'm guessing something to close up in LOAD, but could be UNLOAD as well. First thoughts are ...
mcweebus's user avatar
0 votes
1 answer
58 views

PSET 4 Recover Valgrind Check

Valgrind indicates I have 49 memory blocks left to close. Otherwise, the code satisfies check50. I'm thinking I need to nest the fclose functions within the loop, but I can't get it right. Thoughts? ...
mcweebus's user avatar
0 votes
1 answer
23 views

Pset 4: Why Error at end of checkcs50?

this is how my code looks. Only *filename has a malloc attached to it. Why this valgrind error. This is how the logs look.
Atharva Deodhar's user avatar
0 votes
1 answer
53 views

Pset5 Speller - Got "Conditional jump or move depends on uninitialised value(s)", "Use of uninitialised value of size 8" by check50

I try my code here to solve the pset5 - speller question, it seems pretty ok with locally run my valgrind. But when I use check50 to check it. One error(and only 1) happened. I tried to assigned ...
Li-Yu Chu's user avatar
0 votes
1 answer
105 views

PSET 4 Recover I am not getting all the checks in my program

The program works fine but the last condition is not fulfilled. Valgrind tests failed. I know I have to close the opened files but I cant seem to figure out where to do that. Please help. Following is ...
Abdullah Shahzad's user avatar
0 votes
0 answers
12 views

where is the memory leak in my code?

cant find where is the memory leak here is my code // Implements a dictionary's functionality #include <stdio.h> #include <ctype.h> #include <stdbool.h> #include <string.h> #...
Omar Rehan 777's user avatar
0 votes
1 answer
115 views

Speller: Valgrind Still Reachable Error

after scouring the internet for multiple solutions to my Valgrind issue I cannot seem to find any that is specific to my code. I've spent hours coding this and Check50 gave me the green light except ...
Jun_MacJun's user avatar
0 votes
1 answer
1k views

Program is free of memory errors, valgrind tests failed - pset5 speller

I'm am getting this error - program is free of memory errors, valgrind tests failed; see log for more information. I have tried so many things but I keep getting more errors. Here is my code: // ...
aw_codes's user avatar
0 votes
1 answer
72 views

pset5 speller memory errors with valgrind

i've been working in pset5 and cannot make it work. I've read some similar questions and made some improvements to my code, but still can't figure what is wrong. Any tips are welcomed! Here is my code:...
nico_so's user avatar
0 votes
1 answer
719 views

Helping with Valgrind "Conditional jump or move depends on uninitialised value(s)" in simple C code

So right now my code seems to me like it doesnt have issues, it looks like this: int i; char hello[] = "Hello World!"; char * str = malloc(strlen(hello)+1); for(i = 0; i < ...
Big Thinkie's user avatar
0 votes
1 answer
747 views

Valgrind invalid write and read

I recently made the speller excercise and it is working, has no memory leaks but I am getting some Invalid read and Invalid write errors from Valgrind in my check function. First I got a error because ...
Un1kum's user avatar
  • 1
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 ...
LeVl's user avatar
  • 42
0 votes
1 answer
32 views

CS50 PSET 5 SPELLER - Valgrind issues

I have been trying to figure out what is wrong with my code for a while, running through valgrind and the like. Sorry for the large wall of text, but if you could help me figure out just what one of ...
cheesecake's user avatar
1 vote
1 answer
51 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 ...
PrimeBeat's user avatar
  • 137
1 vote
2 answers
117 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 ...
Seamus McGill's user avatar
0 votes
2 answers
56 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....
Steven George's user avatar
0 votes
1 answer
235 views

Valgrind says 8,013,096 bytes in 143,091 blocks are still reachable in loss record 1 of

Hi) I understand that something incorrect with unload function and that 143,091 blocks it's basically the number of words in the dictionary that was uploaded by the program and I didn't manage to ...
NikitaKvitka's user avatar
0 votes
1 answer
362 views

PSET 5: valgrind: memory marked as 'still reachable'

fortunately I finally made it through speller. The only thing remaining is a valgrind error: ==2226== HEAP SUMMARY: ==2226== in use at exit: 8,013,096 bytes in 143,091 blocks ==2226== total heap ...
c_dinosaur's user avatar
0 votes
2 answers
271 views

Pset5 - Speller - Valgrind error for malloc in load function

I get all test results correct except the Valgrind error as follows, does anyone know why is it so and share some insights please? thanks! running valgrind --show-leak-kinds=all --xml=yes --xml-file=/...
unacorn's user avatar
  • 101
0 votes
2 answers
44 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 ...
cormacl's user avatar
  • 48
0 votes
1 answer
58 views

Pset5 Speller Valgrind error trouble

Baby programmer over here. Before moving on to the (check) function, I wanted to make sure the (load) function was correct. After performing Valgrind, I received the following errors. Up to this point,...
Valerie Bryant's user avatar
0 votes
0 answers
21 views

PSet 5 Speller - Valgrind Segmentation Fault

I keep getting a hit on valgrind. It says to check line 99 but I know I free(cursor) before the end of the block :-( my entire code
Andrew's user avatar
  • 3
0 votes
1 answer
62 views

Errors with Valgrind on Speller (Still Reachable) - PSET5

I am almost done with speller but when I pass it through valgrind, it says there are some mistakes. More specifically, it says a bunch of bytes are still reachable. I don't know whether my problem is ...
Alejandro Escobar's user avatar
0 votes
1 answer
48 views

Struggling with PSET5 Speller valgrind problems (& possibly more)

I've been working on PSET5 for weeks now on & off and I'm becoming really frustrated. I think I'm lacking some understanding of the malloc/free relationship, I'm not sure. Here's all of my code. ...
otter.spotter's user avatar
0 votes
1 answer
103 views

I dont understand valgrind pset5

Error from valgrind $ valgrind ./speller texts/cat.txt ==1453== Memcheck, a memory error detector ==1453== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==1453== Using Valgrind-3.13....
Olhuwhorlhey's user avatar
0 votes
2 answers
78 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 ...
Kelvin Winspinger's user avatar
0 votes
1 answer
79 views

Speller pset 5: Valgrind gives me error

I am doing pset 5 speller and It seems to be okey less valgrind check. Valgrind HELP50 gives me these errors ==22585== Use of uninitialised value of size 8 ==22585== at 0x40110B: hash (dictionary.c:...
santiago correa's user avatar
0 votes
2 answers
162 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 ...
Hana Ali's user avatar
0 votes
1 answer
44 views

Speller - not sure what's wrong

I'm struggling trying to find what the error is or why speller is behaving the way it is. Currently, when I run help50 valgrind, I get this error message: ==8634== 56 bytes in 1 blocks are definitely ...
Hana Ali's user avatar
0 votes
2 answers
231 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 <...
ayushed's user avatar
0 votes
2 answers
153 views

Pset 5 Help understanding Valgrind output

I was wondering if anyone could help me with interpreting the Valgrind error to trouble shoot. There are no memory leaks, but I am getting this error "Conditional jump or move depends on ...
leeetthad's user avatar
0 votes
1 answer
51 views

pset4: recover segmentation fault

The code compiles fine but when running ./recover i keep getting a seg fault. i tried valgrind but still can't seem to get what the problem is exactly. #include <stdio.h> #include <stdlib.h&...
starbvuks's user avatar
1 vote
2 answers
53 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 ...
Disierd's user avatar
  • 13
1 vote
1 answer
410 views

Pset5 Speller - Valgrind displays no leaks but code fails check50

any help would be much appreciated - I've been trawling other questions similar to this one but all the adjustments I have tried to make don't seem to fix the check50 failure. The code seems to run ...
rdauncey's user avatar
0 votes
1 answer
75 views

valgrind Pset5 error

All checks with check50 are green except the memory error. This is what valgrind shows me: ==3259== ==3259== HEAP SUMMARY: ==3259== in use at exit: 8,013,096 bytes in 143,091 blocks ==3259== ...
Neev Mehta's user avatar
0 votes
1 answer
117 views

Pset5 speller getting valgrind error

My code // Implements a dictionary's functionality #include <stdbool.h> #include <string.h> #include <stdlib.h> #include <stdio.h> #include <ctype.h> #include <...
Divyanshi Rawat's user avatar
0 votes
1 answer
44 views

pset5 speller: valgrind 937 errors from 1 context

I have done check50 and the only error is "valgrind tests failed; rerun with --log for more information". I can't find the source of the memory leak and I thought that my unload made sense. ...
ddinh9978's user avatar
0 votes
1 answer
58 views

PSET5: memory leak in check function

bool check(const char *word) { unsigned int hash_index = hash(word); node *trav = table[hash_index]; while (trav != NULL) { int len = strlen(trav->word); char ...
Uzayer Masud's user avatar
0 votes
1 answer
720 views

pset5 valgrind tests failed

I'm very close to completing pset5; all smiley faces except the Valgrind memory leak. I'm hoping someone can help find the problem. I am only leaking 112 bytes and have tried to fix the issue by ...
David's user avatar
  • 11
0 votes
1 answer
123 views

pset5 speller - valgrind & case sensitivity

So valgrind has identified line 102 as the potential source of memory leak which is the following within the load function: node *n = malloc(sizeof(node)); Have I missed freeing up this memory later ...
pizzastory's user avatar

1
2 3 4 5