Skip to content

Show Android tombstone during native crash - #12923

Merged
Hixie merged 2 commits into
flutter:masterfrom
ds84182:android-native-crash-log
Nov 22, 2017
Merged

Hixie merged 2 commits into
flutter:masterfrom
ds84182:android-native-crash-log

Conversation

@ds84182

@ds84182 ds84182 commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

Related issue: #6530

Engine crashes show up in the log like this:

F/libc    (27775): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 27793 (Thread-6300)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'motorola/ghost_verizon/ghost:5.1/LPAS23.12-39.7-1/1:user/release-keys'
Revision: 'p300'
ABI: 'arm'
pid: 27775, tid: 27793, name: Thread-6300  >>> com.endrift.mgba.flutter <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    r0 00000000  r1 bef34c20  r2 a435dead  r3 00000000
    r4 b4894e30  r5 9e144600  r6 cccccccd  r7 afc4f2ec
    r8 a24205e0  r9 b4a4eb78  sl a3c62b60  fp b4a4eb78
    ip a4fe2c20  sp a3c62ad8  lr a433941d  pc a433e2c2  cpsr 80000030
backtrace:
    #00 pc 000872c2  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #01 pc 00082419  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #02 pc 000a6eb5  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #03 pc 0008858d  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #04 pc 0008ac25  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #05 pc 00011a27  /system/lib/libutils.so (android::SimpleLooperCallback::handleEvent(int, int, void*)+10)
    #06 pc 00012685  /system/lib/libutils.so (android::Looper::pollInner(int)+484)
    #07 pc 0001272d  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+92)
    #08 pc 00008db1  /system/lib/libandroid.so (ALooper_pollOnce+64)
    #09 pc 0008abdf  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #10 pc 0008861d  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #11 pc 000899dd  /data/app/com.endrift.mgba.flutter-1/lib/arm/libflutter.so
    #12 pc 000171ab  /system/lib/libc.so (__pthread_start(void*)+30)
    #13 pc 000150d7  /system/lib/libc.so (__start_thread+6)
Tombstone written to: /data/tombstones/tombstone_09

The tombstone doesn't get written to a file, unfortunately, but the ndk-stack does accept the output format.

@eseidelGoogle

Copy link
Copy Markdown
Contributor

This is amazing! Does this "do the right thing" on non-rooted/non-debug phones?

@ds84182

ds84182 commented Nov 8, 2017

Copy link
Copy Markdown
Contributor Author

Yep, both my testing devices are running stock Android. This should work for every phone on any Android version.

@Hixie

Hixie commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

Very nice!

@Hixie

Hixie commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

Ideally we would have a test for this, though I can't really figure out how to do a true test.

@Hixie

Hixie commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

LGTM

@Hixie

Hixie commented Nov 8, 2017

Copy link
Copy Markdown
Contributor

cc @tvolkert

@tvolkert

Copy link
Copy Markdown
Contributor

Does this "do the right thing" on non-rooted/non-debug phones?

@eseidel note that this only changes the amount of filtering we apply to the adb logs to affect how much info we show in flutter logs. It allows the user to see the backtrace and the path of the tombstone that was written - it's still up to the user to download the tombstone off the phone themselves.

@tvolkert tvolkert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hixie

Hixie commented Nov 22, 2017

Copy link
Copy Markdown
Contributor

I'm going to land this because it has two LGTMs and no outstanding comments. Thanks for the patch!

@Hixie
Hixie merged commit c7c3b60 into flutter:master Nov 22, 2017
DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
* Show Android tombstone during native crash

* Fix tombstone lines being missed on newer Android versions
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants