Date: Wed, 8 Mar 2006 10:21:09 +0800 From: David Xu <davidxu@freebsd.org> To: freebsd-threads@freebsd.org Cc: john gladkih <john@kak-sam.to>, freebsd-gnats-submit@freebsd.org Subject: Re: threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH Message-ID: <200603081021.09351.davidxu@freebsd.org> In-Reply-To: <200603071617.k27GHSM5000487@www.freebsd.org> References: <200603071617.k27GHSM5000487@www.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 08 March 2006 00:17, john gladkih wrote: > > >Number: 94176 > >Category: threads > >Synopsis: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH > >Confidential: no > >Severity: serious > >Priority: medium > >Responsible: freebsd-threads > >State: open > >Quarter: > >Keywords: > >Date-Required: > >Class: sw-bug > >Submitter-Id: current-users > >Arrival-Date: Tue Mar 07 16:20:04 GMT 2006 > >Closed-Date: > >Last-Modified: > >Originator: john gladkih > >Release: 5.4-RELEASE, 5.3-RELEASE > >Organization: > >Environment: > FreeBSD freebsd54.i.drweb.ru 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 8 10:21:06 UTC 2005 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 > > >Description: > sigwait() doesn't recieve SIGWINCH (SIGIO and maybe some others signal) sent by pthread_kill() from another thread or even from kill -WINCH. there is no such issue on 5.2.1 and older with libc_r. Good luck! I have been waiting for this PR for a few years. The problem you've hit is that default signal action of these signals is ignore, which causes kernel immediately discard them at the time the signals are generated, I believe libc_r sets handlers for these signals, it causes kernel to always deliver these signals to userland. POSIX does not specify if signal should be discarded immediately or remain pending if its action is ignore. this means sigwaiting a signal which action is ignore is not reliable or portable. http://www.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_04.html Traditionally, FreeBSD immediately discards a signal if its action is ignore except that process is being debugged. I am not sure I should change this history behavior. To work around the problem you've seen, you can set a dummy action for those signals you want to wait for. David Xu
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603081021.09351.davidxu>