Seemingly random crashes

Setup : Unity 2022.2.12f1 on both MacOs and windows
FMOD version : 2.02.09

Our Unity has been unstable for some time, and it seems to have ramped up when we updragede to 2022.2.12. A lot of it is probably Unity being unity, plus a dose of us doing stuff that it probably doesn’t like too much.

But, a good amount of the crash pop-ups have FMOD API calls as the last in the call stack, so I’m looking for ways to investigate further, if it’s an issue with FMOD, how we use it, or just totally unrelated.

As an example, here is the latest one I got :

Obtained 46 stack frames.
Pkilling 0x12657487872x from 0x8272724224x
Pkilling 0x12406992896x from 0x8272724224x
Pkilling 0x14724132864x from 0x8272724224x
Pkilling 0x16064262144x from 0x8272724224x
Pkilling 0x12969078784x from 0x8272724224x
Pkilling 0x12627128320x from 0x8272724224x
Pkilling 0x12973371392x from 0x8272724224x
#0  0x000002e2f90fe4 in mono_get_hazardous_pointer
Pkilling 0x12649574400x from 0x8272724224x
Pkilling 0x15208656896x from 0x8272724224x
#1  0x000002e2ee8378 in mono_jit_info_table_find_internal
Pkilling 0x12977664000x from 0x8272724224x
Pkilling 0x12981956608x from 0x8272724224x
#2  0x000002e2e05a2c in mini_jit_info_table_find_ext
Pkilling 0x15610359808x from 0x8272724224x
Pkilling 0x15228497920x from 0x8272724224x
#3  0x000002e2e04ba8 in mono_summarize_unmanaged_stack
Pkilling 0x12671070208x from 0x8272724224x
#4  0x000002e2f3c5e0 in mono_threads_summarize_native_self
Pkilling 0x12679655424x from 0x8272724224x
#5  0x000002e2f3c93c in mono_threads_summarize_execute_internal
Pkilling 0x16152080384x from 0x8272724224x
Pkilling 0x14730850304x from 0x8272724224x
Pkilling 0x12937359360x from 0x8272724224x
#6  0x000002e2f3c704 in mono_threads_summarize_execute
#7  0x000002e2e45b50 in sigterm_signal_handler
#8  0x00000191c202a4 in _sigtramp
Pkilling 0x14005596160x from 0x8272724224x
Pkilling 0x13955936256x from 0x8272724224x
#9  0x4168800381dd880c in FMOD::DSPConnection::getUserData(void**)
#10 0x00000381dd880c in FMOD::DSPConnection::getUserData(void**)
#11 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#12 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#13 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#14 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#15 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#16 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#17 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#18 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#19 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#20 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#21 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#22 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#23 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)
#24 0x00000381dd8998 in FMOD::DSPConnection::getUserData(void**)
#25 0x00000381dd8944 in FMOD::DSPConnection::getUserData(void**)

Edit : another one

Obtained 13 stack frames.
#0  0x000002c3410fe4 in mono_get_hazardous_pointer
#1  0x000002c3368378 in mono_jit_info_table_find_internal
#2  0x000002c3285a2c in mini_jit_info_table_find_ext
#3  0x000002c3284ba8 in mono_summarize_unmanaged_stack
#4  0x000002c33bc5e0 in mono_threads_summarize_native_self
#5  0x000002c33bc93c in mono_threads_summarize_execute_internal
#6  0x000002c33bc704 in mono_threads_summarize_execute
#7  0x000002c32c5b50 in sigterm_signal_handler
#8  0x00000191c202a4 in _sigtramp
#9  0x8b5800037dc88288 in FMOD_OS_CriticalSection_IsLocked
#10 0x0000037dcacf3c in FMOD_Thread_SetAttributes
#11 0x0000037dc87cdc in FMOD_OS_Time_Sleep
#12 0x00000191bf206c in _pthread_start

Does it look like something known? Is there any way for me to investigate further to get you more info?
Alternatively, is there an easy way to “turn off” FMOD in the project, so I can see if the editor crashes just as much?

Hi,

Based on the stack trace you’ve provided, the crash is likely to be caused by calls to FMOD::DSPConnection::getUserData. If you’re making calls to this function, could I get you to provide snippets of the relevant code? If you’re accessing the DSPConnection of a specific Studio event, could I get you to provide code snippets of the event’s creation and release alongside the DSPConnection::getUserData call? If you’re not making that function call yourself, are you using any custom DSP plugins?

As for “turning off” FMOD, there’s no easy way - commenting out line 173 of RuntimeManager.cs, i.e. initResult = instance.Initialize();, will stop the FMOD system from being created at all, and thus disable all of its processing, but you’ll receive frequent errors.

Besides making our copy of the emitter script, we’ve not really did any custom scripting for fmod on the unity side.
We’re not using any custom plugins on the FMOD studio side either.

Thanks, I’ll try commenting this line and see if that changes anything for the crash frequency.

If disabling the FMOD System doesn’t reduce the frequency, please upload your Unity project (if possible) to the “Uploads” tab of your FMOD profile so that I can take a closer look and hopefully diagnose the problem.

So, in the end it wasn’t quite the good line to disable it all, but a bit above. And our whole system didn’t work with FOD disabled as other parts raised exceptions blocking flow.
Anyway, blocked it the other way around by blocking any of our calls to play events or set parameters.
With that setup the same area still crashes, but with no calls to FMOD in the call stack…

So, this would suggest that FMOD wasn’t really responsible, or at least not on its own? Current crashes logs points to the URP/Editor side of things, so I guess this unity version has some instabilities, and it just happens that FMOD triggers them ?
We’ll upgrade the unity version soon, I’ll check then if we still have the same crashes with and without FMOD.

I suspect that this is the case - based on the stack trace, I would hazard a guess that it’s some managed vs native code/memory issue, which would explain why FMOD would be showing up, as it is unmananged. I can’t really be sure on the cause though. That said, given that the issue may be on Unity’s end, I would recommend also posting on the Unity forums and seeing whether they can be of any help.