堆内存损坏IN dlmalloc或dlfree和SIGSEGV错误的Andr​​oid ICS 4.0 [英] HEAP MEMORY CORRUPTION IN dlmalloc or dlfree and SIGSEGV errors in Android ICS 4.0

查看:693
本文介绍了堆内存损坏IN dlmalloc或dlfree和SIGSEGV错误的Andr​​oid ICS 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因为我无法找到任何人报告这个问题之前,我想过张贴的问题,我的解决方案在这里,以便它可以帮助其他人谁是有这个问题。我们的应用程序并在设备前,ICS工作的伟大。我们测试的Galaxy Nexus的和ICS模拟器我们的应用程序,看到下面的很怪的进程崩溃:

Since I couldn't find anyone reporting this behaviour before I thought about posting the problem and my solution here so it could help others who are having this problem. Our app did work great on devices prior to ICS. We tested our app on the Galaxy Nexus and the ICS emulator and saw weird process crashes of the following kind:

堆内存损坏IN dlmalloc

HEAP MEMORY CORRUPTION IN dlmalloc

堆内存损坏IN dlfree

HEAP MEMORY CORRUPTION IN dlfree

11(SIGSEGV),故障地址deadbaad

signal 11 (SIGSEGV), fault addr deadbaad

现在的问题是,该事故在本地发生的空间,以便有没有任何自我书面code这直接影响了它。由于我们处理大量的图像,在列表和系统分配位图那些浮现在脑海中唯一的事是一些不好的位图处理。我们遵循所有的最佳做法,在网络和我们甚至帮助GC通过调用 bitmap.recycle收集不需要的资源()。无论如何,对于一些未知的原因,应用程序不断地坠毁在Android ICS 4.0。

The problem is that the crashes occured in the native space so there wasn't any self written code which affected it directly. Since we handle a lot of images in lists and the system allocates bitmaps for those the only thing which came to mind was some bad bitmap handling. We followed all best practices out in the web and we even helped the GC to collect unneeded resources by calling bitmap.recycle(). Anyway, for some unknown reason the application crashed constantly on Android ICS 4.0.

推荐答案

经过一番调查,我去掉了调用循环()和一切顺利,现在很大。似乎在ICS中的垃圾收集器已经正确地清除位图。我们对调用循环()导致系统试图释放在本地空间中的内存,但内存已经清除了系统。不知怎的,坏的内存访问,并发生系统崩溃。所以,如果你是编程为Android 4.0 ICS和您遇到这些问题,你可能想尝试没有明确回收利用的位图。

After some investigation I removed the call to recycle() and everything works out great now. It seems that the garbage collector in ICS already clears the bitmaps correctly. Our call to recycle() caused the system to attempt to deallocate the memory in the native space but the memory was already cleared by the system. Somehow bad memory access occured and the system crashed. So if you are programming for Android ICS 4.0 and you are experiencing those problems, you might want to try without recycling your bitmaps explicitly.

这篇关于堆内存损坏IN dlmalloc或dlfree和SIGSEGV错误的Andr​​oid ICS 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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