Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/193.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 来自logcat调试的0x00000000(代码=1)处的致命信号11(SIGSEGV)_Java_Android_C_Android Ndk_Android Logcat - Fatal编程技术网

Java 来自logcat调试的0x00000000(代码=1)处的致命信号11(SIGSEGV)

Java 来自logcat调试的0x00000000(代码=1)处的致命信号11(SIGSEGV),java,android,c,android-ndk,android-logcat,Java,Android,C,Android Ndk,Android Logcat,我正在用C代码调试我的Android项目,logcat消息显示: I/DEBUG (13509): backtrace: I/DEBUG (13509): #00 pc 000106dc /system/lib/libc.so (dlmalloc+1463) I/DEBUG (13509): #01 pc 0000cf3f /system/lib/libc.so (malloc+10) I/DEBUG (13509): #02 pc 00011d

我正在用C代码调试我的Android项目,logcat消息显示:

I/DEBUG   (13509): backtrace:
I/DEBUG   (13509):     #00  pc 000106dc  /system/lib/libc.so (dlmalloc+1463)
I/DEBUG   (13509):     #01  pc 0000cf3f  /system/lib/libc.so (malloc+10)
I/DEBUG   (13509):     #02  pc 00011d0d  /system/lib/libutils.so (android::SharedBuffer::alloc(unsigned int)+8)
I/DEBUG   (13509):     #03  pc 00014cf7  /system/lib/libutils.so (android::VectorImpl::setCapacity(unsigned int)+22)
I/DEBUG   (13509):     #04  pc 0007fd79  /system/lib/libandroid_runtime.so (android::TextLayoutValue::TextLayoutValue(unsigned int)+108)
I/DEBUG   (13509):     #05  pc 000811a9  /system/lib/libandroid_runtime.so (android::TextLayoutCache::getValue(SkPaint const*, unsigned short const*, int, int, int, int)+184)
I/DEBUG   (13509):     #06  pc 00081589  /system/lib/libandroid_runtime.so (android::TextLayoutEngine::getValue(SkPaint const*, unsigned short const*, int, int, int, int)+36)
I/DEBUG   (13509):     #07  pc 0007f799  /system/lib/libandroid_runtime.so (android::TextLayout::getTextRunAdvances(SkPaint*, unsigned short const*, int, int, int, int, float*, float*)+42)
I/DEBUG   (13509):     #08  pc 0007c60d  /system/lib/libandroid_runtime.so
I/DEBUG   (13509):     #09  pc 0007c7f9  /system/lib/libandroid_runtime.so
I/DEBUG   (13509):     #10  pc 0001e690  /system/lib/libdvm.so (dvmPlatformInvoke+112)
I/DEBUG   (13509):     #11  pc 0005100f  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+426)
I/DEBUG   (13509):     #12  pc 00027aa0  /system/lib/libdvm.so
I/DEBUG   (13509):     #13  pc 0002ce84  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
I/DEBUG   (13509):     #14  pc 000674bf  /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+374)
I/DEBUG   (13509):     #15  pc 0007066f  /system/lib/libdvm.so
I/DEBUG   (13509):     #16  pc 00027aa0  /system/lib/libdvm.so
I/DEBUG   (13509):     #17  pc 0002ce84  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+232)
I/DEBUG   (13509):     #18  pc 000671a1  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+272)
I/DEBUG   (13509):     #19  pc 0004d2d7  /system/lib/libdvm.so
I/DEBUG   (13509):     #20  pc 0004d391  /system/lib/libandroid_runtime.so
I/DEBUG   (13509):     #21  pc 0004e22d  /system/lib/libandroid_runtime.so (android::AndroidRuntime::start(char const*, char const*)+540)
I/DEBUG   (13509):     #22  pc 00000e67  /system/bin/app_process
I/DEBUG   (13509):     #23  pc 000128b3  /system/lib/libc.so (__libc_init+38)
I/DEBUG   (13509):     #24  pc 00000b74  /system/bin/app_process
消息告诉我问题出在malloc上,似乎bug来自libandroid_runtim

如何知道我的项目中存在什么问题?因为消息没有显示任何关于我的代码位置的信息,包括java和c


请帮我解决这个问题。这件事困扰了我很长时间。非常感谢。

您得到了一个空的解引用(这就是0x00000000所表示的)。由于它在malloc中,这可能意味着您在信号发出之前的某个时间写入malloc的返回区域,从而破坏了内存分配器的内部结构。我建议使用valgrind来检测这一点,我认为这在Android上是可行的。

可能是您的本地代码中有内存覆盖。这可能会意外损坏dlmalloc使用的内存块头。这反过来可能会导致这样的崩溃谢谢用户3747345,你有没有关于如何获得内存溢出的位置的想法?谢谢你的重播。我尝试在android上使用valgrind,参考这两个页面:和。但我无法获取日志文件,这意味着日志文件未创建。你能给我分享一些建议吗?不幸的是,我从来没有在android上使用过valgrind(valgrind是的,android是的,但不是一起使用),所以我无法帮助你克服这个问题。