SYSMALLOC:断言失败 - 任何想法如何有效地调试? [英] sYSMALLOc: Assertion failed - any ideas how to debug effectively?

查看:1047
本文介绍了SYSMALLOC:断言失败 - 任何想法如何有效地调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器守护程序工作正常,在大多数机器却在一个我收到:

My server daemon works fine on most machines however on one I am getting:

malloc.c:3074: 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.

GDB回溯:

#4  0x002a8300 in sYSMALLOc (av=<value optimised out>, bytes=<value optimised out>) at malloc.c:3071
#5  _int_malloc (av=<value optimised out>, bytes=<value optimised out>) at malloc.c:4702
#6  0x002a9898 in *__GI___libc_malloc (bytes=16) at malloc.c:3638
#7  0x0804d575 in xmpp_ctx_new (mem=0x0, log=0x0) at src/ctx.c:383
#8  0x0804916e in main (argc=1, argv=0xbffff834) at ../src/adminbot.c:277

任何想法去尝试什么?我无法找到我的code的一个错误,也可能是在XMPP库中的错误,我需要确定。

Any ideas what to try else ? I am unable to find a bug in my code, it could be a bug in the XMPP library and I need to determine that.

感谢。

推荐答案

这是几乎可以肯定是由于您的code堆损坏漏洞(写之前或者仅仅是一个分配的块之后)。

This is almost certainly due to a heap corruption bug in your code (writing just before or just after an allocated block).

既然你显然是在Linux上,的的工具,用在这里是 Valgrind的。它应指向您直接在问题,它甚至应该在机器上,你的守护工程这样做的。

Since you are apparently on Linux, the tool to use here is Valgrind. It should point you straight at the problem, and it should do so even on machines where your daemon "works".

尝试Valgrind的比任何其他对于这种问题很可能是浪费时间。

Trying anything other than Valgrind for this kind of problem is likely a waste of time.

这篇关于SYSMALLOC:断言失败 - 任何想法如何有效地调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆