UWP app Crashing while switching to particular scene Access violation writing location 0x000001ED75

Hello I am currently working on a project which involves two scenes in the project. Lets call them phase1 and phase2.
The app launches with the scene phase1, user fill if there details and then proceed to phase 2.
In the phase2 scene there is an option for user to go back to phase1, but as soon as they try to do that we get an error in visual studio
Exception thrown at 0x00007FF9F806DF6B (UnityPlayer.dll) in AppName.exe: 0xC0000005: Access violation writing location 0x0000011B86000004.

Following is the call stack of the same.

>    UnityPlayer.dll!LightmapSettings::RemoveLightmaps(int)    Unknown
     UnityPlayer.dll!DidUnloadScene(int)    Unknown
     UnityPlayer.dll!RuntimeSceneManager::UnloadAllScenesWithoutDestroyingGameObjects(void (*)(class UnityScene &))    Unknown
     UnityPlayer.dll!UnloadGameScene(void)    Unknown
     UnityPlayer.dll!LoadSceneOperation::PlayerLoadSceneFromThread(void)    Unknown
     UnityPlayer.dll!LoadSceneOperation::IntegrateMainThread(void)    Unknown
     UnityPlayer.dll!PreloadManager::UpdatePreloadingSingleStep(enum PreloadManager::UpdatePreloadingFlags,int)    Unknown
     UnityPlayer.dll!PreloadManager::WaitForAllAsyncOperationsToComplete(void)    Unknown
     UnityPlayer.dll!PreloadManager::UpdatePreloading(void)    Unknown
     UnityPlayer.dll!ExecutePlayerLoop(struct NativePlayerLoopSystem *)    Unknown
     UnityPlayer.dll!ExecutePlayerLoop(struct NativePlayerLoopSystem *)    Unknown
     UnityPlayer.dll!PlayerLoop(void)    Unknown
     UnityPlayer.dll!metro::MainLoop(bool)    Unknown
     UnityPlayer.dll!UnityPlayer::AppCallbacks::smile:oPerformUpdateAndRender(void)    Unknown
     UnityPlayer.dll!UnityPlayer::AppCallbacks::_AppThreadImplementation(void *)    Unknown
     kernel32.dll!BaseThreadInitThunk()    Unknown
     ntdll.dll!RtlUserThreadStart()    Unknown

can anyone please help me to figure out what exactly is happening here ?

Could you please file a bug on this?

This looks similar to this issue raised on the forums: Weird crash when unloading a scene, while loading a previous one. [UWP] [Xbox] However, there hasn’t been much progress on it (unable to repro). Filing another bug will help.

Hi, Report Filed case number is 1332318

Any progress on this? We also have this crash on Xbox Game Core Scarlett with Unity 2020.3.4f1.

To answer your question: no progress on the original bug mentioned in the forums link; QA is unable to repro the crash.
The bug in this thread (1332318) is still being investigated by QA (no update).

I recommend you file another bug and include as much information as you can: call stacks (with symbols), crash dumps, etc.There may be some weird race-condition, and the more info we have the more quickly can root-cause and fix the problem.

So, after some trial and error (my project, and even a reduced build, is too large to be sent via the bug reporter, so I could just send the dump and symbols), I successfully sent a bug. Like I said in the report, I can send more stuff if I get a way to transfer it.

Bug number is 1334118

So, I tried to reproduce the bug in a new project by baking some lighting and loading another scene async and it worked. I decided to send another bug report with the project and a build included, 1334415. So yeah, it’s a duplicate, but it should be easier to fix with this.

1 Like

Thank you for filing another bug, as this does seem to be a problem that multiple people are hitting.

Duplicates cases are still useful because they can provide more info (helpful for tricky race-condition or memory corruption bugs) and also increase the priority of the issue so it’ll get resolved more quickly.

Someone posted similar issue in this thread and a potential work around for the issue.

LightmapSettings.lightmaps = new LightmapData[0];
Resources.UnloadUnusedAssets();

Adding this just before changing the scene stops the error for me.

1 Like