我的应用程序不使用NDK.我正在GenyMotion Nexus 7仿真器上测试它,问题很难再现,我仍然没有想出一个正确的方法来重现它.有时候应用程序可以正常运行很长时间,有时它会崩溃并在使用大约30秒后自动重启.
编辑:我不是100%,但它只发生在genymotion模拟器,但不是常规的Android模拟器(我会继续测试).
当我在横向模式下添加对大屏幕的支持时开始出现问题(开始在横向中一次显示两个片段,纵向仅显示1个片段(宽度小于720)).
其中一个片段延迟加载图像(来自内存,磁盘或互联网).
我对这种动态添加和删除片段很新,所以我确信那里可能有一些东西.
无论如何,请帮助我解码这个转储并找出导致崩溃的原因(我会尝试省略我觉得不重要的东西):
12-17 16:52:18.344 1255-1255/? A/libc? Fatal signal 11 (SIGSEGV) at 0x97858094 (code=2), thread 1255 (hiexpressgradle) 12-17 16:52:18.448 121-121/? I/DEBUG? *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 12-17 16:52:18.448 121-121/? I/DEBUG? Build fingerprint: 'generic/vbox86tp/vbox86tp:4.3/JLS36G/eng.buildbot.20131127.101043:userdebug/test-keys' 12-17 16:52:18.448 121-121/? I/DEBUG? Revision: '0' 12-17 16:52:18.448 121-121/? I/DEBUG? pid: 1255, tid: 1255, name: hiexpressgradle >>> XXX <<< 12-17 16:52:18.448 121-121/? I/DEBUG? signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 97858094 12-17 16:52:18.608 121-121/? I/DEBUG? eax 00000000 ebx b754a6fc ecx 0000000e edx 978580a2 12-17 16:52:18.608 121-121/? I/DEBUG? esi 0000000c edi 00000001 12-17 16:52:18.608 121-121/? I/DEBUG? xcs 00000073 xds 0000007b xes 0000007b xfs 00000000 xss 0000007b 12-17 16:52:18.608 121-121/? I/DEBUG? eip b754a6fc ebp b94985e8 esp bfe29398 flags 00210292 12-17 16:52:18.608 121-121/? E/Corkscrew? unrecognized DW_CFA_* instruction: 0x10 12-17 16:52:18.608 121-121/? I/DEBUG? backtrace: 12-17 16:52:18.608 121-121/? I/DEBUG? #00 pc 0002f6fc /system/lib/libc.so (memset+140) 12-17 16:52:18.608 121-121/? I/DEBUG? #01 pc 00015c6f /system/lib/libhwui.so (android::uirenderer::FontRenderer::cacheBitmap(SkGlyph const&, android::uirenderer::CachedGlyphInfo*, unsigned int*, unsigned int*, bool)+511) 12-17 16:52:18.608 121-121/? I/DEBUG? #02 pc 00011aea /system/lib/libhwui.so (android::uirenderer::Font::precache(SkPaint*, char const*, int)+922) 12-17 16:52:18.608 121-121/? I/DEBUG? #03 pc 0001414e /system/lib/libhwui.so (android::uirenderer::FontRenderer::precache(SkPaint*, char const*, int, android::uirenderer::Matrix4 const&)+78) 12-17 16:52:18.608 121-121/? I/DEBUG? #04 pc 00024aa6 /system/lib/libhwui.so (android::uirenderer::DrawTextOp::onDefer(android::uirenderer::OpenGLRenderer&, int*, void**)+486) 12-17 16:52:18.608 121-121/? I/DEBUG? stack: 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29358 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2935c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29360 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29364 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29368 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2936c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29370 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29374 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29378 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2937c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29380 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29384 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29388 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2938c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29390 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29394 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? #00 bfe29398 b5ba5aac /system/lib/libhwui.so 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2939c b5b3ec70 /system/lib/libhwui.so (android::uirenderer::FontRenderer::cacheBitmap(SkGlyph const&, android::uirenderer::CachedGlyphInfo*, unsigned int*, unsigned int*, bool)+512) 12-17 16:52:18.608 121-121/? I/DEBUG? #01 bfe293a0 97858094 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293a4 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293a8 0000000e 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293ac bfe2940c [stack] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293b0 b9726ae4 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293b4 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293b8 b934c340 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293bc b6bff210 /system/lib/libskia.so (SkGlyphCache::findImage(SkGlyph const&)+144) 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293c0 b972f550 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293c4 b934b588 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293c8 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293cc 00000032 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293d0 bfe29410 [stack] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293d4 bfe2940c [stack] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293d8 97858008 12-17 16:52:18.608 121-121/? I/DEBUG? bfe293dc b6eb8d48 /system/lib/libskia.so 12-17 16:52:18.608 121-121/? I/DEBUG? ........ ........ 12-17 16:52:18.608 121-121/? I/DEBUG? #02 bfe29430 b94985e8 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29434 b9726ae4 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29438 b966b9c8 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2943c bfe29470 [stack] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29440 bfe29474 [stack] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29444 00000001 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29448 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2944c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29450 3f800000 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29454 00000010 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29458 b966b9c8 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2945c b9670dc6 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29460 b94907a4 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29464 b9670e28 [heap] 12-17 16:52:18.608 121-121/? I/DEBUG? bfe29468 3f800026 12-17 16:52:18.608 121-121/? I/DEBUG? bfe2946c 00000000 12-17 16:52:18.608 121-121/? I/DEBUG? ........ ........ 12-17 16:52:18.608 121-121/? I/DEBUG? memory map around fault addr 97858094: 12-17 16:52:18.608 121-121/? I/DEBUG? 977fa000-97858000 r-x /dev/ashmem/dalvik-jit-code-cache (deleted) 12-17 16:52:18.608 121-121/? I/DEBUG? 97858000-97859000 r-x 12-17 16:52:18.608 121-121/? I/DEBUG? 97859000-978d9000 rw-
感谢您输入@Simon,经过一些测试后,我开始在Android模拟器上出现错误.但在Android模拟器上,这是一个很好的旧OutOfMemory异常.事实证明,我的drawable管理器(在其中一个片段上)有一个巨大的内存泄漏,它会使一个带有drawable的HashMap膨胀.当我实现两个窗格布局时,它只会成为一个问题,因为DrawableManager将始终保留在内存中(因为即使我切换类别,也不会重新创建保存管理器的类别选择片段).
编辑:即使我已经解决了我的内存泄漏,我的genymotion模拟器仍然与相同的SIGSEGV崩溃,所以我想这个问题仍然是开放的.
测试解决方案的工作:
最明显地提到这些许可:
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/CustomTheme" android:allowBackup="true" android:vmSafeMode="true" android:allowClearUserData="true" android:hardwareAccelerated="true" >
我也遇到了这个问题,特别是GenyMotion上的4.3图像.我切换到4.2.2图像,不再经历崩溃.