-
Notifications
You must be signed in to change notification settings - Fork 42
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
Fix crash on WinPE #163
base: msys2-3.4.7
Are you sure you want to change the base?
Fix crash on WinPE #163
Conversation
Native RAM disks, e.g. as are used in WinPE environments, have other characteristics than regular filesystems such as NTFS. For instance, re-opening files with NtOpenFile is buggy. This commit checks whether a volume is a RAM disk through the NT object the drive letter link refers to. This seems to be the only reliable method of checking whether a volume is a native RAM disk.
Calling mmap on a file stored on a volume with buggy file re-opening currently bugchecks. This commit solves this by using the init_reopen_attr helper function. Fixes msys2#160
I've submitted this upstream. |
For lurkers, the submission can be seen here: https://inbox.sourceware.org/cygwin-patches/[email protected]/ |
It might be a while before I can address the review comments, but the patch does work as-is. |
what ever became of this? |
In https://inbox.sourceware.org/cygwin-patches/[email protected]/, Corinna pointed out that the conditions under which reopen is assumed to be buggy were way to broad (read: they would have changed behavior in many setups where no change of behavior was necessary at all) and made a couple of good suggestions how to improve the patches (re-use already-figured-out information, move code to a more appropriate location), and that's the last word on the list, there was no reply by @lesderid so far. |
I found some other issues with the first patch and sadly haven't had the time yet to look into it. The second one should be good to go. |
@lesderid You may want to reply to Corinna's mail so that she is aware of your answer, too. We here in the MSYS2 project have no permission to apply patches to Cygwin. |
status = NtOpenFile (&h, | ||
fh->get_access () | GENERIC_EXECUTE | SYNCHRONIZE, | ||
&attr, &io, FILE_SHARE_VALID_FLAGS, | ||
fh->pc.init_reopen_attr (attr, h), &io, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be:
fh->pc.init_reopen_attr (attr, h), &io, | |
fh->pc.init_reopen_attr (attr, fh->get_handle ()), &io, |
Native RAM disks, e.g. as are used in WinPE environments, have other characteristics than regular filesystems such as NTFS. For instance, re-opening files with
NtOpenFile
is buggy. This can cause a bugcheck with the current implementation ofmmap
.The first commit adds RAM disk detection. The second commit uses
init_reopen_attr
inmmap
to circumvent the re-opening bug.Fixes #160