valgrind 报告 malloc 断言失败,memcheck 不报告任何错误
尽管 memcheck 和通常的运行没有显示任何错误,但 Callgrind 报告了 malloc 中的断言违规:
stp: malloc.c:3096: sSYSMALLOc: 断言 `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2 ])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & 页掩码) == 0)' 失败。
运行命令为:
taskset -c 7 valgrind --main-stacksize=256768768 --tool=callgrind no-asserts-no-cbitp/stp ~/profiling-stp/python-samples-without-const-arr/*.smt
该程序是用-O2 -g 选项。在运行 valgrind 之前,调用“ulimit -s unlimited”。
是否可以获取 Callgrind 报告的错误的堆栈跟踪?如果没有-想法如何调试?
谢谢!
Callgrind reported an assertion violation in malloc although memcheck and a usual run reveals no errors:
stp: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
The run command is:
taskset -c 7 valgrind --main-stacksize=256768768 --tool=callgrind no-asserts-no-cbitp/stp ~/profiling-stp/python-samples-without-const-arr/*.smt
The program is built with -O2 -g option. Before running valgrind "ulimit -s unlimited" is called.
Is it possible to get a stack trace for the error reported by Callgrind? If not - ideas how to debug?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于这是断言失败,您的程序应该因核心转储而崩溃。如果不是,请启用核心转储保存(ulimit -c unlimited)并在 gdb 中打开核心转储。
As this is assertion failure your program should crash with core dump. If it is not, enable core dump saving (ulimit -c unlimited) and open core dump in gdb.