Only build crashing on scene load with 2019.4.32

Hey! We recently upgraded from 2019.3.11f1 to the latest 2019.4 version. Everything works fine in the editor but the game crashes on sceneload in build. We’ve been debugging, fixing and trying different solutions to this for days without any progress so I thought if anyone could help me? This happens to both of us with different PC configurations and the game is a VR hunting game using SteamVR.

Here is pastebin of the Player log: Mono path[0] = 'K:/Unity/VirtualHunter/Builds/Build_137jpbs1.1/VirtualHunter_Dat - Pastebin.com

Thank you so much if anyone could help us out here!

Do you have a dump file from the crash? It should be here:

A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in:
* E:/WINDOW~1/VirtualHunterTeam/VirtualHunter/Crashes

Hey! Here you go. Added everything from the folder there. Hope it helps! We’ve been on this for 4 days now.

7620178–947500–Crash.7z (104 KB)

It seems the crash occurs when you call AudioSource.PlayOneShot. Do you do that with a lot of audio clips? Perhaps you could add some logging to narrow down which one is causing it?

That is very, very weird. Don’t think we use it during / after scene has loaded. It worked perfectly fine with 2018.3.11 and this started happening when we updated to the LTS version. Nothing else was changed. At least it’s something to look for!

Could you also run the game using “-debugallocator” command line argument and send me a new dump resulting from that? It might reveal more information.

Hope I did it right. Here you go!

7620283–947530–Crash_2021-11-01_164833892.7z (90.6 KB)

Do any of the audio sources you use PlayOneShot with contain MonoBehaviours with OnAudioFilterRead?

Searched through the entire solution and got no hits so I’d say no.

Wait! Ambient sound asset is using that! No idea why it didn’t come up when searching through the whole project but oh well. I’ll remove the asset from the scene and see if that helps.

I got it to load! All I did was disable Ambient Sound asset that we use and disable audiosource from our player. So it is from playing audio. This helps a lot and now I know where to focus. Thank you so much!

Edit: After testing multiple different setups, it all came down to a single audiosource which we use to play the players footsteps. And just that. I reverted everything I’ve done for the past 4 days and just disabled that one audiosource. Why that one is the problem? No idea

Do you have more information on the settings of that particular audio source (player footsteps) and the other components attached to the game object? Do any of the attached components implement OnAudioFilterRead?

We had Ambiance Manager (Ambient Sounds asset) in the player with the audio source. These two didn’t get along apparently and the issue was fixed by moving the audio source to the players foot. Ambient Manager uses OnAudioFilterRead. Extremely weird issue since it has worked with 2019.3.11 for over a year!

There seems to be a corner case we are not handling correctly, but I haven’t been able to reproduce it based on the information at hand. If you can find the time, it would be great if you could file a bug report with a minimal repro project.