bibikurosawa / dokan

Automatically exported from code.google.com/p/dokan
0 stars 0 forks source link

Crash on slow file system #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. It seems that on slow file systems like one that gets files over HTTP, 
Windows explorer calls FindFiles and after some time it may decide to give 
up and call CloseFile before FindFiles returns. That invalidates handles 
and when FindFiles returns from loop it crashes trying to use them. 

What is the expected output? What do you see instead?
Not crashing

What version of the product are you using? On what operating system?
I built version from trunk. Happens on Vista and XP in both 32 and 64bit.

Please provide any additional information below.
In particular I tracked bug down to directory.c file, crash happens in 
next line:
index = MatchFiles(EventContext, eventInfo, openInfo->DirListHead, 
patternCheck);

because openInfo->DirListHead is set to NULL. One "if" before this line 
fixed my problem but it may happen anywhere else in such conditions.

Original issue reported on code.google.com by sslav...@gmail.com on 10 Apr 2009 at 9:44

GoogleCodeExporter commented 9 years ago
I have some more info about this issue and steps to reproduce it. If you just 
wait in
FindFiles until driver times out and then return (one Sleep there will be 
enough)
then Dokan.dll will crash. When timeout occurs it calls CloseFile and then frees
memory that openInfo pointer points to. However, if FindFiles returns after 
that it
still has pointer to this memory in its EventContext and it will use it.

Original comment by sslav...@gmail.com on 14 Aug 2009 at 5:00

GoogleCodeExporter commented 9 years ago
Hi,
I added a reference count to handle openInfo and this issue was fixed.

Original comment by asa...@gmail.com on 26 Dec 2009 at 3:51