3

你能帮我解决这个错误吗?它发生在Nexus 4上。它似乎是由一些字体创建代码引起的......

        06-27 16:43:59.384: A/libc(22545): Fatal signal 11 (SIGSEGV) at 0x0000000c (code=1), thread 22553 (FinalizerDaemon)
        06-27 16:43:59.485: I/DEBUG(157): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        06-27 16:43:59.485: I/DEBUG(157): Build fingerprint: 'google/occam/mako:4.2.2/JDQ39/573038:user/release-keys'
        06-27 16:43:59.485: I/DEBUG(157): Revision: '11'
        06-27 16:43:59.485: I/DEBUG(157): pid: 22545, tid: 22553, name: FinalizerDaemon  >>> com.myapp <<<
        06-27 16:43:59.485: I/DEBUG(157): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000000c
        06-27 16:43:59.585: I/DEBUG(157):     scr 60000093
        06-27 16:43:59.585: I/DEBUG(157): backtrace:
        06-27 16:43:59.585: I/DEBUG(157):     #00  pc 000bd244  /system/lib/libskia.so (SkFontHost::NextLogicalFont(SkScalerContext::Rec const&)+268)
        06-27 16:43:59.585: I/DEBUG(157):     #01  pc 0008cc9c  /system/lib/libskia.so (SkScalerContext::getNextContext()+44)
        06-27 16:43:59.585: I/DEBUG(157):     #02  pc 0008cd90  /system/lib/libskia.so (SkScalerContext::getContextFromChar(int, unsigned int&)+56)
        06-27 16:43:59.585: I/DEBUG(157):     #03  pc 0008ce5c  /system/lib/libskia.so (SkScalerContext::charToGlyphID(int)+12)
        06-27 16:43:59.585: I/DEBUG(157):     #04  pc 0007c480  /system/lib/libskia.so (SkPaint::textToGlyphs(void const*, unsigned int, unsigned short*) const+244)
        06-27 16:43:59.585: I/DEBUG(157):     #05  pc 0006d33b  /system/lib/libandroid_runtime.so
        06-27 16:43:59.585: I/DEBUG(157):     #06  pc 00004c20  /system/lib/libharfbuzz.so (HB_ConvertStringToGlyphIndices+104)
        06-27 16:43:59.585: I/DEBUG(157):     #07  pc 00005e4c  /system/lib/libharfbuzz.so (HB_BasicShape+12)
        06-27 16:43:59.585: I/DEBUG(157):     #08  pc 00005ed8  /system/lib/libharfbuzz.so (HB_ShapeItem+48)
        06-27 16:43:59.585: I/DEBUG(157):     #09  pc 00072c9f  /system/lib/libandroid_runtime.so (android::TextLayoutShaper::doShaping(unsigned int)+44)
        06-27 16:43:59.585: I/DEBUG(157):     #10  pc 00072e75  /system/lib/libandroid_runtime.so (android::TextLayoutShaper::shapeFontRun(SkPaint const*, bool)+284)
        06-27 16:43:59.585: I/DEBUG(157):     #11  pc 00073155  /system/lib/libandroid_runtime.so (android::TextLayoutShaper::computeRunValues(SkPaint const*, unsigned short const*, unsigned int, bool, android::Vector<float>*, float*, android::Vector<unsigned short>*, android::Vector<float>*)+712)
        06-27 16:43:59.585: I/DEBUG(157):     #12  pc 000734ad  /system/lib/libandroid_runtime.so (android::TextLayoutShaper::computeValues(SkPaint const*, unsigned short const*, unsigned int, unsigned int, unsigned int, int, android::Vector<float>*, float*, android::Vector<unsigned short>*, android::Vector<float>*)+444)
        06-27 16:43:59.585: I/DEBUG(157):     #13  pc 0007351d  /system/lib/libandroid_runtime.so (android::TextLayoutShaper::computeValues(android::TextLayoutValue*, SkPaint const*, unsigned short const*, unsigned int, unsigned int, unsigned int, int)+44)
        06-27 16:43:59.585: I/DEBUG(157):     #14  pc 00073a33  /system/lib/libandroid_runtime.so (android::TextLayoutCache::getValue(SkPaint const*, unsigned short const*, int, int, int, int)+226)
        06-27 16:43:59.585: I/DEBUG(157):     #15  pc 00073d49  /system/lib/libandroid_runtime.so (android::TextLayoutEngine::getValue(SkPaint const*, unsigned short const*, int, int, int, int)+36)
        06-27 16:43:59.585: I/DEBUG(157):     #16  pc 00072371  /system/lib/libandroid_runtime.so (android::TextLayout::getTextRunAdvances(SkPaint*, unsigned short const*, int, int, int, int, float*, float*)+42)
        06-27 16:43:59.585: I/DEBUG(157):     #17  pc 0006f319  /system/lib/libandroid_runtime.so
        06-27 16:43:59.585: I/DEBUG(157):     #18  pc 0006f49b  /system/lib/libandroid_runtime.so
        06-27 16:43:59.585: I/DEBUG(157):     #19  pc 0001e290  /system/lib/libdvm.so (dvmPlatformInvoke+112)
        06-27 16:43:59.585: I/DEBUG(157):     #20  pc 0004d411  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+396)
        06-27 16:43:59.585: I/DEBUG(157):     #21  pc 000276a0  /system/lib/libdvm.so
        06-27 16:43:59.585: I/DEBUG(157):     #22  pc 0002b57c  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
        06-27 16:43:59.585: I/DEBUG(157):     #23  pc 0005fc31  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
        06-27 16:43:59.585: I/DEBUG(157):     #24  pc 0005fc5b  /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20)
        06-27 16:43:59.585: I/DEBUG(157):     #25  pc 000547d7  /system/lib/libdvm.so
        06-27 16:43:59.585: I/DEBUG(157):     #26  pc 0000e3d8  /system/lib/libc.so (__thread_entry+72)
        06-27 16:43:59.585: I/DEBUG(157):     #27  pc 0000dac4  /system/lib/libc.so (pthread_create+160)
        06-27 16:43:59.585: I/DEBUG(157): stack:

... 06-27 16:43:59.595: I/DEBUG(157): 730368a4 404b3e60 /system/lib/libskia.so (SkScalerContext::charToGlyphID(int)+16)

有没有人也发现了这个?我无法定期复制它...

4

1 回答 1

2

是的,在运行 Android 4.1 的 Nexsus S 上的 TestPocketSphinxAndAndroidASR 中,这也发生在我身上(并且始终如一!),在名为 tag 的应用程序ca.ilanguage.labs.pocketsphixlibc

确切的错误:

Fatal signal 11 (SIGSEGV) at 0x0000001a (code=1), thread 3182 (FinalizerDaemon)

这不会发生在 Android 2.2 上。看起来像是对特定 NDK 代码的不兼容依赖,我还不知道如何为 Android 4.1 解决这个问题。

我怀疑这与Toast有关,果然,如果我注释掉以下行,应用程序不会崩溃!(即使在 Android 4.1 上)

Toast.makeText(TestPocketSphinxAndAndroidASR.this, "Possible recognitions: "+matches.toString(), Toast.LENGTH_LONG).show();

如果我将单行语句分解为:

  String msg = "Possible recognitions: "+ matches.toString();
  Toast toast = Toast.makeText(TestPocketSphinxAndAndroidASR.this, msg, Toast.LENGTH_LONG);
  toast.show();

崩溃仍然存在,但如果我在两者之间插入 LogCat 语句,应用程序会显示 toast 而不会崩溃!

  String msg = "Possible recognitions: "+ matches.toString();
  Log.d(getClass().getName(), msg);
  Toast toast = Toast.makeText(TestPocketSphinxAndAndroidASR.this, msg, Toast.LENGTH_LONG);
  toast.show();

诡异的。

于 2013-09-15T22:40:04.453 回答