Regression of issue: iOS player crashes on cleanup `MonoManager::GetScriptingClass()`

First of all, I think the Unity Issue Tracker needs a streamlined avenue for reporting regressed issues if it’s going to do this:
8450615--1120997--votingdisabledforresolvedissues.png
Seeing as I’ve already spent half an hour trying to figure out how else to get Unity’s attention about a regressed issue (and not get it flagged as a duplicate), I figured a detailed forum post would be my best shot. Let me know if I missed the memo on SOP for this.

Ok, so here’s the original issue: 1145982
[IOS]CRASH ON “LOOKUP<CORE::BASIC_STRING<CHAR, CORE::STRINGSTORAGEDEFAULT > >() AT HASH_SET.H:645:49” DURING UNITY CLEANUP

This issue declares the fix made it into 2019.2.X. We are currently using 2019.2.21 for iOS 9 support, which is the latest version in the track (so the fix should have made it here). We are seeing this issue on all iOS versions above 9, but what got our attention about it again is that it seems to have really spiked with iOS 15/16. Since this issue overall increases our Apple crashrate by +1-2%, this is a significant issue regardless of UX impact, mostly for UA/valuation.

You can follow the repro steps in the original issue on a device running iOS 15/16.

Now, I don’t expect this old of a legacy version to get much attention, but I figured it’s worth a shot in case anyone has any advice or insight on this. Also, am wanting to know more about the issue regression procedure here in general :slight_smile:

can you please provide the full stack for your crashes? it did fix the bug reported back then. But ios 15/16 could have added new fancy ways for exiting with a crash 8) [trust me - i have fixed that many crashes on exit that i would ignore any requests without full stacktrace. just in case: i did not touch this one, so there are even more than i saw personally ;-)]

I thought you’d never ask! :smile:

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000210
Crashed: com.apple.main-thread
0  REDACTED                       0x167e32c core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char>> const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>> const, int>, core::equal_pair<std::__1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>> const, int>>::node* core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char>> const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>> const, int>, core::equal_pair<std::__1::equal_to<core::basic_string<char, core::StringStorageDefault<char>>>, core::basic_string<char, core::StringStorageDefault<char>> const, int>>::lookup<core::basic_string<char, core::StringStorageDefault<char>>>(core::basic_string<char, core::StringStorageDefault<char>> const&) const + 14237356
1  REDACTED                       0x167b748 MonoManager::GetScriptingClass(char const*, char const*, char const*) + 14226120
2  REDACTED                       0x119fcac InitializeCoreScriptingClasses + 23 (CoreScriptingClasses.cpp:23)
3  REDACTED                       0x119fc20 GetCoreScriptingClassesPtr + 2078 (CoreScriptingClasses.cpp:2078)
4  REDACTED                       0x119f610 Internal_ApplicationWantsToQuit + 797 (CoreScriptingClasses.cpp:797)
5  REDACTED                       0x15bba04 NotifyPlayerQuit(bool) + 13440388
6  REDACTED                       0x15bc21c PlayerCleanup(bool) + 13442460
7  REDACTED                       0x18a53d0 UnityCleanup + 16494416
8  REDACTED                       0x198b4 -[UnityAppController applicationWillTerminate:] + 413 (UnityAppController.mm:413)
9  REDACTED                       0x1379a8 -[AppController applicationWillTerminate:] + 153 (AppController.mm:153)
10 UIKitCore                      0xe97518 -[UIApplication _terminateWithStatus:] + 240
11 UIKitCore                      0x5fc398 -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 124
12 UIKitCore                      0x7d6700 -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 220
13 UIKitCore                      0xe93b48 -[UIApplication workspaceShouldExit:withTransitionContext:] + 220
14 FrontBoardServices             0x48f20 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke_2 + 76
15 FrontBoardServices             0x9bdc -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232
16 FrontBoardServices             0x48ebc __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke + 104
17 libdispatch.dylib              0x64094 _dispatch_client_callout + 16
18 libdispatch.dylib              0x714c _dispatch_block_invoke_direct$VARIANT$mp + 220
19 FrontBoardServices             0xb2ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40
20 FrontBoardServices             0xa7c0 -[FBSSerialQueue _targetQueue_performNextIfPossible] + 176
21 FrontBoardServices             0xe960 -[FBSSerialQueue _performNextFromRunLoopSource] + 24
22 CoreFoundation                 0xb2eec __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
23 CoreFoundation                 0xc301c __CFRunLoopDoSource0 + 204
24 CoreFoundation                 0x5214 __CFRunLoopDoSources0 + 256
25 CoreFoundation                 0xa8e8 __CFRunLoopRun + 768
26 CoreFoundation                 0x1dc30 CFRunLoopRunSpecific + 572
27 GraphicsServices               0x1988 GSEventRunModal + 160
28 UIKitCore                      0x4e5c50 -[UIApplication _run] + 1080
29 UIKitCore                      0x27f3d0 UIApplicationMain + 336
30 REDACTED                       0x469c main + 40 (main.mm:40)
31 ???                            0x1051503d0 (Missing)

To be abundantly clear, we are seeing this trace on iOS 10, 11, 12, 13, 14, 15, and 16. The latter two make up 87% of crashing users, but this split may just be a shear of our user share x OPU.

ok, fair, it comes from Internal_ApplicationWantsToQuit indeed as the previous one, maybe there is one more place we forgot. I’ll poke people responsible or look myself, cheers

1 Like

Same error for me:

Crashed: Thread #1
SIGSEGV 0x0000000000000268
0
libunity.so
core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char> > const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >::node* core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char> > const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >::lookup<core::basic_string<char, core::StringStorageDefault<char> >, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >(core::basic_string<char, core::StringStorageDefault<char> > const&, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> const&) const
1
libunity.so
core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char> > const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >::node* core::hash_set<core::pair<core::basic_string<char, core::StringStorageDefault<char> > const, int, true>, core::hash_pair<core::hash<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int>, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >::lookup<core::basic_string<char, core::StringStorageDefault<char> >, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> >(core::basic_string<char, core::StringStorageDefault<char> > const&, core::equal_pair<std::__ndk1::equal_to<core::basic_string<char, core::StringStorageDefault<char> > >, core::basic_string<char, core::StringStorageDefault<char> > const, int> const&) const
2
(Missing)

Happens when application wants to quit.
Unity 2021.3.15, 2020.3.41.
Android 5 - 13.