From owner-freebsd-threads@FreeBSD.ORG Wed Mar 8 02:21:38 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E911516A422; Wed, 8 Mar 2006 02:21:38 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B112843D45; Wed, 8 Mar 2006 02:21:38 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from localhost.my.domain (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k282LaDt082671; Wed, 8 Mar 2006 02:21:37 GMT (envelope-from davidxu@freebsd.org) From: David Xu To: freebsd-threads@freebsd.org Date: Wed, 8 Mar 2006 10:21:09 +0800 User-Agent: KMail/1.8.2 References: <200603071617.k27GHSM5000487@www.freebsd.org> In-Reply-To: <200603071617.k27GHSM5000487@www.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603081021.09351.davidxu@freebsd.org> Cc: john gladkih , freebsd-gnats-submit@freebsd.org Subject: Re: threads/94176: KSE: sigwait doesn't recieve SIGWINCH sent by pthread_kill() or kill -WINCH X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2006 02:21:39 -0000 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