Search Issue Tracker
Fixed
Fixed in 2021.3.41f1, 2022.3.37f1, 6000.0.7f1, 7000.0.0a1
Votes
0
Found in
2021.3.38f1
2022.3.30f1
6000.0.3f1
7000.0.0a1
Issue ID
UUM-72551
Regression
No
[IOS] Crash on "il2cpp::gc::GCHandle::Free" when App returns to foreground
How to reproduce:
1. Open the Project attached in the Google Drive in the comments
2. Build the Project for iOS
3. Edit the method "applicationWillEnterForeground" in "<Path_To_Xcode_Project>/Classes/UnityAppController.mm" to the version provided in the comments
4. Build and Run the Xcode Project
5. In the Build tap the Green Play button
6. Enter level 101 (detailed steps described in the comments)
7. Tap the red pause Button in the top right of the screen
8. Tap the red home Button in the pop-up
9. Put the App into the background
10. Return to the App
11. If the crash does not occur, relaunch the app and repeat from step 5
Reproducible with: 2022.3.30f1
Could not test with: 2021.3.38f1, 6000.0.2f1 (Updating the Project causes multiple errors to appear)
Reproduced on:
- iPhone 13 Pro (iOS 16.6.1)
- iPhone 13 (iOS 15.0)
- iPad Pro (9.7 inch, WiFi) (iOS 14.8)
- iPad 6th Gen (iOS 17.2)
Could not test on:
- iPhone 7 Plus (iOS 14.6) (a different crash prevents testing)
First lines of the stack trace:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x157e16184)
* frame #0: 0x000000012a405b10 UnityFramework`il2cpp::gc::GCHandle::Free(gchandle=<unavailable>) at GCHandle.cpp:278:38 [opt]
frame #1: 0x000000011fba4ed4 UnityFramework`::ReleaseAndClear() [inlined] Release at ScriptingTypes.cpp:52:9 [opt]
frame #2: 0x000000011fba4ec8 UnityFramework`::ReleaseAndClear() at ScriptingTypes.cpp:59:5 [opt]
frame #3: 0x000000011fa15220 UnityFramework`::~NativePlayerLoopSystem() at PlayerLoop.cpp:106:26 [opt]
frame #4: 0x000000011fa13544 UnityFramework`::clear_dealloc() [inlined] ~NativePlayerLoopSystem at PlayerLoop.cpp:105:5 [opt]
Notes:
- When the crash does not occur, a black screen is shown instead
- Usually crashes on the third attempt to reproduce
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Inconsistent behaviour when interacting with different dropdown types with pointer events on parent Visual Element
- Hidden GameObjects won't re-enable when they have call "DontDestroyOnLoad" function
- Overlay Canvas are rendered on each split-screen camera when HDR is enabled
- [Android] The Player loses focus when using UnityEngine.Handheld.StartActivityIndicator() with Facebook SDK
- Build fails with "Building Library/Bee/artifacts/MacStandalonePlayerBuildProgram/gahcy/hj9mx3z/951.0 failed with output:..." errors when Scripting Backend is set to IL2CPP
Resolution Note:
Based on provided information it is an incorrect usage of Unity: the engine is incorrectly shut down messing up the state.