You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[New msys2-runtime version] Cygwin: signal: Copy context to alternate stack in the SA_ONSTACK case
Cygwin: signal: Copy context to alternate stack in the SA_ONSTACK case
After the commit 0210c77311ae, the context passed to signal handler
cannot be accessed from the signal handler that uses alternate stack.
This is because the context locally copied is on the stack that is
different area from the signal handler uses. With this patch, copy
the context to alternate signal stack area to avoid this situation.
Backported-from: 7f67575711 (Cygwin: signal: Copy context to alternate stack in the SA_ONSTACK case, 2025-03-25)
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257714.html
Fixes: 0210c77311ae ("Cygwin: signal: Use context locally copied in call_signal_handler()")
Reported-by: Bruno Haible <[email protected]>
Reviewed-by: Corinna Vischen <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
(cherry picked from commit 0d0e76b99025704d8ee44a44b19a23af9aafe297)
Signed-off-by: Johannes Schindelin <[email protected]>
[New msys2-runtime version] Cygwin: signal: Clear direction flag in sigdeleyed
Cygwin: signal: Clear direction flag in sigdeleyed
x86_64 ABI requires the direction flag in CPU flags register cleared.
https://learn.microsoft.com/en-us/cpp/build/x64-software-conventions
However, currently that flag is not maintained in signal handler.
Therefore, if the signal handler is called when that flag is set, it
destroys the data and may crash if rep instruction is used in the
signal handler. With this patch, the direction flag is cleared in
sigdelayed() by adding cld instruction.
Backported-from: d71aeccff4 (Cygwin: signal: Clear direction flag in sigdeleyed, 2025-03-24)
Addresses: https://cygwin.com/pipermail/cygwin/2025-March/257704.html
Fixes: 1fd5e000ace5 ("import winsup-2000-02-17 snapshot")
Reported-by: Christian Franke <[email protected]>
Reviewed-by: Corinna Vischen <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
(cherry picked from commit 9f4cec47df66a913256912c358afe5e597dec25c)
Signed-off-by: Johannes Schindelin <[email protected]>
[New msys2-runtime version] Cygwin: pipe: Fix hang due to inadvertent 0-length raw_write()
Cygwin: pipe: Fix hang due to inadvertent 0-length raw_write()
It is possible for `NtQueryInformationFile()` to report a 0-length
`InboundQuota` when obtaining `FilePipeLocalInformation`. This seems to
be the case e.g. when a pipe was created on the other side and its quota
information is not available on the client side.
This can lead to a situation where the `avail` variable is set to 0, and
since that is used to cap the number of bytes to send, a 0-length write.
Which hangs forever.
This was observed in the MSYS2 project when building GIMP, and reduced
to a simple test case where a MINGW `ninja.exe` tries to call an MSYS
`bison.exe` and the error message (saying that `bison` wants to have
some input) is not even shown.
Since the minimal pipe buffer size is 4k, let's ensure that it is at
least that, even when `InboundQuota` reports 0.
This fixes https://github.com/msys2/msys2-runtime/issues/270
Fixes: cbfaeba4f7 (Cygwin: pipe: Fix incorrect write length in raw_write())
Helped-by: Corinna Vinschen <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>
[New msys2-runtime version] Cygwin: signal: Copy context to alternate stack in the SA_ONSTACK case
msys2/msys2-runtime@2a96713
[New msys2-runtime version] Cygwin: signal: Clear direction flag in sigdeleyed
msys2/msys2-runtime@b9d1047
[New msys2-runtime version] Cygwin: pipe: Fix hang due to inadvertent 0-length raw_write()
msys2/msys2-runtime@40a66dc
The text was updated successfully, but these errors were encountered: