Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 6th, 2012  |  syntax: None  |  size: 0.98 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Valgrind not printing inline error messages, just heap and leak summaries
  2. valgrind --tool=memcheck --leak-check=yes ./prog
  3.        
  4. ==31420== HEAP SUMMARY:
  5. ==31420==     in use at exit: 1,580 bytes in 10 blocks
  6. ==31420==   total heap usage: 47 allocs, 37 frees, 7,132 bytes allocated
  7. ==31420==
  8. ==31420== 1,580 (1,440 direct, 140 indirect) bytes in 5 blocks are definitely lost in loss record 2 of 2
  9. ==31420==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
  10. ==31420==    by 0x400FD4: main (lab1.c:51)
  11. ==31420==
  12. ==31420== LEAK SUMMARY:
  13. ==31420==    definitely lost: 1,440 bytes in 5 blocks
  14. ==31420==    indirectly lost: 140 bytes in 5 blocks
  15. ==31420==      possibly lost: 0 bytes in 0 blocks
  16. ==31420==    still reachable: 0 bytes in 0 blocks
  17. ==31420==         suppressed: 0 bytes in 0 blocks
  18. ==31420==
  19. ==31420== For counts of detected and suppressed errors, rerun with: -v
  20. ==31420== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
  21.        
  22. temp_record = malloc(sizeof(struct server_record));