malloc.c:3074错误? [英] malloc.c:3074 error?

查看:202
本文介绍了malloc.c:3074错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我写了一个C程序中,我遇到了一个问题,那就是如下:

When I write a C program, I encountered a problem that is as follows:

malloc.c:3074:SYSMALLOC:断言
  (old_top ==(((mbinptr)(((字符*)
  及((AV) - >仓[((1) - 1)* 2)) -
  __builtin_offsetof(结构个malloc_chunk,FD))))及和放大器; old_size == 0)
  || ((无符号长)(old_size)> =
  (无符号长)((((__ builtin_offsetof
  (结构个malloc_chunk,
  fd_nextsize))+((2 *(sizeof的(为size_t)))
   - 1))及〜((2 *(sizeof的(为size_t))) - 1)))及&放大器; ((old_top) - >尺寸和放大器;为0x1)及和放大器;
  ((无符号长)OLD_END&安培; pagemask)==
  0)失败。

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.

请帮我解决这个问题,先谢谢了!

Please help me to fix it, thanks in advance!

推荐答案

这似乎是政府保持内存分配已损坏。我的猜测是,你有喜欢的东西发生缓冲区溢出这个错误在什么地方。

It seems like the administration kept for memory allocation has been corrupted. My guess would be that you have something like a buffer overflow somewhere before this error occurs.

由于错误是较早问题的结果(假设我右),这可能是一个比较困难的问题来解决。也许像Valgrind的工具可以帮助您检测不正确写入到内存。如果你有一个小程序,演示该问题,我会建议补充说,code你的问题。

As the error is a result of an earlier problem (assuming I'm right), this can be a somewhat difficult problem to fix. Perhaps a tool like valgrind can help you to detect incorrect writes to memory. If you have a small program that demonstrates the problem, I would suggest adding that code to your question.

这篇关于malloc.c:3074错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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