Search Issue Tracker
By Design
Votes
0
Found in
5.3.3p1
Issue ID
776577
Regression
No
[iOS] Application crashes when throwing an exception from OnGUI click function
Steps to reproduce:
1. Open attached project (CrashLogTest_Stripped.zip)
2. Build the project for iOS
3. Build generated Xcode project to a device
4. Click Unity UI button (white one in the middle)
5. Notice an exception is logged
6. Click the legacy GUI button (top left corner of the screen)
7. Notice the application crashes and exception is not logged
Note: Also tried throwing other exceptions (besides System.Exception) - application still crashes.
RESOLUTION:
The behavior you are seeing is expected. The reasoning is that a lot of the time, uncaught exceptions indicate significant error in app logic and that the internal data is no longer consistent. Thus by default we induce a artificial crash to force Apple crash reporter to create a crash report. The UI code has an explicit try..catch block deep inside on the managed side, thus this does not happen there.
It is possible to change the behavior to what you want. Setting "Script call optimization" to "Slow and safe" will disable crashing on exceptions. This is the only thing the setting changes on IL2CPP; the calls aren't actually slower. We will introduce a separate setting that controls this behavior.
This way, the exception is propagated down into Unity and then logged, as expected.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Add comment