Crash in fmodstudioL on Windows 64bit IL2CPP build

Hi,

Recently we’ve been having a lot of random crashes caused by FMOD in our game (Unity 6000.0.62f1, FMOD 2.03.10). It’s all coming from fmodstudioL. I don’t know if I should report this as a bug or ask for debug symbols to see if it’s something from our side. Here’s the stack trace of the crash we’re getting:

0x00007FFCBE7F6BB7 (fmodstudioL) FMOD::SystemI::validate
0x00007FFCBE756578 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FFCBE78612A (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FFCBE78EDC8 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FFCBE78C6B5 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FFCBE7B7D32 (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FFCBE7B774E (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FFCBE7B739A (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FFCBE7C31C1 (fmodstudioL) FMOD_OS_Time_Sleep
0x00007FFCBE7B3621 (fmodstudioL) FMOD_OS_Debug_Output
0x00007FFCBE7BD9EE (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FFCBE84F728 (fmodstudioL) FMOD::SystemI::createMemoryFile
0x00007FFD1F217374 (KERNEL32) BaseThreadInitThunk
0x00007FFD20F9CC91 (ntdll) RtlUserThreadStart

I can send you the crash dump if it helps.

Ok, I’m gonna add that this seems to also cause Unity Editor to crash too:

0x00007FF9218E6BB7 (fmodstudioL) FMOD::SystemI::validate
0x00007FF921846578 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FF92187612A (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FF92187EDC8 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FF92187C6B5 (fmodstudioL) FMOD::DSPConnection::setUserData
0x00007FF9218A7D32 (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FF9218A774E (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FF9218A739A (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FF9218B31C1 (fmodstudioL) FMOD_OS_Time_Sleep
0x00007FF9218A3621 (fmodstudioL) FMOD_OS_Debug_Output
0x00007FF9218AD9EE (fmodstudioL) FMOD_Thread_SetAttributes
0x00007FF92193F728 (fmodstudioL) FMOD::SystemI::createMemoryFile
0x00007FF9EDBE7374 (KERNEL32) BaseThreadInitThunk
0x00007FF9EF57CC91 (ntdll) RtlUserThreadStart

Hi!

Based on the crash dump you sent through to us by email, I suspect this likely is a bug we’d want to look into. However, I’d need a crash dump with full memory in order to actually look into the crash in more detail. You can upload a full crash dump to the uploads tab of your FMOD user profile, which is only accessible by yourself and FMOD staff.

Additionally, if I get you to set FMOD’s logging level set to log and enable API error logging, and share a log with me in which the issue occurs, that’d be great!

1 Like

How do I make the game to make a full crash dump? I can’t find anything about this for Unity.

If you attach Visual Studio’s debugger to the il2cpp build with debugging enabled and reproduce the crash, you should be able to save a “Minidump with Heap” from Debug → Save Dump As. Otherwise, you may be able to set a dotnet environment variable, or use a different dump tool like dotnet-dump. Take a look at the “Dumps” page in the .NET docs for more info.

I just got a crash in Unity editor, the Procdump generated 2 dump files that I uploaded to upload tab. I had the API error logging enabled and logging level was set to Log. Also included the log and crash dump created by Unity.

More crashes, I uploaded the files. This time it’s a hug file, hopefully a full dump.

Thanks for your patience!

This crash appears to be related to the use of the delay effect, potentially caused by the effect being reset while the buffer used to store the delay signal is being reallocated. I’ll be looking into the crash further to pass onto the development team to fix up, but for the time being, are you automating/modulating the delay time on any delay effects at the time of the crash, or in general? If so, I’d recommend disabling those events/effects and seeing whether that makes any difference to the frequency of crashes.

1 Like

I asked our sound engineer about the delay effect; apparently we only use it in one of our levels but not the ones that crash.

That is a little strange, as the crash logs definitely point to a delay effect being the issue, and it is one we’ve been able to force a reproduction of. It may be that the effect isn’t in use at the time, but is still present, i.e. it’s in a part of the mixer that is rarely in use.

If possible, could I get you to upload a minimal repro of your Unity project or a development build to your user profile for me to take a look at on my end?

Sorry for the long delay, we couldn’t make a reliable way to reproduce the crashes, but I think the last one I uploaded is pretty consistent. Here’s the steps to reproduce the crash:

  • Run the game and go through the UI until you get to the main menu
  • Hit F12 to start the debug menu
  • Choose Load Menu → Trial Room
  • After scene loads, Hit F12 again and select: Teleport → QuickCheckpoint (3)
  • usually when you finish the teleport or right after try to move the game crashes

You may need to try a few times, but right now on my machine it crashes every single time.

Sorry for the delayed response!

Unfortunately, it seems like the development build you’ve uploaded doesn’t work for me, and simply opens to a black screen with the Unity log HUD. I’ve tested on a couple PCs, and the notable difference between my player logs and the log you uploaded is that loading a settings object from file succeeds in your log, but fails in mine. On my end, the application logs that it’s creating a new settings object, and then appears to fail like so:

Trying to load settings...
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
GameSettings:LoadIfNeeded() (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:131)
GameManager:ApplyQualitySettings(GameLevelData) (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:187)
<Start>d__72:MoveNext() (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:108)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\build\output\unity\unity\Runtime\Export\Scripting\Coroutines.cs:17)

loading the settings: FileNotFound
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
<>c__DisplayClass137_0:<LoadFromStorage>b__0(Byte[], StorageResults) (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:428)
<>c__DisplayClass14_0:<LoadSettings>b__0(Byte[], StorageResults) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:100)
StandardStorageService:IStorageService.LoadSettings(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\StandardStorageService.cs:35)
GameStorageManager:LoadSettings(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:98)
GameSettings:LoadFromStorage(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:426)
GameSettings:LoadIfNeeded() (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:132)
GameManager:ApplyQualitySettings(GameLevelData) (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:187)
<Start>d__72:MoveNext() (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:108)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\build\output\unity\unity\Runtime\Export\Scripting\Coroutines.cs:17)

Creating new settings object.
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
<>c:<LoadIfNeeded>b__115_0(GameSettings, StorageResults) (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:141)
<>c__DisplayClass137_0:<LoadFromStorage>b__0(Byte[], StorageResults) (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:432)
<>c__DisplayClass14_0:<LoadSettings>b__0(Byte[], StorageResults) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:100)
StandardStorageService:IStorageService.LoadSettings(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\StandardStorageService.cs:35)
GameStorageManager:LoadSettings(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:98)
GameSettings:LoadFromStorage(Action`2) (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:426)
GameSettings:LoadIfNeeded() (at D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:132)
GameManager:ApplyQualitySettings(GameLevelData) (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:187)
<Start>d__72:MoveNext() (at D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:108)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at C:\build\output\unity\unity\Runtime\Export\Scripting\Coroutines.cs:17)

Uploading Crash Report
NotSupportedException: To marshal a managed method, please add an attribute named 'MonoPInvokeCallback' to the method definition. The method we're attempting to marshal is: FMODSoundUtils::DeviceListChangeCallback
  at FMOD.System.setCallback (FMOD.SYSTEM_CALLBACK callback, FMOD.SYSTEM_CALLBACK_TYPE callbackmask) [0x00009] in D:\dev\goldman\Assets\Plugins\FMOD\src\fmod.cs:1140 
  at FMODSoundUtils.SetSystemCallbacks () [0x00031] in D:\dev\goldman\Assets\Scripts\Framework\Sound\FMODSoundUtils.cs:201 
  at FMODSoundUtils.GetCurrentDeviceIndex () [0x00001] in D:\dev\goldman\Assets\Scripts\Framework\Sound\FMODSoundUtils.cs:179 
  at GameSettings.ApplyAudioOptions () [0x00023] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:275 
  at GameSettings.ApplyAll () [0x00002] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:328 
  at GameSettings+<>c.<LoadIfNeeded>b__115_0 (GameSettings settings, StorageResults result) [0x0006a] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:147 
  at GameSettings+<>c__DisplayClass137_0.<LoadFromStorage>b__0 (System.Byte[] bytes, StorageResults result) [0x0005f] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:432 
  at GameStorageManager+<>c__DisplayClass14_0.<LoadSettings>b__0 (System.Byte[] bytes, StorageResults error) [0x0000f] in D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:100 
  at StandardStorageService.IStorageService.LoadSettings (System.Action`2[T1,T2] callback) [0x00016] in D:\dev\goldman\Assets\Scripts\Framework\Storage\StandardStorageService.cs:35 
  at GameStorageManager.LoadSettings (System.Action`2[T1,T2] callback) [0x0004d] in D:\dev\goldman\Assets\Scripts\Framework\Storage\GameStorageManager.cs:98 
  at GameSettings.LoadFromStorage (System.Action`2[T1,T2] callback) [0x0001a] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:426 
  at GameSettings.LoadIfNeeded () [0x0005a] in D:\dev\goldman\Assets\Scripts\Framework\GameSettings.cs:132 
  at GameManager.ApplyQualitySettings (GameLevelData levelData) [0x00001] in D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:187 
  at GameManager+<Start>d__72.MoveNext () [0x00152] in D:\dev\goldman\Assets\Scripts\Game\GameManager.cs:108 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in C:\build\output\unity\unity\Runtime\Export\Scripting\Coroutines.cs:17 

Could I get you to confirm that the development build works on your end without a settings object present? If it doesn’t, I may need you to provide your own so that it runs successfully on my end. Thanks!

We’ve seen the same crash in our UE5 project, tested with 2.03.09 and 2.03.12. We had added a delay with automation, started getting crashes, and on seeing this thread, we removed it and the crashes went away. Is there any issue we can track for this?

EXCEPTION_ACCESS_VIOLATION_WRITE / 0x1e7439193f0: Fatal Error: EXCEPTION_ACCESS_VIOLATION_WRITE / 0x1e7439193f0
fmod 0x7ffb1b2dfba7 FMOD::SystemI::validate
fmod 0x7ffb1b258c97 FMOD::DSPConnection::setUserData
fmod 0x7ffb1b2869f9 FMOD::DSPConnection::setUserData
fmod 0x7ffb1b28e0d2 FMOD::DSPConnection::setUserData
fmod 0x7ffb1b28c032 FMOD::DSPConnection::setUserData
fmod 0x7ffb1b2acb7d FMOD_Thread_SetAttributes
fmod 0x7ffb1b2ac84d FMOD_Thread_SetAttributes
fmod 0x7ffb1b2ac59a FMOD_Thread_SetAttributes
fmod 0x7ffb1b2b4928 FMOD_OS_Time_Sleep
fmod 0x7ffb1b2a9120 FMOD_OS_Debug_Output
fmod 0x7ffb1b2b0f88 FMOD_Thread_SetAttributes
fmod 0x7ffb1b324db7 FMOD::SystemI::createMemoryFile
KERNEL32.DLL 0x7ffb5089e8d6 BaseThreadInitThunk
ntdll 0x7ffb52a6c40b RtlUserThreadStart

We don’t have a public facing issue tracker, but I can confirm that this issue should be fixed in our next minor release, 2.03.13. I can’t offer an exact timeline for the release, but we’re expecting to have it out in the next few weeks. If you need it quicker, you can email us at support@fmod.com and link this thread, and we can go from there!