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

"Fatal signal 11 (SIGSEGV)" - Crash when (sometimes) changing scenes

Discussion in 'Android' started by Prodigga, Dec 1, 2015.

  1. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    Hey guys

    I am seeing a crash on Android between scene loads. It appears to be a problem with Unity (just looking at the logs here). Seems like something is going wrong while cleaning up the scene.

    I don't know how to reproduce it, but in my game it generally happens every 6 or so scene transitions (Enter game scene -> exit to menu scene x6~)

    Need this fixed since it happens so frequently, the game is not at a level where I am happy to publish it. Our beta testers crashing dozens of times every day. (One of them told me they had crashed 35 times trying to play the game that day). Our game would get chewed up by bad reviews and it'll suck for the players too.

    There is no unity logerror's or anything - just a crash dump. It looks like this:

    Code (CSharp):
    1. 12-01 13:41:57.686: A/libc(7320): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xcc7245b0 in tid 7340 (UnityMain)
    2. 12-01 13:41:57.791: A/DEBUG(3935): ************************************************
    3. 12-01 13:41:57.792: A/DEBUG(3935): Build fingerprint: 'google/angler/angler:6.0/MDB08L/2343525:user/release-keys'
    4. 12-01 13:41:57.792: A/DEBUG(3935): Revision: '0'
    5. 12-01 13:41:57.792: A/DEBUG(3935): ABI: 'arm'
    6. 12-01 13:41:57.793: A/DEBUG(3935): pid: 7320, tid: 7340, name: UnityMain  >>> com.mycompany.myproject <<<
    7. 12-01 13:41:57.793: A/DEBUG(3935): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xcc7245b0
    8. 12-01 13:41:57.861: A/DEBUG(3935):     r0 cc7245b0  r1 cc725000  r2 fffffe8c  r3 cc725000
    9. 12-01 13:41:57.862: A/DEBUG(3935):     r4 cc7245b0  r5 00000001  r6 cc724ffc  r7 e88d0000
    10. 12-01 13:41:57.862: A/DEBUG(3935):     r8 bd06d9d4  r9 f3a41248  sl f3a41298  fp f3a410bc
    11. 12-01 13:41:57.862: A/DEBUG(3935):     ip e00fded8  sp f3a41090  lr e001ec9c  pc e001ec0c  cpsr 80010010
    12. 12-01 13:41:57.995: A/DEBUG(3935): backtrace:
    13. 12-01 13:41:57.996: A/DEBUG(3935):     #00 pc 002b2c0c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    14. 12-01 13:41:57.996: A/DEBUG(3935):     #01 pc 002b2c98  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so (GC_push_all_stack+72)
    15. 12-01 13:41:57.996: A/DEBUG(3935):     #02 pc 002bb91c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    16. 12-01 13:41:57.996: A/DEBUG(3935):     #03 pc 002bb9ec  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    17. 12-01 13:41:57.996: A/DEBUG(3935):     #04 pc 002b7760  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    18. 12-01 13:41:57.996: A/DEBUG(3935):     #05 pc 002b4754  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    19. 12-01 13:41:57.997: A/DEBUG(3935):     #06 pc 002b1048  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    20. 12-01 13:41:57.997: A/DEBUG(3935):     #07 pc 002ab11c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    21. 12-01 13:41:57.997: A/DEBUG(3935):     #08 pc 002aac00  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    22. 12-01 13:41:57.997: A/DEBUG(3935):     #09 pc 002ab9c4  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    23. 12-01 13:41:57.997: A/DEBUG(3935):     #10 pc 002aba64  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
    24. 12-01 13:41:57.997: A/DEBUG(3935):     #11 pc 001396d8  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so (mono_gc_collect+40)
    25. 12-01 13:41:57.997: A/DEBUG(3935):     #12 pc 002cda34  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (scripting_gc_collect(int)+4)
    26. 12-01 13:41:57.997: A/DEBUG(3935):     #13 pc 0032c1ec  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (CleanupAfterLoad()+92)
    27. 12-01 13:41:57.998: A/DEBUG(3935):     #14 pc 0032b67c  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (LoadSceneOperation::PlayerLoadSceneFromThread()+596)
    28. 12-01 13:41:57.998: A/DEBUG(3935):     #15 pc 0032b21c  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (LoadSceneOperation::IntegrateMainThread()+164)
    29. 12-01 13:41:57.998: A/DEBUG(3935):     #16 pc 003294c4  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)+388)
    30. 12-01 13:41:57.998: A/DEBUG(3935):     #17 pc 00329908  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (PreloadManager::WaitForAllAsyncOperationsToComplete()+80)
    31. 12-01 13:41:57.999: A/DEBUG(3935):     #18 pc 0032857c  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (PreloadManager::UpdatePreloading()+164)
    32. 12-01 13:41:57.999: A/DEBUG(3935):     #19 pc 003273d4  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (PlayerLoop(bool, bool, IHookEvent*)+772)
    33. 12-01 13:41:57.999: A/DEBUG(3935):     #20 pc 004cddd8  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (UnityPlayerLoop()+748)
    34. 12-01 13:41:57.999: A/DEBUG(3935):     #21 pc 004d2bec  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (nativeRender(_JNIEnv*, _jobject*)+172)
    35. 12-01 13:41:57.999: A/DEBUG(3935):     #22 pc 0082bfc1  /data/app/com.mycompany.myproject-2/oat/arm/base.odex (offset 0x3a0000) (boolean com.unity3d.player.UnityPlayer.nativeRender()+76)
    36. 12-01 13:41:57.999: A/DEBUG(3935):     #23 pc 00829151  /data/app/com.mycompany.myproject-2/oat/arm/base.odex (offset 0x3a0000) (boolean com.unity3d.player.UnityPlayer.a(com.unity3d.player.UnityPlayer)+60)
    37. 12-01 13:41:58.000: A/DEBUG(3935):     #24 pc 008262af  /data/app/com.mycompany.myproject-2/oat/arm/base.odex (offset 0x3a0000) (void com.unity3d.player.UnityPlayer$b.run()+570)
    38. 12-01 13:41:58.000: A/DEBUG(3935):     #25 pc 000e5fc1  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
    39. 12-01 13:41:58.000: A/DEBUG(3935):     #26 pc 003e84bf  /system/lib/libart.so (art_quick_invoke_stub+170)
    40. 12-01 13:41:58.000: A/DEBUG(3935):     #27 pc 0010276c  [stack:7340]
     
  2. Vectorizing

    Vectorizing

    Joined:
    Nov 19, 2011
    Posts:
    14
    I have the same exact issue. I've been reading about it and I found a few posts where this happened back in the older versions of unity around v3.5.

    It appears that, "Signal 11 is segmentation fault. This means the program is trying to access memory it doesn't have permission for." to quote jvil (http://forum.unity3d.com/threads/error-fatal-signal-11-sigsegv.143753/).

    The strange issue is it happens intermittently like you said. Sometimes it happens the first time, sometimes it happens the fifth time. This issue begins when I click a UI button (not the legacy GUI) and call Applciation.LoadLevel(0). I'm not even trying to load a new scene I'm just reloading the only scene in my game since it's easier than deleting and re-hiding objects. etc.

    I've also read that building it in developer mode fixes this but that's not ideal for production.

    Using Unity 5.2.1f1 - 64Bit Editor.

    adb logcat : (From the line where it detected the touch to the line it crashed) - I can provide more info if needed:
    Code (CSharp):
    1.  
    2. I/InputDispatcher(  810): Delivering touch to: action: 0x0, toolType: 1
    3.  
    4. I/ServiceKeeper(  810): In getappinfo pid = 810 pkgName = android appinfo = null
    5.  
    6. D/lights  (  810): button : 1 +
    7.  
    8. I/ServiceKeeper(  810): In getseinfo pid = 810 uid = 1000 seinfo= system
    9.  
    10. D/lights  (  810): button : 1 -
    11.  
    12. D/InputReader(  810): Input event: value=0
    13.  
    14. I/InputReader(  810): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=131113951108000
    15.  
    16. I/InputDispatcher(  810): Delivering touch to: action: 0x1, toolType: 1
    17.  
    18. I/Sensors (  810): Mag old sensor_state 16401, new sensor_state : 16385 en : 0
    19.  
    20. E/Sensors (  810): U_Gyro old sensor_state 16385, new sensor_state : 1 en : 0
    21.  
    22. D/dalvikvm(22301): threadid=15: thread exiting, not yet detached (count=0)
    23.  
    24. F/libc    (22301): Fatal signal 11 (SIGSEGV) at 0x81a33710 (code=1), thread 22322 (UnityMain)
    25.  
    26. I/DEBUG   (  356): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    27.  
    28. I/DEBUG   (  356): Build fingerprint: 'Verizon/kltevzw/kltevzw:4.4.2/KOT49H/G900VVRU1ANE9:user/release-keys'
    29.  
    30. I/DEBUG   (  356): Revision: '14'
    31.  

    Thanks for your time.
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    Glad I am not alone. We are using NGUI for our UI in our game. What we do have in common is that we are both loading a scene when the game crashes. I would put my money on that.

    Also, running in release and develop mode = same problem! :( (For me anyway)

    Happy to send a build to Unity devs if they want to try it out. We need this fixed, not to sound dramatic but the game is basically unplayable. It crashes between every couple of games.
     
  4. United-Unity

    United-Unity

    Joined:
    Mar 25, 2015
    Posts:
    20
    My app has a similar problem with yours. I already reported a bug case and still waiting for a result.
    But now downgrade from Unity 5 to 4 is being considered for not being late at market as a plan B. :(

    --- Following is my bug report.

    Android player crashed while running LoadLevel

    While playing my game built for android, it crashed quite often. (after playing 3~6 stages in a row, it crashed)
    It happened with Unity 5.1, 5.2.2, 5.2.3 and 5.3.0f2 (beta). It started to crash after migration from Unity 4.6 and with Unity 4.6.9 there was no crash related with this one.

    Code (CSharp):
    1.  
    2. Crash call stack is
    3.     #00  (PersistentManager::postLoadStreamNameSpace(StreamNameSpace&, int)+48)
    4.     #01  (PersistentManager::GetStreamNameSpaceInternal(int)+956)
    5.     #02  (PersistentManager::GetLoadErrorMessageFromPath(std::string const&)+56)
    6.     #03  (LoadSceneOperation::perform()+540)
    7.     #04  (PreloadManager::Run()+164)
    8.     #05  (PreloadManager::Run(void*)+4)
    9.     #06  (Thread::RunThreadWrapper(void*)+84)
    10.     #07  (__thread_entry+72)
    11.     #08  (pthread_create+240)
    12.  
    (for collecting detailed call stack my client was built with development build option. and full log file is attached)

    This crash always happens while running LoadLevel. But all LoadLevel don't cause crash. (it makes me crazy)
    And it's better to mention that my game uses LoadLevel, LoadLevelAdditiveAsync and LoadAsset a lot and I think this can be stressfull for player.
     
    liortal likes this.
  5. United-Unity

    United-Unity

    Joined:
    Mar 25, 2015
    Posts:
    20
    After removing all LoadLevelAdditive and LoadLevelAdditiveAsync codes from my project, it seems good enough to tell the reason making my app crashed was "LoadLevelAdditive*". Now my app is being built with Unity 5.x safely.

    When you guys suffer a similar problem that my team had, try to remove all LoadLevelAdditive* functions in your project.