From owner-freebsd-threads@FreeBSD.ORG Mon Dec 26 11:02:48 2005 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 932D116A41F for ; Mon, 26 Dec 2005 11:02:48 +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 35BEB43D81 for ; Mon, 26 Dec 2005 11:02:40 +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 jBQB2d9s018288 for ; Mon, 26 Dec 2005 11:02:39 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBQB2cIl018282 for freebsd-threads@freebsd.org; Mon, 26 Dec 2005 11:02:38 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 26 Dec 2005 11:02:38 GMT Message-Id: <200512261102.jBQB2cIl018282@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, 26 Dec 2005 11:02:48 -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 o [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/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 o [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 [2005/12/14] threads/90392threads libc stdio memory leak with pthread 29 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 Dec 27 12:04:26 2005 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 E8D8016A41F; Tue, 27 Dec 2005 12:04:26 +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 A0E4E43D5D; Tue, 27 Dec 2005 12:04:26 +0000 (GMT) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id jBRC4QTX032418; Tue, 27 Dec 2005 12:04:26 GMT (envelope-from davidxu@freefall.freebsd.org) Received: (from davidxu@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBRC4Q8A032414; Tue, 27 Dec 2005 12:04:26 GMT (envelope-from davidxu) Date: Tue, 27 Dec 2005 12:04:26 GMT From: David Xu Message-Id: <200512271204.jBRC4Q8A032414@freefall.freebsd.org> To: dhartmei@freebsd.org, davidxu@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: threads/90392: libc stdio memory leak with pthread 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, 27 Dec 2005 12:04:27 -0000 Synopsis: libc stdio memory leak with pthread State-Changed-From-To: open->closed State-Changed-By: davidxu State-Changed-When: Tue Dec 27 12:03:45 UTC 2005 State-Changed-Why: Fixed! http://www.freebsd.org/cgi/query-pr.cgi?pr=90392 From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 04:20:07 2005 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 3578416A420 for ; Thu, 29 Dec 2005 04:20:07 +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 7660D43D69 for ; Thu, 29 Dec 2005 04:20:06 +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 jBT4K69E068278 for ; Thu, 29 Dec 2005 04:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT4K6Bo068277; Thu, 29 Dec 2005 04:20:06 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 04:20:06 GMT Message-Id: <200512290420.jBT4K6Bo068277@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe 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: Thu, 29 Dec 2005 04:20:07 -0000 The following reply was made to PR threads/79887; it has been noted by GNATS. From: David Xu To: bug-followup@freebsd.org, tejblum@yandex-team.ru Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe Date: Thu, 29 Dec 2005 12:16:01 +0800 Indeed, this a bug, but the patch you provided breaks the samentic the FILE structure was designed for, here you conditionally call fp->_close(), this is incorrect, because the hook may be an external function, it should always be called to notify external code. I think the right fix is to fix those code which is still using STDERR_FILENO, or don't do following hack in freopen.c: if (wantfd >= 0 && f != wantfd) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; } } This is not required by standard. David Xu From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 05:20:08 2005 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 98A5416A41F for ; Thu, 29 Dec 2005 05:20:08 +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 3025543D53 for ; Thu, 29 Dec 2005 05:20:08 +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 jBT5K720070719 for ; Thu, 29 Dec 2005 05:20:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT5K74e070718; Thu, 29 Dec 2005 05:20:07 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 05:20:07 GMT Message-Id: <200512290520.jBT5K74e070718@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Dmitrij Tejblum Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitrij Tejblum List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2005 05:20:08 -0000 The following reply was made to PR threads/79887; it has been noted by GNATS. From: Dmitrij Tejblum To: David Xu Cc: bug-followup@freebsd.org Subject: Re: threads/79887: [patch] freopen() isn't thread-safe Date: Thu, 29 Dec 2005 08:12:58 +0300 David Xu wrote: > Indeed, this a bug, but the patch you provided breaks the samentic the > FILE structure was designed for, here you conditionally call > fp->_close(), this is incorrect, because the hook may be an external > function, it should always be called to notify external code. I only assume that 1) _file and _close fields are internal to stdio, i.e. only stdio code manipulate with them directly 2) If _file != -1, then the FILE is associated with the file descriptor, fp->_close == __sclose (because the only code that can set fp_close to something different is funopen, and it set _file to -1) and __sclose just close the _fp->_file If so, we know that dup2() will close the descriptor too, dup2() is required to do it. > I think the right fix is to fix those code which is still using > STDERR_FILENO, or don't do following hack in freopen.c: > if (wantfd >= 0 && f != wantfd) { > if (_dup2(f, wantfd) >= 0) { > (void)_close(f); > f = wantfd; > } > } > This is not required by standard. Well, I tried to keep existing behaviour, and I think that the hack is indeed a good idea even though it is not required. > > > David Xu > From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 05:30:09 2005 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 AA6F016A420 for ; Thu, 29 Dec 2005 05:30:09 +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 4430243D5D for ; Thu, 29 Dec 2005 05: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 jBT5U81N071115 for ; Thu, 29 Dec 2005 05:30:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT5U8qX071114; Thu, 29 Dec 2005 05:30:08 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 05:30:08 GMT Message-Id: <200512290530.jBT5U8qX071114@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe 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: Thu, 29 Dec 2005 05:30:09 -0000 The following reply was made to PR threads/79887; it has been noted by GNATS. From: David Xu To: Dmitrij Tejblum Cc: bug-followup@freebsd.org Subject: Re: threads/79887: [patch] freopen() isn't thread-safe Date: Thu, 29 Dec 2005 13:26:03 +0800 Dmitrij Tejblum wrote: > > David Xu wrote: > >> Indeed, this a bug, but the patch you provided breaks the samentic the >> FILE structure was designed for, here you conditionally call >> fp->_close(), this is incorrect, because the hook may be an external >> function, it should always be called to notify external code. > > > I only assume that > 1) _file and _close fields are internal to stdio, i.e. only stdio code > manipulate with them directly > 2) If _file != -1, then the FILE is associated with the file descriptor, > fp->_close == __sclose (because the only code that can set fp_close to > something different is funopen, and it set _file to -1) and __sclose > just close the _fp->_file > If so, we know that dup2() will close the descriptor too, dup2() is > required to do it. > I think we allow _close and others to be changed by user code unless someone can clarify that this is not allowed now, otherwise your assumption is false. >> I think the right fix is to fix those code which is still using >> STDERR_FILENO, or don't do following hack in freopen.c: >> if (wantfd >= 0 && f != wantfd) { >> if (_dup2(f, wantfd) >= 0) { >> (void)_close(f); >> f = wantfd; >> } >> } >> This is not required by standard. > > > Well, I tried to keep existing behaviour, and I think that the hack is > indeed a good idea even though it is not required. From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 05:50:08 2005 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 9E02016A41F for ; Thu, 29 Dec 2005 05:50:08 +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 A8FA043D55 for ; Thu, 29 Dec 2005 05:50:07 +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 jBT5o7Ul072508 for ; Thu, 29 Dec 2005 05:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT5o7Cn072507; Thu, 29 Dec 2005 05:50:07 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 05:50:07 GMT Message-Id: <200512290550.jBT5o7Cn072507@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Dmitrij Tejblum Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dmitrij Tejblum List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Dec 2005 05:50:08 -0000 The following reply was made to PR threads/79887; it has been noted by GNATS. From: Dmitrij Tejblum To: David Xu Cc: bug-followup@freebsd.org Subject: Re: threads/79887: [patch] freopen() isn't thread-safe Date: Thu, 29 Dec 2005 08:43:15 +0300 David Xu wrote: > Dmitrij Tejblum wrote: > >> >> David Xu wrote: >> >>> Indeed, this a bug, but the patch you provided breaks the samentic the >>> FILE structure was designed for, here you conditionally call >>> fp->_close(), this is incorrect, because the hook may be an external >>> function, it should always be called to notify external code. >> >> >> >> I only assume that >> 1) _file and _close fields are internal to stdio, i.e. only stdio >> code manipulate with them directly >> 2) If _file != -1, then the FILE is associated with the file >> descriptor, fp->_close == __sclose (because the only code that can >> set fp_close to something different is funopen, and it set _file to >> -1) and __sclose just close the _fp->_file >> If so, we know that dup2() will close the descriptor too, dup2() is >> required to do it. >> > I think we allow _close and others to be changed by user code unless > someone can clarify that this is not allowed now, otherwise your > assumption is false. Well, this is C, not C++, so there cannot be strict difference between allowed and disallowed. But the _close field is not required by any standarts (funopen() too) and is not documented by manpages (I checked manpages with grep). And there does exist documented interface for setting _close: funopen(). Thus _close is internal. From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 06:30:16 2005 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 A5E1116A423 for ; Thu, 29 Dec 2005 06:30:16 +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 A1AC443D5C for ; Thu, 29 Dec 2005 06:30:15 +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 jBT6UFbG073625 for ; Thu, 29 Dec 2005 06:30:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT6UFUp073622; Thu, 29 Dec 2005 06:30:15 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 06:30:15 GMT Message-Id: <200512290630.jBT6UFUp073622@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/79887: [patch] freopen() isn't thread-safe 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: Thu, 29 Dec 2005 06:30:16 -0000 The following reply was made to PR threads/79887; it has been noted by GNATS. From: David Xu To: Dmitrij Tejblum Cc: bug-followup@freebsd.org Subject: Re: threads/79887: [patch] freopen() isn't thread-safe Date: Thu, 29 Dec 2005 14:23:39 +0800 Dmitrij Tejblum wrote: > > Well, this is C, not C++, so there cannot be strict difference between > allowed and disallowed. But the _close field is not required by any > standarts (funopen() too) and is not documented by manpages (I checked > manpages with grep). And there does exist documented interface for > setting _close: funopen(). Thus _close is internal. > > > Then why use the following code to close a file descriptor, if (isopen) (void) (*fp->_close)(fp->_cookie); Why don't use _close(fp->_file)? this should be faster. This implies that someone can replace fp->_close with another function pointer,so that function must be called unconditionally. I think the libc should have a document to clarify this problem. Also should we move the PR to freebsd-standard@ list ? From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 09:20:05 2005 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 211E516A428 for ; Thu, 29 Dec 2005 09:20:05 +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 F1B0843D4C for ; Thu, 29 Dec 2005 09:20:03 +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 jBT9K37w082979 for ; Thu, 29 Dec 2005 09:20:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBT9K3Jj082978; Thu, 29 Dec 2005 09:20:03 GMT (envelope-from gnats) Resent-Date: Thu, 29 Dec 2005 09:20:03 GMT Resent-Message-Id: <200512290920.jBT9K3Jj082978@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, Kostik Belousov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33AB416A41F for ; Thu, 29 Dec 2005 09:15:36 +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 9AC1543D53 for ; Thu, 29 Dec 2005 09:15:35 +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 jBT9FZiU039596 for ; Thu, 29 Dec 2005 09:15:35 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id jBT9FZ5M039595; Thu, 29 Dec 2005 09:15:35 GMT (envelope-from nobody) Message-Id: <200512290915.jBT9FZ5M039595@www.freebsd.org> Date: Thu, 29 Dec 2005 09:15:35 GMT From: Kostik Belousov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: threads/91044: [patch] ps reports zombie process as having RE state, shall be Z 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: Thu, 29 Dec 2005 09:20:05 -0000 >Number: 91044 >Category: threads >Synopsis: [patch] ps reports zombie process as having RE state, shall be Z >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Dec 29 09:20:03 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Kostik Belousov >Release: 6.0-STABLE >Organization: - >Environment: FreeBSD deviant.kiev.zoral.com.ua 6.0-STABLE FreeBSD 6.0-STABLE #34: Wed Nov 2 11:48:22 EET 2005 root@deviant.kiev.zoral.com.ua:/usr/obj/usr/src/sys/DEVIANT i386 >Description: Revision 1.232 of the sys/kern/kern_proc.c introduced fill_kinfo_thread and fill_kinfo_proc_only separation for sysctl reporting process data. This introduced the buglet where SZOMB status for zombie processes filled in the fk_proc_only, and overwritten in the fk_thread with SIDL. As result, zombies are reported as live processes. I propose the attached patch to put them in the grave in the ps output. >How-To-Repeat: do a ps auxww and watch for zombies >Fix: Index: sys/kern/kern_proc.c =================================================================== RCS file: /usr/local/arch/ncvs/src/sys/kern/kern_proc.c,v retrieving revision 1.235 diff -u -r1.235 kern_proc.c --- sys/kern/kern_proc.c 13 Nov 2005 13:27:44 -0000 1.235 +++ sys/kern/kern_proc.c 29 Dec 2005 09:08:42 -0000 @@ -789,6 +789,8 @@ } else { kp->ki_stat = SWAIT; } + } else if (p->p_state == PRS_ZOMBIE) { + kp->ki_stat = SZOMB; } else { kp->ki_stat = SIDL; } >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-threads@FreeBSD.ORG Thu Dec 29 13:10:13 2005 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 9825116A41F for ; Thu, 29 Dec 2005 13:10:13 +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 4D41A43D4C for ; Thu, 29 Dec 2005 13:10:13 +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 jBTDACsP098773 for ; Thu, 29 Dec 2005 13:10:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id jBTDACR1098772; Thu, 29 Dec 2005 13:10:12 GMT (envelope-from gnats) Date: Thu, 29 Dec 2005 13:10:12 GMT Message-Id: <200512291310.jBTDACR1098772@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/91044: [patch] ps reports zombie process as having RE state, shall be Z 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: Thu, 29 Dec 2005 13:10:13 -0000 The following reply was made to PR threads/91044; it has been noted by GNATS. From: David Xu To: Kostik Belousov Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: threads/91044: [patch] ps reports zombie process as having RE state, shall be Z Date: Thu, 29 Dec 2005 21:02:44 +0800 Kostik Belousov wrote: >>Number: 91044 >>Category: threads >>Synopsis: [patch] ps reports zombie process as having RE state, shall be Z >> >> > Committed to CURRENT, thanks!