[cfe-dev] libclang on Android Marshmallow crashes immediately

Anton Smirnov via cfe-dev cfe-dev at lists.llvm.org
Sun Nov 22 03:34:26 PST 2015


Hey, guys.

I'm using clang over JNI for syntax highlighting in my Android apps.
It worked great until Android Marshmallow, and now it crashes (Fatal signal
11 (SIGSEGV)) in library loading (System.loadLibrary() in java code).

I was able to get stacktrace:

11-22 06:15:47.089: WARN/linker(1838):
/data/data/name.antonsmirnov.android.myapp2/se/libclang.so: unused DT
entry: type 0x1d arg 0x3409
11-22 06:15:47.095: ERROR/chromium(1838): ### WebView Version 40
(1808730-x86) (code 400007)
11-22 06:15:47.096: ASSERT/libc(1838): Fatal signal 11 (SIGSEGV), code -6,
fault addr 0x72e in tid 1838 (d.myapp2)
11-22 06:15:47.147: ASSERT/DEBUG(102): *** *** *** *** *** *** *** *** ***
*** *** *** *** *** *** ***
11-22 06:15:47.147: ASSERT/DEBUG(102): Build fingerprint:
'Android/vbox86p/vbox86p:6.0/MRA58K/buildbot10191552:userdebug/test-keys'
11-22 06:15:47.147: ASSERT/DEBUG(102): Revision: '0'
11-22 06:15:47.147: ASSERT/DEBUG(102): ABI: 'x86'
11-22 06:15:47.147: ASSERT/DEBUG(102): pid: 1838, tid: 1838, name: d.myapp2
 >>> name.antonsmirnov.android.myapp2 <<<
11-22 06:15:47.147: ASSERT/DEBUG(102): signal 11 (SIGSEGV), code -6
(SI_TKILL), fault addr 0x5
11-22 06:15:47.152: ASSERT/DEBUG(102): eax 00000001  ebx 9c2fec98  ecx
9c2fec98  edx 9c3ff928
11-22 06:15:47.152: ASSERT/DEBUG(102): esi 9c3061c0  edi 00000000
11-22 06:15:47.152: ASSERT/DEBUG(102): xcs 00000073  xds 0000007b  xes
0000007b  xfs 00000007  xss 0000007b
11-22 06:15:47.152: ASSERT/DEBUG(102): eip 9bd06d62  ebp 00000003  esp
bf810f60  flags 00210202
11-22 06:15:47.158: ASSERT/DEBUG(102): backtrace:
11-22 06:15:47.158: ASSERT/DEBUG(102): #00 pc 01369d62
 /data/data/name.antonsmirnov.android.myapp2/se/libclang.so (void*
llvm::object_creator<(anonymous namespace)::CommandLineParser>()+34)
11-22 06:15:47.158: ASSERT/DEBUG(102): #01 pc 0137cb5b
 /data/data/name.antonsmirnov.android.myapp2/se/libclang.so
(llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void
(*)(void*)) const+91)
11-22 06:15:47.158: ASSERT/DEBUG(102): #02 pc 0136bdb6
 /data/data/name.antonsmirnov.android.myapp2/se/libclang.so
(llvm::cl::Option::addArgument()+422)
11-22 06:15:47.158: ASSERT/DEBUG(102): #03 pc 001020d6
 /data/data/name.antonsmirnov.android.myapp2/se/libclang.so
(_GLOBAL__sub_I__ZN4llvm21X86AsmInstrumentationC2ERKNS_15MCSubtargetInfoE+262)
11-22 06:15:47.158: ASSERT/DEBUG(102): #04 pc 00003203  /system/bin/linker
(__dl__ZN6soinfo17call_constructorsEv.part.140+1055)
11-22 06:15:47.158: ASSERT/DEBUG(102): #05 pc 0000b8ff  /system/bin/linker
(__dl__Z9do_dlopenPKciPK17android_dlextinfo+495)
11-22 06:15:47.159: ASSERT/DEBUG(102): #06 pc 0000213c  /system/bin/linker
(__dl_dlopen+59)
11-22 06:15:47.159: ASSERT/DEBUG(102): #07 pc 003a6287
 /system/lib/libart.so (art::JavaVMExt::LoadNativeLibrary(_JNIEnv*,
std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> > const&, _jobject*, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> >*)+759)
11-22 06:15:47.159: ASSERT/DEBUG(102): #08 pc 00470d5d
 /system/lib/libart.so (art::Runtime_nativeLoad(_JNIEnv*, _jclass*,
_jstring*, _jobject*, _jstring*)+301)
11-22 06:15:47.159: ASSERT/DEBUG(102): #09 pc 72eba6ce
 /data/dalvik-cache/x86/system at framework@boot.oat (offset 0x1eb6000)
11-22 06:15:47.159: ASSERT/DEBUG(102): #10 pc 33242453  <unknown>
11-22 06:15:47.317: ASSERT/DEBUG(102): Tombstone written to:
/data/tombstones/tombstone_00
11-22 06:15:47.317: ERROR/DEBUG(102): AM write failed: Broken pipe
11-22 06:15:47.317: INFO/BootReceiver(656): Copying
/data/tombstones/tombstone_00 to DropBox (SYSTEM_TOMBSTONE)
11-22 06:15:47.319: WARN/ActivityManager(656): Force finishing activity
name.antonsmirnov.android.myapp2/name.antonsmirnov.android.myapp.ui.MainActivity
11-22 06:15:47.347: INFO/Zygote(333): Process 1838 exited due to signal (11)

Any thoughts why it happens?
Is it know bug/feature? Any fix or ideas on how to fix it?

I know Android Marshmallow brings new security model and now permissions
should be requested in runtime but what permissions are required in this
case?

Regards, Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151122/50d9ed66/attachment.html>


More information about the cfe-dev mailing list