-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BSODs after DokanMounter service restart #26
Comments
Hi ! I think the service should force unmount when killed/restart and also contact mirrorfs to forward that the device is killed. We should even probably add a ping system from the service to mirrorfs in case that something goes wrong for one of them. It is only suggestion because I do not know if the driver have such security already but it seems not. (I hope that I have properly understand your ticket) |
Yep, you get it right. |
I think we should see the service as a guard. If someone ask him to restart or stop he should clean everything before leaving.
I have never tested such case 😃 but as there will be nobody to clean the device...we will get a BSOD. Better to give the possibility to the mirror for handling it that break the OS. For me if the service restart, it mean that something goes wrong or someone that have forget to clean his running "mirror" properly and none of this reason are normal use-case. |
Alright, I agree, cleaning is a preferable solution.
You can try =) but don't forget to do |
Have you already use DOKAN_OPTION_KEEP_ALIVE ? it say that it is for auto unmount. Line 80 in 22cf77c
If this really work, killing the service with the option should work. Can you test with this option ? |
I've been testing with that option turned on. The thing is - when auto unmount is triggered, DokanService searches for mount entry and if service was restarted, appropriate record won't be found and |
@don-Pardon Oh ok I see >< |
Looks like @marinkobabic fixes resolved this issue. I cannot reproduce your BSOD with these changes whereas I was with previous versions. Could you try this pre-release and let me know if you still have BSOD? https://github.com/dokan-dev/dokany/releases/tag/0.7.3-RC2 |
@don-Pardon could you give a try with https://github.com/dokan-dev/dokany/releases/tag/0.7.3-RC3? Thanks. |
don-Pardon's results notwithstanding I can report that dokany 0.7.3-RC3 greatly reduces BSODs on my machine. |
@Maxhy @viciousviper There is no reason for a BSOD. We must identify the problem and solve it. |
Big thank you @marinkobabic ! Your contributions are always welcomed ! @viciousviper could you test with this version ? and make a report using WinDbg as marinkobabic explained ? |
There you go. -- removed misleading .dmp from devenv.exe |
Maybe I am missing something but the crash report is from devenv.exe
Are you debugging dokan with VS when you run it ? If yes, could you run dokan without VS and make a new crash report ? |
Well, yes, just as I wrote above. So far I've only witnessed BSODs after I aborted a VS debugging session on my still very incomplete Dokan.Net application. |
Oh sorry! I missed this information 😄 haha So for now, you have never been able to make a crash without VS ? |
You certainly have a point there. I'll probably get around to upgrading my VS to 2015 final in the next couple of days. However, while I did see my share of exceptions and crashes inside VS 2015 RC I've never had regular BSODs until I started to fiddle with dokan. In the meantime, how's this:
|
The last crash is interesting. You should get the actual symbol file and then execute the analyze command. So we would get a clear stack trace. |
I'd be happy to help if someone (Maxhy?) could provide me with the .pdb for dokan.sys 0.7.3-RC4. |
Sorry @viciousviper, The pdb files have been erased by a new build 😢 . The sys pdf files of this build are in x64.rar. For the next releases, I will add the pdb files next to the installer in the download page. |
Ok, updated to your special build. Now I'll have to see if I can crash nicely again #-) |
Another one bites the dust ...
|
Thats a good report! Do you know exactly how to reproduct it ? It seems that there is corruption of one IRP in the pending irp list causing the crash. @marinkobabic I would like your advice about it since you seems to know more than me 😋 The documentation about IoCompleteRequest say: EDIT: I just found that RemoveTailList is never used :O does that mean the PendingIrp is really never cleaned from irp completed ? if we clean it, the source of this BSOD will be removed. |
No, I cannot reliably reproduce the crash. What I can say is that the BSOD appears several seconds after I terminate the thread that my .NET application gets called on via Dokan.NET. |
@Liryna @viciousviper |
@marinkobabic |
Full would be great if possible :-) |
@marinkobabic |
Does the analysis of the memory dump gave more informations ? |
I think I also got this crash. Is there any quick change to Dokan that I can make to make this cause an error rather than a BSOD? http://www.voltagex.org/081615-16812-01.dmp but I may need to move this file. No full dump captured by the look of it. I caused this BSOD by running the project in http://voltagex.org/DokanTest.7z a couple of times. |
@voltagex Thank you for the dump. Unfortunatly, the crash happen in ntoskrnl.exe. I have try to open DokanTest.7z but SevenZippedFile.cs is full of '\0'. |
Looks like the crash corrupted some files.
I'm away from my computer today, but I'll get back to you tomorrow.
|
Download DokanTest.7z again, I've fixed that file. I don't think the current version will crash. Try this: mount a drive as Z:, mount it again (fails), unmount Z: and mount again (crash) |
But @voltagex ... you have implemented nothing 😐. |
Even with only a few things implemented, Dokan shouldn't cause a BSOD,
|
I'm sorry for causing trouble here. I can't cause the crash with my exe,
but I can cause it by repeatedly unmounting and mounting the drive.
|
@marinkobabic I have made the same test as you. DokanTest more than 25 times with CTRL + C very fast or slowly. @voltagex If you can make a crash, please use WinDbg to see in which software it crashed. |
Was the volume active while it was being dismounted? Sent on a Sprint Samsung Galaxy Note® 3 -------- Original message -------- @marinkobabichttps://github.com/marinkobabic I have made the same test as you. DokanTest more than 25 times with CTRL + C very fast or slowly. @voltagexhttps://github.com/voltagex If you can make a crash, please use WinDbg to see in which software it crashed. Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-132315910. |
The fact is that a lot of people have the BSOD while debugging in Visual Studio. What is the difference when the debugger is used, compared to running the user mode application without attached debugger: If debugger is used we slow down the request and other requests are not processed fast enough which results in more timed out Irp requests. If the developer detaches the debugger then the process terminates. The timeout thread realizes that the user mode application is no longer there and starts to clean up everything. Imagine that the timeout thread is collecting the timed out Irp requests and those are now in a list to complete. At the same time the driver removes all the other pending Irp requests and deletes the device and symbolic link. The timeout thread completes the Irp requests in a loop for a device which no longer exists and here we have an invalid Irp which is completed. To simulate the timeout we could delay the response from user mode methods randomized to cause some of the Irp requests to time out. Then at some point we should exit the application. After several tries the application should crash. |
Reproduced without the debugger. (updated this note to add unmounting step)
|
@voltagex Perfect report ! I have been able to repoduce the issue (Win 8.1) but not the crash.
BUT I still see the M driver in explorer. @marinkobabic I totally agree with you. It is worth to try. |
@marinkobabic Thank you
Here: Line 406 in bdc64b0 The device is well unmount but the mirror is not notified of it and keep running. |
@Liryna If would not make to much dependencies to the service. An option you have is to let the driver to unmount the drive with force flag. What you need to do is to extend UNMOUNT_CONTEXT with Flags and set the force unmount flag here https://github.com/dokan-dev/dokany/blob/master/sys/timeout.c#L64. The mounter service will take the EVENT_CONTEXT and set the flag here after this line. https://github.com/dokan-dev/dokany/blob/master/dokan_mount/mounter.c#L391 |
@marinkobabic I have try what you say, but since the service has lost all mount informations during the restart. FindMountEntry cannot retrieve the MountPoint from the DeviceName so the Unmount, even with force flag, fail. I totally agree with you, the service seems to be useless compared to the issue that it create. |
@Liryna Lines 179 to 181 in bdc64b0
MountManager requires Plug & Play implementation. By the way, can you open pdf files on Windows 8.1 using the native pdf viewer and not the Adobe Reader? |
@marinkobabic Can we get the MountPoint at this part of the code ? I just tested with the native pdf viewer: "There is a problem with the file format." |
@Liryna The reason you can't open the pdf file is that since Windows 8 a lot of programs rely on OpLocks https://msdn.microsoft.com/en-us/library/windows/hardware/ff551007(v=vs.85).aspx . The implementation is no longer optional for File System Drivers. Keep it in mind, when somebody is not able to play/open some formats. The check what requests are sent you can use the process monitor or the filespy https://www.osronline.com/article.cfm?article=370 As you can see there is a lot to do. The first stuff which should be done is to change the DriverEntry like in fastfat example and to catch all exception on one place. |
@marinkobabic What do you mean by catching all exception on one place ? I agree, we are discovering that dokan need a lots of changes to achieve his goal. |
@Liryna |
Hi guys!
I've been investigating a BSOD issue in dokanx fork, than I found out about dokany fork, checked if that issue is reproduced here and it does, so I thinks you guys should know about it too.
Here is the summary:
When you mount your fs on some drive letter, restart DokanMounter service and then you try to kill that fs-app, the BSOD occurs. Here is full description (many letters): BenjaminKim/dokanx#47
Hope to get any comments and/or suggestions.
Thanks.
The text was updated successfully, but these errors were encountered: