MrTimcakes / Unity-DirectInput

Unity Native Plugin to expose DirectX DirectInput ForceFeedback
GNU Lesser General Public License v3.0
33 stars 12 forks source link

In the Unity editor state, it often crashes #18

Open QiaoJingjing opened 4 months ago

QiaoJingjing commented 4 months ago

Hi, Thanks for sharing, I've been using this plugin for a while now, but I've found that in the Unity editor state, the editor often crashes even when doing nothing, by using WinDbg to analyze the crash log, it was found that it might be related to the memory access of this plug-in. Can you take a look? The following is the WinDbg analysis process:

.ecxr

rax=0000015c12efe6f0 rbx=00000010f4cef4c8 rcx=0000000000000007
rdx=0000000000000001 rsi=0000000000000001 rdi=0000000000000000
rip=00000010f4cef4c8 rsp=00000010f4cef450 rbp=0000000000000001
 r8=00000010f4cef4c8  r9=0000000000000000 r10=9aadbe931ed2da70
r11=0000000000000246 r12=0000000000000000 r13=0000000000000000
r14=00007fff40b64710 r15=0000000000000000
iopl=0         nv up ei pl nz na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010206
00000010`f4cef4c8 0000            add     byte ptr [rax],al ds:0000015c`12efe6f0=??

!analyze -v

KEY_VALUES_STRING: 1

    Key  : AV.Fault
    Value: Execute

    Key  : Analysis.CPU.mSec
    Value: 249

    Key  : Analysis.Elapsed.mSec
    Value: 111558

    Key  : Analysis.IO.Other.Mb
    Value: 15

    Key  : Analysis.IO.Read.Mb
    Value: 0

    Key  : Analysis.IO.Write.Mb
    Value: 57

    Key  : Analysis.Init.CPU.mSec
    Value: 249

    Key  : Analysis.Init.Elapsed.mSec
    Value: 205944

    Key  : Analysis.Memory.CommitPeak.Mb
    Value: 167

    Key  : Failure.Bucket
    Value: SOFTWARE_NX_FAULT_c0000005_DirectInputForceFeedback.dll!Unknown

    Key  : Failure.Hash
    Value: {2a526d17-0cd7-2d78-3acb-d855a8976674}

    Key  : Timeline.Process.Start.DeltaSec
    Value: 5288

    Key  : WER.OS.Branch
    Value: ni_release

    Key  : WER.OS.Version
    Value: 10.0.22621.1

    Key  : WER.Process.Version
    Value: 2021.3.4.26661

FILE_IN_CAB:  crash.dmp

CONTEXT:  (.ecxr)
rax=0000015c12efe6f0 rbx=00000010f4cef4c8 rcx=0000000000000007
rdx=0000000000000001 rsi=0000000000000001 rdi=0000000000000000
rip=00000010f4cef4c8 rsp=00000010f4cef450 rbp=0000000000000001
 r8=00000010f4cef4c8  r9=0000000000000000 r10=9aadbe931ed2da70
r11=0000000000000246 r12=0000000000000000 r13=0000000000000000
r14=00007fff40b64710 r15=0000000000000000
iopl=0         nv up ei pl nz na po nc
cs=0033  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010206
00000010`f4cef4c8 0000            add     byte ptr [rax],al ds:0000015c`12efe6f0=??
Resetting default scope

EXCEPTION_RECORD:  (.exr -1)
ExceptionAddress: 00000010f4cef4c8
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000000
NumberParameters: 2
   Parameter[0]: 0000000000000008
   Parameter[1]: 00000010f4cef4c8
Attempt to execute non-executable address 00000010f4cef4c8

PROCESS_NAME:  Unity.exe

EXECUTE_ADDRESS: 10f4cef4c8

FAILED_INSTRUCTION_ADDRESS: 
+0
00000010`f4cef4c8 0000            add     byte ptr [rax],al

ERROR_CODE: (NTSTATUS) 0xc0000005 - 0x%p            0x%p                    %s

EXCEPTION_CODE_STR:  c0000005

EXCEPTION_PARAMETER1:  0000000000000008

EXCEPTION_PARAMETER2:  00000010f4cef4c8

IP_ON_STACK: 
+0
00000010`f4cef4c8 0000            add     byte ptr [rax],al

IP_ON_HEAP:  0000015c12efe6f2
The fault address in not in any loaded module, please check your build's rebase
log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may
contain the address if it were loaded.

FRAME_ONE_INVALID: 1

STACK_TEXT:  
00000010`f4cef450 0000015c`12efe6f2     : 00007fff`40b64747 00000000`00000000 00000000`00000000 00000000`00000000 : 0x00000010`f4cef4c8
00000010`f4cef458 00007fff`40b64747     : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : 0x0000015c`12efe6f2
00000010`f4cef460 00007fff`94bc35c0     : 00000000`00000219 00000010`f4bf9000 00000002`00000004 00000000`00000001 : DirectInputForceFeedback!DEBUG1+0xc17
00000010`f4cef490 00007fff`94badfa7     : 00000001`00000000 00000000`00000001 00000000`00000000 00000000`00000000 : user32!fnHkINLPCWPSTRUCTW+0xf0
00000010`f4cef540 00007fff`96913fe4     : 00000159`c00032e0 00000000`00000000 00000000`00000000 00000010`f4bf9800 : user32!__fnINDEVICECHANGE+0x77
00000010`f4cef600 00007fff`941914d4     : 00007fff`94bc26bf 00000000`00000000 00000000`00000000 00000000`00000001 : ntdll!KiUserCallbackDispatcherContinue
00000010`f4cef6c8 00007fff`94bc26bf     : 00000000`00000000 00000000`00000000 00000000`00000001 00007ff6`a41c4849 : win32u!NtUserPeekMessage+0x14
00000010`f4cef6d0 00007fff`94bc258c     : 00000000`00000001 00000010`f4bf9800 00000000`00000000 00000000`00000001 : user32!_PeekMessage+0x3f
00000010`f4cef740 00007ff6`a5519c6d     : 00000000`00000000 00000010`f4cef8b0 00000501`c66f27c3 00000501`c65ff9a6 : user32!PeekMessageW+0x9c
00000010`f4cef7b0 00000000`00000000     : 00000010`f4cef8b0 00000501`c66f27c3 00000501`c65ff9a6 00000010`00000001 : Unity+0x1fd9c6d

STACK_COMMAND:  ~0s; .ecxr ; kb

SYMBOL_NAME:  directinputforcefeedback+c17

MODULE_NAME: DirectInputForceFeedback

IMAGE_NAME:  DirectInputForceFeedback.dll

FAILURE_BUCKET_ID:  SOFTWARE_NX_FAULT_c0000005_DirectInputForceFeedback.dll!Unknown

OS_VERSION:  10.0.22621.1

BUILDLAB_STR:  ni_release

OSPLATFORM_TYPE:  x64

OSNAME:  Windows 10

FAILURE_ID_HASH:  {2a526d17-0cd7-2d78-3acb-d855a8976674}

Followup:     MachineOwner

k

`# Child-SP          RetAddr               Call Site
00 00000010`f4cede28 00007fff`93d165f9     ntdll!NtWaitForMultipleObjects+0x14
01 00000010`f4cede30 00007fff`93d164fe     KERNELBASE!WaitForMultipleObjectsEx+0xe9
02 00000010`f4cee110 00007ff6`a457dc0c     KERNELBASE!WaitForMultipleObjects+0xe
03 00000010`f4cee150 00000010`f4cee190     Unity+0x103dc0c
04 00000010`f4cee158 00000000`000055c0     0x00000010`f4cee190
05 00000010`f4cee160 00000000`00000000     0x55c0`