dahnielson / UEDirectInput

🕹️ Direct Input for Unreal Engine
MIT License
11 stars 5 forks source link

Sporadic crashes on DirectInputDevice.cpp line 221 #1

Closed dahnielson closed 1 year ago

dahnielson commented 1 year ago

Crashes intermittently on DirectInputDevice.cpp line 221.

dahnielson commented 1 year ago
[2022.12.14-17.35.45:352][508]LogOutputDevice: Warning: 

Script Stack (0 frames) :

[2022.12.14-17.35.45:551][508]LogWindows: Error: appError called: Assertion failed: UserIndex >= 0 [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp] [Line: 4079] 

[2022.12.14-17.35.45:551][508]LogWindows: Windows GetLastError: Åtgärden har slutförts. (0)
[2022.12.14-17.35.58:187][508]LogAudioMixer: Warning: AudioMixerPlatformInterface Timeout [8411ms] waiting for h/w. InstanceID=1
[2022.12.14-17.35.58:187][508]LogWindows: Error: === Critical error: ===
[2022.12.14-17.35.58:187][508]LogWindows: Error: 
[2022.12.14-17.35.58:187][508]LogWindows: Error: Assertion failed: UserIndex >= 0 [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp] [Line: 4079] 
[2022.12.14-17.35.58:187][508]LogWindows: Error: 
[2022.12.14-17.35.58:187][508]LogWindows: Error: 
[2022.12.14-17.35.58:187][508]LogWindows: Error: 
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff84715d369 UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff8471383f8 UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff847150ebf UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff847147503 UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff8471471e9 UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff810b1c498 UnrealEditor-DirectInput-0005.dll!FDirectInputDevice::SendControllerEvents() [H:\Users\Anders Dahnielson\Documents\Unreal Projects\TE\Plugins\DirectInput\Source\DirectInput\Private\DirectInputDevice.cpp:221]
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff8559c03a3 UnrealEditor-ApplicationCore.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff84714dff3 UnrealEditor-Slate.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398a7e18 UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398c287d UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398c296a UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398c5680 UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398d71b4 UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff7398da516 UnrealEditor.exe!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff907e174b4 KERNEL32.DLL!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: [Callstack] 0x00007ff9089226a1 ntdll.dll!UnknownFunction []
[2022.12.14-17.35.58:187][508]LogWindows: Error: 
dahnielson commented 1 year ago

Possible reason is the code being executed while in the editor and not in a game world thus the UserIndex >= 0. (?)

dahnielson commented 1 year ago

Clumsily fixed by using GEngine->IsEditor() as a guard around the code that caused UE to crash when in editor without any game. I say clumsily as PIE also count as in editor.