ABORTING: DALVIK: HEAP MEMORY CORRUPTION IN dispose_chunk addr=0x0

Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 8817 (iidian.imwaiter)

目前遇到的问题是,android系统通过USB连接打印机(打印机机型为YPT,Android系统为4.4.4)时,出现的一个很要命的问题。应用在打印很多单后,导致应用直接崩溃,界面显示无法继续运行。
查了很多资料,虽然都未解决问题,记录下来,待后期参考
HEAP MEMORY CORRUPTION
有人说HEAP MEMORY CORRUPTION 一般是你指针越界或者使用了无效的指针造成堆数据破坏。
Native crash in Android 4.4.3
其中有一个回答
yes, but not related to Picasso. I understand why you ask, since there is something pointing to AsyncTask in the error dump. If I re-run my app, I can also see that each crash is in another thread(Sometimes asynctaks, sometimes regular threads).

But like I said, I can also reproduce the error in the Picasso sample app from the Picasso Github site…

I’m beginning to suspect this is not related to Picasso itself, but with memory allocation or GC in the Android system itself(Since android 4.4.3), but because Images are quite memory intensive, this Android bug is quickly reproducable when using Picasso.
翻译
是的,但与Picasso无关。我理解您为什么这样问,因为在错误转储中有指向AsyncTask的东西。如果我重新运行我的应用程序,我还可以看到每次崩溃都在另一个线程中(有时是asynctaks,有时是常规线程)。
但就像我说的,我也可以在PicassoGithub网站上的Picasso样本应用程序中重现错误……
我开始怀疑这与Picasso本身无关,而是与Android系统本身的内存分配或GC有关(因为Android 4.4.3),但由于图像的内存非常密集,这个Android bug在使用Picasso时可以快速复制。

according to the guy I have been talking to on the Android forum. The error is located in the inSampleSize calculation. In picasso in the BitmapHunter.java file.
If the “options.inSampleSize = sampleSize” on line 341 is bigger then 3. Then you are in for trouble… If the value is 8 or larger, then it crashes immediately.
翻译
据我在安卓论坛上聊天的人说。误差位于采样计算中。在Picasso的BitmapHunter.java文件。
如果“选项。第341行比第3行大。那你就有麻烦了…如果值是8或更大,那么它会立即崩溃。
Weird dalvik crashes since 4.4.3 on Nexus 5
还是上面那个哥们,在android社区问的问题,参考
ABORTING: DALVIK: HEAP MEMORY CORRUPTION IN dispose_chunk addr=0x0

猜你喜欢

转载自blog.csdn.net/changhuzichangchang/article/details/83792223