Valgrind doesn't show the sources of definitely lost memory

こ雲淡風輕ζ 提交于 2019-12-12 03:17:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!