Skip to main content
Commonmark migration
Source Link

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: 367,084 allocs, 367,083 frees, 41,113,888 bytes allocated

 

==24516==

 

==24516== 352 bytes in 1 blocks are still reachable in loss record 1 of 1

 

==24516== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

 

==24516== by 0x40A8D1B: __fopen_internal (iofopen.c:73)

 

==24516== by 0x40A8DFA: fopen@@GLIBC_2.1 (iofopen.c:103)

 

==24516== by 0x8049090: load (dictionary.c:55)

 

==24516== by 0x8048755: main (speller.c:45)

I take this to mean I am opining a file and not closing it. This is line 55 in load:

FILE* dp = fopen(dictionary, "r");

However at the end of load I have this line:

fclose(dp);

So I don't understand what the issue is.

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: 367,084 allocs, 367,083 frees, 41,113,888 bytes allocated

 

==24516==

 

==24516== 352 bytes in 1 blocks are still reachable in loss record 1 of 1

 

==24516== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

 

==24516== by 0x40A8D1B: __fopen_internal (iofopen.c:73)

 

==24516== by 0x40A8DFA: fopen@@GLIBC_2.1 (iofopen.c:103)

 

==24516== by 0x8049090: load (dictionary.c:55)

 

==24516== by 0x8048755: main (speller.c:45)

I take this to mean I am opining a file and not closing it. This is line 55 in load:

FILE* dp = fopen(dictionary, "r");

However at the end of load I have this line:

fclose(dp);

So I don't understand what the issue is.

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: 367,084 allocs, 367,083 frees, 41,113,888 bytes allocated

==24516==

==24516== 352 bytes in 1 blocks are still reachable in loss record 1 of 1

==24516== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==24516== by 0x40A8D1B: __fopen_internal (iofopen.c:73)

==24516== by 0x40A8DFA: fopen@@GLIBC_2.1 (iofopen.c:103)

==24516== by 0x8049090: load (dictionary.c:55)

==24516== by 0x8048755: main (speller.c:45)

I take this to mean I am opining a file and not closing it. This is line 55 in load:

FILE* dp = fopen(dictionary, "r");

However at the end of load I have this line:

fclose(dp);

So I don't understand what the issue is.

Source Link

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: 367,084 allocs, 367,083 frees, 41,113,888 bytes allocated

==24516==

==24516== 352 bytes in 1 blocks are still reachable in loss record 1 of 1

==24516== at 0x402A17C: malloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)

==24516== by 0x40A8D1B: __fopen_internal (iofopen.c:73)

==24516== by 0x40A8DFA: fopen@@GLIBC_2.1 (iofopen.c:103)

==24516== by 0x8049090: load (dictionary.c:55)

==24516== by 0x8048755: main (speller.c:45)

I take this to mean I am opining a file and not closing it. This is line 55 in load:

FILE* dp = fopen(dictionary, "r");

However at the end of load I have this line:

fclose(dp);

So I don't understand what the issue is.