Closed TrabacchinLuigi closed 5 years ago
sorry i've noticed that there is two dups, the second one is with symbols loaded. In our fs we hang FileStreamOpening while the resource becomes available and after a while if the resource is still unavailable we return DokanResult.NotReady (NtStatus.DeviceNotReady) With the debugger i ofthen get caught there, maybe just because it's an hanging call. Could this be a problem ?
Tried the last version of dokany, rebuilt with the new dokan.net still BSOD, but different stack trace in the minidump...
It seems to me that the stack trace changes every time...
I've updated windows to last version, same result i'll attach the analyzed dump anyway. Thi time the stack trace is the same of one of the previous...
Hi @TrabacchinLuigi ,
Do you think this could be reproduce with the mirror changed ?
our implementation is quite similar to the mirror sample, we just might not have all the files available because it's kind of a partial network drive, if a file is not available it hangs the FileStreamOpening
for few seconds with a ManualResetEvent
... so yes, i guess we could add to mirror something that randomly hang the same method and see what happens...
Sorry i've posted some methods specific to our implementation before... not so useful, i feel dumb 😵 .
To remedy i've altered a little the mirror sample to mimic what happen in our implementation and managed to reproduce the BSOD TrabacchinLuigi/dokan-dotnet@2744b65148ef435ba304cadd6673a09d17cb86ec
Removing the lock it works fine, but i do think that investigating this behaviour could be useful. Also, dokany should be bullet proof against what the user does in usermode BSOD aren't that good
Hi guys, back from holidays? Any news on this? Lead to some bug discovery ?
Hi @TrabacchinLuigi ,
I focus currently https://github.com/dokan-dev/dokany/issues/759 by adding some debug lock logs by default to track such case. Will try to look into this when have time 👍
Just my impression but i think this could help a lot identify the problem. since it gets into BSOD almost instantly... When i'll have a new pc i could install few virtual machines and debug drivers easier, maybe i could help too then... good luck for now !
Hi! got the new PC, prepared a VM, installed WinSDK and WDK (i got the newer one, but i think it's ok just for test purposes), made the pipe from local PC to virtual com port and connected to kernel debug succesfully.
Visual studio bothered for some missing spectre/meltdown libs, but i got them installed as-well (not sure if it was better to just disable the fix, but i went for the additive way), now it builds, but i can't find dokan1.sys file... i'm doing something wrong ? visual studio does not complain about errors... so i'm a little confused...
@TrabacchinLuigi Hi,
Have you selected the correct platform for the build ? "Win10 Debug" for exemple
I did batch build, then selected Win10 debug|x86 and Win10 Debug|x64 i also selected to build all other projects in debug x86 and x64
i'm starting to feel dumb... the file is there... just i can't see it from explorer nor console, but if open it from notepad typing the path it exists... i'm sure i have show hidden files and also system files... wtf...
damn! it was not under the sys project... but in the solution folder... sorry
C:\Users\LocalAdmin\Desktop>dokanctl.exe /i d Driver path: 'C:\Windows\system32\drivers\dokan1.sys' Installing driver... DokanServiceInstall: Service (Dokan1) installed DokanServiceControl: Failed to start service (Dokan1). error = 577 DokanServiceInstall: Service (Dokan1) start failed Driver install failed
what can i possibly did wrong ?
Did you add correctly the certificat and enable windows driver option to allow selfsigned driver install ? https://github.com/dokan-dev/dokany/wiki/Build
So, i've managed to install dokany i've built, i'm running my sample (this version takes longer to crash, maybe because of the incremented max threads), still if i try to open a lot of file the machine hangs in a way which is even worse, CPU skyrockets and become totally unresponsive, i loose connection to the VM and even if i let it run it won't recover after hours... nor i get a minidump. Now i'd like to debug it, so i've tried the named pipe to COM approach and didn't worked quite well so i went for the KDNet approach, i can connect in kernel debug via visual studio, but i'm not hitting breakpoints... Can i have some more hints ? 🆘 💌
AH! i did it! i had to break execution and run !analyze it loaded symbols and now i can set breakpoints!
i managed to reproduce it, when it happens it stops on a DbgBreakPoint()
i expected to see many threads instead it's just one... if you wanna have a look i can provide screenshots stack trace, variables etc... remote desktop connections...
Hi @TrabacchinLuigi ,
I try to reproduce this. If I understood correctly. I should just need to change the mirror and change CreateFile:
Sleep(1000);
return STATUS_DEVICE_NOT_READY;
but cannot reproduce a bsod with it. Could you share a C mirror with which create the behavior ?
I used to reproduce it with a manual reset event during create file, so a thread sleep should do pretty much the same, also the fact that i used a mirror in C# should not make any difference...
Maybe in this version of dokany the problem is gone... i will try a few time
OK, i still got a blue screen, it's not immediate, just create C:\Test\New image.bmp fire up the hanger version of mirror, go to N:\Test\New image.bmp an try to open it a few times, eventually you'll get the blue screen
Do you think you can reproduce it on the C mirror ?
not my fav lang... but i can try...
Done.
Sleep(1000);
return STATUS_DEVICE_NOT_READY;
on line 454, just before Handle = CreateFile( ... )
Then mount with so it will mirror C: in N: and browse for that folder with a bitmap (it will be slow as hell) open it twice and Boom.
Thank you @TrabacchinLuigi I will look at it !
Hi @TrabacchinLuigi ,
I could reproduce using last release 👍 I tried to make it happen on the current master state and seems to be fixed 🏆
Do you think you can try to install last snapshot and run a changed mirror as you did ? https://github.com/dokan-dev/dokany/wiki/Build#user-snapshot https://ci.appveyor.com/project/Maxhy/dokany/builds/24484640/job/519720094o9ia5fv/artifacts
sure i will, will get u some feedback tomorrow
Ok, i've tested it with the C implementation and the .net implementation. I can say no more crash happened. I've also wrote a piece of software to open parallel streams of the same file, which i believe is a more reliable way to test it, maybe i can share that too...
[Open parallel streams is one of the IFSTest already running. Here the issue was more related to "unstable" user FS implementation. Driver is now able to handle this.
That's a good news it also fixed on your side. Thank you again for your report & feedback @TrabacchinLuigi 🎉
Environment
Check List
Description
I'm getting a BSOD repeatedly. Before i can further investigate (i'll update windows and dokany) and report here, i've decided to post a log before just in case the bug is not reproducible after those changes. And also to ask for counseling, any advice is welcome.
Logs
analyzed_crash_dump.txt