valgrind
约 1 分钟阅读
brew install valgrind
valgrind --leak-check=yes myprog arg1 arg2
valgrind --leak-check=full --show-leak-kinds=all --verbose --track-origins=yes myprogint run_within_valgrind (void) {
char *p = getenv ("LD_PRELOAD");
if (p == NULL)
return 0;
return (strstr (p, "/valgrind/") != NULL || strstr (p, "/vgpreload") != NULL);
}FAQ
Uninitialised value was created by a stack allocation
Conditional jump or move depends on uninitialised value(s)
Invalid read of size, Invalid write of size
关联信息
反向链接、本文链接的其他页面和外部资料。
References
其他外链1 条
- valgrind.org/docs/manual/manual-core-adv.htmlvalgrind.org/docs/manual/manual-core-adv.html