From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 06:14:06 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 9F71316A41F; Mon, 24 Oct 2005 06:14:06 +0000 (GMT) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C64843D48; Mon, 24 Oct 2005 06:14:06 +0000 (GMT) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9O6E6ZB015453; Mon, 24 Oct 2005 06:14:06 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9O6E6MC015449; Mon, 24 Oct 2005 06:14:06 GMT (envelope-from linimon) Date: Mon, 24 Oct 2005 06:14:06 GMT From: Mark Linimon Message-Id: <200510240614.j9O6E6MC015449@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-threads@FreeBSD.org, jeff@FreeBSD.org Cc: Subject: Re: threads/80887: [sched_ule] ULE with SMP broke libpthread/libthr on 5.4-RELEASE 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, 24 Oct 2005 06:14:06 -0000 Synopsis: [sched_ule] ULE with SMP broke libpthread/libthr on 5.4-RELEASE Responsible-Changed-From-To: freebsd-threads->jeff Responsible-Changed-By: linimon Responsible-Changed-When: Mon Oct 24 06:13:50 GMT 2005 Responsible-Changed-Why: Sounds related to sched_ule. http://www.freebsd.org/cgi/query-pr.cgi?pr=80887 From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 11:02:20 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 3083916A41F for ; Mon, 24 Oct 2005 11:02:20 +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 E80B543D45 for ; Mon, 24 Oct 2005 11:02:19 +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.3/8.13.3) with ESMTP id j9OB2Jfi062145 for ; Mon, 24 Oct 2005 11:02:19 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9OB2JVn062139 for freebsd-threads@freebsd.org; Mon, 24 Oct 2005 11:02:19 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 24 Oct 2005 11:02:19 GMT Message-Id: <200510241102.j9OB2JVn062139@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, 24 Oct 2005 11:02:20 -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 s [2005/08/10] threads/84778threads libpthread busy loop/hang with Java when o [2005/08/20] threads/85160threads [patch] libobjc + libpthread/libthr crash o [2005/09/12] threads/86004threads libthr broken on amd64 28 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/26] kern/18824 threads gethostbyname is not thread safe 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/01/20] threads/76513threads libpthread is not working 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 [PATCH] libc_r close() will fail on any f 13 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 11:30:19 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 DA7A516A41F for ; Mon, 24 Oct 2005 11:30:19 +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 8F39A43D45 for ; Mon, 24 Oct 2005 11:30:19 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9OBUJ7O069741 for ; Mon, 24 Oct 2005 11:30:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9OBUIOj069740; Mon, 24 Oct 2005 11:30:18 GMT (envelope-from gnats) Date: Mon, 24 Oct 2005 11:30:18 GMT Message-Id: <200510241130.j9OBUIOj069740@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Marc Olzheim Cc: Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Marc Olzheim List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 11:30:20 -0000 The following reply was made to PR threads/76690; it has been noted by GNATS. From: Marc Olzheim To: bug-followup@FreeBSD.org, lse@CryptoPro.ru Cc: Marc Olzheim , Sven Berkvens-Matthijsse Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) Date: Mon, 24 Oct 2005 13:25:57 +0200 Sven Berkvens devised a patch for libc_r which fixes this and other locking issues in the uthread library. See http://www.stack.nl/~marcolz/FreeBSD/fork-malloc-thread-4.11.patch.txt at http://www.stack.nl/~marcolz/FreeBSD/showstoppers.html Marc From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 11:32:15 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 A927416A41F; Mon, 24 Oct 2005 11:32:15 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4287D43D48; Mon, 24 Oct 2005 11:32:14 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by mailhost.stack.nl (Postfix) with ESMTP id 1B5B8A2FCE; Mon, 24 Oct 2005 13:32:13 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id E8213644A; Mon, 24 Oct 2005 13:32:12 +0200 (CEST) Date: Mon, 24 Oct 2005 13:32:12 +0200 From: Marc Olzheim To: FreeBSD bugmaster Message-ID: <20051024113212.GA25866@stack.nl> References: <200510241102.j9OB2JVn062139@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <200510241102.j9OB2JVn062139@freefall.freebsd.org> X-Operating-System: FreeBSD hammer.stack.nl 6.0-BETA4 FreeBSD 6.0-BETA4 X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.11 Cc: freebsd-threads@FreeBSD.org Subject: Re: 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, 24 Oct 2005 11:32:15 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2005 at 11:02:19AM +0000, FreeBSD bugmaster wrote: > Current FreeBSD problem reports > Critical problems >=20 > S Submitted Tracker Resp. Description > -------------------------------------------------------------------------= ------ > o [2005/01/26] threads/76690threads fork hang in child for (-lc_r & -= lthr) I've just put up a patch for this at: http://www.stack.nl/~marcolz/FreeBSD/fork-malloc-thread-4.11.patch.txt Could someone still interested in libc_r have a look at it ? It seems to work for me now. Marc --wac7ysb48OaltWcw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDXMY8ezjnobFOgrERAoGyAJ0biO6LLX0xSwknxtONHhdM+qsYnACgi6zg 5toIBxH/WzRKuP9wKuwyoCE= =H3uz -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 11:37:27 2005 Return-Path: X-Original-To: freebsd-threads@FreeBSD.org Delivered-To: freebsd-threads@FreeBSD.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 9215F16A41F; Mon, 24 Oct 2005 11:37:23 +0000 (GMT) (envelope-from davidxu@freebsd.org) Message-ID: <435CC779.7030807@freebsd.org> Date: Mon, 24 Oct 2005 19:37:29 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.10) Gecko/20050806 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Marc Olzheim References: <200510241130.j9OBUIOj069740@freefall.freebsd.org> In-Reply-To: <200510241130.j9OBUIOj069740@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-threads@FreeBSD.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 11:37:27 -0000 libc_r is depreciated, I am not sure who is willing to maintain it, in fact I had voted to remove it from -CURRENT. David Xu Marc Olzheim wrote: >The following reply was made to PR threads/76690; it has been noted by GNATS. > >From: Marc Olzheim >To: bug-followup@FreeBSD.org, lse@CryptoPro.ru >Cc: Marc Olzheim , Sven Berkvens-Matthijsse >Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) >Date: Mon, 24 Oct 2005 13:25:57 +0200 > > Sven Berkvens devised a patch for libc_r which fixes this and other > locking issues in the uthread library. > > See > http://www.stack.nl/~marcolz/FreeBSD/fork-malloc-thread-4.11.patch.txt > at http://www.stack.nl/~marcolz/FreeBSD/showstoppers.html > > Marc >_______________________________________________ >freebsd-threads@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-threads >To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > > > From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 11:49:43 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 A61E616A41F; Mon, 24 Oct 2005 11:49:43 +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 63E6643D45; Mon, 24 Oct 2005 11:49:43 +0000 (GMT) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9OBnhLH072387; Mon, 24 Oct 2005 11:49:43 GMT (envelope-from davidxu@freefall.freebsd.org) Received: (from davidxu@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9OBnhVZ072383; Mon, 24 Oct 2005 11:49:43 GMT (envelope-from davidxu) Date: Mon, 24 Oct 2005 11:49:43 GMT From: David Xu Message-Id: <200510241149.j9OBnhVZ072383@freefall.freebsd.org> To: justin@arl.army.mil, davidxu@FreeBSD.org, freebsd-threads@FreeBSD.org Cc: Subject: Re: threads/76513: libpthread is not working 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, 24 Oct 2005 11:49:43 -0000 Synopsis: libpthread is not working State-Changed-From-To: open->closed State-Changed-By: davidxu State-Changed-When: Mon Oct 24 11:45:27 GMT 2005 State-Changed-Why: The user can not provide more information for a long time. http://www.freebsd.org/cgi/query-pr.cgi?pr=76513 From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 12:11: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 30D9116A41F; Mon, 24 Oct 2005 12:11:48 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5475E43D58; Mon, 24 Oct 2005 12:11:47 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by mailhost.stack.nl (Postfix) with ESMTP id 3A426A30F1; Mon, 24 Oct 2005 14:11:46 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id 19EF4644A; Mon, 24 Oct 2005 14:11:46 +0200 (CEST) Date: Mon, 24 Oct 2005 14:11:45 +0200 From: Marc Olzheim To: David Xu Message-ID: <20051024121145.GB25866@stack.nl> References: <200510241130.j9OBUIOj069740@freefall.freebsd.org> <435CC779.7030807@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Fba/0zbH8Xs+Fj9o" Content-Disposition: inline In-Reply-To: <435CC779.7030807@freebsd.org> X-Operating-System: FreeBSD hammer.stack.nl 6.0-BETA4 FreeBSD 6.0-BETA4 X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.11 Cc: Marc Olzheim , freebsd-threads@FreeBSD.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 12:11:48 -0000 --Fba/0zbH8Xs+Fj9o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2005 at 07:37:29PM +0800, David Xu wrote: > >Sven Berkvens devised a patch for libc_r which fixes this and other > >locking issues in the uthread library. > > > >See > >http://www.stack.nl/~marcolz/FreeBSD/fork-malloc-thread-4.11.patch.txt > >at http://www.stack.nl/~marcolz/FreeBSD/showstoppers.html > > libc_r is depreciated, I am not sure who is willing to maintain it, in= =20 > fact > I had voted to remove it from -CURRENT. >=20 > David Xu I'm not interested in politics, I just want this fixed. Well it is fixed in my local source tree, but since FreeBSD 4.x is still the only FreeBSD version stable enough for me (see showstoppers.html), I'm still bound to libc_r and whether you want to deprecate it in -CURRENT or not is none of my concern. Well, in fact I'm for it, since KSE is a very suitable replacement indeed. Still, *repeating* that same "deprecated!" response over and over does not help anyone on FreeBSD 4.x. So: I have a fix for the bug in 4.x. If you don't want it fixed, close the PR and don't do anything about it, otherwise, let someone who cares about it answer my mail, as I asked for in the first place: "Could someone still interested in libc_r have a look at it ?" Marc --Fba/0zbH8Xs+Fj9o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDXM+BezjnobFOgrERAivIAJ491dZ/iYasl/PpJ8hTZ5MPYG1QegCeP5oK ER5Nv9qZZr8hxNcyWXn87g0= =8nCJ -----END PGP SIGNATURE----- --Fba/0zbH8Xs+Fj9o-- From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 13:49:33 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 B338C16A41F; Mon, 24 Oct 2005 13:49:33 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09B1C43D6A; Mon, 24 Oct 2005 13:49:32 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id j9ODnVhk027165; Mon, 24 Oct 2005 09:49:31 -0400 (EDT) Date: Mon, 24 Oct 2005 09:49:31 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Marc Olzheim In-Reply-To: <20051024121145.GB25866@stack.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 13:49:33 -0000 On Mon, 24 Oct 2005, Marc Olzheim wrote: > I'm not interested in politics, I just want this fixed. Well it is fixed > in my local source tree, but since FreeBSD 4.x is still the only FreeBSD > version stable enough for me (see showstoppers.html), I'm still bound to > libc_r and whether you want to deprecate it in -CURRENT or not is none > of my concern. > > Well, in fact I'm for it, since KSE is a very suitable replacement > indeed. Still, *repeating* that same "deprecated!" response over and > over does not help anyone on FreeBSD 4.x. > > > So: I have a fix for the bug in 4.x. If you don't want it fixed, close > the PR and don't do anything about it, otherwise, let someone who cares > about it answer my mail, as I asked for in the first place: I'm not interested in maintaining libc_r, but I looked at the fix. It exports symbols into the application namespace (those without leading underscores). It also looks to me like an application bug since you can only use async signal safe functions in the child after a fork() from a threaded application and before an exec() of some sort. -- DE From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 14:00:36 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 84D6016A475; Mon, 24 Oct 2005 14:00:36 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: from serv1-mk3.ilse.net (serv1-mk3.ilse.net [62.69.160.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3E0C43D55; Mon, 24 Oct 2005 14:00:31 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: (from sven@localhost) by serv1-mk3.ilse.net (8.12.11/8.12.11) id j9OE0NcU049284; Mon, 24 Oct 2005 16:00:23 +0200 (CEST) (envelope-from sven) Date: Mon, 24 Oct 2005 16:00:23 +0200 From: Sven Berkvens-Matthijsse To: Daniel Eischen Message-ID: <20051024140023.GM22568@ilse.net> References: <20051024121145.GB25866@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-URL: http://www.ilse.nl/ User-Agent: Mutt/1.5.9i Cc: Marc Olzheim , Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 14:00:37 -0000 > I'm not interested in maintaining libc_r, but I looked at the fix. > It exports symbols into the application namespace (those without > leading underscores). It does (which I can fix if you'd like). The reason is that I only changed the names of those mutexes and spinlocks that were called "thread_lock". I'm lazy, I know :-) > It also looks to me like an application bug since you can only use > async signal safe functions in the child after a fork() from a > threaded application and before an exec() of some sort. That's correct, but the libc_r library calls free() itself to clean up after all threads other than the current one (which according to the specs don't exist in a forked program). So it's a bug in the library, I guess, because it calls non-async-signal-safe functions itself. See /usr/src/lib/libc_r/uthread/uthread_fork.c, in which the freeing happens. > -- > DE -- Sven From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 14:26:41 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 9C8E816A41F; Mon, 24 Oct 2005 14:26:41 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E9D5D43D48; Mon, 24 Oct 2005 14:26:40 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id j9OEQdP4003657; Mon, 24 Oct 2005 10:26:40 -0400 (EDT) Date: Mon, 24 Oct 2005 10:26:39 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Sven Berkvens-Matthijsse In-Reply-To: <20051024140023.GM22568@ilse.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Marc Olzheim , Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 14:26:41 -0000 On Mon, 24 Oct 2005, Sven Berkvens-Matthijsse wrote: > > I'm not interested in maintaining libc_r, but I looked at the fix. > > It exports symbols into the application namespace (those without > > leading underscores). > > It does (which I can fix if you'd like). The reason is that I only > changed the names of those mutexes and spinlocks that were called > "thread_lock". I'm lazy, I know :-) > > > It also looks to me like an application bug since you can only use > > async signal safe functions in the child after a fork() from a > > threaded application and before an exec() of some sort. > > That's correct, but the libc_r library calls free() itself to clean up > after all threads other than the current one (which according to the > specs don't exist in a forked program). So it's a bug in the library, > I guess, because it calls non-async-signal-safe functions itself. > See /usr/src/lib/libc_r/uthread/uthread_fork.c, in which the freeing > happens. WRT to malloc() and free() within libc_r, it is always single threaded from the library's perspective because no other threads can be active at the time of the fork (libc_r is all userspace threads). Probably all that needs to be done is take the malloc lock before forking and release it afterwards (like libpthread). It may even be enough just to set __isthreaded to 0 in the child after the fork() before calling any malloc()'s and free()'s so they don't try to use the lock. If __isthreaded is 0 in the child, I don't think any part of libc will attempt to use locking. If the child tries to create any threads, then bad things may happen, but that's the application's fault. -- DE From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 14:45:35 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 980FC16A41F; Mon, 24 Oct 2005 14:45:35 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: from serv1-mk3.ilse.net (serv1-mk3.ilse.net [62.69.160.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3A5643D48; Mon, 24 Oct 2005 14:45:34 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: (from sven@localhost) by serv1-mk3.ilse.net (8.12.11/8.12.11) id j9OEjTkn052060; Mon, 24 Oct 2005 16:45:29 +0200 (CEST) (envelope-from sven) Date: Mon, 24 Oct 2005 16:45:29 +0200 From: Sven Berkvens-Matthijsse To: Daniel Eischen Message-ID: <20051024144529.GP22568@ilse.net> References: <20051024140023.GM22568@ilse.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-URL: http://www.ilse.nl/ User-Agent: Mutt/1.5.9i Cc: Marc Olzheim , freebsd-threads@freebsd.org, Marc Olzheim , David Xu , Sven Berkvens-Matthijsse Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 14:45:35 -0000 > WRT to malloc() and free() within libc_r, it is always single > threaded from the library's perspective because no other threads can > be active at the time of the fork (libc_r is all userspace threads). Correct. It also takes care to disable the signal handler that may cause a thread switch in the "thread kernel". > Probably all that needs to be done is take the malloc lock before > forking and release it afterwards (like libpthread). That's possible (and indeed what I do). I decided to lock the other locks as well because programs (buggy or not) may call those library functions after the fork (in the child) as well. We can remove those locks if you wish, none of the functions involved are async-signal-safe, and programs shouldn't be using them after a fork() in a threaded program. > It may even be enough just to set __isthreaded to 0 in the child > after the fork() before calling any malloc()'s and free()'s so they > don't try to use the lock. But then the free() in the child process may be using an unstable state of the malloc system (because if you don't acquire the lock before the fork(), malloc() may be busy in the middle of the fork()). > If __isthreaded is 0 in the child, I don't think any part of libc > will attempt to use locking. That's correct. > If the child tries to create any threads, then bad things may > happen, but that's the application's fault. True. > -- > DE -- Sven From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 16:41:03 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 EC5B516A41F; Mon, 24 Oct 2005 16:41:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AD2743D45; Mon, 24 Oct 2005 16:41:03 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id j9OGf1FZ019676; Mon, 24 Oct 2005 12:41:02 -0400 (EDT) Date: Mon, 24 Oct 2005 12:41:01 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Sven Berkvens-Matthijsse In-Reply-To: <20051024144529.GP22568@ilse.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Marc Olzheim , Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2005 16:41:04 -0000 On Mon, 24 Oct 2005, Sven Berkvens-Matthijsse wrote: > > It may even be enough just to set __isthreaded to 0 in the child > > after the fork() before calling any malloc()'s and free()'s so they > > don't try to use the lock. > > But then the free() in the child process may be using an unstable > state of the malloc system (because if you don't acquire the lock > before the fork(), malloc() may be busy in the middle of the fork()). I don't think that can happen because libc_r will not switch out a thread that is in a critical region (and libc locks are critical regions) until it leaves the region. -- DE From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 16:58:54 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 5B8B416A41F; Mon, 24 Oct 2005 16:58:54 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from mailhost.stack.nl (vaak.stack.nl [131.155.140.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCBD043D46; Mon, 24 Oct 2005 16:58:53 +0000 (GMT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by mailhost.stack.nl (Postfix) with ESMTP id 63CC1A2FF2; Mon, 24 Oct 2005 18:58:50 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id 44980644A; Mon, 24 Oct 2005 18:58:50 +0200 (CEST) Date: Mon, 24 Oct 2005 18:58:50 +0200 From: Marc Olzheim To: Daniel Eischen Message-ID: <20051024165850.GA28694@stack.nl> References: <20051024144529.GP22568@ilse.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD hammer.stack.nl 6.0-BETA4 FreeBSD 6.0-BETA4 X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.11 Cc: Marc Olzheim , freebsd-threads@freebsd.org, Marc Olzheim , David Xu , Sven Berkvens-Matthijsse Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 16:58:54 -0000 --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 24, 2005 at 12:41:01PM -0400, Daniel Eischen wrote: > > But then the free() in the child process may be using an unstable > > state of the malloc system (because if you don't acquire the lock > > before the fork(), malloc() may be busy in the middle of the fork()). >=20 > I don't think that can happen because libc_r will not switch out > a thread that is in a critical region (and libc locks are critical > regions) until it leaves the region. Well, that would be the idea, but GDB traces prove otherwise... :P And that's why the patch prevents the test program in the PR from hanging. Marc --AqsLC8rIMeq19msA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDXRLKezjnobFOgrERAukqAJ4shbzfmw0/lTJVx5gFji4OuRY0eQCgwBl4 pjkKgtYjRuELVkcc4X6e/fU= =C/QT -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA-- From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 17:20:08 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 1D50D16A420 for ; Mon, 24 Oct 2005 17:20:08 +0000 (GMT) (envelope-from fbavandpouri@amcc.com) Received: from sdcexchange01.amcc.com (gatekeeper-out.amcc.com [198.137.200.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id B9E2143D45 for ; Mon, 24 Oct 2005 17:20:07 +0000 (GMT) (envelope-from fbavandpouri@amcc.com) Importance: normal Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.326 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 24 Oct 2005 10:19:39 -0700 Message-ID: <9D1E2BDCB5C57B46B56E6D80843439EBBB87ED@SDCEXCHANGE01.ad.amcc.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: threads/76690: fork hang in child for (-lc_r & -lthr) thread-index: AcXYvBWslwfT+VNUS/CihgPJdHnxGQAAtbOQ From: "Farid Bavandpouri" To: Subject: RE: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 24 Oct 2005 17:20:08 -0000 Remove/unsubscribe mmontaseri@amcc.com=20 -----Original Message----- From: owner-freebsd-threads@freebsd.org [mailto:owner-freebsd-threads@freebsd.org] On Behalf Of Marc Olzheim Sent: Monday, October 24, 2005 9:59 AM To: Daniel Eischen Cc: Marc Olzheim; freebsd-threads@freebsd.org; Marc Olzheim; David Xu; Sven Berkvens-Matthijsse Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) On Mon, Oct 24, 2005 at 12:41:01PM -0400, Daniel Eischen wrote: > > But then the free() in the child process may be using an unstable=20 > > state of the malloc system (because if you don't acquire the lock=20 > > before the fork(), malloc() may be busy in the middle of the fork()). >=20 > I don't think that can happen because libc_r will not switch out a=20 > thread that is in a critical region (and libc locks are critical > regions) until it leaves the region. Well, that would be the idea, but GDB traces prove otherwise... :P And that's why the patch prevents the test program in the PR from hanging. Marc -------------------------------------------------------- CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, = is for the sole use of the intended recipient(s) and contains = information that is confidential and proprietary to Applied Micro = Circuits Corporation or its subsidiaries. It is to be used solely for = the purpose of furthering the parties' business relationship. All = unauthorized review, use, disclosure or distribution is prohibited. If = you are not the intended recipient, please contact the sender by reply = e-mail and destroy all copies of the original message. From owner-freebsd-threads@FreeBSD.ORG Mon Oct 24 17:25:46 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 09CBD16A41F; Mon, 24 Oct 2005 17:25:46 +0000 (GMT) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [207.200.4.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE9A343D45; Mon, 24 Oct 2005 17:25:45 +0000 (GMT) (envelope-from linimon@lonesome.com) Received: by mail.soaustin.net (Postfix, from userid 502) id A63763040; Mon, 24 Oct 2005 12:25:44 -0500 (CDT) Date: Mon, 24 Oct 2005 12:25:44 -0500 To: Marc Olzheim Message-ID: <20051024172544.GB5156@soaustin.net> References: <200510241102.j9OB2JVn062139@freefall.freebsd.org> <20051024113212.GA25866@stack.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051024113212.GA25866@stack.nl> User-Agent: Mutt/1.5.9i From: linimon@lonesome.com (Mark Linimon) Cc: FreeBSD bugmaster , freebsd-threads@FreeBSD.org Subject: Re: 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, 24 Oct 2005 17:25:46 -0000 On Mon, Oct 24, 2005 at 01:32:12PM +0200, Marc Olzheim wrote: > I've just put up a patch for this at: > http://www.stack.nl/~marcolz/FreeBSD/fork-malloc-thread-4.11.patch.txt Please send the URL along as a followup to the initial PR (see the individual page at http://www.freebsd.org/cgi/query-pr.cgi and then use the link at the bottom of the page for reference). Otherwise things just tend to get lost on the mailing lists. Thanks. mcl From owner-freebsd-threads@FreeBSD.ORG Tue Oct 25 07:16:26 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 4780D16A41F; Tue, 25 Oct 2005 07:16:26 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: from serv1-mk3.ilse.net (serv1-mk3.ilse.net [62.69.160.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id A834343D46; Tue, 25 Oct 2005 07:16:25 +0000 (GMT) (envelope-from sven@serv1-mk3.ilse.net) Received: (from sven@localhost) by serv1-mk3.ilse.net (8.12.11/8.12.11) id j9P7GJfh018622; Tue, 25 Oct 2005 09:16:19 +0200 (CEST) (envelope-from sven) Date: Tue, 25 Oct 2005 09:16:19 +0200 From: Sven Berkvens-Matthijsse To: Daniel Eischen Message-ID: <20051025071619.GS22568@ilse.net> References: <20051024144529.GP22568@ilse.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-URL: http://www.ilse.nl/ User-Agent: Mutt/1.5.9i Cc: Marc Olzheim , freebsd-threads@freebsd.org, Marc Olzheim , David Xu , Sven Berkvens-Matthijsse Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) 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, 25 Oct 2005 07:16:26 -0000 > > But then the free() in the child process may be using an unstable > > state of the malloc system (because if you don't acquire the lock > > before the fork(), malloc() may be busy in the middle of the > > fork()). > > I don't think that can happen because libc_r will not switch out a > thread that is in a critical region (and libc locks are critical > regions) until it leaves the region. What code leads you to that conclusion? All the malloc functions simply lock a spinlock, do their work, and then unlock the spinlock. If the code gets interrupted by a timer signal and the thread scheduler schedules a thread that calls fork(), the malloc system will be in an unstable state in the child process, and when the thread library calls free() itself, the spinlock will already be locked, causing free() to hang. If you decide to set __isthreaded to 0, free() will be manipulating data that was in the process of being manipulated by the parent process (and is now in a potentially unusable state). > -- > DE -- Sven From owner-freebsd-threads@FreeBSD.ORG Tue Oct 25 12:52:18 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 2F89D16A437; Tue, 25 Oct 2005 12:52:18 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0E2C43D48; Tue, 25 Oct 2005 12:52:17 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.ntplx.net (8.13.5/8.13.5/NETPLEX) with ESMTP id j9PCqGYL013213; Tue, 25 Oct 2005 08:52:16 -0400 (EDT) Date: Tue, 25 Oct 2005 08:52:16 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Sven Berkvens-Matthijsse In-Reply-To: <20051025071619.GS22568@ilse.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) Cc: Marc Olzheim , Marc Olzheim , David Xu , freebsd-threads@freebsd.org Subject: Re: threads/76690: fork hang in child for (-lc_r & -lthr) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 12:52:18 -0000 On Tue, 25 Oct 2005, Sven Berkvens-Matthijsse wrote: > > > But then the free() in the child process may be using an unstable > > > state of the malloc system (because if you don't acquire the lock > > > before the fork(), malloc() may be busy in the middle of the > > > fork()). > > > > I don't think that can happen because libc_r will not switch out a > > thread that is in a critical region (and libc locks are critical > > regions) until it leaves the region. > > What code leads you to that conclusion? All the malloc functions I had thought that spinlocks and internal mutexes (_pthread_mutex_lock() called from libc) would mark critical regions. That was the intent, but it doesn't seem to be implemented that way in libc_r. It _is_ implemented that way in libpthread. -- DE From owner-freebsd-threads@FreeBSD.ORG Sat Oct 29 04:10:22 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 4978B16A41F for ; Sat, 29 Oct 2005 04:10:22 +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 013FE43D45 for ; Sat, 29 Oct 2005 04:10:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9T4ALVZ057254 for ; Sat, 29 Oct 2005 04:10:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j9T4ALST057250; Sat, 29 Oct 2005 04:10:21 GMT (envelope-from gnats) Date: Sat, 29 Oct 2005 04:10:21 GMT Message-Id: <200510290410.j9T4ALST057250@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: David Xu Cc: Subject: Re: threads/86004: libthr broken on amd64 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: Sat, 29 Oct 2005 04:10:22 -0000 The following reply was made to PR threads/86004; it has been noted by GNATS. From: David Xu To: bug-followup@FreeBSD.org, justin@arl.army.mil Cc: Subject: Re: threads/86004: libthr broken on amd64 Date: Sat, 29 Oct 2005 12:07:02 +0800 I have no plan to MFC new libthr to RELENG-5, there is too much difference, I am going to close the PR. David Xu