From owner-freebsd-threads@FreeBSD.ORG Wed Mar 8 02:30:10 2006 Return-Path: X-Original-To: freebsd-threads@hub.freebsd.org Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D02AB16A420 for ; Wed, 8 Mar 2006 02:30:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 759C443D48 for ; Wed, 8 Mar 2006 02:30:09 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k282U9YW082957 for ; Wed, 8 Mar 2006 02:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k282U9vt082956; Wed, 8 Mar 2006 02:30:09 GMT (envelope-from gnats) Date: Wed, 8 Mar 2006 02:30:09 GMT Message-Id: <200603080230.k282U9vt082956@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: 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 Reply-To: David Xu List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Mar 2006 02:30:10 -0000 The following reply was made to PR threads/94176; it has been noted by GNATS. From: David Xu To: freebsd-threads@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 Date: Wed, 8 Mar 2006 10:21:09 +0800 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