Crash when quitting the application (JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkS

After updating to Unity 2020.3.42 from 2020.3.19, a crash is reported by Firebase Crashytics after the user closes the application.

This is the stack trace:

Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000000000010a

0  UnityFramework                 0xeb1670 JobQueue::WaitForJobGroupID(JobGroupID, JobQueue::JobQueueWorkStealMode) + 1750 (JobQueue.cpp:1750)
1  UnityFramework                 0xead754 CompleteFenceInternal(JobFence&, WorkStealMode) + 17 (Jobs.cpp:17)
2  UnityFramework                 0xe017c4 AsyncUploadManager::~AsyncUploadManager() + 282 (Jobs.h:282)
3  UnityFramework                 0xe01514 AsyncUploadManager::StaticDestroy(void*) + 203 (MemoryMacros.h:203)
4  UnityFramework                 0x104bd3c RegisterRuntimeInitializeAndCleanup::ExecuteCleanup() + 520 (dynamic_array.h:520)
5  UnityFramework                 0xf23b54 RuntimeCleanup() + 728 (Player.cpp:728)
6  UnityFramework                 0x155b4 -[UnityAppController applicationWillTerminate:] + 526 (UnityAppController.mm:526)
7  UIKitCore                      0xd3dc24 -[UIApplication _terminateWithStatus:] + 196
8  UIKitCore                      0x29090c -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:] + 112
9  UIKitCore                      0x6a7cd4 -[_UISceneLifecycleMultiplexer forceExitWithTransitionContext:scene:] + 164
10 UIKitCore                      0xd3a040 -[UIApplication workspaceShouldExit:withTransitionContext:] + 176
11 FrontBoardServices             0x41e74 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke_2 + 72
12 FrontBoardServices             0x6c24 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 168
13 FrontBoardServices             0x41e14 __63-[FBSWorkspaceScenesClient willTerminateWithTransitionContext:]_block_invoke + 128
14 libdispatch.dylib              0x3fdc _dispatch_client_callout + 20
15 libdispatch.dylib              0x7a5c _dispatch_block_invoke_direct + 264
16 FrontBoardServices             0x10d40 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 52
17 FrontBoardServices             0x108dc -[FBSSerialQueue _targetQueue_performNextIfPossible] + 220
18 FrontBoardServices             0x13184 -[FBSSerialQueue _performNextFromRunLoopSource] + 28
19 CoreFoundation                 0xd5f34 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
20 CoreFoundation                 0xe230c __CFRunLoopDoSource0 + 176
21 CoreFoundation                 0x66230 __CFRunLoopDoSources0 + 340
22 CoreFoundation                 0x7bb8c __CFRunLoopRun + 836
23 CoreFoundation                 0x80ec0 CFRunLoopRunSpecific + 612
24 GraphicsServices               0x1368 GSEventRunModal + 164
25 UIKitCore                      0x3a186c -[UIApplication _run] + 888
26 UIKitCore                      0x3a14d0 UIApplicationMain + 340
27 UnityFramework                 0x1a05c -[UnityFramework runUIApplicationMainWithArgc:argv:] + 96 (main.mm:96)

It can be reproduced on most devices (tablets, phones) and iOS/iPadOS 15+.

1 Like

I also had the same crash on exit issue after upgrading to Unity 2020.3.42.
However, the cause of the exit was different, so I am splitting it into a separate thread.
Does anyone know if these are related issues?

1 Like

Please pay attention to this bug @ , we have the same issue too.
We experience the issue on Ubuntu 22.04

I have same issue too for ubuntu 22.04 looking for fix but no one solved, @TomasKucinskas dear moderator please add new 2020. version and fix it, I do not want to jump 2021 because my unity project is very big and in 2021 i have a lot of problem, so i want to just fix this…

in 2020.3.42f1 we experience Segmentation fault (core dumped) on application quit, so I have digged into it.

In someway, AsyncUploadManager::StaticDestroy is being added to RegisterRuntimeInitializeAndCleanup::ExecuteCleanup()'s cleanup list and AsyncUploadManager::StaticDestroy is using JobQueue::WaitForJobGroupID which uses gQueue but RegisterRuntimeInitializeAndCleanup::ExecuteCleanup() is being called after DestroyJobQueue(JobQueue *a1) therefore gQueue is being null then causes Segmentation fault on application quit.
As I do not have the source code, I do not know what adds AsyncUploadManager::StaticDestroy to RegisterRuntimeInitializeAndCleanup::ExecuteCleanup()'s cleanup list but we run our servers on Unity and we need a solution ASAP, please provide us a work-around or fix it fastly.

Experiencing the issue on Ubuntu 22.04 64 Bit.

3 Likes

@ I’m also chiming in to take a look at this. We’re seeing the exact same problem. Any workaround or fix would be appreciated.

I am also suffering from the same issue.
Unity version: 2020.3.42f1

Can you please report this as a bug? No need for repro, just reference forum thread and mark somewhere to assign to alexey. And thanks for details - indeed this was fixed in 2021 and simply not backported to 2020.3 (thats why the need for the bug - so it is properly tracked).

I have the same crash with 2020.3.43f1 on the app quit with Windows Standalone. Unity 2020.3.38 didn’t have this issue.

Do you still need a bug report?

If you have the same callstack - yes (it should be platform-independent). Again - this is just for tracking, no worries, the fix is done and is in the “process”

2 Likes

Did you report the bug?

@Alexey any update?

Can anybody confirm whether this is fixed in 2020.3.44?

No sorry, I didn’t. I downgraded instead.

I discovered the same issue after upgrading to 2020.3.43.
Not sure about 2020.3.44 but I just upgraded Unity to 2021.3.16 and it looks like it doesn’t happen there (at least on windows)

I suggest 2020.3.41f1 as it doesn’t have this bug.

1 Like

the fix should be released in 2020.3.45f1 (do not forget - some time must pass between developer seeing the bug, and the fix being released ;-))

3 Likes

Do you have any ETA for 2020.3.45f1? No need an exact date but something like in 2 weeks etc.

2 Likes

We see the same crash reports on android after update from 2020.3.32f1 to 2020.3.44f1. I guess based on the history of Unity releases - updates usually come out somewhere in the middle of each month. Then perhaps the update will be only in mid-February. So, since we can’t wait fix we’ll try roll back to 2020.3.41f1 as written here that there is no crash

1 Like

@Alexey