Android crash manage

About cpp crash, android in specifics, don’t give specifics about crash.

This is a common crash I found during my develop:

I/trace   ( 2677): CommonMapContainer.hx:294: times: 0
F/libc    ( 2677): Fatal signal 11 (SIGSEGV) at 0x00000014 (code=1), thread 2715 (Thread-109)
I/DEBUG   (  142): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (  142): Build fingerprint: 'samsung/samsung/samsung:4.2.2/JDQ39E/eng.se.infra.20160926.152902:userdebug/release-keys'
I/DEBUG   (  142): Revision: '0'
I/DEBUG   (  142): pid: 2677, tid: 2715, name: Thread-109  >>> redevogames.redmption.tcg <<<
I/DEBUG   (  142): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000014
I/DEBUG   (  142):     eax 00000000  ebx 1a020020  ecx 00000014  edx 00000014
I/DEBUG   (  142):     esi 000000c6  edi ffffffec
I/DEBUG   (  142):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000043  xss 0000007b
I/DEBUG   (  142):     eip 985ceb71  ebp 9780482c  esp 97804744  flags 00010246
I/DEBUG   (  142):
I/DEBUG   (  142): backtrace:
I/DEBUG   (  142):     #00  pc 00133b71  /system/lib/libhoudini.so
I/DEBUG   (  142):     #01  pc 0013345e  /system/lib/libhoudini.so
I/DEBUG   (  142):     #02  pc 00076710  /system/lib/libhoudini.so
I/DEBUG   (  142):     #03  pc 000d2e1a  /system/lib/libhoudini.so
I/DEBUG   (  142):     #04  pc 000d110f  /system/lib/libhoudini.so
I/DEBUG   (  142):     #05  pc 000fe8f0  [stack:2715]
I/DEBUG   (  142):     #06  pc 0001e020  <unknown>
I/DEBUG   (  142):     #07  pc 0001e020  <unknown>
I/DEBUG   (  142):     #08  pc 0001e020  <unknown>
I/DEBUG   (  142):     #09  pc 0001e020  <unknown>
I/DEBUG   (  142):     #10  pc 0001e020  <unknown>
I/DEBUG   (  142):     #11  pc 0001e020  <unknown>
I/DEBUG   (  142):     #12  pc 0001e020  <unknown>
I/DEBUG   (  142):     #13  pc 0001e020  <unknown>
I/DEBUG   (  142):     #14  pc 0001e020  <unknown>
I/DEBUG   (  142):     #15  pc 0001e020  <unknown>
I/DEBUG   (  142):     #16  pc 0001e020  <unknown>
I/DEBUG   (  142):     #17  pc 0001e020  <unknown>
I/DEBUG   (  142):     #18  pc 0001e020  <unknown>
I/DEBUG   (  142):     #19  pc 0001e020  <unknown>
I/DEBUG   (  142):     #20  pc 0001e020  <unknown>
I/DEBUG   (  142):     #21  pc 0001e020  <unknown>
I/DEBUG   (  142):     #22  pc 0001e020  <unknown>
I/DEBUG   (  142):     #23  pc 0001e020  <unknown>
I/DEBUG   (  142):     #24  pc 0001e020  <unknown>
I/DEBUG   (  142):     #25  pc 0001e020  <unknown>
I/DEBUG   (  142):     #26  pc 0001e020  <unknown>
I/DEBUG   (  142):     #27  pc 0001e020  <unknown>
I/DEBUG   (  142):     #28  pc 0001e020  <unknown>
I/DEBUG   (  142):     #29  pc 0001e020  <unknown>
I/DEBUG   (  142):     #30  pc 0001e020  <unknown>
I/DEBUG   (  142):     #31  pc 0001e020  <unknown>
I/DEBUG   (  142):
I/DEBUG   (  142): stack:
I/DEBUG   (  142):          97804704  00000000
I/DEBUG   (  142):          97804708  00000000
I/DEBUG   (  142):          9780470c  00000000
I/DEBUG   (  142):          97804710  00000000
I/DEBUG   (  142):          97804714  00000000
I/DEBUG   (  142):          97804718  00000000
I/DEBUG   (  142):          9780471c  00000000
I/DEBUG   (  142):          97804720  00000000
I/DEBUG   (  142):          97804724  00000000
I/DEBUG   (  142):          97804728  00000000
I/DEBUG   (  142):          9780472c  00000000
I/DEBUG   (  142):          97804730  00000000
I/DEBUG   (  142):          97804734  00000000
I/DEBUG   (  142):          97804738  00000000
I/DEBUG   (  142):          9780473c  00000000
I/DEBUG   (  142):          97804740  00000000
I/DEBUG   (  142):     #00  97804744  1a020020
I/DEBUG   (  142):          97804748  165e5c48  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          9780474c  9780483c  [stack:2715]
I/DEBUG   (  142):          97804750  978047d4  [stack:2715]
I/DEBUG   (  142):          97804754  00000000
I/DEBUG   (  142):          97804758  00000000
I/DEBUG   (  142):          9780475c  1a020020
I/DEBUG   (  142):          97804760  00000001
I/DEBUG   (  142):          97804764  00001fa0
I/DEBUG   (  142):          97804768  00000000
I/DEBUG   (  142):          9780476c  007ab7d4
I/DEBUG   (  142):          97804770  0b629e7a
I/DEBUG   (  142):          97804774  00000001
I/DEBUG   (  142):          97804778  00000000
I/DEBUG   (  142):          9780477c  00000001
I/DEBUG   (  142):          97804780  ffffffff
I/DEBUG   (  142):          ........  ........
I/DEBUG   (  142):     #01  97804834  16487018  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          97804838  1a020020
I/DEBUG   (  142):          9780483c  97804840  [stack:2715]
I/DEBUG   (  142):          97804840  97804844  [stack:2715]
I/DEBUG   (  142):          97804844  16487018  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          97804848  b765eff4  /system/lib/libc.so
I/DEBUG   (  142):          9780484c  9780486c  [stack:2715]
I/DEBUG   (  142):          97804850  985d4c61  /system/lib/libhoudini.so
I/DEBUG   (  142):          97804854  16487018  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          97804858  00001648
I/DEBUG   (  142):          9780485c  00000001
I/DEBUG   (  142):          97804860  00000000
I/DEBUG   (  142):          97804864  00000001
I/DEBUG   (  142):          97804868  1a0201c0
I/DEBUG   (  142):          9780486c  00000000
I/DEBUG   (  142):          97804870  1a020020
I/DEBUG   (  142):          ........  ........
I/DEBUG   (  142):     #02  97804884  16487018  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          97804888  16487018  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          9780488c  1657d67c  /data/app-lib/redevogames.redmption.tcg-1/libApplicationMain.so
I/DEBUG   (  142):          97804890  ba1fdcc0  [heap]
I/DEBUG   (  142):          97804894  978048d4  [stack:2715]
I/DEBUG   (  142):          97804898  b75c9620  /system/lib/libc.so (free+32)
I/DEBUG   (  142):          9780489c  978048bc  [stack:2715]
I/DEBUG   (  142):          978048a0  9856de1a  /system/lib/libhoudini.so
--------- beginning of /dev/log/system

Is there a way to comprehend where the crash is happen? Number of line and file as normal, no more.
Now i’m forced to log every line :frowning: Have you any advice?

Thanks in advance, David.

For null pointer errors in your code, this usually helps:

<haxedef name="HXCPP_CHECK_POINTER" if="DEBUG" />
<haxedef name="HXCPP_STACK_LINE" if="DEBUG" />

HXCPP_CHECK_POINTER makes it add an if(x == null) test before anything that could possibly cause a null pointer error. If something is null, it prints a stack trace. HXCPP_STACK_LINE makes it include the line numbers.

The reason you include if="DEBUG" is because you don’t want to ship your app with line numbers. Doing so would make it easy for someone else to decompile your code.


Unfortunately, that may not help here.

Generally the first backtrace is the one that caused the error, and the others can be ignored. Your code is compiled into libApplicationMain.so, which doesn’t appear in the first backtrace. Therefore, this error happened while executing someone else’s code, not yours.

At least, that’s how things normally are. However, libhoudini.so might be a special case. I looked it up, and it turns out that that’s a library for running ARM code on an x86 processor. So… it might be running your code after all, just indirectly.

Go ahead and add those flags I mentioned. Even if they don’t give you any information this time, they’ll be good to have for later.

If the flags don’t help, see if you can find an ARM device to run this code on. Either that, or <architecture name="x86" /> might remove the requirement for libhoudini.

Thanks for reply and sharing knowledge! I’m going to integrate your information and try them on my code to see results. Hope can help in debug :slight_smile:

David.