Crash Upon Exiting Game Build

Hey,

almost everytime when i close my game with application.quit() it crashes before closing.

When i have a look at the error it states the following (see below)

Everytime the first non SYSTEM32 dll is the fmodstudio.dll. Previously the steam audio phonon dll was at last position. but i removed it because i dont need it anymore. so it looks like this now.

Any known issues or advice on how to fix this?

Crash!!!

“Some long trace here”

S:\Builds\Unity_6_2\Data\Plugins\x86_64\fmodstudio.dll:fmodstudio.dll (00007FF888280000), size: 3461120 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 0.2.2.30C:\Windows\System32\MMDevApi.dll:MMDevApi.dll (00007FF93D790000), size: 647168 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.22621.4111C:\Windows\SYSTEM32\AUDIOSES.DLL:AUDIOSES.DLL (00007FF93F540000), size: 2019328 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.22621.4111C:\Windows\SYSTEM32\resourcepolicyclient.dll:resourcepolicyclient.dll (00007FF949F10000), size: 86016 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.22621.3527C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_adf5a840df867035\nvrtum64.dll:nvrtum64.dll (00007FF8AE760000), size: 78561280 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 32.0.15.6614C:\Windows\SYSTEM32\CoreUIComponents.dll:CoreUIComponents.dll (00007FF945160000), size: 3592192 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.22621.3672C:\Windows\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FF94B7A0000), size: 274432 (result: 0), SymType: ‘-deferred-’, PDB: ‘’, fileVersion: 10.0.22621.3810

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

“Some long trace here”

S:\Builds\Unity_6_2\Data\Plugins\x86_64\fmodstudio.dll:fmodstudio.dll (00007FF888280000), size: 3461120 (result: 0), SymType: ‘-exported-’, PDB: ‘S:\Builds\Unity_6_2\Data\Plugins\x86_64\fmodstudio.dll’, fileVersion: 0.2.2.30C:\Windows\System32\MMDevApi.dll:MMDevApi.dll (00007FF93D790000), size: 647168 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\System32\MMDevApi.dll’, fileVersion: 10.0.22621.4111C:\Windows\SYSTEM32\AUDIOSES.DLL:AUDIOSES.DLL (00007FF93F540000), size: 2019328 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\SYSTEM32\AUDIOSES.DLL’, fileVersion: 10.0.22621.4111C:\Windows\SYSTEM32\resourcepolicyclient.dll:resourcepolicyclient.dll (00007FF949F10000), size: 86016 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\SYSTEM32\resourcepolicyclient.dll’, fileVersion: 10.0.22621.3527C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_adf5a840df867035\nvrtum64.dll:nvrtum64.dll (00007FF8AE760000), size: 78561280 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_adf5a840df867035\nvrtum64.dll’, fileVersion: 32.0.15.6614C:\Windows\SYSTEM32\CoreUIComponents.dll:CoreUIComponents.dll (00007FF945160000), size: 3592192 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\SYSTEM32\CoreUIComponents.dll’, fileVersion: 10.0.22621.3672C:\Windows\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FF94B7A0000), size: 274432 (result: 0), SymType: ‘-exported-’, PDB: ‘C:\Windows\SYSTEM32\SspiCli.dll’, fileVersion: 10.0.22621.3810ERROR: SymGetSymFromAddr64, GetLastError: ‘Es wurde versucht, auf eine unzulässige Adresse zuzugreifen.’ (Address: 00007FF8A3F769BE)0x00007FF8A3F769BE (UnityPlayer) (function-name not available)0x00007FF94E14257D (KERNEL32) BaseThreadInitThunk0x00007FF94F18AF08 (ntdll) RtlUserThreadStart

Hi,

Thank you for sharing the information and stack trace!

I tested with Unity 6000.2.0b12 and FMOD Unity integration 2.02.30 in a game build but was unable to reproduce the issue.

Would it be possible to share a code snippet showing how you’re calling Application.Quit()?

It would also be helpful if you could provide more details on how to reproduce the crash. For example, any particular scene setup, timing, or audio activity happening when the game exits.

Hey thank you for your reply.

After removing the phonon.dll the crashes reduced by 50%.

Then i completely removed fmod from my project and reimported it.

Now i tried quitting 10 times and got no crash. So i suppose something corrupted the dlls which is weird because i updated fmod 1 day before the tests and recopied them but maybe my package download was already corrupt.

Anyway if the crashes come up again ill keep you updated.

I close the game like this. Its in a ui callback function when i click on a button.

1 Like

Glad to hear it’s stable for now and thank you for sharing your solution here!

If the issue comes back, feel free to let me know. I’d be happy to take another look and help further.

Ok they are back with the same error. Here a snippet

C:\Windows\SYSTEM32\textinputframework.dll:textinputframework.dll (00007FFD03B10000), size: 1323008 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\textinputframework.dll', fileVersion: 10.0.22621.4249
C:\Users\App\Release\Data\Plugins\x86_64\lib_burst_generated.dll:lib_burst_generated.dll (00007FFC9BB70000), size: 2273280 (result: 0), SymType: '-exported-', PDB: 'C:\ App\Release\Data\Plugins\x86_64\lib_burst_generated.dll'
C:\Users\App\Release\Data\Plugins\x86_64\fmodstudio.dll:fmodstudio.dll (00007FFC9B820000), size: 3461120 (result: 0), SymType: '-exported-', PDB: 'C:\Users\App\Release\Data\Plugins\x86_64\fmodstudio.dll', fileVersion: 0.2.2.30
C:\Windows\System32\MMDevApi.dll:MMDevApi.dll (00007FFCFD3E0000), size: 647168 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\MMDevApi.dll', fileVersion: 10.0.22621.4111
C:\Windows\SYSTEM32\AUDIOSES.DLL:AUDIOSES.DLL (00007FFD03EB0000), size: 2019328 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\AUDIOSES.DLL', fileVersion: 10.0.22621.4111
C:\Windows\SYSTEM32\resourcepolicyclient.dll:resourcepolicyclient.dll (00007FFD0D1E0000), size: 86016 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\resourcepolicyclient.dll', fileVersion: 10.0.22621.3527
C:\Windows\system32\mswsock.dll:mswsock.dll (00007FFD0ED60000), size: 430080 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\mswsock.dll', fileVersion: 10.0.22621.2506
C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_adf5a840df867035\nvrtum64.dll:nvrtum64.dll (00007FFC6D510000), size: 78561280 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_adf5a840df867035\nvrtum64.dll', fileVersion: 32.0.15.6614
C:\Windows\SYSTEM32\CoreUIComponents.dll:CoreUIComponents.dll (00007FFD09390000), size: 3592192 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\CoreUIComponents.dll', fileVersion: 10.0.22621.3672
C:\Windows\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FFD0EB60000), size: 274432 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\SspiCli.dll', fileVersion: 10.0.22621.3810
  ERROR: SymGetSymFromAddr64, GetLastError: It was tried to access an invalid address.' (Address: 00007FFCA12669BE)
0x00007FFCA12669BE (UnityPlayer) (function-name not available)
0x00007FFD10E0257D (KERNEL32) BaseThreadInitThunk
0x00007FFD1254AF08 (ntdll) RtlUserThreadStart

Thank you for sharing the Log!

Before calling Application.Quit(), could you try adding an explicit call to Studio::System::release to see if it resolves the crash?

For example:

FMODUnity.RuntimeManager.CoreSystem.release();
UnityEngine.Application.Quit();

This ensures FMOD has time to flush commands, stop all sounds, and clean up its internal threads before Unity starts unloading native plugins, which could be the cause of the crash you’re seeing in fmodstudio.dll.

Let me know if this makes a difference.

Hey, thank you for the reply. Ill add it and see if it happens again.

I also experience crashes during runtime where FMOD is at the end of the stack trace. Im just not so sure if it is caused by fmod. When i analyse the crash.dmp file with WinDbg it does not state anything about fmod but the stack trace in the player log does.

I already posted this topic in the unity forums

Ok i tried it and i crashes my editor. I could screenshot this before the crash

image

Unfortunately, I was still not able to reproduce the issue on my end.

Would it be possible to share your Unity project, or a stripped down version of it where you can still reproduce the issue, so I can take a closer look?

Please note that before you can upload your project to the “Uploads” section of your FMOD user profile, you’ll first need to register it in the Projects section.

Hey. No sorry i cant do that. When i have more time ill try to reproduce it in a sample project.

A few minutes ago i posted a big update on the crash during runtime.

I dont wanna post everything here again so please check out this.

In summary the game crashes when the players are shooting.

As the crashes are caused by a thread accessing an invalid address and fmod being at the end of the stack trace all the time could it be that triggering the same sfx in one frame could crash fmod?

are there any known problems with thread safety?

I tested a build where i removed all sfx stuff and it hasnt crashed in the past 90 mins.
Now ill reset everything to the original state and only remove sfx.
after that ill readd fmod again and it should crash again

if the first builds without sfx runs without a crash i know that fmod is the issue.

can you please check if triggering multiple sfx in the same frame or stopping and starting in the same frame can cause crashes?

ill report here again in a few hours when im certain that this is the issue

Thank you for sharing the extra info!

Would it be possible to share a code snippet around how you’re managing EventInstances around player shooting logic?

If the same EventInstance is reused incorrectly (e.g. released twice or accessed after release), it might lead to memory access violations.

We haven’t seen consistent crashes from triggering multiple SFX or starting/stopping events in the same frame under normal use.

Creating and releasing new EventInstances per frame is generally safe, as long as:

  • You avoid calling .release() more than once on the same instance
  • You don’t try to use the instance after it has been released
  • You avoid starting and immediately stopping and releasing the same instance in the same frame, especially under heavy load

All my sfx stuff is handled at one point.

The call order is this:

// Create instance
data.Instance = RuntimeManager.CreateInstance(data.DataStorage.FMODPath);

// Assign 3d attributes
data.Attributes3D.position = AssignFmodVector(data.Attributes3D.position, data.Query.Context.Position);
data.Attributes3D.forward  = AssignFmodVector(data.Attributes3D.forward, data.Query.Context.Forward);
data.Attributes3D.up       = AssignFmodVector(data.Attributes3D.up, data.Query.Context.Up);
data.Instance.set3DAttributes(data.Attributes3D);

// start an release it (i have read somewhere in the docs to handle it like this)
data.Instance.start();
data.Instance.release();

// Some time later (maybe in same frame but i don't think so)

// Stop event
data.Instance.stop(STOP_MODE.ALLOWFADEOUT);

// Removing the data container from the list of active sfx (custom)
// So the event instance shouldn't be reused


Im currently in the process of creating a new project and trying to reproduce it there.

Thank you for sharing the call order!

The overall flow looks mostly correct, but one thing that stands out is this sequence:

data.Instance.start();
data.Instance.release();

Then later:

data.Instance.stop(STOP_MODE.ALLOWFADEOUT);

The release() method doesn’t immediately destroy the instance. It marks it for deletion once playback ends and all references are cleared.

However, any interaction with the instance after calling release(), including stop(), can lead to crashes or access violations.

That said, I’ve tried to reproduce the crash locally by following this call order, but haven’t been able to trigger it on my end yet.

Let me know how your reproduction project goes, I’m happy to take another look once you have more results.