Unity 5.5 game build crashes in Application.Quit() when in fullscreen mode

We have just upgraded a large project from Unity 5.4 to 5.5 and our desktop build crashes when exiting the application. This only and always happens when in fullscreen mode. In the “main menu” scene where one can exit all threads and all resources have been let go and this happens even if only starting the application and exiting directly without starting to use any resources.

What we have tried:

  • Build and run on two different machines, same results
  • Reverting to old version and building on Unity 5.4, no crash
  • Quitting using
    if (!Application.isEditor) System.Diagnostics.Process.GetCurrentProcess().Kill(); instead, no crash. I’d prefer quitting a bit more gracefully though…
  • Looking through the crash and log file, nothing interesting
  • Run the build in windowed mode, no crash
  • Create a new empty project and try to recreate the problem, no crash

I can’t share the project (corporate stuff) and it is too large anyway.

Is anyone else experiencing similar issues or is this a one off thing?
Any ideas?

As I can’t recreate the issue I haven’t made a ticket for it, thought I’d try to figure out what causes it first…

output_log.txt and error.log are attached below.

Peace,
Mike

2928385–216485–error.txt (24.1 KB)
2928385–216486–output_log.txt (27 KB)

I have been having the same issue. I have resorted to prefabing a scene and bringing in things one by one and retesting but there is no indication of why this is happening.

1 Like

I have the same issue on unity 5.4.3f1 - Application.Quit() causes a crash only in full screen mode. Only the PC standalone build is affected, not the mac or linux builds. I suspect this has something to do with direct3D. I have found an effective workaround is to change the build settings D3D9 fullscreen mode and D3D11 fullscreen mode from ‘exclusive mode’ to ‘fullscreen window’, this prevents the crash.

1 Like

Thanks that’s good input! I ahve also found that fiddling about with D3D settings may make the error go away but I haven’t reproduced a case yet…

So as I said earlier I re-prefabed and entire huge scene and re-built again and again bring in one component and or system one by one. You would not believe I found a fusion reactor core I made out of primitives using the standard shader. It had a transparent, a metallic and a particle system inside it. It also had no scripts attached to it. It would crash when ever I added this game object to the scene, either while loading into or always when exiting the game or even leaving the scene was using 5.5.0f3. I upgraded to 5.5.1f1and it completely went away I changed nothing and thought I was going mad. Looking though the fixes, and just the crashes from 5.5.0f3 > 5.5.1f1 > I could have had at least 5 “crashes fixed” found here https://unity3d.com/unity/whats-new/unity-5.5.1

Well that sounds… arbitrary… That it went away when upgrading sounds very promising though! :slight_smile:

Same problem here since we upgraded from 5.3 to 5.5.1p3. Before upgrading we had no problems with this and we launch our game today on Steam!! So the game will include this problem. As OP, logs are fine, no errors. Sometimes it works, others not…

P.S.: Btw, I’ve D3D9 and D3D11 set as “Fullscreen Window”

1 Like

Damn bro, feel your pain…
Did you try:
if (!Application.isEditor) System.Diagnostics.Process.GetCurrentProcess().Kill();
?

Best of luck with your launch!

Thanks man! Will try that!

2017.3 - Crashes on Quit:

========== OUTPUTING STACK TRACE ==================

  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9CE378D)
0x00007FF9C9CE378D (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9CDE240)
0x00007FF9C9CDE240 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9CDD38B)
0x00007FF9C9CDD38B (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9891779)
0x00007FF9C9891779 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C988E8C9)
0x00007FF9C988E8C9 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9891B8C)
0x00007FF9C9891B8C (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9891A5A)
0x00007FF9C9891A5A (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9EE8D80)
0x00007FF9C9EE8D80 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9EE913E)
0x00007FF9C9EE913E (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9A9DEB6)
0x00007FF9C9A9DEB6 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9A9DAB2)
0x00007FF9C9A9DAB2 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9A9ADDF)
0x00007FF9C9A9ADDF (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9A98B35)
0x00007FF9C9A98B35 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9BEED74)
0x00007FF9C9BEED74 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9BEEE2E)
0x00007FF9C9BEEE2E (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9C9BE3834)
0x00007FF9C9BE3834 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9CA180737)
0x00007FF9CA180737 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9CA17FB9A)
0x00007FF9CA17FB9A (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF9CA18212C)
0x00007FF9CA18212C (UnityPlayer) (function-name not available)
0x00007FF9CA18231B (UnityPlayer) UnityMain
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF682DB13EE)
0x00007FF682DB13EE (Hellpoint) (function-name not available)
0x00007FFA1CF03034 (KERNEL32) BaseThreadInitThunk
0x00007FFA1E4C1431 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

**** Crash! ****

This is happening to us. We’re using 2018.2.11.

Just scouring forum for crashes that are similar to the one we’re having (thread here: Crash during Scene Change / Unload ) and there are some similarities it seems, and we’ve experienced this same issue (crash on exit) though it isn’t the one we’re actively fire-fighting at the moment.

Sorry can’t be of more help, but figured we’d toss our hat in the ring as well. =(

Hoping this will be helpful to someone–I’ve run into a similar problem, and I’ve discovered that freezing on Application.quit can be a symptom of a memory leak.

I’ve run a few tests; if you make an empty project that contains a single object that does something memory-leaky (say, instantiating 100 new materials every frame), and then call Application.Quit, the game will freeze.

2 Likes

Hello, in case this matches someone’s problem, in my case I used StreamReader and forgot to dispose it. (Or forgot to using over it) In this case what happening is the game close properly on the first try but not the 2nd time. It is as if some read lock persiss across process.

1 Like

Hello, just adding to the culprits.

I have a freeze on quit in 2021.1.24.f1, for me it was the new input system. I created an empty project and switched between “Input System Package”, “Input Manager” and “Both”. When building for standalone windows the application quits as expected only with the “Input Manager (Old)” setting.

2022.2.0b16 Crashes on Application.Quit()