3

We just released a new version of our Android app to the play store, and now users are reporting crashes. We were able to reproduce, however it's happening randomly throughout the app and is a SIGSEGV crash.

https://gist.github.com/justintoth/78abbd4b647de3ee04037631e921198f

The last two crashes both seem to be related to imageviews, based on the backtraces.

Crash #1:

A/DEBUG(6953): #00 pc 000c1178 /system/lib/libandroid_runtime.so 04-13 17:26:53.640: A/DEBUG(6953): #01 pc 020813ce /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.RenderNode.nGetTransformMatrix+138) 04-13 17:26:53.640: A/DEBUG(6953): #02 pc 020845cd /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.RenderNode.getMatrix+89) 04-13 17:26:53.640: A/DEBUG(6953): #03 pc 020082dd /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.View.getMatrix+89) 04-13 17:26:53.640: A/DEBUG(6953):

04 pc 02061f2b /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.ViewGroup.invalidateChild+119) 04-13

17:26:53.640: A/DEBUG(6953): #05 pc 0200bda1 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.View.invalidateInternal+541) 04-13 17:26:53.640: A/DEBUG(6953): #06 pc 0200ba3b /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.View.invalidate+103) 04-13 17:26:53.640: A/DEBUG(6953):

07 pc 0200b822 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.view.View.invalidate+46) 04-13 17:26:53.640:

A/DEBUG(6953): #08 pc 0216c878 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.widget.ImageView.setImageDrawable+180)

Crash #2:

/system/lib/libskia.so (_ZN8SkMatrix13setRectToRectERK6SkRectS2_NS_10ScaleToFitE+289) 04-13 17:59:57.981: A/DEBUG(8047): #01 pc 000f7c9d /system/lib/libandroid_runtime.so (_ZN7android12SkMatrixGlue13setRectToRectEP7_JNIEnvP8_jobjectxS4_S4_i+134) 04-13 17:59:57.981: A/DEBUG(8047): #02 pc 01936e62 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.graphics.Matrix.native_setRectToRect+190) 04-13 17:59:57.981: A/DEBUG(8047): #03 pc 01939373 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.graphics.Matrix.setRectToRect+127) 04-13 17:59:57.981: A/DEBUG(8047): #04 pc 0216977d /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.widget.ImageView.configureBounds+1625) 04-13 17:59:57.981: A/DEBUG(8047): #05 pc 0216b253 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.widget.ImageView.invalidateDrawable+159) 04-13 17:59:57.981: A/DEBUG(8047): #06 pc 0170f783 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.graphics.drawable.Drawable.invalidateSelf+79) 04-13 17:59:57.981: A/DEBUG(8047): #07 pc 017100f5 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.graphics.drawable.Drawable.setVisible+81) 04-13 17:59:57.981: A/DEBUG(8047): #08 pc 0216a91f /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.widget.ImageView.updateDrawable+619) 04-13 17:59:57.981: A/DEBUG(8047): #09 pc 0216c829 /system/framework/x86/boot-framework.oat (offset 0x1588000) (android.widget.ImageView.setImageDrawable+101)

I'm unclear how to go about troubleshooting a SIGSEGV crash, as they seem to be low level and don't contain stack traces from my actual code. Are they generally crashes that I can control as an app developer, or are they Xamarin bugs? Is my best bet to try downgrading my Xamarin packages (which might be difficult, their download page only provides the last two versions now...) Does anyone have experience with this?

Community
  • 1
  • 1
Justin
  • 17,670
  • 38
  • 132
  • 201
  • 1
    The crash in the report is a `Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0` (assuming com.rpr.mobile is your app), so your app is accessing a reference (object/etc..) that has been released/dereference as its address is zero (0x0). Symbolize the crash log as in this case you are assigning an ImageView a bad drawable (either the BitMap was released or it was GC'd or just not available). – SushiHangover Apr 13 '18 at 22:26
  • @SushiHangover Thanks, you were spot on. We don't manually call SetImageDrawable, we use a library called FFImageLoading to handle this for us, however we did have code that manually disposed of bitmaps / drawables when our custom imageview control is freed from memory. When I disabled this custom code, the SIGSEGV's went away. Weird though, this code worked fine before, only with the latest Xamarin installs does it throw the SIGSEGV's. In any case, please post your comment as an answer and I'll accept. – Justin Apr 14 '18 at 21:45

1 Answers1

5

Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0

Your app is accessing a reference (object/etc..) that has been released/dereference as its address is zero (0x0).

(6953): backtrace:
~~~
(android.view.RenderNode.getMatrix+89)
(android.view.View.getMatrix+89)
(android.view.ViewGroup.invalidateChild+119)
(android.view.View.invalidateInternal+541)
(android.view.View.invalidate+103)
(android.view.View.invalidate+46)
(android.widget.ImageView.setImageDrawable+180)
~~~

In this case you are assigning an ImageView a bad drawable, either the BitMap was Release or it was GC'd or just not available.

You can use mono-symbolicate to add symbols to that logcat backtrace/crash:

SushiHangover
  • 73,120
  • 10
  • 106
  • 165