Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Crashes on Nexus 6, Note 4 and other Adreno 420 devices

Discussion in 'General Graphics' started by hutch_jl, May 28, 2015.

  1. hutch_jl

    hutch_jl

    Joined:
    Jan 8, 2013
    Posts:
    40
    Hi,

    We get a very reliable (pretty much 100%) crash on these devices in our game:

    05-28 13:09:12.497: I/DEBUG(354): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    05-28 13:09:12.498: I/DEBUG(354): Build fingerprint: 'google/shamu/shamu:5.1/LMY47D/1743759:user/release-keys'
    05-28 13:09:12.498: I/DEBUG(354): Revision: '33696'
    05-28 13:09:12.498: I/DEBUG(354): ABI: 'arm'
    05-28 13:09:12.498: I/DEBUG(354): pid: 22607, tid: 22629, name: UnityMain >>> com.hutchgames.mud <<<
    05-28 13:09:12.498: I/DEBUG(354): signal 11 (SIGSEGV), code -6 (SI_TKILL), fault addr 0x5c
    05-28 13:09:12.570: I/DEBUG(354): r0 00000000 r1 b4b6a080 r2 a0b9df00 r3 00000000
    05-28 13:09:12.571: I/DEBUG(354): r4 99e53ed0 r5 00000001 r6 889b9800 r7 00000000
    05-28 13:09:12.571: I/DEBUG(354): r8 00000000 r9 aae0ac84 sl 00000000 fp 99e52000
    05-28 13:09:12.571: I/DEBUG(354): ip 00000020 sp a07ff208 lr aacb856f pc aad19d7e cpsr 60030030
    05-28 13:09:12.571: I/DEBUG(354): backtrace:
    05-28 13:09:12.571: I/DEBUG(354): #00 pc 00177d7e /system/vendor/lib/egl/libGLESv2_adreno.so (EsxCmdBuf::UnCachePreviousEntries()+1)
    05-28 13:09:12.571: I/DEBUG(354): #01 pc 0011656b /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::processAndSubmitRendering(EsxFlushReason)+3146)
    05-28 13:09:12.572: I/DEBUG(354): #02 pc 00177435 /system/vendor/lib/egl/libGLESv2_adreno.so (EsxCmdMgr::Flush(EsxFlushReason)+412)
    05-28 13:09:12.572: I/DEBUG(354): #03 pc 0011693d /system/vendor/lib/egl/libGLESv2_adreno.so (EsxContext::SwapBuffers(EsxRect const*, unsigned int, EglResourceAccessInfo*)+140)
    05-28 13:09:12.572: I/DEBUG(354): #04 pc 0011dd43 /system/vendor/lib/egl/libGLESv2_adreno.so (EglContext::SwapBuffers(EsxRect const*, unsigned int, EglResourceAccessInfo*)+54)
    05-28 13:09:12.572: I/DEBUG(354): #05 pc 0011ae89 /system/vendor/lib/egl/libGLESv2_adreno.so (EglApi::SwapBuffers(void*, void*)+140)
    05-28 13:09:12.572: I/DEBUG(354): #06 pc 00005dc5 /system/vendor/lib/egl/libEGL_adreno.so (eglSwapBuffers+28)
    05-28 13:09:12.572: I/DEBUG(354): #07 pc 0001237f /system/lib/libEGL.so (eglSwapBuffers+290)
    05-28 13:09:12.572: I/DEBUG(354): #08 pc 003b26b0 /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (ContextGLES::present()+40)
    05-28 13:09:12.572: I/DEBUG(354): #09 pc 003b8cbc /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (PresentContextGLES()+292)
    05-28 13:09:12.572: I/DEBUG(354): #10 pc 0037d540 /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (GfxDeviceGLES20::presentFrame()+4)
    05-28 13:09:12.573: I/DEBUG(354): #11 pc 001c17e0 /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (GfxDevice::presentFrame(ChannelAssigns const*)+12)
    05-28 13:09:12.573: I/DEBUG(354): #12 pc 00253258 /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (PresentAndSync()+100)
    05-28 13:09:12.573: I/DEBUG(354): #13 pc 0025377c /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (PlayerLoop(bool, bool, IHookEvent*)+420)
    05-28 13:09:12.573: I/DEBUG(354): #14 pc 003b6b0c /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (UnityPlayerLoop()+580)
    05-28 13:09:12.573: I/DEBUG(354): #15 pc 003be9a4 /data/app/com.hutchgames.mud-2/lib/arm/libunity.so (nativeRender(_JNIEnv*, _jobject*)+52)
    05-28 13:09:12.573: I/DEBUG(354): #16 pc 00953aff /data/dalvik-cache/arm/data@app@com.hutchgames.mud-2@base.apk@classes.dex

    I found this thread (http://forum.unity3d.com/threads/unity3d-and-ngui-causing-crash-on-nexus-6.325281/) which sounded similar and we are using NGUI, but I've totally disabled NGUI and the problem still occurs. We are using 4.6.5p2, I haven't tried p3 but it doesn't mention any Android fixes.

    Has anyone seen anything similar and found a workaround, or will I just have to submit the whole project as a repro? I can't really narrow the issue down any further unfortunately, I've manipulated the game flow but whatever I do it still occurs.

    Thanks
     
  2. Tronno

    Tronno

    Joined:
    Apr 23, 2015
    Posts:
    11
    My brute-force approach to handle untraceable bugs is to start paring down the app, one component at a time, until it no longer crashes. Start removing shaders, textures, models, plugins, etc. until the game works. Then, revert your changes and only remove the last component to confirm it broke the game.

    It's a brutal slog but occasionally it works.
     
  3. hutch_jl

    hutch_jl

    Joined:
    Jan 8, 2013
    Posts:
    40
    Yeah I'm aware of that, but our game is very large and includes numerous plugins; if I can get a headstart from someone I'll try that first :)

    As it turns out I managed to guess a workaround based on the timing of the crash. We had some code that contained the following:

    Application.LoadLevel(sceneName);
    Resources.UnloadUnusedAssets();

    Inserting a frame wait between the two prevents the crash. It's Adreno-specific so there seems to be a timing issue in the cleanup of assets in that GPU/driver/Unity combo.
     
  4. florianpenzkofer

    florianpenzkofer

    Unity Technologies

    Joined:
    Sep 2, 2014
    Posts:
    479
    Do you get the crash when using the ES2 and ES3 renderer?
    If you manage to reproduce it with a smaller project then please report a bug :).
     
  5. hutch_jl

    hutch_jl

    Joined:
    Jan 8, 2013
    Posts:
    40
    Hi Flo,

    This was on ES2. I've been looking at other Android issues since but I might get a chance to try to generate a small repro hopefully.

    Thanks!
     
  6. Danubian

    Danubian

    Joined:
    May 17, 2014
    Posts:
    3
    The issue is that Adreno 400 GPU's use ES3.1, which is NOT backwards compatible with ES2, even though ES3 was.
     
  7. hutch_jl

    hutch_jl

    Joined:
    Jan 8, 2013
    Posts:
    40
    Hi Danubian,

    Do you have a reference for this? The spec is backwards compatible as far as I know. The game runs fine forced to ES2 apart from the issue, which I worked around as mentioned above.