From owner-freebsd-threads@FreeBSD.ORG Mon Mar 6 11:03:28 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 3134816A420 for ; Mon, 6 Mar 2006 11:03:28 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E866743D45 for ; Mon, 6 Mar 2006 11:03:27 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k26B3RTn098800 for ; Mon, 6 Mar 2006 11:03:27 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k26B3QNe098794 for freebsd-threads@freebsd.org; Mon, 6 Mar 2006 11:03:26 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 6 Mar 2006 11:03:26 GMT Message-Id: <200603061103.k26B3QNe098794@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Cc: Subject: Current problem reports assigned to you 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: Mon, 06 Mar 2006 11:03:28 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -lthr) 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] kern/20861 threads libc_r does not honor socket timeouts o [2001/01/20] threads/24472threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] threads/24632threads libc_r delicate deviation from libc in ha o [2001/01/25] kern/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] threads/34536threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] threads/39922threads [threads] [patch] Threaded applications e o [2002/08/04] kern/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] threads/48856threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] threads/49087threads Signals lost in programs linked with libc s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/08/26] threads/70975threads unexpected and unreliable behaviour when o [2004/10/05] threads/72353threads Assertion fails in /usr/src/lib/libpthrea o [2004/10/07] threads/72429threads threads blocked in stdio (fgets, etc) are o [2004/10/21] threads/72953threads fork() unblocks blocked signals w/o PTHRE o [2004/12/19] threads/75273threads FBSD 5.3 libpthread (KSE) bug o [2004/12/21] threads/75374threads pthread_kill() ignores SA_SIGINFO flag o [2005/01/26] threads/76694threads fork cause hang in dup()/close() function p [2005/03/10] threads/78660threads Java hangs unkillably in STOP state after o [2005/04/08] threads/79683threads svctcp_create() fails if multiple threads o [2005/04/28] threads/80435threads panic on high loads o [2005/05/19] threads/81258threads Thread specific data is sometimes assigne o [2005/07/22] threads/83914threads [libc] popen() doesn't work in static thr o [2005/08/02] threads/84483threads problems with devel/nspr and -lc_r on 4.x o [2005/08/20] threads/85160threads [libthr] [patch] libobjc + libpthread/lib p [2005/11/19] threads/89262threads [kernel] [patch] multi-threaded process h o [2005/12/12] threads/90278threads libthr, ULE and -current produces >100% W o [2006/01/03] kern/91266 threads [threads] Trying sleep, but thread marked 30 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2000/10/21] kern/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] threads/30464threads pthread mutex attributes -- pshared o [2002/05/02] threads/37676threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] threads/40671threads pthread_cancel doesn't remove thread from o [2004/07/13] threads/69020threads pthreads library leaks _gc_mutex o [2004/09/21] threads/71966threads Mlnet Core Dumped : Fatal error '_pq_inse o [2004/11/21] threads/74180threads KSE problem. Applications those riched ma o [2005/04/13] threads/79887threads [patch] freopen() isn't thread-safe o [2005/05/13] threads/80992threads abort() sometimes not caught by gdb depen o [2005/05/26] threads/81534threads [libc_r] [patch] libc_r close() will fail 11 problems total. 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: 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 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 From owner-freebsd-threads@FreeBSD.ORG Sat Mar 11 11:40:54 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 30C9A16A41F for ; Sat, 11 Mar 2006 11:40:54 +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 F3D9B43D46 for ; Sat, 11 Mar 2006 11:40:53 +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 k2BBer0n096412 for ; Sat, 11 Mar 2006 11:40:53 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k2BBerFh096411; Sat, 11 Mar 2006 11:40:53 GMT (envelope-from gnats) Date: Sat, 11 Mar 2006 11:40:53 GMT Message-Id: <200603111140.k2BBerFh096411@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Martin Cc: Subject: Re: threads/80435: panic on high loads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Mar 2006 11:40:54 -0000 The following reply was made to PR threads/80435; it has been noted by GNATS. From: Martin To: bug-followup@FreeBSD.org Cc: Subject: Re: threads/80435: panic on high loads Date: Sat, 11 Mar 2006 12:36:04 +0100 Hi, I've a similar panic. Not exactly the same, but in a similar situation. You can trigger it with a slightly modified fork bomb: #include #include int main(void) { while(1) { fork(); malloc(1024); } return 0; } The resulting panic is: fault code = supervisor write, page not present backtrace: pmap_qenter() vm_thread_new() thread_init() slab_zalloc() uma_zone_slab() uma_zalloc_bucket() uma_zalloc_arg() thread_alloc() proc_init() slab_zalloc() uma_zone_slab() uma_zalloc_bucket() uma_zalloc_arg() fork1() fork() syscall() Xint0x80() -- syscall (2, FreeBSD ELF32, fork) Reproducible on: -STABLE uname -a: FreeBSD klotz.local 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Mon Mar 6 00:21:54 CET 2006 root@klotz.local:/usr/obj/usr/src/sys/KLOTZ i386 -- Martin