Game build always freezes when closing the applicaiton

I’m using Unity 6000.0.34f1 and have a problem where the application always freezes when closing (not in Editor, Editor works fine). When inspecting the player log files of the game, I found some errors about the Input System so I tried to change the input manager from the new one to the old one, and this fixed the issue.

What I’ve tried and have not worked:

  1. Creating a new blank project
  2. Removing all the unnecessary package
  3. Changing different player settings such as Render API, fullscreen/windowed, etc.

Temporary fixes:

  1. System.Diagnostics.Process.GetCurrentProcess().Kill(); inside the OnApplicationQuit function, this closes the application but is not a good fix.
  2. Changing to the old input manager.

Here is the error that I believe was produced by the freeze:

Input System module state changed to: ShutdownInProgress.
Input System polling thread exited.
Input System module state changed to: Shutdown.
Couldn't register input device. The Input System is not in an initialized state (Shutdown). 
A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor:
 {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"785","capabilities":"
{\"vendorId\":6940,\"productId\":7029,\"usage\":4,\"usagePage\":65474,\"inputReportSize\":65,\"outputReportSize\":65,\"featureReportSize\":65}"}

What’s the Input System version in use? Have you tried up or downgrading that package?

If this fails even with the latest (including prerelease or experimental) please submit a bug report (Help - Report a bug).

I used the recommended version 1.11.2. I tried switching to the newest 1.12.0 but the issue still exists.

@Grimbeorn I’m sorry you experiencing this. Could you tell me if this also happens with the Unity version 6000.0.33f1 ? Sorry to ask since I know you already opened a bug. Our quality team is currently looking into it.

Did u manage to fix it

Getting the same thing in 6000.1.0f1 but my project is set to only use the old Input Manager. These are the last items in the log before an indefinite freeze in OnApplicationQuitting.

[Physics::Module] Cleanup current backned.
[Physics::Module] Id: 0xf2b8ea05
Input System module state changed to: ShutdownInProgress.
Input System polling thread exited.
Input System module state changed to: Shutdown.

I’m getting the same problem. Unity 6000.1.0f1.

Here is the error message in the player log:

Input System module state changed to: ShutdownInProgress.
Input System polling thread exited.
Input System module state changed to: Shutdown.
Couldn’t register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {“interface”:“HID”,“type”:“”,“product”:“”,“manufacturer”:“”,“serial”:“”,“version”:“12296”,“capabilities”:“{"vendorId":6940,"productId":6973,"usage":1,"usagePage":12,"inputReportSize":5,"outputReportSize":0,"featureReportSize":0}”}Couldn’t register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {“interface”:“HID”,“type”:“”,“product”:“Hid Interface”,“manufacturer”:“Corsair”,“serial”:“”,“version”:“0”,“capabilities”:“{"vendorId":6940,"productId":2616,"usage":1,"usagePage":12,"inputReportSize":3,"outputReportSize":0,"featureReportSize":0}”}

I’ve made several builds before but this just started happening. One thing to note is that I made an iOS build for the first time a few days ago, and this is the first time I’ve made a Windows build after making the iOS build. Other than that, I can’t think of any reason for this to start happening all of a sudden.

Can you capture a dump file via the task manager for the stuck Windows build process after you attempt to exit it and share it here? That would tell us what it’s getting stuck on.

Any update on this? Having the same issue in Unity 6000.1.2f1 with Input System package 1.14.0.
Bug ticket link?

Same Issue, would love to know how to solve this.

Same Issue on 2022.3.27f1, I have New Input System on, However despite it, I’ve tried to fallback to old Input Manager, still the same result (Application hangs)

I have an update, it was not related to the input system. It is related to the LiteNetLib network library that I used. It started as a network manager, but I haven’t stopped it if the object owner is destroyed.

Stopping the network manager after the owner object is destroyed resolves the issue (via the OnDestroy callback). As far as I know, when LiteNetLib is started, it creates a separate THREAD, which may be the culprit

1 Like

I’m experiencing this issue in an empty project with a simple class that quits on start - Unity 6000.1.9f, using the universal 2d template.

public class QuitTester : MonoBehaviour {
    public IEnumerator Start() {
           yield new WaitForSeconds(1);
            Application.Quit();
    }
}

Here are the input devices I got registered together with their ID.

input device: Keyboard:1
input device: Mouse:2
input device: Touchscreen:3
input device: PTK-640:4
input device: Xbox Controller:6

Hi,

I’m also experiencing this issue, with the same player logs as others, e.g. : Whenever I build my project, run it and then try to quit it with Application.Quit(), the process just hang forever.

I’m on Unity 6000.3.2f1 with Input Manager 1.17.0.
Here’s a memory dump file as @Tautvydas-Zilys asked previously (from a Development Build with “Script debugging” enabled, if this change anything). It’s uploaded to Google Drive since I can’t upload files here as a “new” user (according to the error popup).

For clarification, this only happens when I enable the new Input Manager. If I revert to the old one, everthing works as expected and the application close.

Thanks!

Closing application...
UnityEngine.Debug:ExtractStackTraceNoAlloc (byte*,int,string)
UnityEngine.StackTraceUtility:ExtractStackTrace () (at C:/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:35)
UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at C:/build/output/unity/unity/Runtime/Export/Logging/DebugLogHandler.cs:9)
UnityEngine.Logger:Log (UnityEngine.LogType,object) (at C:/build/output/unity/unity/Runtime/Export/Logging/Logger.cs:60)
UnityEngine.Debug:Log (object) (at C:/build/output/unity/unity/Runtime/Export/Debug/Debug.bindings.cs:123)
ApplicationManager:CloseApplication () (at C:/Dev/MedievalCitySimulator/Assets/Script/ApplicationManager.cs:115)
ApplicationManager:<Awake>b__14_0 () (at C:/Dev/MedievalCitySimulator/Assets/Script/ApplicationManager.cs:74)
UnityEngine.Application:Internal_ApplicationQuit () (at C:/build/output/unity/unity/Runtime/Export/Application/Application.cs:370)

(Filename: C:/build/output/unity/unity/Runtime/Export/Debug/Debug.bindings.cs Line: 123)

[Physics::Module] Cleanup current backend.
[Physics::Module] Id: 0xf2b8ea05
Input System module state changed to: ShutdownInProgress.
Input System polling thread exited.
Input System module state changed to: Shutdown.
Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"801","capabilities":"{\"vendorId\":6940,\"productId\":7051,\"usage\":2,\"usagePage\":65473,\"inputReportSize\":64,\"outputReportSize\":0,\"featureReportSize\":0}"}Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"801","capabilities":"{\"vendorId\":6940,\"productId\":7051,\"usage\":3,\"usagePage\":65474,\"inputReportSize\":64,\"outputReportSize\":0,\"featureReportSize\":0}"}Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"1","capabilities":"{\"vendorId\":6940,\"productId\":7152,\"usage\":1,\"usagePage\":12,\"inputReportSize\":3,\"outputReportSize\":0,\"featureReportSize\":0}"}Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"513","capabilities":"{\"vendorId\":4152,\"productId\":5660,\"usage\":1,\"usagePage\":12,\"inputReportSize\":5,\"outputReportSize\":0,\"featureReportSize\":0}"}Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"SteelSeries Apex 5","manufacturer":"SteelSeries","serial":"","version":"513","capabilities":"{\"vendorId\":4152,\"productId\":5660,\"usage\":1,\"usagePage\":65473,\"inputReportSize\":65,\"outputReportSize\":0,\"featureReportSize\":0}"}Couldn't register input device. The Input System is not in an initialized state (Shutdown). A call to GetIInput()->InitInput() or equivalently InitializeNewInputSystem() is required before using the Input System. Associated device descriptor: {"interface":"HID","type":"","product":"","manufacturer":"","serial":"","version":"513","capabilities":"{\"vendorId\":4152,\"productId\":5660,\"usage\":1,\"usagePage\":12,\"inputReportSize\":5,\"outputReportSize\":0,\"featureReportSize\":0}"}```

Do you have any “weird” USB devices plugged into your computer/installed as virtual HID devices? The dump shows it hangs inside hid.dll!HidD_GetManufacturerString(), which would indicate a bug in the device driver.

Not that I’m aware of.

Of course, now that I want to A/B test it, I’m not able to reproduce it, even though I haven’t changed anything to my setup as far as I know.

I’ll keep you updated in this thread if I’m able to pinpoint it more precisely in the future I guess.

Edit: Actually, that’s not true.

I’ve upgraded the graphic card on this machine since my first comment, but I doubt it’d be related and I’m not really motivated to reinstall the old one to test it.