Help and Support
Ask a question, report a problem, request a feature...
<<  Back To Forum

Suggestion: use valgrind to find bugs and memory leaks

by Guest on 2017/01/23 01:07:50 PM    
Thanks for an amazing BitTorrent client!

You may find Valgrind (valgrind dot org) tool useful for identifying bugs and memory leaks. In particular, running valgrind tixati on my Linux system produces reports like these:


==16099== Conditional jump or move depends on uninitialised value(s)
==16099==    at 0xB1ECA5: ??? (in /usr/bin/tixati)
==16099==    by 0x7F0483: ??? (in /usr/bin/tixati)
==16099==    by 0x7FBBEB: ??? (in /usr/bin/tixati)
==16099==    by 0x7EF2D9: ??? (in /usr/bin/tixati)
==16099==    by 0x7FBAAF: ??? (in /usr/bin/tixati)
==16099==    by 0x7CAF72: ??? (in /usr/bin/tixati)
==16099==    by 0x56F28E6: ??? (in /usr/lib64/libglib-2.0.so.0.5000.2)
==16099==    by 0x56F5E41: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.5000.2)
==16099==    by 0x56F61BF: ??? (in /usr/lib64/libglib-2.0.so.0.5000.2)
==16099==    by 0x56F64E1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.5000.2)
==16099==    by 0x65A7266: gtk_main (in /usr/lib64/libgtk-x11-2.0.so.0.2400.31)
==16099==    by 0x7CAC68: ??? (in /usr/bin/tixati)
==16099==
==16099==
==16099== HEAP SUMMARY:
==16099==     in use at exit: 3,156,524 bytes in 33,486 blocks
==16099==   total heap usage: 6,268,180 allocs, 6,234,694 frees, 708,796,594 bytes allocated
==16099==
==16099== LEAK SUMMARY:
==16099==    definitely lost: 36,716 bytes in 242 blocks
==16099==    indirectly lost: 303,844 bytes in 1,408 blocks
==16099==      possibly lost: 4,228 bytes in 42 blocks
==16099==    still reachable: 2,590,112 bytes in 30,513 blocks
==16099==                       of which reachable via heuristic:
==16099==                         length64           : 9,272 bytes in 119 blocks
==16099==                         newarray           : 2,192 bytes in 57 blocks
==16099==         suppressed: 0 bytes in 0 blocks
==16099== Rerun with --leak-check=full to see details of leaked memory


Naturally, I have no debugging symbols installed, so Valgrind can't show the exact locations where the bugs happen, where the lost memory was allocated, etc., but you (the developers) should be able to see those.




This web site is powered by Super Simple Server