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

Fix crash on WinPE #163

Open
wants to merge 2 commits into
base: msys2-3.4.7
Choose a base branch
from
Open

Conversation

lesderid
Copy link

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 of mmap.

The first commit adds RAM disk detection. The second commit uses init_reopen_attr in mmap to circumvent the re-opening bug.

Fixes #160

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
@lesderid
Copy link
Author

lesderid commented Jul 13, 2023

This should probably be submitted upstream to Cygwin, but I don't have time for this right now.

I've submitted this upstream.

@dscho
Copy link
Collaborator

dscho commented Aug 14, 2023

This should probably be submitted upstream to Cygwin, but I don't have time for this right now.

I've submitted this upstream.

For lurkers, the submission can be seen here: https://inbox.sourceware.org/cygwin-patches/cover.1690932049.git.les@lesderid.net/

@lesderid
Copy link
Author

It might be a while before I can address the review comments, but the patch does work as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some executables cause BSOD in WinPE
2 participants