android - genymotion 模拟器上的致命信号 11 (SIGSEGV) 代码=2 不使用 NDK

标签 android android-fragments android-ndk libc genymotion

我的应用程序不使用 NDK。我正在 GenyMotion Nexus 7 模拟器上对其进行测试,这个问题很难重现,我仍然没有找到重现它的正确方法。有时应用程序可以正常运行很长时间,有时它只是崩溃并在使用大约 30 秒后自动重启。

编辑:我不是 100%,但它只发生在 genymotion 模拟器上,而不是普通的 android 模拟器(我将继续测试)。

当我在横向模式下添加对大屏幕的支持时,问题开始发生(开始在横向模式下一次显示两个 fragment ,在纵向模式下仅显示 1 个 fragment (宽度小于 720))。

其中一个 fragment 延迟加载图像(从内存、磁盘或互联网)。

我对这种动态添加和删除 fragment 非常陌生,所以我确信那里可能有一些东西。

无论如何,请帮我解码这个转储并找出导致崩溃的原因(我会尝试省略我认为不重要的东西):

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 异常。所以事实证明,我的可绘制管理器(在其中一个 fragment 上)有一个巨大的内存泄漏,它会使带有可绘制对象的 HashMap 膨胀。仅当我实现两个 Pane 布局时才成为问题,因为即使我切换类别,DrawableManager 也会始终留在内存中(因为保存管理器的类别选择 fragment 永远不会重新创建)。

编辑:即使我已经解决了我的内存泄漏问题,我的 genymotion 模拟器仍然会因相同的 SIGSEGV 崩溃,所以我想这个问题仍然悬而未决。

最佳答案

经过测试的解决方案的工作:

在 list 中提及这些权限:

 <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" >

关于android - genymotion 模拟器上的致命信号 11 (SIGSEGV) 代码=2 不使用 NDK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20640647/

相关文章:

ListFragment 中的 Android ListView header 在按下后退按钮时崩溃

android - Android 中的 ViewPager + RecyclerView 问题

c++ - 未知类型名称命名空间

Android NDK制作。数百个 "undefined reference error"秒

android-ndk - Android NDK : ARMv6 + VFP devices. 错误计算、NaN、非正规数、VFP11 bug

java - 如何将数据从 PageAdapter 发送到扩展 Activity 类的 Activity

android - 我可以将 SupportMapFragment 更改为 Google Maps v2 上的 Mapview 吗?

java - fragment 数组中 "this"上的错误第一个参数类型错误

Android:应用程序关闭后将值保留在列表中

java - 如何从 tmdb json feed 加载电影图像