Commit 33799c2
Cygwin: signal: Do not handle signal when __SIGFLUSHFAST is sent
After the commit d243e51, zsh sometimes hangs at startup. This
occurs because SIGCHLD, which should trigger sigsuspend(), is handled
in cygwait() that is used to wait for a wakeup event in sig_send(),
even when __SIGFLUSHFAST is sent. Despite __SIGFLUSHFAST being
required to return before handling the signal, this does not happen.
With this patch, if the signal currently being sent is __SIGFLUSHFAST,
do not handle the received signal and keep it asserted after the
cygwait() for the wakeup event. Apply the same logic to the cygwait()
in the retrying loop for WriteFile() as well.
Applied-from: https://inbox.sourceware.org/cygwin-patches/[email protected]
Addresses: https://cygwin.com/pipermail/cygwin/2024-December/256954.html
Fixes: d243e51 ("Cygwin: signal: Fix deadlock between main thread and sig thread")
Reported-by: Daisuke Fujimura <[email protected]>
Reviewed-by:
Signed-off-by: Takashi Yano <[email protected]>
Signed-off-by: Johannes Schindelin <[email protected]>1 parent 985e265 commit 33799c2
2 files changed
+20
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
754 | | - | |
| 754 | + | |
| 755 | + | |
755 | 756 | | |
756 | 757 | | |
757 | 758 | | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
758 | 762 | | |
759 | 763 | | |
760 | 764 | | |
| |||
785 | 789 | | |
786 | 790 | | |
787 | 791 | | |
788 | | - | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
789 | 802 | | |
790 | 803 | | |
791 | 804 | | |
| |||
806 | 819 | | |
807 | 820 | | |
808 | 821 | | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | 822 | | |
813 | 823 | | |
814 | 824 | | |
| |||
0 commit comments