From 574959b168c1a40d8bbfc2e18f4388ca662bcac2 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 25 Aug 2015 08:27:50 +0200 Subject: [PATCH] Added patch to fix access violation in MSYS2 git when when cloning repository (fixes Wine Staging Bug #348). --- README.md | 5 ++++ debian/changelog | 2 ++ ...ing-stack-faults-also-commit-the-pag.patch | 25 +++++++++++++++++++ patches/ntdll-Stack_Fault/definition | 1 + patches/patchinstall.sh | 16 ++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 patches/ntdll-Stack_Fault/0001-ntdll-When-handling-stack-faults-also-commit-the-pag.patch create mode 100644 patches/ntdll-Stack_Fault/definition diff --git a/README.md b/README.md index cba4db95..8c4a9266 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,11 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- +**Bug fixes and features included in the next upcoming release [1]:** + +* Fix access violation in MSYS2 git when cloning repository + + **Bug fixes and features in Wine Staging 1.7.50 [242]:** *Note: The following list only contains features and bug fixes which are not diff --git a/debian/changelog b/debian/changelog index 89a0c3f5..d9d6f0a3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ wine-staging (1.7.51) UNRELEASED; urgency=low * Added patch to fix bug in wineserver debug_children inheritance (fixes Wine Staging Bug #525). + * Added patch to fix access violation in MSYS2 git when when cloning + repository (fixes Wine Staging Bug #348). * Removed patch to fix bug in wineserver debug_children inheritance (accepted upstream). * Removed patch to use helper function for NtWaitForMultipleObjects and diff --git a/patches/ntdll-Stack_Fault/0001-ntdll-When-handling-stack-faults-also-commit-the-pag.patch b/patches/ntdll-Stack_Fault/0001-ntdll-When-handling-stack-faults-also-commit-the-pag.patch new file mode 100644 index 00000000..55c0bbc4 --- /dev/null +++ b/patches/ntdll-Stack_Fault/0001-ntdll-When-handling-stack-faults-also-commit-the-pag.patch @@ -0,0 +1,25 @@ +From 6235c2318a0180d0cc9b19aaab5f9369da09f68a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 25 Aug 2015 08:25:22 +0200 +Subject: ntdll: When handling stack faults also commit the page, instead of + just removing the guard page flag. + +--- + dlls/ntdll/virtual.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c +index 8ece7e7..fc22029 100644 +--- a/dlls/ntdll/virtual.c ++++ b/dlls/ntdll/virtual.c +@@ -1606,6 +1606,7 @@ BOOL virtual_handle_stack_fault( void *addr ) + BYTE vprot = view->prot[((const char *)page - (const char *)view->base) >> page_shift]; + if (vprot & VPROT_GUARD) + { ++ if (!view->mapping) vprot |= VPROT_COMMITTED; /* FIXME */ + VIRTUAL_SetProt( view, page, page_size, vprot & ~VPROT_GUARD ); + NtCurrentTeb()->Tib.StackLimit = page; + if ((char *)page >= (char *)NtCurrentTeb()->DeallocationStack + 2*page_size) +-- +2.5.0 + diff --git a/patches/ntdll-Stack_Fault/definition b/patches/ntdll-Stack_Fault/definition new file mode 100644 index 00000000..122ebb75 --- /dev/null +++ b/patches/ntdll-Stack_Fault/definition @@ -0,0 +1 @@ +Fixes: Fix access violation in MSYS2 git when cloning repository diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 0211f52a..2489f5cb 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -185,6 +185,7 @@ patch_enable_all () enable_ntdll_NtSetLdtEntries="$1" enable_ntdll_Pipe_SpecialCharacters="$1" enable_ntdll_RtlIpStringToAddress="$1" + enable_ntdll_Stack_Fault="$1" enable_ntdll_SystemRoot_Symlink="$1" enable_ntdll_ThreadTime="$1" enable_ntdll_Threading="$1" @@ -645,6 +646,9 @@ patch_enable () ntdll-RtlIpStringToAddress) enable_ntdll_RtlIpStringToAddress="$2" ;; + ntdll-Stack_Fault) + enable_ntdll_Stack_Fault="$2" + ;; ntdll-SystemRoot_Symlink) enable_ntdll_SystemRoot_Symlink="$2" ;; @@ -3985,6 +3989,18 @@ if test "$enable_ntdll_RtlIpStringToAddress" -eq 1; then ) >> "$patchlist" fi +# Patchset ntdll-Stack_Fault +# | +# | Modified files: +# | * dlls/ntdll/virtual.c +# | +if test "$enable_ntdll_Stack_Fault" -eq 1; then + patch_apply ntdll-Stack_Fault/0001-ntdll-When-handling-stack-faults-also-commit-the-pag.patch + ( + echo '+ { "Sebastian Lackner", "ntdll: When handling stack faults also commit the page, instead of just removing the guard page flag.", 1 },'; + ) >> "$patchlist" +fi + # Patchset ntdll-SystemRoot_Symlink # | # | This patchset has the following (direct or indirect) dependencies: