Questions tagged [valgrind]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
33 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
1answer
22 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:...
0
votes
2answers
19 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
1answer
19 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 ...
0
votes
2answers
25 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
2answers
23 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 ...
0
votes
1answer
26 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&...
1
vote
2answers
31 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 ...
0
votes
1answer
35 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 ...
0
votes
1answer
47 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== ...
0
votes
1answer
43 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 <...
0
votes
1answer
23 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. ...
0
votes
1answer
30 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 ...
0
votes
1answer
37 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 ...
0
votes
1answer
35 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 ...
0
votes
1answer
61 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
80 views

PSet5, Speller, all correct but problem with Valgrind

I am so close to finally finishing Speller, however I'm running into an issue with Valgrind that I don't understand. I was under the impression that when I malloc a node for the dictionary table in ...
0
votes
1answer
29 views

Cannot understand why valgrind is giving error although check50 runs properly

In this problem, (filter), I'm receiving all green from check50. But when I ran valgrind for blurring I got the following error: ==4412== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al....
0
votes
1answer
81 views

pset5 speller, passes all Check50 requirements except the last one (Valgrind)

My code is now working fine but misses out on fully completing Check50 because of the last requirement. Running ~/pset5/speller/ $ help50 valgrind ./speller texts/cat.txt, it returns: ==6259== ...
0
votes
1answer
37 views

Pset5 memory leaks

so I've been working on that speller code recently. It's actually working good, but valgrind returns memory leaks.. I do "understand" the problem of the first leak, but can't find a solution. Same ...
0
votes
2answers
43 views

Valgrind errors: “invalid read of size 8” and “…uninitialised value” (pset5, speller)

I have basically finished the code, no memory leaking and tests work out fine. However, Valgrind is not happy: Conditional jump or move depends on uninitialised value(s): line 141 This is one of the ...
0
votes
1answer
43 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
1answer
51 views

cs50 Pset5 Valgrind Error

I'm just about to finish pset5 but I'm stumped on this valgrind error. Check50 tells me everything works well except that I am leaking memory. Valgrind tells me the memory leak is coming from line 44 ...
0
votes
1answer
32 views

Speller Valgrind Error

I worked on the speller code for bath 2020 for cs50x course. My code passed all test cases but got stuck at a valgrind error. Im new to this and Im unable to comprehend valgrind logs. Please help ...
0
votes
1answer
36 views

PSET5 Speller using trie memory leak

Could somebody help me identify the cause of the memory leak shown by Valgrind? Check50 says that there are no leaks, for some reason. Here is my code for dictionary.c // Implements a dictionary's ...
0
votes
1answer
77 views

Valgrind shows memory error pset5

My code is // Implements a dictionary's functionality #include <stdbool.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <strings.h> #include <...
0
votes
2answers
35 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
1answer
34 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== ...
0
votes
2answers
71 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
41 views

Valgrind uninitialized values pset5

This is my solution for pset5's speller problem, which uploads a dictionary with a hash table and checks an inputed text to find misspelled words. My code works fine when I run, but valgrind says "...
0
votes
1answer
47 views

Pset5 Speller: Valgrind issue - conditional jump etc

I think I have my speller working except for the below issue. I can't see any variable's I have not initialized properly. Valgrind points to my check function (the offending line is marked below): /...
0
votes
1answer
54 views

CS50 PSET5 Speller Valgrind error: still reachable: 8,013,096 bytes in 143,091 blocks

I have got this Valgrind error for my code. I know that I have not freed the malloc of new_node but I still could not solve this problem after trying many different ways. Can anyone help:( // ...
0
votes
1answer
40 views

Pset5 Valgrind Error: Reachable Memory

I've been on the speller problem for a while and I don't understand where i'm going wrong. Any help would be much appreciated. I'm getting the following error from valgrind when i run it alongside --...
0
votes
1answer
62 views

Check function Segmentation

I am struggling to find the problem in my check function. I have a segmentation fault that it's position varies every time I alter my code a bit. bool check(const char *word) { int index = hash(...
0
votes
1answer
99 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 ...
1
vote
1answer
36 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 #...
0
votes
1answer
46 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
1answer
52 views

SEGFAULT in pset5 speller

I'm working on pset5 2020 speller. I have managed to get my code to compile but no matter how small the input data sets are I suffer a segmentation fault. I've run valgrind and there only seems to be ...
0
votes
1answer
46 views

CS50 Pset 5 speller valgrind error

I am currently trying to master speller but getting an error in one specific line when I run valgrind. It mentions this line: n ->next = table[index]; I have no idea why. It says invalid read of ...
0
votes
1answer
51 views

CHECK50 ERRORS IN SPELLER PSET

Here is my code for the pset I am getting 2 errors after check50. I am not able to get hold of any loopholes in the code. Kindly help! 1) :( handles max length (45-char) words expected "MISSPELLED ...
0
votes
0answers
45 views

pset5 speller - struggling to free memory (valgrind error)

My code: #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <ctype.h> #include <cs50.h> #include "...
0
votes
1answer
40 views

pset5 Speller Valgrind conditional jump or move depends on uninitialized values

Sorry for asking about a valgrind-reported error that has been asked many times. I've read through many of the questions and responses, but I could not find an answer that applies to my problem. The ...
0
votes
1answer
57 views

pset5 - check50 fails at valgrind but valgrind directly seems to show no errors?

#include <stdbool.h> #include <cs50.h> #include <string.h> #include <strings.h> #include <ctype.h> #include <stdlib.h> #include "dictionary.h" const int ...
0
votes
0answers
60 views

PSET5 Valgrind Problem!

I have my code semi working (it passes most of the check50) except Valgrind keeps reporting 'Invalid read of size 1' . Here is a screenshot of the error message: . I used the djb2 hash function. ...
0
votes
0answers
52 views

Pset 5 - Error with freeing up memory - Use of uninitialised value of size 8

I am working on Pset5 and the only issue I am having is regarding the requirement for freeing up memory. Based on the output received from Valgrind, it looks like there is no issue with the memory ...
0
votes
0answers
40 views

Need help fixing memory leaks

I need help fixing the memory leaks on the code! I have already tried fixing them, but I have no clue how to do so. Here is the complete code: // Implements a dictionary's functionality #include &...
0
votes
0answers
38 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 (...
1
vote
1answer
97 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 ...
0
votes
1answer
80 views

valgrind on filter -r. No leaks but errors

I am working on pset4 filter -r (reflection). How I want to achieve reflection: Reserve space in memory, enough to fit an image. Name it image-copy. Copy 1-to-1 the original file there. Original ...
0
votes
1answer
31 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 ...