Skip to content
Search

Android:NDK:Troubleshooting

lastmod 2018-08-17created 2016-06-231 edits

Describes problems that can occur while using the NDK.

NDK Note: The Mangling of 'Va_list' Has Changed in GCC 4.

You may see a message like the following when compiling a build.

In file included from jni/fskmodule.cpp:7:0:
/xxxx/usr/include/jni.h:592:13: note: the mangling of 'va_list' has changed in GCC 4.4

To fix this, add the following flag to the Android.mk file.

LOCAL_CFLAGS = -Wno-psabi

Fatal signal 11 (SIGSEGV)

A log like the following may appear in Android LogCat.

A/libc  Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)
  • libc: strlen(), sprintf(),...: library implementing the C standard library, etc.
  • signal 11 (SISSEGV) - Segmentation Violation: short for this, an invalid memory reference
  • at 0x0000000 - 0x00000: the memory address referenced

In other words, the error is most likely caused by passing NULL as a parameter when calling a Standard C function such as strlen in the [[JNI] side code, which then tried to dereference NULL. For reference, if you look closely at the log, you can also see the Stack of the C code.

See also