Re: [PATCH] Cygwin: sigtimedwait: Fix segfault when timeout is used

2024-11-19 Thread Takashi Yano
On Mon, 18 Nov 2024 16:34:55 +0100 Corinna Vinschen wrote: > Hi Takashi, > > thanks for looking into this problem. > > On Nov 18 00:48, Takashi Yano wrote: > > @@ -640,6 +641,16 @@ sigwait_common (const sigset_t *set, siginfo_t *info, > > PLARGE_INTEGER waittime) > > } > > break; >

Re: [PATCH] Cygwin: sigtimedwait: Fix segfault when timeout is used

2024-11-18 Thread Corinna Vinschen
Hi Takashi, thanks for looking into this problem. On Nov 18 00:48, Takashi Yano wrote: > @@ -640,6 +641,16 @@ sigwait_common (const sigset_t *set, siginfo_t *info, > PLARGE_INTEGER waittime) > } > break; > case WAIT_TIMEOUT: > + _my_tls.lock (); > + if (_my_tl

[PATCH] Cygwin: sigtimedwait: Fix segfault when timeout is used

2024-11-17 Thread Takashi Yano
Previously, two bugs exist in sigtimedwait(). One is, that since _my_tls.sigwait_mask was left non-zero if the signal arrives after the timeout, sigpacket::process() would wrongly try to handle it. The other is if a timeout occurs after sigpacket::process() is called, but not completed yet, the sig