问题
Valgrind detects memory that is definitely lost but doesn't show me the source (just question marks):
==9859== 32 bytes in 1 blocks are definitely lost in loss record 61 of 274
==9859== at 0x4C244E8: malloc (vg_replace_malloc.c:236)
==9859== by 0x100F8FB9: ???
==9859== by 0x3A6F: ???
==9859== by 0x1F: ???
==9859== by 0x12C24F07: ???
==9859== by 0x87: ???
Why are the sources not shown (not even the start in the main() function)? What should I do? Where do I need to look to determine the problem or the sources of the leak?
回答1:
The most often source of question marks instead of function names(at least in my practice) is the lack of the debugging info. If you're using gcc, try compiling and linking with -g option.
来源:https://stackoverflow.com/questions/8890654/valgrind-doesnt-show-the-sources-of-definitely-lost-memory