From owner-freebsd-threads@FreeBSD.ORG Tue Mar 7 16:20:31 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 7D58816A420 for ; Tue, 7 Mar 2006 16:20:31 +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 A893743D60 for ; Tue, 7 Mar 2006 16:20:04 +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 k27GK4da039132 for ; Tue, 7 Mar 2006 16:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k27GK4pj039131; Tue, 7 Mar 2006 16:20:04 GMT (envelope-from gnats) Resent-Date: Tue, 7 Mar 2006 16:20:04 GMT Resent-Message-Id: <200603071620.k27GK4pj039131@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, john gladkih Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD5E116A420 for ; Tue, 7 Mar 2006 16:17:34 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id B03C143D77 for ; Tue, 7 Mar 2006 16:17:28 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k27GHSpR000488 for ; Tue, 7 Mar 2006 16:17:28 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k27GHSM5000487; Tue, 7 Mar 2006 16:17:28 GMT (envelope-from nobody) Message-Id: <200603071617.k27GHSM5000487@www.freebsd.org> Date: Tue, 7 Mar 2006 16:17:28 GMT From: john gladkih To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: 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: Tue, 07 Mar 2006 16:20:31 -0000 >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. >How-To-Repeat: [~]> cat t.cc #include #include #include #include sigset_t blk; void *thread( void* ) { pthread_sigmask( SIG_BLOCK, &blk, NULL ); printf( "sigwait()\n" ); int sig, rc = sigwait( &blk, &sig ); printf( "got %d (rc=%d)\n", sig, rc ); printf( "no bug!\n" ); _exit( 0 ); } int main() { sigemptyset( &blk ); sigaddset( &blk, SIGWINCH ); sigprocmask( SIG_BLOCK, &blk, NULL ); pthread_sigmask( SIG_BLOCK, &blk, NULL ); pthread_attr_t attr; pthread_t tid; pthread_attr_init( &attr ); pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); printf( "pthread_create=%d\n", pthread_create( &tid, &attr, thread, 0 ) ); pthread_attr_destroy( &attr ); sleep( 5 ); printf( "pthread_kill=%d\n", pthread_kill( tid, SIGWINCH ) ); sleep( 5 ); printf( "bug!\n" ); return 1; } [~]> g++ -o t t.cc -lpthread [~]> ./t sigwait() pthread_create=0 pthread_kill=0 bug! >Fix: >Release-Note: >Audit-Trail: >Unformatted: