Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unity crashes while reloading domains #545

Open
Mercury-Leo opened this issue Jan 21, 2025 · 0 comments
Open

Unity crashes while reloading domains #545

Mercury-Leo opened this issue Jan 21, 2025 · 0 comments

Comments

@Mercury-Leo
Copy link

This issue is an extension of #525.

In one work day, the unity Editor can crash between 15-50 times, depending on the type of work. (During our URP tests, Cesium will cause the editor to crash every SINGLE time we exited play mode)
My suspicion is that issue 525 only moved the crash from being in Cesium's stacktrace to being Unity's stacktrace, as the crash reports say different things now.

To test our suspicion, we've made a fork of Cesium.
In CesiumIonSessionImpl.cpp we just call return on these functions: Connect Resume Disconnect.
I am aware this is not a fix, but removing the logic behind these functions stops the crashes.
Also, we don't use Ion.

To Reproduce

  1. Install Cesium.
  2. Cause long domain reloads.
  3. Crashes.

Setup

  • Unity version: 6000.0.32f1
  • Cesium: 1.14.1

Additional context

This seems to be a problem with CesiumIonSession that isn't handled while reloading domains.
It causes a native crash on the C++ side in Cesium which causes Unity to crash.

We have upgraded to Unity 6, which causes the crashes to occur more often, though it still happened on older Unity versions.
Our project is very large and can have very long domain reloads (As this is an actual product as opposed to a tech demo).

This is an example of a crash, all crashes are related to scriptable objects, and these go away once we moved to our custom Cesium fork.

========== OUTPUTTING STACK TRACE ==================

0x00007FFCA6B7C734 (Unity) GetOrCreateObjectStoredInField
0x00007FFCA6B78A89 (Unity) LinearCollectionField::LinearCollectionField
0x00007FFCA6B4BA19 (Unity) TransferField_LinearCollection<ReportScriptingObjectsTransfer>
0x00007FFCA6ABE176 (Unity) ExecuteSerializationCommands<ConfigSettingsRead>
0x00007FFCA6B70D23 (Unity) Transfer_ManagedObject<StreamedBinaryWrite,0>
0x00007FFCA6ABE176 (Unity) ExecuteSerializationCommands<ConfigSettingsRead>
0x00007FFCA6B70D23 (Unity) Transfer_ManagedObject<StreamedBinaryWrite,0>
0x00007FFCA6ABE2DC (Unity) ExecuteSerializationCommands<JSONRead>
0x00007FFCA6ADAF78 (Unity) <lambda_23502d5cf47c99f01792cd87488ce116>::operator()
0x00007FFCA6AD5826 (Unity) TransferScriptingObject<StreamedBinaryWrite>
0x00007FFCA6AE0B79 (Unity) SerializableManagedRefBackupGenerator::ExtractBackupFromInstance
0x00007FFCA6ADDC3E (Unity) MonoBehaviour::BackupAndDeflateManagedReferences
0x00007FFCA6B9D830 (Unity) SerializableManagedRefsUtilities::BackupAndDeflateAll
0x00007FFCA6ADE0B7 (Unity) MonoManager::BeginReloadAssembly
0x00007FFCA6AE7715 (Unity) MonoManager::ReloadAssembly
0x00007FFCA7D1EFC2 (Unity) Internal_ADB_Only_ReloadAllUsedAssemblies
0x00007FFCA804B9F6 (Unity) DomainReloadIfAllowed
0x00007FFCA80637D1 (Unity) RefreshInternalV2
0x00007FFCA806D55E (Unity) StopAssetImportingV2Internal
0x00007FFCA7880C10 (Unity) Application::TickTimer
0x00007FFCA7E763EA (Unity) MainMessageLoop
0x00007FFCA7E7C0B4 (Unity) UnityMain
0x00007FF715C72FBA (Unity) __scrt_common_main_seh
0x00007FFD69C7259D (KERNEL32) BaseThreadInitThunk
0x00007FFD6B96AF38 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant