Skip to content
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

Windows Explorer hangs and Windows needs restart #623

Closed
3 of 4 tasks
g-fusion opened this issue Nov 20, 2017 · 15 comments
Closed
3 of 4 tasks

Windows Explorer hangs and Windows needs restart #623

g-fusion opened this issue Nov 20, 2017 · 15 comments
Labels

Comments

@g-fusion
Copy link

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

  • Windows version: Win 10
  • Processor architecture: x64
  • Dokany version: 1.0.0 (final)
  • Library type (Dokany/FUSE): Dokany

Check List

  • I checked my issue doesn't exist yet
  • My issue is valid with mirror default sample and not specific to my user-mode driver implementation
  • I can always reproduce the issue with the provided description below.
  • [] I have updated Dokany to the latest version and have reboot my computer after.
  • I tested one of the last snapshot from appveyor CI

Description

We have scenario when 1200-1400 big jpg files (~45-50MB each) has to be displayed in Explorer and thumbnails is ON (in some system it is not by default on https://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/cannot-preview-images-in-windows-explorer-or-my/75ebc2c3-1ff4-44da-b684-7dbdb5ac9576) . When loading is started, View in Explorer is switched to Extra Large icons and do a little bit of scrolling, at some point entire Explorer hangs. At the end you end up to a point Windows restart. Issue reproduced with Mirror and logs attached. Any help is much appreciated. Just to mention that I could see "DokanFS" written in the logs despite Explorer hang before i restart the Windows.

Logs

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

@Liryna
Copy link
Member

Liryna commented Nov 20, 2017

Hi @g-fusion ,

Which version of Dokan exactly are you using ?

@g-fusion g-fusion reopened this Nov 20, 2017
@g-fusion
Copy link
Author

Hi Liryna,

Version is 1.0.0.5000

@Liryna
Copy link
Member

Liryna commented Nov 20, 2017

1.0.5 ?
Can you try with 1.0.3 see if this also happen ?

@g-fusion
Copy link
Author

Hi,

Will test and provide update. Do you need Debug logs as well if it happen to hang?

@Liryna
Copy link
Member

Liryna commented Nov 20, 2017

@g-fusion if you can get a full log, it would be nice !
Otherwise I will try to reproduce with a proper guide 👍

@g-fusion
Copy link
Author

g-fusion commented Nov 20, 2017

Hi,

Just tested it. It seems to work with Mirror. We are using DotNet for custom solution. Do you need logs to compare?! I will do some additional testing meanwhile.

@fanlonglong8500
Copy link
Contributor

fanlonglong8500 commented Nov 21, 2017

I encountered the same problem,I found it deadlock in DokanDispatchCleanup -> FlushFcb -> CcFlushCache , but i do not know how to fix it, and i have a question to this ,where is fcb->SectionObjectPointers init?

@g-fusion
Copy link
Author

Hello,

I was wondering if any down-port can be done, to the driver that we are using? The reason is that once i put new driver 1.03 rev. some of the functionalities that we are using are affected. For example creating new Excel file is no longer possible also its upload or move as well. I mean adopt ing new driver is not that easily done out of the box.

@Liryna
Copy link
Member

Liryna commented Nov 25, 2017

@fanlonglong8500 fcb->SectionObjectPointers is init in SetFileObjectForVCB

@g-fusion I did tried to reproduce the issue with a picture (copy x1000 of 10mb), I could not reproduce this.
Since you say it works with 1.0.3 and after a review of the changes, there is a good chance that it was the lock I introduce in write that is probably used during the creation of the thumbnails cache.
I reverted it already for another issue: b72f645

There is another lock added for set security but I do not expect it to create an issue here.

Are you able to test the fix with the snapshot:
https://ci.appveyor.com/project/Maxhy/dokany/branch/master/job/d3y3qs3c5mh03e9i/artifacts
https://github.com/dokan-dev/dokany/wiki/Build#user-snapshot
The release should come very soon but want to be sure that it really solve the problem.

@g-fusion
Copy link
Author

Hi,

Will take only those changes b72f645 and try to build driver and will report back. Small remark when reproduce, the images must be BIG > 40 MB each. With small ones i did not managed to reproduce it either.

@g-fusion
Copy link
Author

g-fusion commented Nov 27, 2017

Hi,

The change b72f645 is not contained in 1.0.0.500 and 1.0.3 driver, how it can explain the behaviour i.e. on 1.0.0 it hangs and on 1.0.3 i does not. The DokanCompleteWrite() method does not have any difference there (in 1.0.0 and 1.0.3) compared to master?! Also, having latest driver is not an option for us based on my previous memo, it is somehow incompatible working with office files (excel). I though having only your change, as down-port, to 1.0.0 driver would be possible, but not sure if this is the real cause of the issue.

@Liryna
Copy link
Member

Liryna commented Nov 27, 2017

Hi @g-fusion ,

Oh, I tought you were using 1.0.5 and not 1.0.0
#623 (comment)

Forget about what I said before. Now I remember this issue has already been reported and fixed for 1.0.1 (test on 1.0.1 before be sure it fix your issue)
https://github.com/dokan-dev/dokany/blob/master/CHANGELOG.md#1011000---2016-11-04
Lots of changes for lock have been made, you may want to look at them if you wanna backport v1.0.0...v1.0.1
And specially about CcPurgeCacheSection

@g-fusion
Copy link
Author

Hi,

Did small test with drivers as follows:

  1. 1.0.0 - Hang (reboot required)(
  2. 1.0.1 - Runs smoothly
  3. 1.0.3 - Runs OK
  4. 1.0.5(without change b72f645e55b3a480a43a3fdac4b0d0a03fb54480)- Runs OK, not that smooth as 1.0.1 while loading all the images
  5. 1.0.5 (with change b72f645) - Runs OK, again not that smooth like 1.0.1

Maybe i have to check our impl. as well, because we are fetching images from network and working as Local Disk and reading is not sequential. Maybe if i am network driver it will be(if i remember my test in the past correctly). I saw something similar in context of FTP (#210), but this is related i think to (#307). Any suggestions here? Should Network Drive will be better or not?

@Liryna
Copy link
Member

Liryna commented Dec 1, 2017

About smooth, v1.0.1...v1.0.3 has reviews of the FCB locks in the kernel.
Maybe there some locks that are heavier than on 1.0.1 BUT they were added to handle possible crash/BSOD.

You can see the lock usage by macro DokanFCBLockRW/DokanFCBLockRO

@Liryna
Copy link
Member

Liryna commented Dec 28, 2017

@g-fusion I close this. If you have any other question. Do not hesitate and I will reopen.

@Liryna Liryna closed this as completed Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants