Android signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000023

4,509 views
Skip to first unread message

Monkey M

unread,
Jun 14, 2019, 5:15:52 PM6/14/19
to android-ndk
I'm new to android NDK, if I left out some information please let me know.
I modified a C++ program and built a .so library for my unity program. When I'm trying to run on android phone, I get this error. It happens when I click a button to get the pointer from the .so, then construct an raw image. The other functions are working fine.
I tested the .dll in 32bit unity, it was working properly.
I tried to use ndk-stack but I don't have a $PROJECT_PATH/obj/local/ folder.
I'm totally stuck at this point. Pleeeeeease help!!!!!

E/CRASH: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000023
    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
    Build fingerprint: 'xiaomi/whyred/whyred:8.1.0/OPM1.171019.011/V10.3.1.0.OEIMIXM:user/release-keys'
    Revision: '0'
E/CRASH: pid: 5035, tid: 5115, name: UnityMain  >>> com.vasst.UltrasoundSimulator <<<
        r0 c71fe478  r1 ffffffff  r2 00000018  r3 c71fe448
        r4 c71fe384  r5 e4d9d1b8  r6 00000000  r7 c71fe378
        r8 b8af5068  r9 c71fe478  sl 00000001  fp 00000001
        ip 00000000  sp c71fe370  lr b4cda2cf  pc b4cda4b6  cpsr e5389d10
    backtrace:
E/CRASH: #00  pc 000724b6  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libc++_shared.so (unw_get_proc_info+7)
    #01  pc 000722cb  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libc++_shared.so (_Unwind_GetLanguageSpecificData+18)
    #02  pc 0006fd5f  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libc++_shared.so (__cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)+106)
    #03  pc 0006fbe9  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libc++_shared.so (__gxx_personality_v0+100)
    #04  pc 00b418e0  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libil2cpp.so (__gnu_Unwind_RaiseException+108)
    #05  pc 00b42424  /data/app/com.vasst.UltrasoundSimulator-8IEWkyK9ZuGMYQRXMYHtuw==/lib/arm/libil2cpp.so (_Unwind_RaiseException+20)
    memory near r8:
        b8af5048 c53183d4 00000000 c50618ad c5065805  ..1..........X..
E/CRASH:     b8af5058 00000000 00000000 00000000 00000000  ................
        b8af5068 43554e47 002b2b43 c5061919 00000000  GNUCC++.........
        b8af5078 b4e2aac4 00000000 00000000 00000000  ................
        b8af5088 00000000 00000000 00000000 00000000  ................
        b8af5098 00000000 00000000 00000000 00000000  ................
        b8af50a8 00000000 00000000 b4e55cf8 b4e5c6fc  .........\......
        b8af50b8 00000000 00000000 e4764e10 397948fa  .........Nv..Hy9
        b8af50c8 3a1e42ac 3987be7d 00003808 00000000  .B.:}..9.8......
        b8af50d8 00000001 00000000 408305c2 beb69b50  ...........@P...
        b8af50e8 bf4f1cac bc48051e bdae7463 bcd9ac3c  ..O...H.ct..<...
        b8af50f8 beb69b50 40a8f72b 3f771d27 3def385c  P...+..@'.w?\8.=
        b8af5108 3bbe499c 3bc0ad98 bf4f1cac 3f771d27  .I.;...;..O.'.w?
E/CRASH:     b8af5118 3ee06c92 3cbac15c 3c89859c 3bc25922  .l.>\..<...<"Y.;
        b8af5128 bc480520 3def385d 3cbac15c 3b29ed78   .H.]8.=\..<x.);
        b8af5138 3965123a 392aed94 bdae7462 3bbe49a0  :.e9..*9bt...I.;
    code around pc:
        b4cda494 200047e0 4802e000 8b04f85d bf00bdf0  .G. ...H].......
        b4cda4a4 ffffe672 6a096801 b5d04708 460caf02  r....h.j.G.....F
        b4cda4b4 6a4a6801 47904621 20006861 bf042900  .hJj!F.Gah. .)..
        b4cda4c4 606bf24e 70fff6cf 0000bdd0 466fb580  N.k`...p......oF
        b4cda4d4 6a896801 48014788 bf00bd80 ffffe674  .h.j.G.H....t...
        b4cda4e4 466fb580 c000f8d0 c030f8dc 490347e0  ..oF......0..G.I
        b4cda4f4 bf182800 46082100 bf00bd80 ffffe674  .(...!.F....t...
        b4cda504 466fb580 69526802 bd804790 6b926802  ..oF.hRi.G...h.k
        b4cda514 b5804710 6801466f 47886ac9 6801bd80  .G..oF.h.j.G...h
        b4cda524 47086bc9 47704770 20003910 0f13f111  .k.GpGpG.9. ....
E/CRASH:     b4cda534 2001bf88 30084770 b89cf000 f0003008  ... pG.0.....0..
        b4cda544 f021b8d5 f5a0001f fab07080 0940f080  ..!......p....@.
        b4cda554 30084770 b904f000 f0003008 b5d0b957  pG.0.....0..W...
        b4cda564 4604af02 0180f890 2000b108 4620bdd0  ...F....... .. F
        b4cda574 f9aaf000 d11b2801 21016820 46206b42  .....(.. h.!Bk F
        b4cda584 f8944790 28000180 f8d4d1ef b1700168  .G.....(....h.p.
    code around lr:
        b4cda2ac 00011652 0001165d 000116d5 af02b5d0  R...]...........
        b4cda2bc 490ab08c 680c4479 910b6821 f000a901  ...IyD.h!h......
        b4cda2cc 4601f8f0 29009803 2000bf18 6822990b  ...F...)... .."h
        b4cda2dc bf041a51 bdd0b00c e964f7c2 000198c4  Q.........d.....
        b4cda2ec af02b5d0 490ab08c 680c4479 910b6821  .......IyD.h!h..
        b4cda2fc f000a901 4601f8d6 29009801 2000bf18  .......F...)... 
E/CRASH:     b4cda30c 6822990b bf041a51 bdd0b00c e94af7c2  .."hQ.........J.
        b4cda31c 00019890 b1126882 20014601 47704710  .....h...F. .GpG
        b4cda32c 466fb580 f0004608 3801f8b9 2009bf18  ..oF.F.....8... 
        b4cda33c 0000bd80 e8801fff e580d034 e580e038  ........4...8...
        b4cda34c e580e03c e3a00000 e12fff1e ec800b20  <........./. ...
        b4cda35c e12fff1e ec800b20 e12fff1e ecc00b20  ../. ...../. ...
        b4cda36c e12fff1e af02b5d0 480e4604 23004a0e  ../......F.H.J.#
        b4cda37c f8a44478 447a3048 f8843008 e9c4304a  xD..H0zD.0..J0..
        b4cda38c f1040200 22400008 ea20f7c2 0050f104  ......@".. ...P.
        b4cda39c 7199f44f e8b6f7c3 21004620 f92cf000  O..q.... F.!..,.
E/MessageQueue: IdleHandler threw exception
    java.lang.Error: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000023
    Build fingerprint: 'xiaomi/whyred/whyred:8.1.0/OPM1.171019.011/V10.3.1.0.OEIMIXM:user/release-keys'
    Revision: '0'
    pid: 5035, tid: 5115, name: UnityMain  >>> com.vasst.UltrasoundSimulator <<<
        r0 c71fe478  r1 ffffffff  r2 00000018  r3 c71fe448
        r4 c71fe384  r5 e4d9d1b8  r6 00000000  r7 c71fe378
        r8 b8af5068  r9 c71fe478  sl 00000001  fp 00000001
        ip 00000000  sp c71fe370  lr b4cda2cf  pc b4cda4b6  cpsr e5389d10
    
        at libc++_shared.unw_get_proc_info(unw_get_proc_info:7)
        at libc++_shared._Unwind_GetLanguageSpecificData(_Unwind_GetLanguageSpecificData:18)
        at libc++_shared.__cxxabiv1::scan_eh_tab(__cxxabiv1::(anonymous namespace)::scan_results&, _Unwind_Action, bool, _Unwind_Control_Block*, _Unwind_Context*)(scan_eh_tab:106)
        at libc++_shared.__gxx_personality_v0(__gxx_personality_v0:100)
        at libil2cpp.__gnu_Unwind_RaiseException(__gnu_Unwind_RaiseException:108)
        at libil2cpp._Unwind_RaiseException(_Unwind_RaiseException:20)

Shahriar Vaghar

unread,
Jun 14, 2019, 5:23:10 PM6/14/19
to andro...@googlegroups.com
Identify which line of code is crashing by adding logcat messages to your code. 
Then print the pointers to find which has a bad value.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/e2471503-db4f-4931-94f7-b917337855b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan Albert

unread,
Jun 14, 2019, 5:33:25 PM6/14/19
to android-ndk
The usual cause of segfaults during exception handling is mismatched STLs in your libraries, or a improperly built library. See https://github.com/android-ndk/ndk/issues/379 and https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Unwinding

Monkey M

unread,
Jun 16, 2019, 4:09:35 PM6/16/19
to android-ndk
That was really helpful! I recompiled everything to 64 bits, it's working now! Thank you so much Dan! 
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages