From 22de9acd6dd8951d40024a2cd5366a7f548a8a4c Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 25 Nov 2024 09:27:51 +0000 Subject: [PATCH] msys2-runtime: update to 395fda678b4448587cabbeab936318459c10f209 Signed-off-by: Johannes Schindelin --- ...e-of-CancelSyncronousIo-on-wait_thre.patch | 58 +++++++++++++++++++ msys2-runtime/PKGBUILD | 13 +++-- msys2-runtime/msys2-runtime.commit | 2 +- 3 files changed, 67 insertions(+), 6 deletions(-) create mode 100644 msys2-runtime/0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch diff --git a/msys2-runtime/0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch b/msys2-runtime/0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch new file mode 100644 index 00000000000..278193a999c --- /dev/null +++ b/msys2-runtime/0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch @@ -0,0 +1,58 @@ +From 395fda678b4448587cabbeab936318459c10f209 Mon Sep 17 00:00:00 2001 +From: Jeremy Drake +Date: Thu, 21 Nov 2024 22:13:42 -0800 +Subject: [PATCH 56/N] Cygwin: revert use of CancelSyncronousIo on + wait_thread. + +It appears this is causing hangs on native x86_64 in similar scenarios +as the hangs on ARM64, because `CancelSynchronousIo` is returning `TRUE` +but not canceling the `ReadFile` call as expected. + +Cherry-picked from msys2/msys2-runtime's 2eb6be14ee (Cygwin: revert use +of CancelSyncronousIo on wait_thread., 2024-11-21). + +Addresses: https://github.com/msys2/MSYS2-packages/issues/4340#issuecomment-2491401847 +Fixes: b091b47b9e56 ("cygthread: suspend thread before terminating.") +Signed-off-by: Jeremy Drake +Signed-off-by: Johannes Schindelin +--- + winsup/cygwin/pinfo.cc | 7 +++---- + winsup/cygwin/sigproc.cc | 3 +-- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc +index 43e0034..a5f5d6e 100644 +--- a/winsup/cygwin/pinfo.cc ++++ b/winsup/cygwin/pinfo.cc +@@ -1262,14 +1262,13 @@ proc_waiter (void *arg) + + for (;;) + { +- DWORD nb, err; ++ DWORD nb; + char buf = '\0'; + + if (!ReadFile (vchild.rd_proc_pipe, &buf, 1, &nb, NULL) +- && (err = GetLastError ()) != ERROR_BROKEN_PIPE) ++ && GetLastError () != ERROR_BROKEN_PIPE) + { +- if (err != ERROR_OPERATION_ABORTED) +- system_printf ("error on read of child wait pipe %p, %E", vchild.rd_proc_pipe); ++ system_printf ("error on read of child wait pipe %p, %E", vchild.rd_proc_pipe); + break; + } + +diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc +index d180277..5c5ff73 100644 +--- a/winsup/cygwin/sigproc.cc ++++ b/winsup/cygwin/sigproc.cc +@@ -410,8 +410,7 @@ proc_terminate () + if (!have_execed || !have_execed_cygwin) + chld_procs[i]->ppid = 1; + if (chld_procs[i].wait_thread) +- if (!CancelSynchronousIo (chld_procs[i].wait_thread->thread_handle ())) +- chld_procs[i].wait_thread->terminate_thread (); ++ chld_procs[i].wait_thread->terminate_thread (); + /* Release memory associated with this process unless it is 'myself'. + 'myself' is only in the chld_procs table when we've execed. We + reach here when the next process has finished initializing but we diff --git a/msys2-runtime/PKGBUILD b/msys2-runtime/PKGBUILD index 5e84e08f5a9..0d55b74b790 100644 --- a/msys2-runtime/PKGBUILD +++ b/msys2-runtime/PKGBUILD @@ -4,7 +4,7 @@ pkgbase=msys2-runtime pkgname=('msys2-runtime' 'msys2-runtime-devel') pkgver=3.5.4 -pkgrel=4 +pkgrel=5 pkgdesc="Cygwin POSIX emulation engine" arch=('x86_64') url="https://www.cygwin.com/" @@ -81,9 +81,10 @@ source=('msys2-runtime'::git+https://github.com/cygwin/cygwin#tag=cygwin-${pkgve 0052-Fix-SSH-hangs.patch 0053-Cygwin-find_fast_cwd-don-t-run-assembler-checking-co.patch 0054-cygthread-suspend-thread-before-terminating.patch - 0055-fixup-cygthread-suspend-thread-before-terminating.patch) + 0055-fixup-cygthread-suspend-thread-before-terminating.patch + 0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch) sha256sums=('3812485e2a6ab8360e5b9d566a47b982852ff2b140cea4e332ded19c11c77663' - 'd6b70c10a740be79a95afdb65c4f557f8f4aaaf24e67010f6efe6ff5c21ed5db' + '827a95d14b6a6c5ec2875c571a38b82d136a845d89e44d7b895c71a9ac4b3be2' '9f9e1b6b05cbc9a715fe9443740b25171e9c1a276a058e6ba7e4f6eada6872c8' 'e5b2095e543a5d702cfce6da26cd17a78f40e17620315b1bcc434b94a007ae9b' 'f13b15dc14aa6ee1dd628a2487564bb484e74ff2f3e4059b9d9d64446a327db1' @@ -138,7 +139,8 @@ sha256sums=('3812485e2a6ab8360e5b9d566a47b982852ff2b140cea4e332ded19c11c77663' '75e22e453011ea15c6cf6b6904c33256530d6f4ba273f03bc6a37d9245064c8c' '7fe562197a1f3b67b1e794808186c10ff0186b0fcf8d09a8021499b952d04d2c' '957ea63fbe8e950276dd9deaf9ad3d52bb1558cc6ae71dd741ed3bf14d882499' - '0234fe3a4903fcff8c17a5eff680c357582028f5f794da4e9da68fe843a95ecb') + '0234fe3a4903fcff8c17a5eff680c357582028f5f794da4e9da68fe843a95ecb' + 'da3e715e6789295d49afb6ef778f03591b710b4b579c3849674898d159f349bd') # Helper macros to help make tasks easier # apply_patch_with_msg() { @@ -247,7 +249,8 @@ prepare() { 0052-Fix-SSH-hangs.patch \ 0053-Cygwin-find_fast_cwd-don-t-run-assembler-checking-co.patch \ 0054-cygthread-suspend-thread-before-terminating.patch \ - 0055-fixup-cygthread-suspend-thread-before-terminating.patch + 0055-fixup-cygthread-suspend-thread-before-terminating.patch \ + 0056-Cygwin-revert-use-of-CancelSyncronousIo-on-wait_thre.patch } build() { diff --git a/msys2-runtime/msys2-runtime.commit b/msys2-runtime/msys2-runtime.commit index 8c09af2ecdd..c9bb1dcad49 100644 --- a/msys2-runtime/msys2-runtime.commit +++ b/msys2-runtime/msys2-runtime.commit @@ -1 +1 @@ -54a725237845135bbb4609e1194366dece79a0e3 +395fda678b4448587cabbeab936318459c10f209