Questions tagged [valgrind]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
10k views

invalid read of size 1 — Valgrind error

This is what valgrind is giving. ==7194== Invalid read of size 1 ==7194== at 0x4C2E0F4: strlen (in /usr/lib/valgrind/vgpreload_memcheck- amd64-linux.so) ==7194== by 0x42278F: insert (tries.c:34)...
0
votes
1answer
269 views

pset5 valgrind error

I was working on pset5 (speller), and I think my program seems to work. However, it does not pass check50, and I think that this might be due to the valgrind errors I am receiving (which I pasted ...
0
votes
1answer
35 views

Errors from context when running trie dictionary from pset5 speller through valgrind

I've managed to implement a trie data structure for speller, and it seems like there are no memory leaks, but when I run valgrind -v ./speller texts/lalaland.txt I get quite a lot of errors from ...
0
votes
1answer
508 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
1answer
45 views

Does anyone know how to fix this problem?

this error is in every check50 test. Conditional jump or move depends on uninitialised value(s): (file: dictionary.c, line: 92) Conditional jump or move depends on uninitialised value(s): (file: ...
0
votes
1answer
273 views

pset5 speller - Conditional jump or move depends on uninitialised value(s)

As you can see here valgrind is angry about some lines but I have no idea why, I've seem other people with similar problem here but different than mine. Also, it seems my program can't handle the ...
1
vote
1answer
150 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 ...
0
votes
1answer
864 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 ...
0
votes
1answer
117 views

Pset 5 - valgrind errror because of memory leak

Succesfully finished Pset5 except for one memory leak error. This is the Valgrind and Help50 report: ==32337== ==32337== HEAP SUMMARY: ==32337== in use at exit: 47 bytes in 1 blocks ==32337== ...
0
votes
1answer
211 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
2answers
209 views

pset5 Speller -load - Valgrind error - “invalid read of size 8”(segmentation fault)

i have been trying to figure this out but need some help! even a hint will do... //trie node typedef struct trie_node { struct trie_node* parent; struct trie_node *child[27]; //check is ...
0
votes
1answer
3k views

How do I fix the 'Invalid read of size 8' error in pset5 using a trie?

My output and leak checks with valgrind are fine, but check50 asks me to run valgrind adding --log. When i do that I get an 'Invalid read of size 8' error. Here's my code: /** * Implements a ...
0
votes
1answer
9k views

How do I fix the 'Invalid read of size 8' error from Valgrind for pset5?

My output and leak checks with valgrind are fine, but check50 asks me to run valgrind adding --log. When i do that I get an 'Invalid read of size 8' error.
0
votes
1answer
14 views

Only getting 3 frees in Speller

No matter what text I test this with, I only ever get 3 or maybe 4 frees using Valgrind. Any ideas why? /** * Implements a dictionary's functionality. */ #include <stdbool.h> #include "...
0
votes
1answer
196 views

Pset5 - Valgrind success, speller output matches staff solution, passes all but the last test on check50

I'm almost there on speller but I think I need another nudge before I can pass check50. I had the same valgrind error that some others seemed to be getting (Conditional jump or move depends on ...
0
votes
1answer
108 views

can't pass check50 of Pset5

I can't figure out what is the problem. I compared my solution with staff's and they are the same. Valgrind gives me the following, is there any problem with memory ? MISSPELLED WORDS Wiggum WORDS ...
0
votes
1answer
95 views

pset5 matches staff but won't work with valgrind/check50

So I've been testing speller and checked it with the staff solution and get matching outputs (click here for comparison). But when I run with valgrind every word is mispelled. valgrind --leak-...
0
votes
1answer
476 views

pset5: working, no leaks but many errors says valgrind in my recursive trie

well it works, but i keep getting many errors related to init and freeRecursive that are my recursive functions to generate and delete my trie most of my errors are related to the condition of ...
0
votes
1answer
388 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/...
1
vote
1answer
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....
0
votes
1answer
99 views

Pset5 Speller Tries Valgring memory leak; don't undertand how unload works

The code works and I compared it with the staff's code it cought all the errors but it leaks memory. I don't know why isn't it freeing new_node. I also managed to make unload() work but I don't fully ...
0
votes
1answer
374 views

Pset5 Speller Load - Segmentation Fault - Valgrind error: Invalid read of size 8

this is my first post to this forum so I hope I've followed correct procedure. I get a segmentation fault when I run speller. Valgrind says the problem is "Invalid read of size 8" at line 114 in the ...
1
vote
1answer
282 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. ...
0
votes
0answers
61 views

pset5 segmentation fault after check50 passed

After fixing and running pset5 most recently yesterday, it made it through check50 with no errors -- all smiley faces. I ran valgrind and found a number of leaks which were repaired by removing an ...
0
votes
1answer
182 views

unload function in speller.c failing miserably despite seemingly correct code

My code was working perfectly until I tried to implement the unload function, the load, check and size functions all match the staff output for misspelled words, number of words loaded in dictionary ...
0
votes
2answers
617 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
1answer
169 views

Pset5 - thousands of errors using valgrind. Help?

I've successfully implemented the dictionary and it fully works (already submitted and got 100/100). But when I run valgrind I get9911215 errors from 6 contexts. I really don't know what that means or ...
1
vote
1answer
79 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 ...
0
votes
1answer
536 views

Pset5 Accessing 8 Byte Outside An Array

I'm working on pset5 right now and I've met this problem that has taken me hours yet no luck to crack. This is how I defined my struct, containing a next[] array of 27 elements. // define the trie ...
1
vote
2answers
158 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 ...
0
votes
2answers
96 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
44 views

Error in my cs50's unload function in pset5 - speller - trie

This my code for dictionary.c but each time i run speller.c i'm getting a segmentation error. I'm not able to understand where my this code is leaking memory! Can anyone help? typedef struct node { ...
0
votes
1answer
56 views

pset5. Can unload words in dictionary but memory is definitely and indirectly lost

My unload function: void clean(node* trav){ //Iterate over the trie structure for(int i=0; i<CHILDREN_LENGTH; i++){ //Recursively delete deeper nodes if curent node is not null ...
0
votes
1answer
1k 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 ...
0
votes
1answer
235 views

PSET5: memory leak

Mem. leaking. help. Only written load function but have the free function within load. Haven't fleshed out unload yet. Want to test that load works before fleshing out unload hence have included the ...
0
votes
1answer
94 views

Pset5 all words are misspelled and Valgrind reports 15 errors

I can compile pset5 but when I run the program, it treats all words misspelled. Also, Valgrind reports 15 errors and help50 hints that I am trying to access 1 byte of memory that isn't mine. I have no ...
0
votes
1answer
450 views

Speller Valgrind errors. Fixed but not sure if correct

I have managed to finish pset5 speller and attempted creating dictionaries with linked-list, hash tables and tries. They are all working successfully and if I create a hash table with 20,000 elements ...
0
votes
1answer
2k views

Memory leak in linked list

can you help explain to me why my following code has a memory leak? I'll very appreciate it if you can help me correct the mistake. /* Copyright 2017 linkedList.c */ #include <stdlib.h> #...
1
vote
1answer
241 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 ...
0
votes
1answer
83 views

pset6 issues with indexes. Valgrind shows some errors

I'm currently working on pset6 and can't figure out what I'm doing wrong. I think the problem is the indexes function, because after running GDB I notices the program crashes as it passes that ...
0
votes
1answer
476 views

pset6 parse function: Invalid read of size 1

I'm having trouble with allocating memory correctly. p is a pointer that I intended to point to method, target, then http switching to the next one after each space is found. Then I thought I'd be ...
0
votes
1answer
74 views

CS50 - PSET5 - program works, no leaks, fixed number of errors

I tested my code on multiple dicitonaries/texts, it all works nicely, even at times faster than the staff's solution. When I run valgrind, I get no memory leaks but 14 errors, seemingly in Load, and ...
0
votes
0answers
230 views

Pset5 speller.c valgrind errors in load and check

I have problem with speller.c. Check50 shows that everything is good but when I run valgrind there are a lot of errors. There are no memory leaks, but number of errors is huge. I ve already search for ...
0
votes
1answer
448 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 ...
0
votes
1answer
143 views

pset5 unload printed failed to unload but pass valgrind with no leak?

I'm sooo close!! My code is running and printing out misspelled words but stopped at message "could not unload dictionary" (I tried on both large and small). However when I run Valgrind, it's ...
1
vote
1answer
100 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 ...
0
votes
1answer
145 views

CS50 PSET5 Memory Leak (updated2)

I had posted two questions regarding memory leak in Problem Set 5, available at CS50 PSET5 Memory Leak and CS50 PSET5 Memory Leak (updated). I got amazing feedback from different people (and I ...
1
vote
1answer
141 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....
0
votes
1answer
31 views

How/when to free this memory? (pset6/server)

Here is my implementation of the indexes function in pset6: char* indexes(const char* path) { char* php = "index.php"; char* html = "index.html"; char* pathCopy = malloc(strlen(path) + ...
2
votes
1answer
359 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 ...