Android Java App Crashing with SIGSEGV

2019-07-23 16:22发布

问题:

My android application sometimes crashes without any error message. The app just closes up and the device returns to the home screen.

Normally there would be some error message that the app crashed but nothing shows up. Logcat shows that some kind of segmentation violation happened causing the crash but as the app only consists of java code and no native code I'm really curious why the app is crashing.Can anybody give me a clue?

Here is what logcat is showing when the app is crashing:

D/dalvikvm(23912): GC freed 3923 objects / 230968 bytes in 94ms
I/DEBUG   (18110): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   (18110): Build fingerprint: 'MOTO_O2DE/umts_sholes/umts_sholes/sholes:2.1-update1/SHOLS_U2_02.36.0/6899264:user/rel-keys'
I/DEBUG   (18110): pid: 23912, tid: 23913  >>> com.example.test <<<
I/DEBUG   (18110): signal 11 (SIGSEGV), fault addr 0000000c
I/DEBUG   (18110):  r0 00140120  r1 00000048  r2 00000000  r3 00140168
I/DEBUG   (18110):  r4 afe3ae08  r5 00000006  r6 00140158  r7 0000a000
I/DEBUG   (18110):  r8 100ffcf8  r9 4185eef8  10 4185eee0  fp 001243b0
I/DEBUG   (18110):  ip 00000000  sp 100ffc50  lr afe0f130  pc afe0aeec  cpsr 80000070
I/DEBUG   (18110):          #00  pc 0000aeec  /system/lib/libc.so
I/DEBUG   (18110):          #01  pc 000008e6  /system/lib/libstdc++.so
I/DEBUG   (18110):          #02  pc 00014124  /system/lib/libutils.so
I/DEBUG   (18110):          #03  pc 0001423c  /system/lib/libutils.so
I/DEBUG   (18110):          #04  pc 0001af28  /system/lib/libbinder.so
I/DEBUG   (18110):          #05  pc 0001ba20  /system/lib/libbinder.so
I/DEBUG   (18110):          #06  pc 0001bcd6  /system/lib/libbinder.so
I/DEBUG   (18110):          #07  pc 00014236  /system/lib/libutils.so
I/DEBUG   (18110):          #08  pc 000293a6  /system/lib/libandroid_runtime.so
I/DEBUG   (18110):          #09  pc 000313ca  /system/lib/libandroid_runtime.so
I/DEBUG   (18110):          #10  pc 0000ecb4  /system/lib/libdvm.so
I/DEBUG   (18110):          #11  pc 00038838  /system/lib/libdvm.so
I/DEBUG   (18110):          #12  pc 000139b8  /system/lib/libdvm.so
I/DEBUG   (18110):          #13  pc 00019338  /system/lib/libdvm.so
I/DEBUG   (18110):          #14  pc 00018804  /system/lib/libdvm.so
I/DEBUG   (18110):          #15  pc 0004eed0  /system/lib/libdvm.so
I/DEBUG   (18110):          #16  pc 0004eef8  /system/lib/libdvm.so
I/DEBUG   (18110):          #17  pc 00044ada  /system/lib/libdvm.so
I/DEBUG   (18110):          #18  pc 00044b66  /system/lib/libdvm.so
I/DEBUG   (18110):          #19  pc 00044ff0  /system/lib/libdvm.so
I/DEBUG   (18110):          #20  pc 000425f4  /system/lib/libdvm.so
I/DEBUG   (18110):          #21  pc 0000fd94  /system/lib/libc.so
I/DEBUG   (18110):          #22  pc 0000f860  /system/lib/libc.so
I/DEBUG   (18110):
I/DEBUG   (18110): code around pc:
I/DEBUG   (18110): afe0aedc 809bf000 2d1f08d5 f8d0d829 68c2c008
I/DEBUG   (18110): afe0aeec 600cf8dc f0404286 6890822e f04042b0
I/DEBUG   (18110): afe0aefc 4594822a d1079e02 fa122201 59a2f505
I/DEBUG   (18110):
I/DEBUG   (18110): code around lr:
I/DEBUG   (18110): afe0f120 e1a00005 e3a01001 e1a02004 ebfffa00
I/DEBUG   (18110): afe0f130 e3500000 1a000001 ea000008 ebfffa0a
I/DEBUG   (18110): afe0f140 e1a01004 e3a00002 ebfffa05 e3a02000
I/DEBUG   (18110):
I/DEBUG   (18110): stack:
I/DEBUG   (18110):     100ffc10  afe3db94
I/DEBUG   (18110):     100ffc14  afe0f130  /system/lib/libc.so
I/DEBUG   (18110):     100ffc18  00000000
I/DEBUG   (18110):     100ffc1c  afe0f048  /system/lib/libc.so
I/DEBUG   (18110):     100ffc20  afe3d9dc
I/DEBUG   (18110):     100ffc24  998bffec
I/DEBUG   (18110):     100ffc28  afe3db94
I/DEBUG   (18110):     100ffc2c  afe0f130  /system/lib/libc.so
I/DEBUG   (18110):     100ffc30  afe3ae08  /system/lib/libc.so
I/DEBUG   (18110):     100ffc34  003f194c  [heap]
I/DEBUG   (18110):     100ffc38  00140158  [heap]
I/DEBUG   (18110):     100ffc3c  00005f38
I/DEBUG   (18110):     100ffc40  100ffcf8
I/DEBUG   (18110):     100ffc44  4185eef8
I/DEBUG   (18110):     100ffc48  df002777
I/DEBUG   (18110):     100ffc4c  e3a070ad
I/DEBUG   (18110): #00 100ffc50  a9da9208  /system/lib/libbinder.so
I/DEBUG   (18110):     100ffc54  00100000  [heap]
I/DEBUG   (18110):     100ffc58  00002bd4
I/DEBUG   (18110):     100ffc5c  afd008e9  /system/lib/libstdc++.so
I/DEBUG   (18110):     100ffc60  003ee870  [heap]
I/DEBUG   (18110):     100ffc64  00140158  [heap]
I/DEBUG   (18110):     100ffc68  003f194c  [heap]
I/DEBUG   (18110):     100ffc6c  003f194c  [heap]
I/DEBUG   (18110):     100ffc70  00005f38
I/DEBUG   (18110):     100ffc74  afd008e9  /system/lib/libstdc++.so
I/DEBUG   (18110): #01 100ffc78  00140158  [heap]
I/DEBUG   (18110):     100ffc7c  a9d14127  /system/lib/libutils.so
I/ActivityManager( 1283): Process com.example.test (pid 23912) has died.
I/WindowManager( 1283): WIN DEATH: Window{44fcf318 com.example.test/com.example.test.Main paused=false}
D/Zygote  ( 1054): Process 23912 terminated by signal (11)
D/dalvikvm( 1614): GC freed 1856 objects / 84128 bytes in 78ms

The android version of the device is 2.1 update 1

回答1:

A SIGSEGV indicates a firmware bug. There should be no way of causing one of these from an Android SDK application.

The error dump suggests that you are testing this on a Motorola device, perhaps a DROID. If you have access to another device, please try your app there and see if you have the same crashes.

If you have these crashes only on some modded ROM, you should contact that ROM maker and point them to this question, preferably with instructions for how to reproduce this crash.

If you have the crashes on multiple devices each running stock firmware, then this would be an Android firmware bug. Post the whole error dump you have below, plus steps to reproduce the crash, to http://b.android.com.

If you only have the crashes on this Motorola device, then the whole error dump you have below, plus steps to reproduce the crash, to the relevant MOTODEV support board.



回答2:

Do these sudden crashes occur on any other app?

Can you describe the general nature of your app, what it does, what permissions and libraries it is using? The random nature makes me suspect a piece of hardware is failing at random times due to heat or other anomalous conditions.