Greetings
I’m getting a signal 11 (SIGSEGV) crash on Android and I need help fixing it Maybe it’s a bug in Unity? Following are the details:
I’m developing an isometric game that has only 1 scene and both 2D and 3D objects. The apk is 79MB and works great on Nexus 5X (Android 8). However, I tried running it on Samsung Galaxy Duos S7852 (Android 4.2.2) and it crashes.
On Nexus 5X, it’s white screen > black screen > game start.
On S7852, it’s white screen > black screen > crash.
I had my suspicions on the RAM of this device (768MB). So I created an emulator with same Android version, screen size and RAM size, and the game works on the emulator! So I’m guessing this is a hardware related issue?
I also tried creating another scene and loading the main scene async. In this case, the first scene loads and the app crashes some time later.
Have you tried building an empty project and running it?
We experience the same problem and it only crashes on our project.
It launches one time in five, then works ok (relatively - stable 30 fps without any crashes for the whole game).
I stopped using this crashy 4.4.2 device a long time ago as it had 512 megs of ram and the former project wasn’t able to run on that. So I haven’t built any real projects on that device since ~5.2-ish version I think, but before that it worked fine on smaller Unity projects. New project however should run fine on it (which it does) as we use only 30 megs of ram tops, but doesn’t always launch.
I tried building empty projects and they don’t seem to crash at all, they launch 100% of the time. I haven’t been able to pin down the problem, but maybe it’s something with included .dlls or plugins, I don’t know.
It crashes on startup with this message, which is related to graphics drivers (Adreno GPU):
Error
@Kumo-Kairo
Thanks for replying!
Empty project works fine. Even if I take everything out of my game and leave the floor and 2 buildings, it works fine.
Maybe it’s something with shader variants, I couldn’t see any specific info on that in these forums, no one has ever solved this problem really (or they keep quiet about it).
I’ll try to break down the game and will try to pin down the problem. If you can, @ercion , you should do the same thing. There’s have to be an answer.
Edit - I tried building a debug version if APK (development build) to get a more detailed stacktrace and it doesn’t crash at all, it launches correctly.
Maybe. I am using a shader that I copied from the internet. I also did some digging on SIGSEGV. Turns out it’s the good ol’ segmentation fault (please correct me if I’m wrong). That’s the most cruel and difficult-to-find error I’ve experienced in all my years of programming. It also makes me suspect something wrong in the engine core of Unity.
It’s definitely has to do something with Unity, but there has to be a way around it - somehow it compiles small projects that work fine.
It may be very tricky to pin down, I’ve seen a few cases from people that use LibGDX (another game programming engine), so it’s not just Unity that has something wrong.
Now I have another issue on another phone. This time on a Xiaomi 4X with 2 gigs of ram. It also crashes after the “Made with Unity” splash (the previous crash on another phone happened before that).
The error seems relatively similar, but not exactly the same:
10-01 21:01:01.023 29937 29977 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 29977 (UnityMain)
10-01 21:01:01.097 677 677 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-01 21:01:01.099 677 677 F DEBUG : Build fingerprint: 'Xiaomi/santoni/santoni:6.0.1/MMB29M/V8.5.2.0.MAMMIED:user/release-keys'
10-01 21:01:01.099 677 677 F DEBUG : Revision: '0'
10-01 21:01:01.099 677 677 F DEBUG : ABI: 'arm'
10-01 21:01:01.099 677 677 F DEBUG : pid: 29937, tid: 29977, name: UnityMain >>> org.nadezhdin.roadtrip <<<
10-01 21:01:01.099 677 677 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
10-01 21:01:01.147 677 677 F DEBUG : r0 d81bded8 r1 d820e940 r2 aca0c070 r3 ea1c9c10
10-01 21:01:01.148 677 677 F DEBUG : r4 d81bded8 r5 ea1c9ce0 r6 d9f02dd0 r7 d820e940
10-01 21:01:01.148 677 677 F DEBUG : r8 acc08b4c r9 d81e3860 sl ffffe144 fp f396ce80
10-01 21:01:01.148 677 677 F DEBUG : ip f396ce30 sp f396ce80 lr ea1b9ae0 pc 00000000 cpsr 200b0010
10-01 21:01:01.149 677 677 F DEBUG :
10-01 21:01:01.149 677 677 F DEBUG : backtrace:
10-01 21:01:01.150 677 677 F DEBUG : #00 pc 00000000 <unknown>
10-01 21:01:01.150 677 677 F DEBUG : #01 pc 0000fadc <unknown>
10-01 21:01:01.658 690 771 D ThermalEngine: sensor_wait: case_therm Wait done.
10-01 21:01:01.660 690 771 D ThermalEngine: sensor_monitor: case_therm Reading 36000 .
10-01 21:01:01.660 690 771 I ThermalEngine: Sensor:case_therm:36000 mC
10-01 21:01:01.660 690 771 D ThermalEngine: update_active_thresh: case_therm Active(1), Hi(1) 42000, Lo(0) -2147483648, Interval(1) 1000
10-01 21:01:01.660 690 771 D ThermalEngine: sensor_monitor: case_therm Sensor wait.
10-01 21:01:01.660 690 771 D ThermalEngine: sensor_wait: case_therm Wait start. 1000ms
10-01 21:01:02.152 681 1617 I AudioFlinger: BUFFER TIMEOUT: remove(4098) from active list on thread 0xf00ec008
10-01 21:01:02.182 681 1610 V AudioPolicyManagerCustom: getNewOutputDevice() selected device 0
10-01 21:01:02.660 690 771 D ThermalEngine: sensor_wait: case_therm Wait done.
10-01 21:01:02.662 690 771 D ThermalEngine: sensor_monitor: case_therm Reading 36000 .
10-01 21:01:02.662 690 771 I ThermalEngine: Sensor:case_therm:36000 mC
10-01 21:01:02.662 690 771 D ThermalEngine: update_active_thresh: case_therm Active(1), Hi(1) 42000, Lo(0) -2147483648, Interval(1) 1000
10-01 21:01:02.662 690 771 D ThermalEngine: sensor_monitor: case_therm Sensor wait.
10-01 21:01:02.662 690 771 D ThermalEngine: sensor_wait: case_therm Wait start. 1000ms
10-01 21:01:03.015 1761 1761 D wpa_supplicant: wlan0: Control interface command 'SIGNAL_POLL'
10-01 21:01:03.030 1761 1761 D wpa_supplicant: CTRL-DEBUG: global_ctrl_sock-sendto: sock=11 sndbuf=229376 outq=0 send_len=48
10-01 21:01:03.060 1812 1812 D StatusBar.NetworkController: onSignalStrengthsChanged received on slotId :0signalStrength=SignalStrength: 13 0 -120 -160 -120 -1 -1 99 2147483647 2147483647 2147483647 2147483647 2147483647 gsm|lte level=5 cdmdlevel=0 evdolevel=0
10-01 21:01:03.070 1812 1812 D StatusBar.NetworkController: slot=-10;action=android.net.wifi.RSSI_CHANGED
10-01 21:01:03.072 1812 1812 D StatusBar.NetworkController: updateNetworkName chosenNetType=2;mNetworkName[0]=Rostelecom
10-01 21:01:03.079 1419 1715 D ConnectivityService: notifyType CAP_CHANGED for NetworkAgentInfo [WIFI () - 128]
10-01 21:01:03.178 1419 1758 E NativeCrashListener: Exception dealing with report
10-01 21:01:03.178 1419 1758 E NativeCrashListener: android.system.ErrnoException: read failed: EAGAIN (Try again)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at libcore.io.Posix.readBytes(Native Method)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at libcore.io.Posix.read(Posix.java:169)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at libcore.io.BlockGuardOs.read(BlockGuardOs.java:230)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at android.system.Os.read(Os.java:367)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at com.android.server.am.NativeCrashListener.consumeNativeCrashData(NativeCrashListener.java:240)
10-01 21:01:03.178 1419 1758 E NativeCrashListener: at com.android.server.am.NativeCrashListener.run(NativeCrashListener.java:138)
10-01 21:01:03.663 690 771 D ThermalEngine: sensor_wait: case_therm Wait done.
10-01 21:01:03.664 690 771 D ThermalEngine: sensor_monitor: case_therm Reading 36000 .
10-01 21:01:03.664 690 771 I ThermalEngine: Sensor:case_therm:36000 mC
10-01 21:01:03.664 690 771 D ThermalEngine: update_active_thresh: case_therm Active(1), Hi(1) 42000, Lo(0) -2147483648, Interval(1) 1000
10-01 21:01:03.664 690 771 D ThermalEngine: sensor_monitor: case_therm Sensor wait.
10-01 21:01:03.664 690 771 D ThermalEngine: sensor_wait: case_therm Wait start. 1000ms
I’m not sure how this bug can be reproduced. It requires a certain phone model, at least the one that only happens on ZTE V811. In my experience, such reported bugs get rejected right away as “not reproduced”. I’ve had terrible past experience with bug reporting where unity editor literally made me to file a bug report, which I did, spending a whole lot of time uploading the project, filling the description window etc. Only to then receive a semi-rage response from support team like “Don’t file these useless reports, make sure the bug can be reproduced before sending it next time, you dumbo”, so I try to stay away from bug reporting unless I have a crystal-clear way to reproduce a problem. With this little bug, however, it’s not achievable. @NinjaCat I’ll find all the links to forum threads and unity answers regarding this problem, it dates back to 2014 and there is no clear way to solve it yet.
Sorry to hear that! We certainly don’t consider any bug report useless and we’d really like to help you solve these crashes. If it happens every few runs, that should be perfectly fine for us to reproduce - we just need a bug report with a project and a small description of the problem.
Bug reporting and handling is tricky business, sometimes it’s hard for us to recreate the issue or maybe we don’t have the correct setup, but in those situations we always try and get more information from you guys. Just don’t be afraid to reply to our emails or just send any new information you run into - that helps us a lot!
So I decided to take a break of constant debugging an digging into a problem and did a clean Windows reinstall (I’ve wanted to do that a long time ago). This resulted in a need of Android SDK re-installation (no way dude). The new Android SDK version comes with a console-only based SDK Manager (without that fancy GUI app that enables you to checkbox things you need and install them), so I decided to install an older version, the one with the 23 as a build target (http://dl-ssl.google.com/android/repository/tools_r23-windows.zip)
And you know what. It started building ok and running ok without any crashes or issues whatsoever for a few days already.
I think this is why this problem is not fixed yet - the root of it is somewhere inside Android SDK or the system itself (maybe some cached registry values, who knows what).
One thing I don’t quite understand though is that if the system or Android SDK is guilty of this, why Unity Cloud builds also crash. They have a clean system and a clean SDK install and can’t really do something wrong.
@Kumo-Kairo Good to hear. So you’re saying that if I change the Target API Level to 23, it will work fine? Or are you talking about the build-tools version?
I can’t tell for sure what have helped. It’s not possible to do such things one step at a time. It may be Android SDK version and may be some internal system cache. It even can be something with Unity project cache too (I’ve deleted the Library folder prior to running a project on a “new” machine).
Questions remain - if it’s something with the Android SDK then why emplty or simple projects work ok but not the big one.
You can try reinstalling the Android SDK as well as deleting the Library folder inside Unity project (it will nullify all the imported assets cache and all built assemblies)
Will do. Can you please tell me the contents of your C:\Users<username>\AppData\Local\Android\sdk\build-tools and C:\Users<username>\AppData\Local\Android\sdk\platforms folders?
I’ve tried building it on Unity Cloud Build and it doesn’t crash after splash screen. This persistent crash really has something to do with system cache after all. It doesn’t solve the problem of occasional crashes on a ZTE phone though.
Well I tried to target platform 23 but it wouldn’t let me because of some God forsaken VR library that apparently exists in my project for no reason. Changing build tools to 26.0.2 and deleting Library folder didn’t work either. Which version of Unity are you using?
Dang. I had a ray of hope for once. Good thing I have some time today. Gonna try to pin point the error.
Great then I’ll try that for a release build for now. Meanwhile, I’ll keep investigating.
Which system? The one that’s building the app or the one that’s running it?
I have more logs. They might help. Notice the glsl link error when the app launches.