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

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:

Crash

12-01 13:41:57.686: A/libc(7320): Fatal signal 11 (SIGSEGV), code 1, fault addr 0xcc7245b0 in tid 7340 (UnityMain)
12-01 13:41:57.791: A/DEBUG(3935): ************************************************
12-01 13:41:57.792: A/DEBUG(3935): Build fingerprint: 'google/angler/angler:6.0/MDB08L/2343525:user/release-keys'
12-01 13:41:57.792: A/DEBUG(3935): Revision: '0'
12-01 13:41:57.792: A/DEBUG(3935): ABI: 'arm'
12-01 13:41:57.793: A/DEBUG(3935): pid: 7320, tid: 7340, name: UnityMain  >>> com.mycompany.myproject <<<
12-01 13:41:57.793: A/DEBUG(3935): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xcc7245b0
12-01 13:41:57.861: A/DEBUG(3935):     r0 cc7245b0  r1 cc725000  r2 fffffe8c  r3 cc725000
12-01 13:41:57.862: A/DEBUG(3935):     r4 cc7245b0  r5 00000001  r6 cc724ffc  r7 e88d0000
12-01 13:41:57.862: A/DEBUG(3935):     r8 bd06d9d4  r9 f3a41248  sl f3a41298  fp f3a410bc
12-01 13:41:57.862: A/DEBUG(3935):     ip e00fded8  sp f3a41090  lr e001ec9c  pc e001ec0c  cpsr 80010010
12-01 13:41:57.995: A/DEBUG(3935): backtrace:
12-01 13:41:57.996: A/DEBUG(3935):     #00 pc 002b2c0c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
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)
12-01 13:41:57.996: A/DEBUG(3935):     #02 pc 002bb91c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.996: A/DEBUG(3935):     #03 pc 002bb9ec  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.996: A/DEBUG(3935):     #04 pc 002b7760  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.996: A/DEBUG(3935):     #05 pc 002b4754  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.997: A/DEBUG(3935):     #06 pc 002b1048  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.997: A/DEBUG(3935):     #07 pc 002ab11c  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.997: A/DEBUG(3935):     #08 pc 002aac00  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.997: A/DEBUG(3935):     #09 pc 002ab9c4  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
12-01 13:41:57.997: A/DEBUG(3935):     #10 pc 002aba64  /data/app/com.mycompany.myproject-2/lib/arm/libmono.so
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)
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)
12-01 13:41:57.997: A/DEBUG(3935):     #13 pc 0032c1ec  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (CleanupAfterLoad()+92)
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)
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)
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)
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)
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)
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)
12-01 13:41:57.999: A/DEBUG(3935):     #20 pc 004cddd8  /data/app/com.mycompany.myproject-2/lib/arm/libunity.so (UnityPlayerLoop()+748)
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)
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)
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)
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)
12-01 13:41:58.000: A/DEBUG(3935):     #25 pc 000e5fc1  /system/lib/libart.so (art_quick_invoke_stub_internal+64)
12-01 13:41:58.000: A/DEBUG(3935):     #26 pc 003e84bf  /system/lib/libart.so (art_quick_invoke_stub+170)
12-01 13:41:58.000: A/DEBUG(3935):     #27 pc 0010276c  [stack:7340]

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 (Error Fatal signal 11 (SIGSEGV) - Unity Engine - Unity Discussions).

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:

I/InputDispatcher(  810): Delivering touch to: action: 0x0, toolType: 1

I/ServiceKeeper(  810): In getappinfo pid = 810 pkgName = android appinfo = null

D/lights  (  810): button : 1 +

I/ServiceKeeper(  810): In getseinfo pid = 810 uid = 1000 seinfo= system

D/lights  (  810): button : 1 -

D/InputReader(  810): Input event: value=0

I/InputReader(  810): Touch event's action is 0x1 (deviceType=0) [pCnt=1, s=] when=131113951108000

I/InputDispatcher(  810): Delivering touch to: action: 0x1, toolType: 1

I/Sensors (  810): Mag old sensor_state 16401, new sensor_state : 16385 en : 0

E/Sensors (  810): U_Gyro old sensor_state 16385, new sensor_state : 1 en : 0

D/dalvikvm(22301): threadid=15: thread exiting, not yet detached (count=0)

F/libc    (22301): Fatal signal 11 (SIGSEGV) at 0x81a33710 (code=1), thread 22322 (UnityMain)

I/DEBUG   (  356): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG   (  356): Build fingerprint: 'Verizon/kltevzw/kltevzw:4.4.2/KOT49H/G900VVRU1ANE9:user/release-keys'

I/DEBUG   (  356): Revision: '14'

Thanks for your time.

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! :frowning: (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.

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. :frowning:

— 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.

Crash call stack is
    #00  (PersistentManager::postLoadStreamNameSpace(StreamNameSpace&, int)+48)
    #01  (PersistentManager::GetStreamNameSpaceInternal(int)+956)
    #02  (PersistentManager::GetLoadErrorMessageFromPath(std::string const&)+56)
    #03  (LoadSceneOperation::perform()+540)
    #04  (PreloadManager::Run()+164)
    #05  (PreloadManager::Run(void*)+4)
    #06  (Thread::RunThreadWrapper(void*)+84)
    #07  (__thread_entry+72)
    #08  (pthread_create+240)

(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.

1 Like

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.