game crashes after unity splash screen - cannot find stacktrace in logs - android

Please note: I'm not a professional developer and will probably need more detailed instructions on how to get needed information
I am working on a mobile game, currently called EndlessTD using Unity3d 2022.2.4f1. during testing, it used to work fine on bluestacks and in my Mi9T pro running MIUI 12.5.1 and android 11.
Developer options are active, the phone is connected to my pc via usb and displaying "USB debugging is on".
While it still works without errors in the editor on my windows machine, apparently, I screwed something up and now the game crashes right after the unity splash screen when it should load my scene.
Crash Log:
01-29 02:23:27.465 2748 2796 E CRASH : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-29 02:23:27.465 2748 2796 E CRASH : Version '2022.2.3f1 (55531d7fa82e)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
01-29 02:23:27.465 2748 2796 E CRASH : Build fingerprint: 'Xiaomi/raphael_eea/raphael:11/RKQ1.200826.002/V12.5.1.0.RFKEUXM:user/release-keys'
01-29 02:23:27.465 2748 2796 E CRASH : Revision: '0'
01-29 02:23:27.465 2748 2796 E CRASH : ABI: 'arm64'
01-29 02:23:27.465 2748 2796 E CRASH : Timestamp: 2023-01-29 02:23:27.465468704+0100
01-29 02:23:27.465 2748 2796 E CRASH : pid: 2748, tid: 2796, name: UnityMain >>> com.EndlessRageLimited.EndlessTD <<<
01-29 02:23:27.465 2748 2796 E CRASH : uid: 10467
01-29 02:23:27.465 2748 2796 E CRASH : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr --------
01-29 02:23:27.465 2748 2796 E CRASH : Cause: null pointer dereference
01-29 02:23:27.465 2748 2796 E CRASH : x0 0000006ff01b7d30 x1 0000000000000000 x2 0000000000000000 x3 00000070175dcad0
01-29 02:23:27.465 2748 2796 E CRASH : x4 00000000000002ae x5 00000070175dcad0 x6 00000000000003e9 x7 000000000000004d
01-29 02:23:27.465 2748 2796 E CRASH : x8 0000000000000000 x9 8000000000000000 x10 8000000000000000 x11 0000000000000000
01-29 02:23:27.465 2748 2796 E CRASH : x12 0000000000000001 x13 ffffffffffe00000 x14 fffffc00001fffff x15 0000000000000000
01-29 02:23:27.465 2748 2796 E CRASH : x16 0000000000000001 x17 0000000000000000 x18 0000006fd1d7b638 x19 0000006ff01b7d30
01-29 02:23:27.465 2748 2796 E CRASH : x20 0000000000000000 x21 00000070185b1000 x22 0000006fd23111f8 x23 0000000000000000
01-29 02:23:27.465 2748 2796 E CRASH : x24 0000007015202000 x25 0000000000000000 x26 0000007015202000 x27 0000006f21abd610
01-29 02:23:27.465 2748 2796 E CRASH : x28 0000000000000001 x29 00000070151ffdd0
01-29 02:23:27.465 2748 2796 E CRASH : lr 0000007017a330b8 sp 00000070151ffd20 pc 0000000000000000 pst 00000000a0000000
My usual build settings:
Since this is my first time dealing with this, I am quite lost:
I recently upgraded unity from 2022.2.3f1 to 2022.2.4f1 so I tried using 2022.2.3f1 again, but the error persists. Unity editor version doesnt seem to be the issue.
Since the game is already on google play using an internal testing track, I found reports under Testing -> Pre-launch report -> Details -> stability -> Crashes and ANRs.
Sadly, stack traces are "Fatal AndroidRuntime Exception detected." and "Native crash of com.EndlessRageLimited.EndlessTD".
I'm not sure what to do with that information.
So more digging and it seems from the posts on the internet, people usually have a stack trace or backtrace. I dont and I dont understand why.
In the log file, there are multiple messages about not being able to load the debugger:
.android.camer: Not starting debugger since process cannot load the jdwp agent.
Here on StackOverflow, it was recommended to execute adb reverse tcp:8081 tcp:8081
but this didnt change anything.
Another website recommended to enable Wait for debugger in developer options, but this option is greyed out for me.
Other posts on StackOverflow and other pages didnt help me to find a solution either. Did I miss anything?
What I perceive as the relevant output from adb logcat in command prompt is available here. If I interpret it correctly, it starts when the app launches.
I now managed to get a stacktrace using Run device and Build to device, hitting Patch and Run with Development Build, Autoconnect Profiler, Deep Profiling Support and Script debugging enabled.
The stack trace is available here
Sadly, I cannot find any specific information on why it crashes.
After stubeling on the stacktrace utility and adding symbols for il2cpp and mono, I end up with this resolved stacktrace here .
Would somebody please have some tips on what I can do to get more information on why the game crashes? Since the last test on a phone I got like 30 commits and rolling back would mean reapplying several days of work :S
Thanks!!!

after going back and forth in my git history, I decided to git clean -fdx to see if something on my computers side got messed up. miraculously this did indeed "fix" the issue.
While I still don't know what caused the problem, at least I dipped my feet into debugging android games using Unity and learned something new :)

Related

libc.so crash on Android 12 devices

I found a strange crash message about the system so library on the APM platform, and it only happens on Android 12 devices.
Some of my app build gradle config:
compileSdkVersion 31
buildToolsVersion '31.0.0'
defaultConfig {
minSdkVersion 24
targetSdkVersion 26
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
And below is the crash message:
Process Name: 'xxx'
Thread Name: 'ReferenceQueueD'
pid: 29245, tid: 29254 >>> com.xxx.xxxx <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00fffffefffffff0
x0 00000070a0f4a6c0 x1 00ffffff00000000 x2 0000000000000000 x3 0000000000000000
x4 0000000000000010 x5 0000006ded2d4340 x6 0003522200034d82 x7 00034dcc00035472
x8 02ffffff00000000 x9 02ffffff00000000 x10 00000000ecc30e2f x11 0000000000000000
x12 0000000000000019 x13 000009f3ba83fe32 x14 00106e6d9f58a32d x15 0000000034155555
x16 00000070803f9248 x17 00000070a0eb2c00 x18 0000006d758cc000 x19 00ffffff00000000
x20 0000000000000000 x21 00000070a0f4a6c0 x22 0000000000000000 x23 0000000014f28e78
x24 000000006f7aaba0 x25 0000000014f28eb8 x26 0000000000000000 x27 0000006de9217000
x28 0000000000000043 x29 0000006d7631b6e0 x30 00000070806b0cd0
sp 0000006d7631b6d0 pc 00000070a0eb8668 pstate 0000000060001000
v0 0000518400006498000050f0000035e9 v1 000030ff000055ff000052d100004c9a
v2 00000000001c30000000006dd3dca000 v3 00000000000001000000000000000100
v4 00000000000221c00000000000022180 v5 0000221c000022180000221400002210
v6 00000000000000000000000000000000 v7 00000000000000008060180680601806
v8 00000000000000000000000000000000 v9 00000000000000000000000000000000
v10 00000000000000000000000000000000 v11 00000000000000000000000000000000
v12 00000000000000000000000000000000 v13 00000000000000000000000000000000
v14 00000000000000000000000000000000 v15 00000000000000000000000000000000
v16 c0300c03c0300c03c0300c03c0300c03 v17 00000000000800000000080001000404
v18 00000000000000000000080000000000 v19 0000000000000000be00000000000000
v20 00000000000000003ff0002b8b263fc3 v21 00000000000001480000000000000001
v22 00000000000000380000000000000001 v23 00000000000002000000000000000001
v24 00000000000000800000000000000001 v25 00000000000001100000000000000001
v26 00000000000001800000000000000001 v27 00000000000000b80000000000000001
v28 00000000000000000000000300000001 v29 000000000000000c0000000000000002
v30 00000000000000080000000000000002 v31 006d005f00790061006c00650064005f
fpsr 00000010 fpcr 00000000
#00 pc 0000000000006668 /apex/com.android.runtime/lib64/bionic/libc.so (_ZN5scudo9AllocatorINS_13AndroidConfigEXadL_Z21scudo_malloc_postinitEEE10deallocateEPvNS_5Chunk6OriginEmm+104)
#01 pc 0000000000121ccc /apex/com.android.i18n/lib64/libicui18n.so (_ZN6icu_6812RegexPattern3zapEv+216)
--- --- --- ---
This crash has not yet been reproduced on my test devices.It has been bothering me for a long time, I can't find relevant information on Google, and I am very eager for any relevant help.
The problem is because it tried to access an illegal memory address (address 00fffffefffffff0). It's illegal because that address isn't mapped to a valid space in virtual memory. It's occurring in some memory management code- notice the function name says malloc_postinit (malloc is the C function to request memory) dealocateChunk.
So either the C standard library has a bug in it (unlikely but possible), or somehow the memory of the allocation table got corrupted. Which can happen if C code overwrites its bounds or if an already deallocated chunk of memory is written to by mistake. Or a few hardware causes (RAM failure, cosmic rays, etc). Unless you can reliably reproduce it, you're not going to solve it. If you can reproduce it, try to figure out what the corrupted memory was holding and look for illegal access to it. A memory watch would work for that. But really these kinds of problems are incredibly hard to track, especially when not writing C or C++ yourself, as the illegal access is likely occurring far from your code.

Unity Android app crashes after splash screen with Google Play Services for AR update (after April 11th 2020)

I'm working collaboratively on an Android app that uses AR Foundation. From one day to another (without making new builds) the app started to crash after the splash screen, every time. I'm working on my Huawei Mate 20 Pro, but my teammates use other Android phones (Samsung, Xiaomi and Motorola) and they continued to develop the app, and it works just fine for them. I pull their commits (which work for them), make no changes, and it keeps crashing on my phone. We are using Firebase so I have the info from Crashlytics, but I can't quiet understand it:
Unity version is 2019.4.8f1 LTS, and the Huawei phone runs on Android 10.
The complete crash log is:
Caused by java.lang.Error
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.4.8f1 (60781d942082)', Build type 'Release', Scripting Backend 'mono', CPU 'armeabi-v7a'
Build fingerprint: 'HUAWEI/LYA-L29/HWLYA:10:user/release-keys' Revision: '0' ABI: 'arm'
Timestamp: 2020-08-13 14:12:37-0300 pid: 3571, tid: 3777,
name: UnityMain >>> com.app.name <<<
uid: 10315 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference r0 00000000 r1 00000000 r2 00000000 r3 00000000 r4 a965d490 r5 bd74a87c r6 80808080 r7 00000000 r8 be98f540 r9 00000000 r10 00000000 r11 b2f15f60 ip b2f4cc90 sp bd74a878 lr b2f1e859 pc 00000000
managed backtrace: #00 (wrapper managed-to-native)
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/NativeApi:UnityARCore_session_update (UnityEngine.ScreenOrientation,UnityEngine.Vector2Int,intptr,UnityEngine.XR.ARSubsystems.Feature) #01
UnityEngine.XR.ARCore.ARCoreSessionSubsystem/ARCoreProvider:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams,UnityEngine.XR.ARSubsystems.Configuration) <0xef> #02
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update (UnityEngine.XR.ARSubsystems.XRSessionUpdateParams) <0x1d3> #03
UnityEngine.XR.ARFoundation.ARSession:Update () <0x157> #04
(wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
UPDATE
I've managed to narrow down the crash to the following lines of code, inside the Update of ARSession script:
void Update()
{
if (subsystem?.running == true)
{
m_TrackingMode = subsystem.requestedTrackingMode.ToTrackingMode();
if (subsystem.matchFrameRateEnabled)
{
Application.targetFrameRate = subsystem.frameRate;
QualitySettings.vSyncCount = 0;
}
//subsystem.Update(new XRSessionUpdateParams
//{
// screenOrientation = Screen.orientation,
// screenDimensions = new Vector2Int(Screen.width, Screen.height)
//});
switch (subsystem.trackingState)
{
case TrackingState.None:
case TrackingState.Limited:
state = ARSessionState.SessionInitializing;
break;
case TrackingState.Tracking:
state = ARSessionState.SessionTracking;
break;
}
}
}
With those commented lines, the app starts but the camera won't work. If I uncomment them, it crashes. I know the problem is there because I placed a:
UnityEngine.Handheld.Vibrate();
Before and after, and the phone only vibrates once.
I updated the question's title because the problem is caused by an issue in the update of Google Play Services for AR. I managed to make my app work by manually downloading an older version of Google Play Services for AR, following the instructions here.
You can track the issue I opened in the ARCore Unity SDK repo here

Android UI tests with Espresso + MockK crash with SIGSEGV on emulators, fine on physical devices

I have just started using MockK to mock all the Repositories / Services logic in an MVP-based app for UI tests.
I have some UI tests running a login activity where the Espresso inputs logins and passwords and using MockK I can fake various situation where the login fails or not.
All services & repositories are standard Kotlin object, so I am using mockkobject and every/coEvery to override and handle login requests & tasks.
On my physical devices, there are no issues with the tests at all, but as soon as I tried to run them on a emulator running Android P+ with recommended image, they constantly crash at random time. And on rare occasion they can survive long enough to work.
Looking at the logs, I got various SIGSEGV:
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 10425 (e.android.debug), pid 10425 (e.android.debug)
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc in tid 10968 (HeapTaskDaemon), pid 10957 (e.android.debug)
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 15050 (firebase-instal), pid 14972 (e.android.debug)
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xd in tid 8902 (Measurement Wor), pid 8858 (e.android.debug)
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22004 (Binder:21832_5), pid 21832 (e.android.debug)
But looking deeper into the logs I believe I found the culprit:
InputDispatcher: channel '9fa7335 my.company.com.android.debug/my.company.com.ui.login.LoginActivity(server)' ~ Channel is unrecoverably broken and will be disposed!
Looking for solutions, it seems this could happen due to memory leaks ?
In any case, I made sure to launch the activity under test in a #Before method where all the mocks occur while I am clearing such mocks and verifies in the #After method.
Clearly I believe the tests do work just fine but something must be wrong with Espresso or all the mocking that occurs...
[EDIT 1]
Further looking at prior logs, this could be the reason why there are memory leaks:
ActivityThread: Service com.google.android.gms.autofill.service.AutofillService has leaked IntentReceiver com.google.android.gms.autofill.smsretriever.TracingSmsBroadcastReceiver#ce00658 that was originally registered here. Are you missing a call to unregisterReceiver()?
android.app.IntentReceiverLeaked: Service com.google.android.gms.autofill.service.AutofillService has leaked IntentReceiver com.google.android.gms.autofill.smsretriever.TracingSmsBroadcastReceiver#ce00658 that was originally registered here. Are you missing a call to unregisterReceiver()?
I disabled the AutoFillService (set to none in the relevant settings section) on my emulator. This seemed to improve my tests success rate at the beginning, but they keep crashing after several runs.
Now the logs are not showing this leak anymore, though.
[EDIT 2]
Apparently this issue could be related to MockK as I was able to retrieve more logs:
2020-07-24 11:57:15.955 15767-15780/com.my.company.android.debug A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 15780 (HeapTaskDaemon), pid 15767 (e.android.debug)
2020-07-24 11:57:15.997 15962-15962/? E/crash_dump32: failed to detach from thread 15773: No such process
2020-07-24 11:57:15.997 15962-15962/? E/crash_dump32: failed to detach from thread 15778: No such process
2020-07-24 11:57:15.997 15962-15962/? E/crash_dump32: failed to detach from thread 15779: No such process
2020-07-24 11:57:15.997 15962-15962/? E/crash_dump32: failed to detach from thread 15780: No such process
// 20 more times of exact same line //
2020-07-24 11:57:16.007 15962-15962/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2020-07-24 11:57:16.007 15962-15962/? A/DEBUG: Build fingerprint: 'google/sdk_gphone_x86/generic_x86:10/QSR1.190920.001/5891938:user/release-keys'
2020-07-24 11:57:16.007 15962-15962/? A/DEBUG: Revision: '0'
2020-07-24 11:57:16.007 15962-15962/? A/DEBUG: ABI: 'x86'
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: Timestamp: 2020-07-24 09:57:16+0000
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: pid: 15767, tid: 15780, name: HeapTaskDaemon >>> com.my.company.android.debug <<<
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: uid: 10136
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: Cause: null pointer dereference
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: eax 00000000 ebx ef8a6c34 ecx 00000000 edx f310b604
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: edi f3200380 esi 00000000
2020-07-24 11:57:16.008 15962-15962/? A/DEBUG: ebp e659d9a8 esp e659d940 eip ef7d89f4
2020-07-24 11:57:16.027 2044-2135/? E/InputDispatcher: channel '342ebda com.my.company.android.debug/com.my.compan.android.ui.error.LoginActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
After further investigation, there is a 1-year-old issue on the Android Test Github repo showing the same problem (but issue is now closed): https://github.com/android/android-test/issues/352
A relevant issue at Mockk was opened here: https://github.com/mockk/mockk/issues/466
[EDIT 3]
I was exploring the alternative to go back to Mockito which has more history and more active development. It took a bit of time but I had no major issue migrating my UI tests to Mockito.
The results: well, at first the crash were completely gone. I could fire my tests run, 10, 20, 30 times without a hinch. At least on mobile.
However, on Android TV (still with a simulator), the crash reappeared rather quickly. And then on mobile as well, but way less often with the dreadful message from the InputDispatcher.
While setting up the migration to Mockito, I have noticed that Mockk shares the same restrictions & dependencies with Mockito when mocking on Android Test Instrumentation. I faced the same issues and the same difficulties.
So it led me to believe that neither of them are the culprit, but it could very well be the Android Instrumentation APIs.
I also noticed that manually rebooting the emulators greatly improved the situation.
This was in my stacktrace:
W Unexpected CPU variant for X86 using defaults: x86
ActivityThread W Package uses different ABI(s) than its instrumentation:
Switching to a 64 bit emulator fixed the problem.
I too have been running into this issue with my instrumentation test suite and also suspect MockK to be (at least partially) at fault.
This is far from a true solution, but I've noticed that running MY tests with Android Test Orchestrator greatly reduces the chance of random failure due to test process crash (caused by the above segfault). (If you are running tests with Firebase Test Lab emulators, this could be particularly helpful.)
Another bonus of using Orchestrator, it does a really good job of digging through the logs (in Firebase Test Lab) to find the root error if your test does fail in an Orchestrator process.
I'm not certain this will work well for everyone, but if it does, it likely indicates that MockK (if it truly is the source of this issue) isn't cleaning up fully and is leaking into other tests.
I had exactly the same case where my tests were crashing randomly on the Emulator with Process crashed error saying check the Logcat. There was SIGSEGV error on the Logcat but not always.
In my case it was com.linkedin.dexmaker:dexmaker-mockito-inline causing the random crashes. I had to add it to mock a Kotlin data class in Instrumentation tests which I didn't need after all. So removing this dependency solved my issue.
I recommend to investigate after which point your tests started crashing, then it will be easier to get to bottom of it.

Error signal 11 (SIGSEGV), code 2 in a Unity App

I'm working on and Android game in Unity 2018.1.0f2. Some builds of the App lead to a crash. The log contains then the following:
05-20 18:52:17.993: A/libc(26270): Fatal signal 11 (SIGSEGV), code 2, fault addr 0xef97cffc in tid 26284 (UnityMain)
05-20 18:52:17.993: A/libc(26270): [ 05-20 18:52:17.993 3095: 3095 W/ ]
05-20 18:52:17.993: A/libc(26270): debuggerd: handling request: pid=26270 uid=10367 gid=10367 tid=26284
05-20 18:52:18.094: A/DEBUG(26286): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-20 18:52:18.094: A/DEBUG(26286): Build fingerprint: 'samsung/heroltexx/herolte:7.0/NRD90M/G930FXXS2DRDI:user/release-keys'
05-20 18:52:18.094: A/DEBUG(26286): Revision: '8'
05-20 18:52:18.094: A/DEBUG(26286): ABI: 'arm'
05-20 18:52:18.095: A/DEBUG(26286): pid: 26270, tid: 26284, name: UnityMain >>> de.zoomapp.zoom <<<
05-20 18:52:18.095: A/DEBUG(26286): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0xef97cffc
05-20 18:52:18.095: A/DEBUG(26286): r0 e9c93908 r1 f0f805c0 r2 e42c70e0 r3 00000008
05-20 18:52:18.095: A/DEBUG(26286): r4 00000000 r5 e42c70e0 r6 00000010 r7 00000008
05-20 18:52:18.095: A/DEBUG(26286): r8 e42c7000 r9 e9c93908 sl f0f805c0 fp 00000000
05-20 18:52:18.095: A/DEBUG(26286): ip f1200948 sp ef97d020 lr f11e6bc1 pc f11cbf00 cpsr 60070030
05-20 18:52:18.098: A/DEBUG(26286): backtrace:
05-20 18:52:18.098: A/DEBUG(26286): #00 pc 00053f00 /system/lib/libc.so (arena_purge_to_limit+1151)
05-20 18:52:18.098: A/DEBUG(26286): #01 pc 00064095 /system/lib/libc.so (imemalign+428)
05-20 18:52:18.098: A/DEBUG(26286): #02 pc 0000002f <unknown>
05-20 18:52:19.028: E/audit(4563): type=1701 audit(1526835139.011:7135): auid=4294967295 uid=10367 gid=10367 ses=4294967295 subj=u:r:untrusted_app:s0:c512,c768 pid=26284 comm="UnityMain" exe="/system/bin/app_process32" sig=11
05-20 18:52:19.054: E/lowmemorykiller(3180): Error writing /proc/26270/oom_score_adj; errno=22
05-20 18:52:19.059: E/InputDispatcher(4902): channel ~ Channel is unrecoverably broken and will be disposed!
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
05-20 18:52:21.967: E/OpenGLRenderer(4902): Error:glDeleteShader::<shader> is not a value generated by OpenGL
As I said, I don't get this problem every time, only in some builds. The crash occurs even before the Unity splash screen is shown. It seems like none of my scripts is called (not even Awake()) before it crashes. Also it only occured in the release build which I wanted to upload into the Google Play Store. This release build is splitted into APK and OBB file by Unity, so maybe there is some kind of problem? I don't know if there is much I can do to avoid this, as I don't see how my code or scene might lead to this error.
Maybe someone saw this kind of error before or even had some similiar problem and can give me a hint on how to fix this.
Thank you guys.
Regards, Michael
Any crash inside malloc, realloc, free, or memalign is a 99.99% indication that you have heap corruption (which is the result of overflowing a heap-allocated buffer, freeing unallocated memory, freeing memory twice, etc. etc.)
I don't get this problem every time, only in some builds
Yes: these are all quite characteristic of heap corruption problems.
I don't see how my code or scene might lead to this error.
Unfortunately, heap corruption errors are often very hard to debug without tool support.
On Linux and Mac OSX, you could use valgrind or (better) Address Sanitizer. Looks like the Address Sanitizer is available on Android as well.

Android - App runs on install, crashes when it is re-opened

When I first install the app onto my device, it works fine. Then, if I close it and re-open it, the app will crash with the below logcat message.
I don't think the first line regarding libwvm.so has anything to do with it, because that appears on install as well, but doesn't cause a crash.
I'm not sure what to do with this message, because as far as I can tell it doesn't point to anything in my code that I can try to fix.
I am following this tutorial to learn developing games with libGDX.
Any help appreciated. Thanks!
02-13 11:01:59.292 13140-13156/? E/WVMExtractor: Failed to open libwvm.so: dlopen failed: library "libwvm.so" not found
02-13 11:02:01.317 13140-13154/? A/libc: Fatal signal 11 (SIGSEGV), code 2, fault addr 0x76a96000 in tid 13154 (GLThread 823)
02-13 11:02:01.424 3254-3254/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-13 11:02:01.425 3254-3254/? A/DEBUG: Build fingerprint: 'google/bullhead/bullhead:6.0.1/MMB29Q/2480792:user/release-keys'
02-13 11:02:01.426 3254-3254/? A/DEBUG: Revision: 'rev_1.0'
02-13 11:02:01.426 3254-3254/? A/DEBUG: ABI: 'arm64'
02-13 11:02:01.427 3254-3254/? A/DEBUG: pid: 13140, tid: 13154, name: GLThread 823 >>> com.mypackage.name <<<
02-13 11:02:01.427 3254-3254/? A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x76a96000
02-13 11:02:01.462 3254-3254/? A/DEBUG: x0 00000000be39c000 x1 0000000076a96000 x2 00000000000000a0 x3 0000000000000120
02-13 11:02:01.463 3254-3254/? A/DEBUG: x4 0000000000000000 x5 0000000000000000 x6 00000000be39c000 x7 0000000000000000
02-13 11:02:01.463 3254-3254/? A/DEBUG: x8 0000000000000000 x9 0000000000000000 x10 0000000000000120 x11 0000000000000000
02-13 11:02:01.463 3254-3254/? A/DEBUG: x12 0000000000000000 x13 0000007f8b9ad468 x14 0000007f8b9ad458 x15 0000007f8b9ad4b8
02-13 11:02:01.464 3254-3254/? A/DEBUG: x16 0000007f82329148 x17 0000007f900d4140 x18 0000000000000001 x19 0000000076a96120
02-13 11:02:01.464 3254-3254/? A/DEBUG: x20 00000000be39c000 x21 0000000000000001 x22 0000000000000120 x23 0000000000000120
02-13 11:02:01.464 3254-3254/? A/DEBUG: x24 0000000000000120 x25 0000000000000001 x26 0000000000000001 x27 0000000000000120
02-13 11:02:01.464 3254-3254/? A/DEBUG: x28 0000000076a96000 x29 0000007f8b9ace60 x30 0000007f81e57f74
02-13 11:02:01.464 3254-3254/? A/DEBUG: sp 0000007f8b9ace60 pc 0000007f900d4280 pstate 0000000020000000
02-13 11:02:01.468 3254-3254/? A/DEBUG: #00 pc 000000000001c280 /system/lib64/libc.so (memcpy+312)
02-13 11:02:01.469 3254-3254/? A/DEBUG: #01 pc 000000000025df70 /vendor/lib64/egl/libGLESv2_adreno.so (BltDevice::ExecFastCopyBlock(void*, void const*, unsigned int, unsigned int, unsigned int, unsigned int, BltRect const*, BltRect const*, int)+144)
02-13 11:02:01.650 3254-3254/? E/DEBUG: AM write failed: Broken pipe
02-13 11:02:01.675 4413-13173/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 112)
02-13 11:02:01.682 366-366/? E/lowmemorykiller: Error writing /proc/13140/oom_score_adj; errno=22
02-13 11:02:06.360 3321-3321/? E/QCALOG: [MessageQ] ProcessNewMessage: [LOWI-SERVER] unknown deliver target [OS-Agent]
02-13 11:02:32.344 6226-6226/? E/NetworkScheduler.SchedulerReceiver: Invalid parameter app
02-13 11:02:32.344 6226-6226/? E/NetworkScheduler.SchedulerReceiver: Invalid package name : Perhaps you didn't include a PendingIntent in the extras?
02-13 11:02:32.945 7266-7266/? E/clatd: plat_prefix/dns(ipv4only.arpa) status = 7/No address associated with hostname
I don't think this is a logcat filtering issue. I selected "no filter" in the logcat and the message was the same, except for the last few lines which went like this instead of as above:
02-13 12:02:54.902 3254-3254/? E/DEBUG: AM write failed: Broken pipe
02-13 12:02:54.923 4413-17149/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 112)
02-13 12:02:54.928 4413-4459/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 60)
02-13 12:03:22.680 4413-5547/? E/native: do suspend true
02-13 12:03:22.688 6053-6302/? E/NxpTml: _i2c_write() errno : 5
02-13 12:03:22.688 6053-6302/? E/NxpTml: PN54X - Error in I2C Write.....
02-13 12:03:22.689 6053-6304/? E/NxpHal: write error status = 0x1ff
02-13 12:03:22.689 6053-6267/? E/NxpHal: write_unlocked failed - PN54X Maybe in Standby Mode - Retry
Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackage.name"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/GdxTheme" >
<activity
android:name="com.mypackage.name.AndroidLauncher"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I think the most likely cause is that the OpenGL context is being released when the game goes into the background.
Lots of OpenGL based games use a class called glSurfaceView to manage the OpenGL surface, and by default, you get these sorts of crashes if you don't very carefully reinitialize all of your OpenGL objects after returning from suspend because they all get invalidated. In Ice Cream Sandwich, a function called setPreserveEGLContextOnPause was added to let you easily request that the OpenGL context is kept alive after your game goes into the background.
After some cursory research (so apologies if this is wrong) I believe libgdx uses it or something similar, but that it might be failing to work because you're not specifying a min or target sdk version in your manifest. Try adding a line like this to your manifest:
<uses-sdk android:targetSdkVersion="19" android:minSdkVersion="14" />
Documentation of the uses-sdk tag is here: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Categories

Resources