OiO.lk Blog C++ Valgrind says there are errors, but does not show what they are
C++

Valgrind says there are errors, but does not show what they are


I am using Valgrind to detect memory leaks and errors. It correctly shows the heap summary but sometimes does not show error summary. To be exact, it says there are 4 errors but does not show them in the error summary. (Note: this is for some errors, others it shows with no problem under the error summary).

==51929== HEAP SUMMARY:
==51929==     in use at exit: 12,900,962 bytes in 140,398 blocks
==51929==   total heap usage: 142,880 allocs, 2,482 frees, 12,953,354 bytes allocated
==51929== 
==51929== Searching for pointers to 140,398 not-freed blocks
==51929== Checked 850,874,432 bytes
==51929== 
==51929== 60 bytes in 10 blocks are possibly lost in loss record 1 of 13
==51929==    at 0x48447A8: malloc (vg_replace_malloc.c:446)
==51929==    by 0x112EFF: bstr_new_len (bstrings.c:37)
==51929==    by 0x112660: dal_insert_at (darray_list.c:91)
==51929==    by 0x116313: atomic_push_operation (list_commands.c:83)
==51929==    by 0x1164E0: lpush_command (list_commands.c:97)
==51929==    by 0x114822: parse (resp.c:48)
==51929==    by 0x10A66C: handle_client (server.c:92)
==51929==    by 0x4A1439C: start_thread (pthread_create.c:447)
==51929==    by 0x4A992A3: clone (clone.S:100)
==51929== 
==51929== 90 bytes in 10 blocks are possibly lost in loss record 3 of 13
==51929==    at 0x48447A8: malloc (vg_replace_malloc.c:446)
==51929==    by 0x112EFF: bstr_new_len (bstrings.c:37)
==51929==    by 0x10B146: eh_bucket_inset_no_override (extendible_hashing.c:154)
==51929==    by 0x10B7BF: eh_insert_no_override (extendible_hashing.c:338)
==51929==    by 0x11632A: atomic_push_operation (list_commands.c:84)
==51929==    by 0x1164E0: lpush_command (list_commands.c:97)
==51929==    by 0x114822: parse (resp.c:48)
==51929==    by 0x10A66C: handle_client (server.c:92)
==51929==    by 0x4A1439C: start_thread (pthread_create.c:447)
==51929==    by 0x4A992A3: clone (clone.S:100)
==51929== 
==51929== 5,940 bytes in 990 blocks are possibly lost in loss record 7 of 13
==51929==    at 0x48447A8: malloc (vg_replace_malloc.c:446)
==51929==    by 0x112EFF: bstr_new_len (bstrings.c:37)
==51929==    by 0x112660: dal_insert_at (darray_list.c:91)
==51929==    by 0x1162A8: atomic_push_operation (list_commands.c:70)
==51929==    by 0x1164E0: lpush_command (list_commands.c:97)
==51929==    by 0x114822: parse (resp.c:48)
==51929==    by 0x10A66C: handle_client (server.c:92)
==51929==    by 0x4A1439C: start_thread (pthread_create.c:447)
==51929==    by 0x4A992A3: clone (clone.S:100)
==51929== 
==51929== 27,200 bytes in 100 blocks are possibly lost in loss record 9 of 13
==51929==    at 0x484BC13: calloc (vg_replace_malloc.c:1675)
==51929==    by 0x4011003: calloc (rtld-malloc.h:44)
==51929==    by 0x4011003: allocate_dtv (dl-tls.c:395)
==51929==    by 0x4011AE1: _dl_allocate_tls (dl-tls.c:664)
==51929==    by 0x4A14F14: allocate_stack (allocatestack.c:429)
==51929==    by 0x4A14F14: pthread_create@@GLIBC_2.34 (pthread_create.c:655)
==51929==    by 0x10A7D1: thread_pool_init (server.c:121)
==51929==    by 0x10A961: start_server (server.c:183)
==51929==    by 0x10A49C: main (main.c:23)
==51929== 
==51929== LEAK SUMMARY:
==51929==    definitely lost: 0 bytes in 0 blocks
==51929==    indirectly lost: 0 bytes in 0 blocks
==51929==      possibly lost: 33,290 bytes in 1,110 blocks
==51929==    still reachable: 12,867,672 bytes in 139,288 blocks
==51929==         suppressed: 0 bytes in 0 blocks
==51929== Reachable blocks (those to which a pointer was found) are not shown.
==51929== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==51929== 
==51929== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)



You need to sign in to view this answers

Exit mobile version