问题描述
我工作的一个应用程序,在那里我将采用Android NDK和放大器; JNI。每当我在任何Android 4.0或更高版本上运行我的应用程序......我的应用程序将会崩溃,并给出了下面的错误...
I am working on a app, where I will use android NDK & JNI.Whenever I run my app on any android 4.0 or higher version... my app will crash and gives the following error...
A/libc(18556): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)
D/libEGL(18606): loaded /system/lib/egl/libGLES_android.so
D/libEGL(18606): loaded /system/lib/egl/libEGL_adreno200.so
D/libEGL(18606): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
D/libEGL(18606): loaded /system/lib/egl/libGLESv2_adreno200.so
I/Adreno200-EGLSUB(18606): <ConfigWindowMatch:2078>: Format RGBA_8888.
D/OpenGLRenderer(18606): Enabling debug mode 0
主要问题是在0xdeadbaad致命的信号11(SIGSEGV)(code = 1)
如果有谁知道这一点......然后告诉我的原因。
If anyone know about this... then tell me the reason.
推荐答案
首先,分割故障和,特别是0xdeadbaad,将意味着内存损坏或类似的,但是,我最近发现,与NDK,这也是断言默认行为:在断言失败发送,而不是SIGTRAP SIGSEGV,并将内存指针这个十六进制字符串
initially, the segmentation fault and, specially the 0xdeadbaad, would mean a memory corruption or similar but, I recently found that, with the NDK, this is also the default behaviour for assertions: on assert fail it sends SIGSEGV, instead of SIGTRAP, and sets the memory pointer to this hex string.
您应该检查你的code呼吁断言或者,如果你使用第三方的软件,请检查你传递正确的价值观,以每个呼叫。一个快速的方法来检查这将是构建库NDEBUG设置为1(默认情况下,如果你设置APP_OPTIM:=释放你的Application.mk),并检查您是否仍然有完全相同的问题
You should check that your code is calling to assert or, in case you're using third party's software, check that you're passing the proper values to every call. A quick way to check this would be building your library with NDEBUG set to 1 (by default if you set APP_OPTIM := release in your Application.mk) and check if you still have exactly the same problem.
希望这有助于。
这篇关于与Android 4.0或更高版本的应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!