Menu

#160 readdir() bug with Cygwin.

v1.0_(example)
open
nobody
None
5
2016-10-06
2016-10-06
No

I'm trying to use ext2fs from MSYS2/Cygwin. There seems to be a weird bug that's very easy to reproduce. I'd be very thankful if someone could take a look at it.

Create a folder, test in a subfolder ext2fs from Windows Exploerer, then step into that folder.

Open up an MSYS2 or Cygwin bash prompt and cd to ext2fs, for me, cd /f/ext2fs.
Attempt to remove the test folder: rm -rf test.
Notice that no error nor warning (or any output) was given.
Show the return code: echo $? => 0.
Notice how the folder, test still exists!

If the same process is repeated without having stepped into the folder, then the problem does not happen.

If it is useful, I did a strace -f rm -rf test, here is the pertainent part:

   99   22105 [main] rm 7420 fhandler_base::set_close_on_exec: set close_on_exec for F:/ext2fs/test to 1
   22   22127 [main] rm 7420 fhandler_disk_file::opendir: 0x600043D40 = opendir (F:/ext2fs/test)
   71   22198 [main] rm 7420 fhandler_disk_file::readdir: NtQueryDirectoryFile failed, status 0xC000000F, win32 error 2
   29   22227 [main] rm 7420 geterrno_from_win_error: windows error 2 == errno 2
   25   22252 [main] rm 7420 fhandler_disk_file::readdir: 0 = readdir(0x600043D40, 0xFFFFC830) (L"" > ".") (attr 0x0 > type 4)
   28   22280 [main] rm 7420 geterrno_from_win_error: windows error 18 == errno 89

.. so it seems NtQueryDirectoryFile fails with 0xC000000F, which means, AFAIK, STATUS_NO_SUCH_FILE.

I actually tried to build and install my own driver with debugging enabled, and, after test signing it, I was able to install it, however it took my system down immediately upon use and I've run out of time to investigate why. Sorry I can't be more helpful.

Discussion


Log in to post a comment.