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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Add comment