dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.2k stars 661 forks source link

Enabling driver log on 32bit causes BSOD. #1088

Closed onexzero closed 1 year ago

onexzero commented 2 years ago

Feature request can skip this form. Bug report must complete it. Check List must be 100% match or it will be automatically closed without further discussion. Please remove this line.

Environment

Check List

Description

Enabling the DOKAN_OPTION_DISPATCH_DRIVER_LOGS flag causes CRASH on mount on 32-bit.

Logs

Please attach in separate files: mirror output, library logs and kernel logs. In case of BSOD, please attach minidump or dump analyze output.

Liryna commented 2 years ago

@onexzero can you share the crash report ? https://github.com/dokan-dev/dokany/wiki/How-to-Debug-Dokan#crash-report-bsod

onexzero commented 2 years ago

KMODE_EXCEPTION_NOT_HANDLED (1e) This is a very common BugCheck. Usually the exception address pinpoints the driver/function that caused the problem. Always note this address as well as the link date of the driver/image that contains this address. Arguments: Arg1: c0000005, The exception code that was not handled Arg2: 8256de74, The address that the exception occurred at Arg3: 00000000, Parameter 0 of the exception Arg4: 0038002e, Parameter 1 of the exception

Debugging Details:

Page 7452 not present in the dump file. Type ".hh dbgerr004" for details Page 7452 not present in the dump file. Type ".hh dbgerr004" for details Page 7452 not present in the dump file. Type ".hh dbgerr004" for details

KEY_VALUES_STRING: 1

Key  : Analysis.CPU.mSec
Value: 2578

Key  : Analysis.DebugAnalysisManager
Value: Create

Key  : Analysis.Elapsed.mSec
Value: 2703

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

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

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

Key  : WER.OS.Branch
Value: 19h1_release

Key  : WER.OS.Timestamp
Value: 2019-03-18T12:02:00Z

Key  : WER.OS.Version
Value: 10.0.18362.1

FILE_IN_CAB: MEMORY.DMP

VIRTUAL_MACHINE: VMware

BUGCHECK_CODE: 1e

BUGCHECK_P1: ffffffffc0000005

BUGCHECK_P2: ffffffff8256de74

BUGCHECK_P3: 0

BUGCHECK_P4: 38002e

BLACKBOXBSD: 1 (!blackboxbsd)

BLACKBOXNTFS: 1 (!blackboxntfs)

BLACKBOXWINLOGON: 1

PROCESS_NAME: mirror.exe

TRAP_FRAME: 9cedb1ec -- (.trap 0xffffffff9cedb1ec) ErrCode = 00000000 eax=00000007 ebx=00000800 ecx=0038002a edx=9cedb5cc esi=9cedb4ac edi=a91ed84b eip=8256de74 esp=9cedb260 ebp=9cedb4c0 iopl=0 nv up ei pl nz na po nc cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010202 nt!_output_l+0x3be: 8256de74 8b7104 mov esi,dword ptr [ecx+4] ds:0023:0038002e=???????? Resetting default scope

STACK_TEXT:
9cedaba8 826088d7 0000001e c0000005 8256de74 nt!KeBugCheckEx 9cedabc4 82582282 9cedb108 82704428 9cedacc0 nt!KiFatalExceptionHandler+0x1a 9cedabe8 82582254 9cedb108 82704428 9cedacc0 nt!ExecuteHandler2+0x26 9cedacb0 8247c141 9cedb108 9cedacc0 00010037 nt!ExecuteHandler+0x24 9cedb0ec 8257aeed 9cedb108 00000000 9cedb1ec nt!KiDispatchException+0x1a1 9cedb158 8257f7ce 00000000 00000000 00000000 nt!KiDispatchTrapException+0x51

9cedb158 8256de74 (T) 00000000 00000000 00000000 nt!KiTrap0E+0x382 9cedb4c0 82568ef7 (T) 9cedb4e0 a91ed84c 00000000 nt!_output_l+0x3be 9cedb500 82568e9c c2250018 000007ff a91ed7ec nt!_vsnprintf_l+0x55 9cedb51c a91c17ae c2250018 000007ff a91ed7ec nt!_vsnprintf+0x18 9cedb54c a91ec1f6 c2250018 00000800 9cedb580 dokan2!RtlStringCchVPrintfExA+0xfc [C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntstrsafe.h @ 5733] > **9cedb59c a91e9290 9cedb71c a91ed7ec 00000015 dokan2!PushDokanLogEntry+0xb4 [C:\Project\dokany\sys\util\log.c @ 539]** 9cedb6d8 a91a56d6 9cedb71c 8698ed64 bbbfbe40 dokan2!DokanDispatchCreate+0x18a [C:\Project\dokany\sys\create.c @ 408] 9cedb7a0 a91a503d b846a8b8 bbbfbe40 8ecb1301 dokan2!DokanDispatchRequest+0x2a4 [C:\Project\dokany\sys\dispatch.c @ 177] 9cedb7e8 82493d08 b846a8b8 bbbfbe40 c23db2c8 dokan2!DokanBuildRequest+0x4d [C:\Project\dokany\sys\dispatch.c @ 38] 9cedb800 865d9848 a7a095a0 c23db2c8 00000000 nt!IofCallDriver+0x48 9cedb83c 865f9b36 00000000 bbbfbed4 a7a095a0 FLTMGR!FltpLegacyProcessingAfterPreCallbacksCompleted+0x168 9cedb890 82493d08 a7a095a0 bbbfbe40 00000000 FLTMGR!FltpCreate+0x356 9cedb8a8 8250837f bbbfbed4 85dbdb98 9cedb8d0 nt!IofCallDriver+0x48 9cedb8d0 827f8af7 e5e86a07 b5fb8d10 827f85e0 nt!IoCallDriverWithTracing+0x2f 9cedb984 827acf6c b5fb8d10 05dff660 a65cdb98 nt!IopParseDevice+0x517 9cedba8c 827af322 00000040 85dff660 9cedbb01 nt!ObpLookupObjectName+0x69c 9cedbb14 827b81f0 00efb440 85dff660 9cedbb01 nt!ObOpenObjectByNameEx+0x142 9cedbb9c 827b8996 00efb440 00efb414 00000000 nt!IopCreateFile+0x800 9cedbbe0 825795db 00efb40c 00100080 00efb440 nt!NtCreateFile+0x36 9cedbbe0 774b1630 (T) 00efb40c 00100080 00efb440 nt!KiSystemServicePostCall WARNING: Frame IP not in any known module. Following frames may be wrong. 00efb488 00000000 (T) 00000000 00000000 00000000 0x774b1630 FAULTING_SOURCE_LINE: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntstrsafe.h FAULTING_SOURCE_FILE: C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntstrsafe.h FAULTING_SOURCE_LINE_NUMBER: 5733 FAULTING_SOURCE_CODE: No source found for 'C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\km\ntstrsafe.h' SYMBOL_NAME: dokan2!RtlStringCchVPrintfExA+fc MODULE_NAME: dokan2 IMAGE_NAME: dokan2.sys STACK_COMMAND: .cxr; .ecxr ; kb BUCKET_ID_FUNC_OFFSET: fc FAILURE_BUCKET_ID: AV_dokan2!RtlStringCchVPrintfExA OS_VERSION: 10.0.18362.1 BUILDLAB_STR: 19h1_release OSPLATFORM_TYPE: x86 OSNAME: Windows 10 FAILURE_ID_HASH: {7eff157e-2c85-0f97-405e-b6b4c1356723} Followup: MachineOwner ---------
Liryna commented 2 years ago

Thanks I have been able to reproduce but could not find out right now what is happening.

onexzero commented 1 year ago

Here is a fix! sys/create.c line 413 change fileObject->FileName, --> &fileObject->FileName
we need & operator.

Liryna commented 1 year ago

Very good catch @onexzero ! I applied the fix here https://github.com/dokan-dev/dokany/commit/938f012556d45d53f17adc446582b7964b2773e2 Thanks for not giving up on this issue 👍