Frequent Android Crashes

I’m getting more and more frequent reports of this issue:

signal 5 (SIGTRAP), code 1 (TRAP\_BRKPT)

\*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* pid: 0, tid: 0 \>\>\> com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle \<\<\< backtrace: #00 pc 00000000002dfc72 /data/app/com.google.android.webview-2/lib/arm/libwebviewchromium.so

Currently I don’t have more info than this, but googling it gave this: https://groups.google.com/forum/#!topic/google-admob-ads-sdk/I6giN0VbVa0

I’m not using Admob, but I am using Kidoz plugin and calls system.openURL in a couple of places. Nothing fancy. 

When is the libwebview library used?

I have 2 very frequent crashes that puts me above the threshold for a bunch of my apps:

signal 5 (SIGTRAP), code 4 (TRAP\_HWBKPT) Lenovo Tab 7 Essential (TB-7304F), 1024MB RAM, Android 7.0 \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* pid: 0, tid: 0 \>\>\> com.yogergames.peg\_puzzle\_1 \<\<\< backtrace: #00 pc 0000000000593c5a /data/app/com.android.chrome-1/base.apk

signal 5 (SIGTRAP), code 1 (TRAP\_BRKPT) base.apk Sony Xperia XZs (SO-03J), 4096MB RAM, Android 7.1 \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* pid: 0, tid: 0 \>\>\> com.kavrakids.Cats\_Dogs\_Photo\_Jigsaw\_Puzzle \<\<\< backtrace: #00 pc 0000000000593c5a /data/app/com.android.chrome-2/base.apk

Both using Corona version 2017.3184. I haven’t been able to reproduce.

I’m using plugins

plugin.kidoz

plugin.google.iap.v3

plugin.google.play.services

I’m calling system.openURL from a couple of places to open google play links / youtube / facebook. 

This plugin needs to go away:  plugin.google.play.services

I don’t know if that’s the cause, but it’s based on Google Play v4 and they are now on v11.

Rob

Thanks Rob, tried it (actually just remove the plugin) and get the crashes a bit less frequently now. I’ll keep an eye on it for a few more days. 

One of the apps I was testing with the pre-launch review crashes. The test device was a Pixel with Android 8.0

01-24 21:02:47.965: I/cr\_LibraryLoader(10900): Expected native library version number "58.0.3029.125", actual native library version number "58.0.3029.125" 01-24 21:02:47.981: W/crash\_dump32(10987): type=1400 audit(0.0:114): avc: denied { search } for name="net.facv.playwater7" dev="sda35" ino=877676 scontext=u:r:crash\_dump:s0:c512,c768 tcontext=u:object\_r:app\_data\_file:s0:c512,c768 tclass=dir permissive=0 01-24 21:02:48.033: I/crash\_dump32(10987): obtaining output fd from tombstoned 01-24 21:02:48.033: I//system/bin/tombstoned(678): received crash request for pid 10643 01-24 21:02:48.036: I/crash\_dump32(10987): performing dump of process 10643 (target tid = 10688) 01-24 21:02:48.036: A/DEBUG(10987): \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* 01-24 21:02:48.037: A/DEBUG(10987): Build fingerprint: 'google/sailfish/sailfish:8.0.0/OPR3.170623.008/4294783:user/release-keys' 01-24 21:02:48.037: A/DEBUG(10987): Revision: '0' 01-24 21:02:48.037: A/DEBUG(10987): ABI: 'arm' 01-24 21:02:48.037: A/DEBUG(10987): pid: 10643, tid: 10688, name: GLThread 61 \>\>\> net.facv.playwater7 \<\<\< 01-24 21:02:48.037: A/DEBUG(10987): signal 11 (SIGSEGV), code 1 (SEGV\_MAPERR), fault addr 0x0 01-24 21:02:48.037: A/DEBUG(10987): Cause: null pointer dereference 01-24 21:02:48.037: A/DEBUG(10987): r0 00000000 r1 fffffd3c r2 c7883f00 r3 00000003 01-24 21:02:48.037: A/DEBUG(10987): r4 e756db70 r5 c7883f00 r6 000513fc r7 00000000 01-24 21:02:48.037: A/DEBUG(10987): r8 02a0e9a0 r9 ca03a610 sl 00000004 fp c77f4900 01-24 21:02:48.037: A/DEBUG(10987): ip c9b4acd0 sp c9b4b1d8 lr e7553f4d pc ca02ff94 cpsr 600f0010 01-24 21:02:48.044: A/DEBUG(10987): backtrace: 01-24 21:02:48.044: A/DEBUG(10987): #00 pc 000a2f94 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libopenal.so 01-24 21:02:48.044: A/DEBUG(10987): #01 pc 00016874 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libopenal.so (alcCreateContext+436) 01-24 21:02:48.045: A/DEBUG(10987): #02 pc 00005ff7 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libalmixer.so (ALmixer\_Init+214) 01-24 21:02:48.045: A/DEBUG(10987): #03 pc 0011de04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #04 pc 000fce20 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #05 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #06 pc 0001ce18 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #07 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #08 pc 00005524 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_call+32) 01-24 21:02:48.045: A/DEBUG(10987): #09 pc 000126cc /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #10 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #11 pc 0001c954 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #12 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #13 pc 00005524 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_call+32) 01-24 21:02:48.045: A/DEBUG(10987): #14 pc 000126cc /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #15 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #16 pc 0001c954 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #17 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #18 pc 0000c35c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #19 pc 0000d1c8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #20 pc 000055a0 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_pcall+88) 01-24 21:02:48.045: A/DEBUG(10987): #21 pc 00006ff8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #22 pc 0000cc04 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/l ib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #23 pc 0001ce18 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #24 pc 0000d050 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #25 pc 0000c35c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #26 pc 0000d1c8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so 01-24 21:02:48.045: A/DEBUG(10987): #27 pc 000055a0 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/liblua.so (lua\_pcall+88) 01-24 21:02:48.045: A/DEBUG(10987): #28 pc 000f59e8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #29 pc 00089904 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.045: A/DEBUG(10987): #30 pc 0012fa5c /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.046: A/DEBUG(10987): #31 pc 0007bad8 /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/lib/arm/libcorona.so 01-24 21:02:48.046: A/DEBUG(10987): #32 pc 0005262f /data/app/net.facv.playwater7-G3AZSaR5hROGFwvVzNJPQA==/oat/arm/base.odex (offset 0x2c000)

The full log is here. Video is here.

I am also getting a lot of crashes of this kind (on Android 7.0+):

signal 5 (SIGTRAP), code 1 (TRAP_BRKPT)

base.apk

\*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* pid: 0, tid: 0 \>\>\> com.\*mycompanyname\*.\*myappname\* \<\<\< backtrace: #00 pc 00000000005d02be /data/app/com.android.chrome-2/base.apk

Did anyone have a solution for that?

Best regards,

Bjoern

Dear All,

I am facing a “signal 11 (SIGSEGV), code 1 (SEGV_MAPERR) libcorona.so” crash problem similar to a previous one reported by Sphere Game Studios below.

My GOOGLE PLAY crash details are the following:

 

Samsung Galaxy J1 Mini (j1mini3gxw), 768MB RAM, Android 5.1

*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

pid: 0, tid: 0 >>> com.gmail.huzso78.stickball.europeanedition <<<

backtrace:

#00 pc 0000000000030c7c /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so

#01 pc 000000000002b6e4 /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so

#02 pc 000000000002e9f8 /data/app/com.gmail.huzso78.stickball.europeanedition-1/lib/arm/libcorona.so (Java_com_ansca_corona_JavaToNativeShim_nativeDone+28)

#03 pc 000000000041cf45 /data/dalvik-cache/arm/data@app@com.gmail.huzso78.stickball.europeanedition-1@base.apk@classes.dex

 

The Corona build is 2017.3145.

Do these lines hint the root problem? Is there a known solution to this issue?

I would highly appreciate any tips or advice. Many thanks in advance!

In the meantime, I will try to reproduce the error (I am not sure whether I can do this, since this kind of problem has not come up so far with my devices despite a long test period).

Kind regards,

Zsolt

For us its easy to replicate these ANR crashes, seems only to happen frequently on Android 7 >

And it crashes right after asking for permissions during a fresh install.

Wow! That’s amazing (for fixing it)! Could you please list plugins which are calling for permissions, or make a sample?

Not sure if you quoted the right post there, as we are having the ANR problems not finding any fixes. But below is our build.settings

settings = { plugins = { ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, --for vungle below ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, }, orientation = { default = "landscapeRight", supported = {"landscapeLeft", "landscapeRight"} }, iphone = { xcassets = "Images.xcassets", plist = { UIPrerenderedIcon = true, UIStatusBarHidden = true, UIApplicationExitsOnSuspend = false, UILaunchStoryboardName = "LaunchScreen", CFBundleDisplayName = "WOTZ" }, }, android = { largeHeap = true, usesExpansionFile = true, versionCode = "464", usesPermissions = { "android.permission.INTERNET", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.CHECK\_LICENSE" }, } }

 And this is the code in the main.lua calling for the permissions.

-------------------------------------------------------- -- CHECK STORAGE PERMISSION IS GRANTED -------------------------------------------------------- local function isStoragePermissionGranted( grantedAppPermissionsTable ) if grantedAppPermissionsTable then for k,v in pairs( grantedAppPermissionsTable ) do if ( v == "Storage" ) then print( "\*\* Storage permission granted! \*\*" ) return true end end end return false end local function appPermissionsListener( event ) if ( isStoragePermissionGranted( event.grantedAppPermissions ) ) then -- Do stuff requiring storage permission print("\* Storage Permission granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION GRANTED" else -- Handle not having storage permission print("\* Storage Permission NOT granted \*") debugLog.text=debugLog.text.."\n STORAGE PERMISSION NOT GRANTED" end end if ( not isStoragePermissionGranted( system.getInfo( "grantedAppPermissions" ) ) ) then if ( native.canShowPopup( "requestAppPermission" ) ) then -- Request Storage Permission. local options = { appPermission = "Storage", urgency = "Critical", listener = appPermissionsListener, rationaleTitle = "Storage access required", rationaleDescription = "Storage access is required to store your career data. Re-request now?", settingsRedirectTitle = "Alert", settingsRedirectDescription = "Without the ability to store data, this app cannot properly function. Please grant storage access within Settings." } native.showPopup( "requestAppPermission", options ) else -- You need to add a permission in the Storage group to your build.settings. print("\* requestAppPermission NOT compatible, Storage Permission NOT granted \*") end end 

Whether the permissions request is one of the causes of ANRs I am not sure as we don’t actually have a device with android 7.0 or newer, we only got this info from one of our core beta testers in Europe.

We are using Build: 2018.3224, and the same build.settings for both android and ios.

**Apologies, CORRECTION to the build number, for our last android build we used 2018.3222 NOT 2018.3224.**

We use 2018.3224 for our mac osx builds which run fine.

Many thanks Jacques for the info!

I am sharing the excitement along with Vlad – would be great if Corona Staff could make a fix!

As for plugins and permissions, my app is simple:

[lua]

plugins =

    {

        [“plugin.applovin”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true }

        },

    },

[/lua]

Based on the plugin’s doc the following permissions are automatically added:

  • “android.permission.INTERNET”
  • “android.permission.ACCESS_NETWORK_STATE”
  • “android.permission.WRITE_EXTERNAL_STORAGE”

I am still trying to replicate the mentioned crash, I would let you know if I succeed…

We have seen a lot of this crashes -> signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
 

[lua]backtrace:
native: pc 000000000009bce8 /system/lib/libandroid_runtime.so (_ZN7android6Bitmap6jniEnvEv+11)
native: pc 000000000009bebd /system/lib/libandroid_runtime.so (_ZN7android6Bitmap17unpinPixelsLockedEv+28)
native: pc 000000000009bef5 /system/lib/libandroid_runtime.so (_ZN7android6Bitmap20onStrongRefDestroyedEv+28)
native: pc 00000000001248ad /system/lib/libskia.so (_ZN8SkBitmap10freePixelsEv+52)
native: pc 000000000012486d /system/lib/libskia.so (_ZN8SkBitmapD1Ev+4)
native: pc 0000000000127e65 /system/lib/libskia.so
native: pc 0000000000137771 /system/lib/libskia.so
native: pc 000000000013647f /system/lib/libskia.so (_ZN8SkCanvasD2Ev+42)
native: pc 0000000000136549 /system/lib/libskia.so (_ZN8SkCanvasD0Ev+2)
native: pc 000000000005420d /system/lib/libhwui.so
native: pc 000000000068ced3 /system/framework/arm/boot-core-libart.oat (libcore.util.NativeAllocationRegistry.applyFreeFunction+102)
native: pc 000000000068cc11 /system/framework/arm/boot-core-libart.oat (libcore.util.NativeAllocationRegistry$CleanerThunk.run+84)
native: pc 0000000000792fbb /system/framework/arm/boot.oat (sun.misc.Cleaner.clean+86)
native: pc 00000000005fdc75 /system/framework/arm/boot.oat (java.lang.ref.ReferenceQueue.enqueueLocked+144)
native: pc 00000000005fdd2b /system/framework/arm/boot.oat (java.lang.ref.ReferenceQueue.enqueuePending+110)
native: pc 00000000005e1309 /system/framework/arm/boot-core-libart.oat (java.lang.Daemons$ReferenceQueueDaemon.run+228)
native: pc 00000000005f749d /system/framework/arm/boot.oat (java.lang.Thread.run+48)
native: pc 00000000000a9041 /system/lib/libart.so (art_quick_invoke_stub_internal+64)
native: pc 0000000000402451 /system/lib/libart.so (art_quick_invoke_stub+232)
native: pc 00000000000b02d5 /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+136)
native: pc 0000000000312b99 /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+56)
native: pc 0000000000313965 /system/lib/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+256)
native: pc 000000000032b389 /system/lib/libart.so (_ZN3art6Thread14CreateCallbackEPv+848)
native: pc 0000000000047083 /system/lib/libc.so (_ZL15__pthread_startPv+22)
native: pc 0000000000019d39 /system/lib/libc.so (__start_thread+6)[/lua]

Most of the crashes happened on Xperia (XZ and Z5) and S7 Edge with OS 7.0 or 7.1.
 

The app was updated using 2017.3159, will post back if it helps.

I don’t have the expertise to drill down, but I have have plenty of crashes in various libraries that look Corona-related.

I’m very happy to open access to the dev console for Corona developers who want to investigate. 

Here’s a screenshot showing last 7 days for most popular app, around 3K crashes: https://www.dropbox.com/s/jhnm8ktwl6a5dex/crashes_corona_forum.png?dl=0

What are the devices and OS affected @ferflubron ?

Everything @fungrip .

See screenshot

The crashes visible in the screenshot are actually very similar to what I see for my apps. 

i don’t have equivalent volumes, but as a percentage, all my apps suffer from >1% of signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

typical culprits at the top of backtrace include:  libcorona.so, libopenal.so, libalmixer.so, liblua.so

my top occurring ANR closely resembles the one by OP, but doesn’t seem tied to a particular corona build - libopenal.so and libalmixer.so have always been at the top of crash-generators for me.

Are there steps to reproduce any of this crashes?

Dumping .so tracebacks doesn’t really help without Corona version. To parse them we would need exact Corona version apps was build with. This would have very slight chance of leading us to the issue. Also, it would be better to attach them as text files.

Hi vlads,

Do you mean that you will not have a look at any of the crashes unless we could reproduce it?

Hello. I would take a look if you can provide crash log with specific corona version. Every time corona is built we save symbols so we can decode crashlogs since around 3107.
But seeing where crash occurred often doesn’t say why.
Trust me, we will do our best to reduce crashing.