InputSystem icon indicating copy to clipboard operation
InputSystem copied to clipboard

Input system stops working

Open iBicha opened this issue 8 years ago • 12 comments

Editor on macOS, Unity 2018.3.0b1

Sometimes, it happens randomly that the input system stops working. No events are ever fired again, unless the editor is restarted.

I know this is not much information to go from, but this happens a few times a day with a project using the input system

iBicha avatar Sep 19 '18 19:09 iBicha

When it happens again, could you take a snapshot of what the Input Debugger looks like at that point? Are all the devices gone? Is it happening right after a script change / when going into play mode? Is the system spilling anything in the console or is it just sitting there and simply does nothing?

events are ever fired again

Events as in no input events are actually coming in or as in none of the action callbacks are being triggered?

Rene-Damm avatar Sep 22 '18 00:09 Rene-Damm

Upgraded project to Unity 2018.3.0b2


Okay, so the device count is 0, and when I enable diagnostics, the console spams:

Cannot find device for input event: id=73541 type=STAT device=7 size=52 time=21.024752084224
UnityEngine.Experimental.Input.LowLevel.<>c__DisplayClass6_0:<set_onUpdate>b__0(NativeInputUpdateType, Int32, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:91)
Cannot find device for input event: id=87298 type=STAT device=2 size=1016 time=191.117491006851
UnityEngine.Experimental.Input.LowLevel.<>c__DisplayClass6_0:<set_onUpdate>b__0(NativeInputUpdateType, Int32, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:91)

Note that the device, size and time changes in the console, not all the exceptions are identical

iBicha avatar Sep 24 '18 21:09 iBicha

Looks like the input system is losing all its devices. Is this happening right after changing scripts or going into play mode?

Rene-Damm avatar Sep 24 '18 22:09 Rene-Damm

I notice the change when I go into play mode (so not in the middle of play mode) So it could be caused by script recompilation or domain unload. Either way, it's not always consistent (doesn't happen every time)

iBicha avatar Sep 24 '18 22:09 iBicha

Sounds like we definitely have a pretty serious bug in the refactored domain reload code then.

Rene-Damm avatar Sep 24 '18 22:09 Rene-Damm

I will try to provide a repro repository as soon as I can

iBicha avatar Sep 24 '18 22:09 iBicha

Here's a repo where I used the input system https://github.com/iBicha/sevakon

There's also a weird bug that happens only when the Input system fails, which makes a Job run in unexpected behaviour. I suspect that the input system and job system might be interfering with each other. I'll investigate further, and open a separate issue when I have more details

iBicha avatar Sep 26 '18 05:09 iBicha

Hey @iBicha, thanks for keeping at it.

I've tried your project and various other things to try to reproduce but so far unfortunately without luck. However, I received a report from another user so you're definitely not the only one seeing this problem.

I'll keep digging.

Rene-Damm avatar Oct 05 '18 01:10 Rene-Damm

Ok, finally seeing this, too. For me, seems to only happen when using the .NET 4 runtime. Haven't seen it when using the .NET 3.5 runtime.

Rene-Damm avatar Dec 07 '18 00:12 Rene-Damm

Yes during testing the project was a .NET 4

iBicha avatar Dec 07 '18 01:12 iBicha

This should be fixed @iBicha Do you still have this issue with 0.2.6-preview?

JiaUnity avatar Apr 05 '19 22:04 JiaUnity

@JiaUnity I have the same issue on my mac using 0.2.10 and Unity 2019.1.3f0.

interior-night avatar May 22 '19 04:05 interior-night