From owner-freebsd-threads@FreeBSD.ORG Sun Nov 9 09:31:32 2003 Return-Path: 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 5F48D16A4CE for ; Sun, 9 Nov 2003 09:31:32 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9ABE843FEC for ; Sun, 9 Nov 2003 09:31:31 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hA9HVT1G014051; Sun, 9 Nov 2003 12:31:29 -0500 (EST) Date: Sun, 9 Nov 2003 12:31:29 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: giffunip@asme.org In-Reply-To: <20031108165012.19170.qmail@web13402.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Scheduler Activations on Linux X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Nov 2003 17:31:32 -0000 On Sat, 8 Nov 2003, Pedro F. Giffuni wrote: > Hi; > > I was navigating and I found that some Linux guys discovered that they want > (but haven't yet implemented) Scheduler Activations: > > http://people.redhat.com/drepper/glibcthreads.html This was their original design intent, but the changes to the Linux kernel necessary to support this were not deemed acceptable. There's more info on their current implementation at: http://people.redhat.com/drepper/nptl-design.pdf nptl is a 1:1 implementation with most of the work performed by the kernel. > It's nice to see that thanks to heroic efforts of the KSE guys we are so far > ahead! > > It might be interesting to run the posix test suite with our current threads: > > http://posixtest.sourceforge.net/ Someone make a port! -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sun Nov 9 22:59:20 2003 Return-Path: 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 B591D16A4CE for ; Sun, 9 Nov 2003 22:59:20 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ACA643F75 for ; Sun, 9 Nov 2003 22:59:19 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])hAA71BD7065747 for ; Mon, 10 Nov 2003 02:01:12 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)hAA71BR4065746 for freebsd-threads@freebsd.org; Mon, 10 Nov 2003 02:01:11 -0500 (EST) (envelope-from rodrigc) Date: Mon, 10 Nov 2003 02:01:11 -0500 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20031110070111.GA65707@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 06:59:20 -0000 Hi, I tried to submit a patch to teh Apache Portable Runtime people to fix up the threads support in apr. Now, they are complaining about perceived bugs in the FreeBSD threads code. Can someone with more knowledge about this stuff comment on these perceptions? -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org ----- Forwarded message from Justin Erenkrantz ----- X-Originating-IP: [216.220.40.247] Date: Sun, 09 Nov 2003 22:39:05 -0800 From: Justin Erenkrantz To: Craig Rodrigues , dev@apr.apache.org Subject: Re: [PATCH] FreeBSD threads configure support In-Reply-To: <20031109234157.GA58055@crodrigues.org> X-Mailer: Mulberry/3.1.0 (Mac OS X) X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.70-cvs X-Spam-Checker-Version: SpamAssassin 2.70-cvs (1.217-2003-10-04-exp) on scotch.ics.uci.edu --On Sunday, November 9, 2003 6:41 PM -0500 Craig Rodrigues wrote: >I am the maintainer of the FreeBSD port of apr. > >Here is a patch that updates the configury checks for >pthread flags in FreeBSD. Have the threading/cond-var/socket race conditions been fixed in FreeBSD? That is, does worker MPM from httpd-2.x function properly with multiple clients and multiple processes? We've seen that the pthread condition variables did not function properly when threading was enabled - this is why we had APR_SETIFNULL(enable_threads, [no]) as we were not confident in FreeBSD's reliability with threads. Please see STATUS entries in httpd-2.x regarding this. Until that is confirmed, I'd highly recommend *not* enabling threads in FreeBSD - last we heard was that FreeBSD 4.x and 5.x were still broken. -- justin ----- End forwarded message ----- From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 02:01:09 2003 Return-Path: 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 37BD416A4CE; Mon, 10 Nov 2003 02:01:09 -0800 (PST) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1802043FE0; Mon, 10 Nov 2003 02:01:07 -0800 (PST) (envelope-from phantom@FreeBSD.org.ua) Received: (from phantom@localhost) by phantom.cris.net (8.12.6/8.12.6) id hAAAAT0b046354; Mon, 10 Nov 2003 12:10:29 +0200 (EET) (envelope-from phantom) Date: Mon, 10 Nov 2003 12:10:29 +0200 From: Alexey Zelkin To: standards@freebsd.org, threads@freebsd.org Message-ID: <20031110121029.A46284@phantom.cris.net> References: <200311100949.hAA9ncYS099464@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200311100949.hAA9ncYS099464@repoman.freebsd.org>; from phantom@FreeBSD.org on Mon, Nov 10, 2003 at 01:49:38AM -0800 X-Operating-System: FreeBSD 4.7-STABLE i386 Subject: Re: cvs commit: ports/misc/posixtestsuite Makefile distinfo pkg-descr ports/misc/posixtestsuite/files patch-gentests.pl patch-locate-test X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 10:01:09 -0000 JFYI. Comments and suggestions on port logic improvement are welcome! On Mon, Nov 10, 2003 at 01:49:38AM -0800, Alexey Zelkin wrote: > phantom 2003/11/10 01:49:38 PST > > FreeBSD ports repository > > Added files: > misc/posixtestsuite Makefile distinfo pkg-descr > misc/posixtestsuite/files patch-gentests.pl patch-locate-test > Log: > Add pseudo-port of POSIX Test Suite (http://posixtest.sourceforge.net). > It does not builds/installs anything, and should be used as wrapper to > run testsuite on FreeBSD. See 'make help' output for usage. > > Revision Changes Path > 1.1 +101 -0 ports/misc/posixtestsuite/Makefile (new) > 1.1 +1 -0 ports/misc/posixtestsuite/distinfo (new) > 1.1 +11 -0 ports/misc/posixtestsuite/files/patch-gentests.pl (new) > 1.1 +27 -0 ports/misc/posixtestsuite/files/patch-locate-test (new) > 1.1 +6 -0 ports/misc/posixtestsuite/pkg-descr (new) From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 05:56:49 2003 Return-Path: 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 D1D6516A4CF for ; Mon, 10 Nov 2003 05:56:49 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0637443F85 for ; Mon, 10 Nov 2003 05:56:49 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAADuf1G008323; Mon, 10 Nov 2003 08:56:41 -0500 (EST) Date: Mon, 10 Nov 2003 08:56:41 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20031110070111.GA65707@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 13:56:49 -0000 On Mon, 10 Nov 2003, Craig Rodrigues wrote: > Hi, > > I tried to submit a patch to teh Apache Portable Runtime > people to fix up the threads support in apr. > > Now, they are complaining about perceived bugs > in the FreeBSD threads code. > > Can someone with more knowledge about this stuff > comment on these perceptions? There's not enough info in STATUS to go on, and in any case it is written against libc_r. Tell them about libpthread^Wlibkse. David Xu has tested apache with threading enabled. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 06:00:48 2003 Return-Path: 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 E9F7E16A4CE for ; Mon, 10 Nov 2003 06:00:48 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id B946D43FAF for ; Mon, 10 Nov 2003 06:00:47 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])hAAE2eD7067151; Mon, 10 Nov 2003 09:02:40 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)hAAE2dUH067150; Mon, 10 Nov 2003 09:02:39 -0500 (EST) (envelope-from rodrigc) Date: Mon, 10 Nov 2003 09:02:39 -0500 From: Craig Rodrigues To: Daniel Eischen Message-ID: <20031110140239.GA67109@crodrigues.org> References: <20031110070111.GA65707@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 14:00:49 -0000 On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > There's not enough info in STATUS to go on, and in any case it > is written against libc_r. Tell them about libpthread^Wlibkse. > David Xu has tested apache with threading enabled. Well, Apache guys complained, because I submitted the following patch that: (1) took out the configure stuff which disabled threads in apr for FreeBSD (2) put in "-pthread" link flag for -STABLE, and "-lc_r" for -CURRENT My patch was based on what is in /usr/ports/Mk/bsd.port.mk. I submitted this patch to our own devel/apr port, since without it, dependent ports like subversion are breaking. I think they don't want to enable threads by default, because of the threading situation on -STABLE. Index: apr_hints.m4 =================================================================== RCS file: /home/cvspublic/apr/build/apr_hints.m4,v retrieving revision 1.53 diff -u -r1.53 apr_hints.m4 --- apr_hints.m4 2 Jun 2003 15:52:28 -0000 1.53 +++ apr_hints.m4 9 Nov 2003 23:27:11 -0000 @@ -130,14 +130,15 @@ APR_ADDTO(CPPFLAGS, [-DNETBSD]) ;; *-freebsd*) - case $host in - *freebsd[2345]*) - APR_ADDTO(CFLAGS, [-funsigned-char]) - ;; - esac - APR_SETIFNULL(enable_threads, [no]) + os_version=`sysctl -n kern.osreldate` + APR_ADDTO(CFLAGS, [-funsigned-char]) APR_SETIFNULL(apr_lock_method, [USE_FLOCK_SERIALIZE]) - APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE]) + if test $os_version -lt "500016"; then + ac_cv_pthreads_cflags="-D_THREAD_SAFE -D_REENTRANT" + APR_ADDTO(LIBS, [-pthread]) + else + ac_cv_pthreads_lib="c_r" + fi ;; *-next-nextstep*) APR_SETIFNULL(CFLAGS, [-O]) -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 09:50:45 2003 Return-Path: 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 EC20416A4CE for ; Mon, 10 Nov 2003 09:50:45 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1D1243F75 for ; Mon, 10 Nov 2003 09:50:42 -0800 (PST) (envelope-from gofdt-freebsd-threads@m.gmane.org) Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AJGBV-0006sF-00 for ; Mon, 10 Nov 2003 18:50:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-threads@freebsd.org Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AJG5C-0006n6-00 for ; Mon, 10 Nov 2003 18:44:10 +0100 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1AJG5C-0003L2-00 for ; Mon, 10 Nov 2003 18:44:10 +0100 From: "William Henny" Date: Mon, 10 Nov 2003 17:44:10 +0000 (UTC) Lines: 12 Message-ID: References: <20031108165012.19170.qmail@web13402.mail.yahoo.com> X-Complaints-To: usenet@sea.gmane.org User-Agent: slrn/0.9.7.4 (NetBSD) Sender: news Subject: Re: Scheduler Activations on Linux X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 17:50:46 -0000 On 2003-11-08, Pedro F. Giffuni wrote: > Hi; > > I was navigating and I found that some Linux guys discovered that they want > (but haven't yet implemented) Scheduler Activations: > > http://people.redhat.com/drepper/glibcthreads.html > > It's nice to see that thanks to heroic efforts of the KSE guys we are so far > ahead! Uhm, try reading the very top of that page. From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 11:01:49 2003 Return-Path: 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 147C516A4CE for ; Mon, 10 Nov 2003 11:01:49 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AA1243FCB for ; Mon, 10 Nov 2003 11:01:48 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id hAAJ1lFY050608 for ; Mon, 10 Nov 2003 11:01:47 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id hAAJ1lWM050602 for freebsd-threads@freebsd.org; Mon, 10 Nov 2003 11:01:47 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 10 Nov 2003 11:01:47 -0800 (PST) Message-Id: <200311101901.hAAJ1lWM050602@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 Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Nov 2003 19:01:49 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything o [2002/01/16] kern/33951 threads pthread_cancel is ignored 2 problems 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] misc/20861 threads libc_r does not honor socket timeouts o [2001/01/19] bin/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] bin/24632 threads libc_r delicate deviation from libc in ha o [2001/01/25] misc/24641 threads pthread_rwlock_rdlock can deadlock o [2001/04/02] bin/26307 threads libc_r aborts when using the KDE media pl o [2001/10/31] bin/31661 threads pthread_kill signal handler doesn't get s o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] i386/34536 threads accept() blocks other threads o [2002/03/07] bin/35622 threads sigaltstack is missing in libc_r o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] bin/39922 threads [PATCH?] Threaded applications executed w o [2002/08/04] misc/41331 threads Pthread library open sets O_NONBLOCK flag o [2002/10/10] kern/43887 threads abnormal CPU useage when use pthread_mute o [2003/03/02] bin/48856 threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] bin/49087 threads Signals lost in programs linked with libc a [2003/04/08] bin/50733 threads buildworld won't build, because of linkin o [2003/05/07] bin/51949 threads thread in accept cannot be cancelled o [2003/05/30] kern/52817 threads top(1) shows garbage for threaded process 19 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/25] misc/18824 threads gethostbyname is not thread safe o [2000/10/21] misc/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] bin/30464 threads pthread mutex attributes -- pshared o [2002/05/02] bin/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwri o [2002/07/16] misc/40671 threads pthread_cancel doesn't remove thread from 5 problems total. From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 16:56:35 2003 Return-Path: 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 9481116A4CE for ; Mon, 10 Nov 2003 16:56:35 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1A38F43FAF for ; Mon, 10 Nov 2003 16:56:34 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])hAB0wRD7098299; Mon, 10 Nov 2003 19:58:27 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)hAB0wRSl098298; Mon, 10 Nov 2003 19:58:27 -0500 (EST) (envelope-from rodrigc) Date: Mon, 10 Nov 2003 19:58:26 -0500 From: Craig Rodrigues To: Daniel Eischen Message-ID: <20031111005826.GA98288@crodrigues.org> References: <20031110070111.GA65707@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 00:56:35 -0000 On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > There's not enough info in STATUS to go on, and in any case it > is written against libc_r. Tell them about libpthread^Wlibkse. > David Xu has tested apache with threading enabled. Hi, Here is more feedback from the Apache people. It might be worth taking their experiences into account... -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org ----- Forwarded message from Justin Erenkrantz ----- X-Originating-IP: [216.220.40.247] Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Delivered-To: mailing list dev@apr.apache.org Date: Mon, 10 Nov 2003 16:51:24 -0800 From: Justin Erenkrantz To: Craig Rodrigues Cc: dev@apr.apache.org Subject: Re: [PATCH] FreeBSD threads configure support --On Monday, November 10, 2003 19:40:31 -0500 Craig Rodrigues wrote: >On Sun, Nov 09, 2003 at 10:39:05PM -0800, Justin Erenkrantz wrote: >>FreeBSD's reliability with threads. Please see STATUS entries in >>httpd-2.x regarding this. > >There is not enough information in STATUS to go on. >Do you have a testcase, or pointers to further information? The mailing list references in httpd's STATUS might be of some help. Roughly, the test case is fairly simple and is as follows: - Build threaded APR (--enable-threads) and httpd with worker MPM (--with-mpm=worker) - Start httpd with worker MPM (default config okay - 2+ processes required!) - Issue an HTTP request against the httpd (i.e. apachectl status) - *no response yet* - Issue another connection and request against the same httpd (i.e. another window w/apachectl status or whatnot) - *Response from 1st request is returned* - *No response to 2nd request yet* - Issue another connection - *Response from 2nd* - *No response from 3rd until 4th request, etc, etc, etc* This worker MPM code works correctly on Linux, Solaris, AIX, Darwin, etc, so we believe our pthread API usage in APR is correct. But, perhaps someone familiar with FreeBSD can shed some more light on this. (If you could pass along to David, that might be helpful!) We know 4.x still has this problem, and we believe 5.0 had it (at least the original 5.0 did), too. But, I don't have access to a FreeBSD 5.x box to test this. HTH. -- justin ----- End forwarded message ----- From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 17:12:58 2003 Return-Path: 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 1827116A4CE for ; Mon, 10 Nov 2003 17:12:58 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-167-164-97-218.anlai.com [218.97.164.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3D6243FE0 for ; Mon, 10 Nov 2003 17:12:49 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (ip-240-1-168-192.rev.dyxnet.com [192.168.1.240]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id TZ2GZ13D; Tue, 11 Nov 2003 08:52:12 +0800 Message-ID: <3FB038D7.1070804@viatech.com.cn> Date: Tue, 11 Nov 2003 09:18:15 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <20031110070111.GA65707@crodrigues.org> <20031111005826.GA98288@crodrigues.org> In-Reply-To: <20031111005826.GA98288@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 01:12:58 -0000 Craig Rodrigues wrote: >On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > > >>There's not enough info in STATUS to go on, and in any case it >>is written against libc_r. Tell them about libpthread^Wlibkse. >>David Xu has tested apache with threading enabled. >> >> > > >Hi, > >Here is more feedback from the Apache >people. It might be worth >taking their experiences into account... > > > > This is helpful, I will test it on my SMP machine with libkse. Thanks! David Xu From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 17:15:12 2003 Return-Path: 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 D387D16A4CE for ; Mon, 10 Nov 2003 17:15:12 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id E57D94400B for ; Mon, 10 Nov 2003 17:15:11 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAB1F81G018303; Mon, 10 Nov 2003 20:15:08 -0500 (EST) Date: Mon, 10 Nov 2003 20:15:08 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20031111005826.GA98288@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 01:15:12 -0000 On Mon, 10 Nov 2003, Craig Rodrigues wrote: > On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > > There's not enough info in STATUS to go on, and in any case it > > is written against libc_r. Tell them about libpthread^Wlibkse. > > David Xu has tested apache with threading enabled. > > > Hi, > > Here is more feedback from the Apache > people. It might be worth > taking their experiences into account... Have you tried this with libkse? I don't care about libc_r; it's being deprecated. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Mon Nov 10 22:32:32 2003 Return-Path: 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 DB5D516A4CF for ; Mon, 10 Nov 2003 22:32:32 -0800 (PST) Received: from postoffice.e-easy.com.au (eth0.lnk.e-easy.com.au [203.31.73.253]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45FF043FE9 for ; Mon, 10 Nov 2003 22:32:29 -0800 (PST) (envelope-from chris@e-easy.com.au) Received: from e-easy.com.au (eet03s01.aims.private [192.168.10.3]) by postoffice.e-easy.com.au with ESMTP id hAB6W9b7033319 for ; Tue, 11 Nov 2003 17:32:10 +1100 (EST) (envelope-from chris@e-easy.com.au) Received: from eet03s01 by e-easy.com.au (e-easy.com.au) (MDaemon.PRO.v7.0.0g.R) with ESMTP id md50000013676.msg for ; Tue, 11 Nov 2003 17:23:35 +1100 From: "Chris Knight" To: "'Daniel Eischen'" Date: Tue, 11 Nov 2003 17:23:31 +1100 Organization: E-Easy Message-ID: <00f801c3a81c$540266a0$030aa8c0@corp.eeasy.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Importance: Normal X-Spam-Processed: e-easy.com.au, Tue, 11 Nov 2003 17:23:35 +1100 (not processed: spam filter disabled) X-Return-Path: chris@e-easy.com.au X-MDaemon-Deliver-To: freebsd-threads@freebsd.org X-Virus-Scanned: by amavisd-milter (http://amavis.org/) X-Spam-Status: No, hits=-4.7 required=4.5 tests=AWL,BAYES_00 autolearn=ham version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on firewall.aims.private cc: freebsd-threads@freebsd.org Subject: RE: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 06:32:33 -0000 Howdy, > -----Original Message----- > From: Daniel Eischen [mailto:eischen@vigrid.com] > Sent: Tuesday, 11 November 2003 12:15 > To: freebsd-threads@freebsd.org > Subject: Re: Comments about FreeBSD threading from Apache people > > > On Mon, 10 Nov 2003, Craig Rodrigues wrote: > > > On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > > > There's not enough info in STATUS to go on, and in any case it is > > > written against libc_r. Tell them about > libpthread^Wlibkse. David > > > Xu has tested apache with threading enabled. > > > > > > Hi, > > > > Here is more feedback from the Apache > > people. It might be worth > > taking their experiences into account... > > Have you tried this with libkse? > > I don't care about libc_r; it's being deprecated. > Except you need a production-ready release before you can deprecate it. Which means a working threads-capable version of Apache on FreeBSD is still 9+ months away :-( It doesn't help when the re team suggest via the Announcement e-mails that the current production-ready release is still 4.8... If you want libc_r deprecated sooner, get /etc/libmap.conf installed, defaulting libc_r to libkse. Most people (including me), just use the defaults. I've just found libmap.conf by chance, while trying to resolve a build issue on a program that uses pthread_spinlock_* and POSIX semaphore calls. You'd have more testers that way too. > -- > Dan Eischen > Regards, Chris Knight Systems Administrator E-Easy Tel: +61 3 6334 9995 Fax: +61 3 6331 7032 Mob: +61 419 528 795 Web: http://www.e-easy.com.au From owner-freebsd-threads@FreeBSD.ORG Tue Nov 11 03:30:38 2003 Return-Path: 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 5776D16A4CE for ; Tue, 11 Nov 2003 03:30:38 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B11143FE1 for ; Tue, 11 Nov 2003 03:30:37 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hABBUO1G005654; Tue, 11 Nov 2003 06:30:25 -0500 (EST) Date: Tue, 11 Nov 2003 06:30:24 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Chris Knight In-Reply-To: <00f801c3a81c$540266a0$030aa8c0@corp.eeasy.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: RE: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 11:30:38 -0000 On Tue, 11 Nov 2003, Chris Knight wrote: > Howdy, > > > -----Original Message----- > > From: Daniel Eischen [mailto:eischen@vigrid.com] > > Sent: Tuesday, 11 November 2003 12:15 > > To: freebsd-threads@freebsd.org > > Subject: Re: Comments about FreeBSD threading from Apache people > > > > > > On Mon, 10 Nov 2003, Craig Rodrigues wrote: > > > > > On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > > > > There's not enough info in STATUS to go on, and in any case it is > > > > written against libc_r. Tell them about > > libpthread^Wlibkse. David > > > > Xu has tested apache with threading enabled. > > > > > > > > > Hi, > > > > > > Here is more feedback from the Apache > > > people. It might be worth > > > taking their experiences into account... > > > > Have you tried this with libkse? > > > > I don't care about libc_r; it's being deprecated. ^^^^^ It isn't gone yet, and will be around through the life of 5.x I'd guess. > Except you need a production-ready release before you can deprecate it. > Which means a working threads-capable version of Apache on FreeBSD is still > 9+ months away :-( It doesn't help when the re team suggest via the > Announcement e-mails that the current production-ready release is still > 4.8... > If you want libc_r deprecated sooner, get /etc/libmap.conf installed, > defaulting libc_r to libkse. Most people (including me), just use the > defaults. I've just found libmap.conf by chance, while trying to resolve a > build issue on a program that uses pthread_spinlock_* and POSIX semaphore > calls. You'd have more testers that way too. Something like this is under consideration for 5.2. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Nov 11 08:09:18 2003 Return-Path: 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 9A87416A4CE for ; Tue, 11 Nov 2003 08:09:18 -0800 (PST) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD0B943FBD for ; Tue, 11 Nov 2003 08:09:17 -0800 (PST) (envelope-from mark@markdnet.demon.co.uk) Received: from lizacnet.demon.co.uk ([80.177.208.105]) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 1AJb4u-0000sP-0Z for freebsd-threads@freebsd.org; Tue, 11 Nov 2003 16:09:16 +0000 From: Mark Dixon To: freebsd-threads@freebsd.org Date: Tue, 11 Nov 2003 16:09:00 +0000 User-Agent: KMail/1.5.4 References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Description: clearsigned data Content-Disposition: inline Message-Id: <200311111609.14418.mark@markdnet.demon.co.uk> Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 16:09:18 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 11 Nov 2003 11:30, Daniel Eischen wrote: > > If you want libc_r deprecated sooner, get /etc/libmap.conf installed, > > defaulting libc_r to libkse. Most people (including me), just use the > > defaults. I've just found libmap.conf by chance, while trying to resolve > > a build issue on a program that uses pthread_spinlock_* and POSIX > > semaphore calls. You'd have more testers that way too. > > Something like this is under consideration for 5.2. I'm an occasional reader of this list, so I may not know what I'm talking about, but wouldn't this break anything that tries to used threads and Nvidia's OpenGL together? As KDE does this by default (when using x11/ nvidia-driver), wouldn't this break a lot of people's systems (I'm pretty sure it would break mine)? Mark -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (FreeBSD) iD8DBQE/sQmlLqgJ90OcaiARAgpzAJ9ElumpN6HO4g4/f9yBKKggswFhHQCg2llX MMjJoGB0vUtAZsHKQmE8u4k= =UtMK -----END PGP SIGNATURE----- From owner-freebsd-threads@FreeBSD.ORG Tue Nov 11 09:28:00 2003 Return-Path: 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 AB6BA16A4CE for ; Tue, 11 Nov 2003 09:28:00 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE01843F93 for ; Tue, 11 Nov 2003 09:27:59 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hABHRx1G028273; Tue, 11 Nov 2003 12:27:59 -0500 (EST) Date: Tue, 11 Nov 2003 12:27:59 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Mark Dixon In-Reply-To: <200311111609.14418.mark@markdnet.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Nov 2003 17:28:00 -0000 On Tue, 11 Nov 2003, Mark Dixon wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tuesday 11 Nov 2003 11:30, Daniel Eischen wrote: > > > If you want libc_r deprecated sooner, get /etc/libmap.conf installed, > > > defaulting libc_r to libkse. Most people (including me), just use the > > > defaults. I've just found libmap.conf by chance, while trying to resolve > > > a build issue on a program that uses pthread_spinlock_* and POSIX > > > semaphore calls. You'd have more testers that way too. > > > > Something like this is under consideration for 5.2. > > I'm an occasional reader of this list, so I may not know what I'm talking > about, but wouldn't this break anything that tries to used threads and > Nvidia's OpenGL together? As KDE does this by default (when using x11/ > nvidia-driver), wouldn't this break a lot of people's systems (I'm pretty > sure it would break mine)? Yes, it'll break. You can use a libmap.conf if you want to override the threads library with libc_r. But Nvidia will have to rebuild their drivers/libraries to use dynamic LDT allocation if they are to be used for future FreeBSD releases. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Tue Nov 11 18:28:35 2003 Return-Path: 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 A623A16A4CE for ; Tue, 11 Nov 2003 18:28:35 -0800 (PST) Received: from exchhz01.viatech.com.cn (ip-167-164-97-218.anlai.com [218.97.164.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5129F43FBF for ; Tue, 11 Nov 2003 18:28:28 -0800 (PST) (envelope-from davidxu@viatech.com.cn) Received: from viatech.com.cn (ip-240-1-168-192.rev.dyxnet.com [192.168.1.240]) by exchhz01.viatech.com.cn with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id TZ2GZJPG; Wed, 12 Nov 2003 10:08:02 +0800 Message-ID: <3FB19C12.50608@viatech.com.cn> Date: Wed, 12 Nov 2003 10:33:54 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030723 Thunderbird/0.1 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Craig Rodrigues References: <20031110070111.GA65707@crodrigues.org> <20031111005826.GA98288@crodrigues.org> In-Reply-To: <20031111005826.GA98288@crodrigues.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Nov 2003 02:28:35 -0000 Craig Rodrigues wrote: >On Mon, Nov 10, 2003 at 08:56:41AM -0500, Daniel Eischen wrote: > > >>There's not enough info in STATUS to go on, and in any case it >>is written against libc_r. Tell them about libpthread^Wlibkse. >>David Xu has tested apache with threading enabled. >> >> > > >Hi, > >Here is more feedback from the Apache >people. It might be worth >taking their experiences into account... > > > > I have tried, but can not reproduce the problem, I am using likse, the test was done on SMP machine. David Xu From owner-freebsd-threads@FreeBSD.ORG Wed Nov 12 20:49:38 2003 Return-Path: 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 3409216A4CE for ; Wed, 12 Nov 2003 20:49:38 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0427543FA3 for ; Wed, 12 Nov 2003 20:49:37 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])hAD4pWXP005591; Wed, 12 Nov 2003 23:51:33 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)hAD4pWHN005590; Wed, 12 Nov 2003 23:51:32 -0500 (EST) (envelope-from rodrigc) Date: Wed, 12 Nov 2003 23:51:31 -0500 From: Craig Rodrigues To: Daniel Eischen Message-ID: <20031113045131.GA5544@crodrigues.org> References: <20031110070111.GA65707@crodrigues.org> <20031111005826.GA98288@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031111005826.GA98288@crodrigues.org> User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 04:49:38 -0000 Hi, I compiled httpd-2.0.47 from apache.org, and compiled the latest APR from ports with threading (-lc_r) enabled. This was with a -CURRENT, cvsup'd from last week. I was able to reproduce the behavior that Justin Erenkrantz outlined with libc_r. I then added the following to /etc/libmap.conf: [/opt/home/rodrigc/httpd/bin/httpd] libc_r.so libkse.so libc_r.so.5 libkse.so.1 At this point, Apache worked fine. So, I can understand from the Apache point of view why they don't want to enable threads by default in APR. This whole discussion came about because I maintain the APR port for FreeBSD, and recently tried to push some threading configury fixes upstream back to the APR maintainers, and they balked. I'd still like to push my APR changes upstream to them, but maybe with threads disabled by default on FreeBSD, instead of enabled by default as I had in my patch. How close are we to having libkse as the default threading library on FreeBSD? The ports maintainers define PTHREAD_LIBS to be -pthread on older FreeBSD's, and -lc_r on newer ( > 500016) and do not tell people to explicitly link to -lkse. Thanks. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org On Mon, Nov 10, 2003 at 07:58:26PM -0500, Craig Rodrigues wrote: > ----- Forwarded message from Justin Erenkrantz ----- > X-Originating-IP: [216.220.40.247] > Mailing-List: contact dev-help@apr.apache.org; run by ezmlm > Delivered-To: mailing list dev@apr.apache.org > Date: Mon, 10 Nov 2003 16:51:24 -0800 > From: Justin Erenkrantz > To: Craig Rodrigues > Cc: dev@apr.apache.org > Subject: Re: [PATCH] FreeBSD threads configure support > > Roughly, the test case is fairly simple and is as follows: > > - Build threaded APR (--enable-threads) and httpd with worker MPM > (--with-mpm=worker) > - Start httpd with worker MPM (default config okay - 2+ processes required!) > - Issue an HTTP request against the httpd (i.e. apachectl status) > - *no response yet* > - Issue another connection and request against the same httpd (i.e. another > window w/apachectl status or whatnot) > - *Response from 1st request is returned* > - *No response to 2nd request yet* > - Issue another connection > - *Response from 2nd* > - *No response from 3rd until 4th request, etc, etc, etc* > > This worker MPM code works correctly on Linux, Solaris, AIX, Darwin, etc, > so we believe our pthread API usage in APR is correct. But, perhaps > someone familiar with FreeBSD can shed some more light on this. (If you > could pass along to David, that might be helpful!) > > We know 4.x still has this problem, and we believe 5.0 had it (at least the > original 5.0 did), too. But, I don't have access to a FreeBSD 5.x box to > test this. > > HTH. -- justin > > ----- End forwarded message ----- > _______________________________________________ > 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 Wed Nov 12 22:51:07 2003 Return-Path: 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 9C05916A4CF for ; Wed, 12 Nov 2003 22:51:07 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA78D43FB1 for ; Wed, 12 Nov 2003 22:51:04 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAD6p01G003215; Thu, 13 Nov 2003 01:51:00 -0500 (EST) Date: Thu, 13 Nov 2003 01:51:00 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20031113045131.GA5544@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 06:51:07 -0000 On Wed, 12 Nov 2003, Craig Rodrigues wrote: > Hi, > > I compiled httpd-2.0.47 from apache.org, and compiled > the latest APR from ports with threading (-lc_r) enabled. > This was with a -CURRENT, cvsup'd from last week. > > I was able to reproduce the behavior that Justin > Erenkrantz outlined with libc_r. > I then added the following to /etc/libmap.conf: > > [/opt/home/rodrigc/httpd/bin/httpd] > libc_r.so libkse.so > libc_r.so.5 libkse.so.1 > > At this point, Apache worked fine. > > So, I can understand from the Apache point of view > why they don't want to enable threads by default > in APR. This whole discussion came about because > I maintain the APR port for FreeBSD, and recently > tried to push some threading configury fixes > upstream back to the APR maintainers, and they balked. > > I'd still like to push my APR changes upstream to them, > but maybe with threads disabled by default on FreeBSD, > instead of enabled by default as I had in my patch. > > How close are we to having libkse as the default > threading library on FreeBSD? The ports maintainers > define PTHREAD_LIBS to be -pthread on older FreeBSD's, > and -lc_r on newer ( > 500016) and do not tell people > to explicitly link to -lkse. Supposedly, libkse will be default for archs in which it is supported (currently i386, amd64, ia64) for 5.2-RELEASE. It is undecided whether it will be default by means of installing an appropriate libmap.conf, or by renaming libkse back to libpthread and changing PTHREAD_LIBS to -lpthread (and also changing gcc -pthread so that it links to libpthread instead of libc_r). Port maintainers shouldn't get too concerned about this; they should continue to rely on PTHREAD_LIBS and PTHREAD_CFLAGS. I suppose there is the possibility that some ports may want a specific threads library. In that case, perhaps PTHREAD_LIBS can be overridden by the port. But you should probably ask ports@ to see if that is how it should be handled. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Thu Nov 13 09:06:08 2003 Return-Path: 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 27DAA16A4CE for ; Thu, 13 Nov 2003 09:06:08 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [66.31.45.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id C093143F85 for ; Thu, 13 Nov 2003 09:06:06 -0800 (PST) (envelope-from rodrigc@crodrigues.org) Received: from h00609772adf0.ne.client2.attbi.com (localhost.crodrigues.org [127.0.0.1])hADH82XP008815; Thu, 13 Nov 2003 12:08:03 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)hADH823J008814; Thu, 13 Nov 2003 12:08:02 -0500 (EST) (envelope-from rodrigc) Date: Thu, 13 Nov 2003 12:08:01 -0500 From: Craig Rodrigues To: Daniel Eischen Message-ID: <20031113170801.GA8760@crodrigues.org> References: <20031113045131.GA5544@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 17:06:08 -0000 On Thu, Nov 13, 2003 at 01:51:00AM -0500, Daniel Eischen wrote: > Supposedly, libkse will be default for archs in which > it is supported (currently i386, amd64, ia64) for > 5.2-RELEASE. What is the release criteria for this? Is re@ going to make this decision? > It is undecided whether it will be default > by means of installing an appropriate libmap.conf, or > by renaming libkse back to libpthread and changing > PTHREAD_LIBS to -lpthread (and also changing gcc -pthread > so that it links to libpthread instead of libc_r). Hmm, this is indeed a tricky thing, and I don't know the best course of action to recommend. Where is the best place to follow discussion related to this? > Port maintainers shouldn't get too concerned about > this; they should continue to rely on PTHREAD_LIBS > and PTHREAD_CFLAGS. I suppose there is the possibility > that some ports may want a specific threads library. > In that case, perhaps PTHREAD_LIBS can be overridden > by the port. But you should probably ask ports@ > to see if that is how it should be handled. Well, for just maintaining a port, it is OK. However, for pushing changes back to the original package maintainers, you cannot really rely on PTHREAD_LIBS and PTHREAD_CFLAGS, because those variables are defined in /usr/ports/Mk/bsd.port.mk. For example, I pushed some FreeBSD thread changes back to the ACE developers, because they have their own complex make system which is outside of the FreeBSD system (and I am an ACE committer :). I have been working a lot with Lev Serebryakov, since he maintains the subversion port, and I maintain the apr port, which subversion depends on. We managed to fix some thread related problems in apr and subversion after a lot of libtool hacking, but we both got into trouble when we tried to push our changes back to the original package maintainers, and the maintainers did not want to accept them. I guess package maintainers will be more willing to accept changes when the thread situation in FreeBSD stabilizes some more. -- Craig Rodrigues http://crodrigues.org rodrigc@crodrigues.org From owner-freebsd-threads@FreeBSD.ORG Thu Nov 13 10:33:10 2003 Return-Path: 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 83FAA16A4CE for ; Thu, 13 Nov 2003 10:33:10 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3AAB843FF5 for ; Thu, 13 Nov 2003 10:33:09 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hADIX31G004933; Thu, 13 Nov 2003 13:33:03 -0500 (EST) Date: Thu, 13 Nov 2003 13:33:03 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Craig Rodrigues In-Reply-To: <20031113170801.GA8760@crodrigues.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Comments about FreeBSD threading from Apache people X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Nov 2003 18:33:10 -0000 On Thu, 13 Nov 2003, Craig Rodrigues wrote: > On Thu, Nov 13, 2003 at 01:51:00AM -0500, Daniel Eischen wrote: > > Supposedly, libkse will be default for archs in which > > it is supported (currently i386, amd64, ia64) for > > 5.2-RELEASE. > > What is the release criteria for this? Is re@ going > to make this decision? Yes. > > It is undecided whether it will be default > > by means of installing an appropriate libmap.conf, or > > by renaming libkse back to libpthread and changing > > PTHREAD_LIBS to -lpthread (and also changing gcc -pthread > > so that it links to libpthread instead of libc_r). > > Hmm, this is indeed a tricky thing, and I don't know > the best course of action to recommend. Where is > the best place to follow discussion related to this? I dunno; ask re@. It's their call. I don't really care one way or the other for 5.2-release, but for 5.3 libkse will going out as libthread. > > Port maintainers shouldn't get too concerned about > > this; they should continue to rely on PTHREAD_LIBS > > and PTHREAD_CFLAGS. I suppose there is the possibility > > that some ports may want a specific threads library. > > In that case, perhaps PTHREAD_LIBS can be overridden > > by the port. But you should probably ask ports@ > > to see if that is how it should be handled. > > Well, for just maintaining a port, it is OK. > However, for pushing changes back to the original > package maintainers, you cannot really rely on > PTHREAD_LIBS and PTHREAD_CFLAGS, because those > variables are defined in /usr/ports/Mk/bsd.port.mk. Don't use -lkse somewhere outside our ports tree; it is just a temporary name. In the future, whether it's 5.2 or 5.3, it will be libpthread. Autoconf/configure/etc scripts should first check for the presence of libpthread, then libc_r. Things that don't use autoconf et. al. can always check the FreeBSD version (we'll bump it when libkse becomes libpthread). -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri Nov 14 19:19:08 2003 Return-Path: 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 CF93E16A4CE for ; Fri, 14 Nov 2003 19:19:08 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F64C43FB1 for ; Fri, 14 Nov 2003 19:19:07 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id hAF3J7be037194 for ; Fri, 14 Nov 2003 19:19:07 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.10/8.12.10) with ESMTP id hAF3J6bH052865 for ; Fri, 14 Nov 2003 19:19:07 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.10/8.12.10/Submit) id hAF3J6A3052864 for threads@FreeBSD.org; Fri, 14 Nov 2003 19:19:06 -0800 (PST) (envelope-from marcel) Date: Fri, 14 Nov 2003 19:19:06 -0800 From: Marcel Moolenaar To: threads@FreeBSD.org Message-ID: <20031115031906.GA52831@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i Subject: KSE/ia64 broken X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 03:19:08 -0000 Gang, The following change broke KSE on ia64: -------- revision 1.18 date: 2003/11/08 06:07:04; author: davidxu; state: Exp; lines: +16 -17 Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock. Reviewed by: deischen -------- We seem to be clobbering the thread structure instead of writing to the mailbox. This happens at initialization. Can it be that the change assumes PER_KSE and doesxn't work for PER_THREAD? -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-threads@FreeBSD.ORG Sat Nov 15 07:48:12 2003 Return-Path: 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 8303C16A4CE; Sat, 15 Nov 2003 07:48:12 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34C5A43FB1; Sat, 15 Nov 2003 07:48:11 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAFFm91G013847; Sat, 15 Nov 2003 10:48:09 -0500 (EST) Date: Sat, 15 Nov 2003 10:48:09 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20031115031906.GA52831@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org cc: davidxu@freebsd.org Subject: Re: KSE/ia64 broken X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 15:48:12 -0000 On Fri, 14 Nov 2003, Marcel Moolenaar wrote: > Gang, > > The following change broke KSE on ia64: > > -------- > revision 1.18 > date: 2003/11/08 06:07:04; author: davidxu; state: Exp; lines: +16 -17 > Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock. > > Reviewed by: deischen > -------- > > We seem to be clobbering the thread structure instead of writing > to the mailbox. This happens at initialization. Can it be that > the change assumes PER_KSE and doesxn't work for PER_THREAD? I assume this is coming from a malloc() or free() which uses a spinlock. Spinlocks shouldn't be called at initialization; everything using spinlocks should be conditional based on __isthreaded != 0. Also, libpthread shouldn't be calling malloc() or free() after initialization unless it is within the context of a thread. There seems to be a case where the current thread isn't set or it is the fake thread and malloc() or free() is called. Is this repeatable on a simple threaded application (we can reproduce it on plutoX)? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Nov 15 09:36:44 2003 Return-Path: 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 9D7AA16A4CF; Sat, 15 Nov 2003 09:36:44 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id C67F543FCB; Sat, 15 Nov 2003 09:36:43 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id hAFHag1G008138; Sat, 15 Nov 2003 12:36:43 -0500 (EST) Date: Sat, 15 Nov 2003 12:36:42 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Marcel Moolenaar In-Reply-To: <20031115031906.GA52831@dhcp01.pn.xcllnt.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: kan@freebsd.org cc: threads@freebsd.org cc: davidxu@freebsd.org Subject: Re: KSE/ia64 broken X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 17:36:44 -0000 On Fri, 14 Nov 2003, Marcel Moolenaar wrote: > Gang, > > The following change broke KSE on ia64: > > -------- > revision 1.18 > date: 2003/11/08 06:07:04; author: davidxu; state: Exp; lines: +16 -17 > Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock. > > Reviewed by: deischen > -------- > > We seem to be clobbering the thread structure instead of writing > to the mailbox. This happens at initialization. Can it be that > the change assumes PER_KSE and doesxn't work for PER_THREAD? I _think_ this may be because rltd-elf (at least for ia64) calls malloc with the rtld lock held. I'm not sure how to test this theory. The rtld lock uses a KSE lock because it is not always called within the context of a thread. We try to be careful in libpthread to only call malloc()/free() either at initialization (when there are no threads) or within the context of a thread. This allows us to make the malloc lock (currently a spinlock) a thread-based lock. KSE locks have the disadvantage of blocking the KSE from running any other threads. So moving spinlocks to thread locks improves performance. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat Nov 15 11:30:42 2003 Return-Path: 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 1600616A4CE; Sat, 15 Nov 2003 11:30:42 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4387043FAF; Sat, 15 Nov 2003 11:30:40 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id hAFJUebe044835; Sat, 15 Nov 2003 11:30:40 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) hAFJUdbH056259; Sat, 15 Nov 2003 11:30:39 -0800 (PST) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.10/8.12.10/Submit) id hAFJUdlX056258; Sat, 15 Nov 2003 11:30:39 -0800 (PST) (envelope-from marcel) Date: Sat, 15 Nov 2003 11:30:39 -0800 From: Marcel Moolenaar To: deischen@freebsd.org Message-ID: <20031115193039.GA55917@dhcp01.pn.xcllnt.net> References: <20031115031906.GA52831@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i cc: kan@freebsd.org cc: threads@freebsd.org cc: davidxu@freebsd.org Subject: Re: KSE/ia64 broken X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Nov 2003 19:30:42 -0000 On Sat, Nov 15, 2003 at 12:36:42PM -0500, Daniel Eischen wrote: > On Fri, 14 Nov 2003, Marcel Moolenaar wrote: > > > Gang, > > > > The following change broke KSE on ia64: > > > > -------- > > revision 1.18 > > date: 2003/11/08 06:07:04; author: davidxu; state: Exp; lines: +16 -17 > > Use THR lock instead of KSE lock to avoid scheduler be blocked in spinlock. > > > > Reviewed by: deischen > > -------- > > > > We seem to be clobbering the thread structure instead of writing > > to the mailbox. This happens at initialization. Can it be that > > the change assumes PER_KSE and doesxn't work for PER_THREAD? > > I _think_ this may be because rltd-elf (at least for ia64) calls > malloc with the rtld lock held. I'm not sure how to test this > theory. No worries, I have a way to disproof it :-) Staticly linked binaries are as much broken as dynamicly linked binaries. So, if we have a rtld problem, it's not the only one: The following triggers the bug (from the configure script of Python): \begin{C} #include void* routine(void* p){return NULL;} int main(){ pthread_t p; if(pthread_create(&p,NULL,routine,NULL)!=0) return 1; (void)pthread_detach(p); return 0; } \end{C} (gdb) run Starting program: /nfs/home/marcel/KSE/foo Program received signal SIGILL, Illegal instruction. _pthread_create (thread=0x200000000009b8d8, attr=0x9fffffffffffeb00, start_routine=@0x2000000000082520: 0x2000000000034cf0 , arg=0x0) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_create.c:202 202 new_thread->tcb->tcb_tmbx.tm_context.uc_stack.ss_size = (gdb) bt #0 _pthread_create (thread=0x200000000009b8d8, attr=0x9fffffffffffeb00, start_routine=@0x2000000000082520: 0x2000000000034cf0 , arg=0x0) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_create.c:202 #1 0x2000000000035430 in _thr_start_sig_daemon () at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_sig.c:236 #2 0x2000000000004e80 in _kse_setthreaded (threaded=1) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_kern.c:449 #3 0x2000000000001490 in _pthread_create (thread=0x9fffffffffffebc0, attr=0x0, start_routine=@0x2000000000082090: 0x2000000000000380 , arg=0x0) at /nfs/freebsd/5.x/src/lib/libpthread/thread/thr_create.c:111 #4 0x20000000000003e0 in main () at foo.c:7 (gdb) p *new_thread $1 = {tcb = 0xfffffffffffefeff, magic = 4294967295, name = 0x0, uniqueid = 0, tle = {tqe_next = 0x9fffffffffffeaa0, tqe_prev = 0x0}, kle = { tqe_next = 0x2000000000001e00, tqe_prev = 0x4041}, gcle = { tqe_next = 0xc00000000000048f, tqe_prev = 0x8000000000000130}, hle = { le_next = 0x0, le_prev = 0x0}, lock = {l_head = 0x20000000000b1ad0, l_tail = 0xf, l_type = 2322596671, l_wait = 0, l_wakeup = @0x2000000000081d40: 0x20000000000055e0 <_thr_lock_wakeup>}, : (partially shown) (gdb) p *crit $2 = {tm_context = {uc_sigmask = {__bits = {0, 0, 0, 0}}, uc_mcontext = { mc_flags = 3, _reserved_ = 0, mc_special = {sp = 11529215046068464288, unat = 0, rp = 2305843009213701744, pr = 32833, pfs = 13835058055282164879, bspstore = 9223372036854776160, rnat = 0, __spare = 0, tp = 2305843009214421712, rsc = 15, fpsr = 2674341018862399, psr = 19872948576272, gp = 2305843009214327112, ndirty = 0, cfm = 9223372036854776975, iip = 2305843009213701936, ifa = 18446744073709488367, isr = 549755813936}, mc_preserved = {unat = 0, gr4 = 2131440464, gr5 = 2147314880, gr6 = 1423, gr7 = 2135720224, br1 = 2145524112, br2 = 9223372041147674448, br3 = 9223372041147674368, br4 = 9223372041147674464, br5 = 2146730000, lc = 0, __spare = 0}, : (partially shown) If you interpret the data then new_thread is clobbered by a ucontext: (gdb) p /x *(ucontext_t*)new_thread $6 = {uc_sigmask = {__bits = {0xfffefeff, 0xffffffff, 0xffffffff, 0xffffffff}}, uc_mcontext = {mc_flags = 0x0, _reserved_ = 0x0, mc_special = {sp = 0x9fffffffffffeaa0, unat = 0x0, rp = 0x2000000000001e00, pr = 0x4041, pfs = 0xc00000000000048f, bspstore = 0x8000000000000130, rnat = 0x0, __spare = 0x0, tp = 0x20000000000b1ad0, rsc = 0xf, fpsr = 0x9804c8a70033f, psr = 0x0, gp = 0x2000000000081d40, ndirty = 0x20000000000a8460, cfm = 0x0, iip = 0x0, ifa = 0x20000000000bc000, isr = 0x20000000000bc000}, mc_preserved = {unat = 0x0, gr4 = 0x7f0b3350, gr5 = 0x7ffd6cc0, gr6 = 0x58f, gr7 = 0x7f4c8120, br1 = 0x7fe21990, br2 = 0x80000000ffe06f50, br3 = 0x80000000ffe06f00, br4 = 0x80000000ffe06f60, br5 = 0x7ff48010, lc = 0x0, __spare = 0x0}, mc_preserved_fp = {fr2 = {fpr_bits = {0x0 }, : (partially shown) mc_flags = 0, which means that the context is synchronous, and with ifa and isr set to new_thread, it looks like there may have been an async context before that (those are the registers we use to tell the kernel which value (=isr) to write at what location (=ifa) when we restore an async context. The sync has a valid thread pointer in it (tp=0x20000000000b1ad0): (gdb) p /x *(struct tcb*)(((ucontext_t*)new_thread)->uc_mcontext.mc_special.tp - (sizeof(struct tcb) - sizeof(struct ia64_tp))) $13 = {tcb_tmbx = {tm_context = {uc_sigmask = {__bits = {0x0, 0x0, 0x0, 0x0}}, uc_mcontext = {mc_flags = 0x3, _reserved_ = 0x0, mc_special = { sp = 0x9fffffffffffeaa0, unat = 0x0, rp = 0x2000000000001e70, pr = 0x8041, pfs = 0xc00000000000048f, bspstore = 0x8000000000000160, rnat = 0x0, __spare = 0x0, tp = 0x20000000000b1ad0, rsc = 0xf, fpsr = 0x9804c8a70033f, psr = 0x1213080a6010, gp = 0x200000000009a948, ndirty = 0x0, cfm = 0x800000000000048f, iip = 0x2000000000001f30, ifa = 0xffffffffffff08ef, isr = 0x8000000030}, mc_preserved = { unat = 0x0, gr4 = 0x7f0b3350, gr5 = 0x7ffd6cc0, gr6 = 0x58f, gr7 = 0x7f4c8120, br1 = 0x7fe21990, br2 = 0x80000000ffe06f50, br3 = 0x80000000ffe06f00, br4 = 0x80000000ffe06f60, br5 = 0x7ff48010, lc = 0x0, __spare = 0x0}, mc_preserved_fp = { fr2 = {fpr_bits = {0x0 }, fpr_flt = 0x00000000000000000000000000000000}, fr3 = {fpr_bits = { 0x0 }, : (partially shown) The mailbox has an async context in it caused by what looks like a page fault (faulting address = 0xffffffffffff08ef). The instruction that caused the page fault is at 0x2000000000001f30. Note that mc_flags = 3, which tells us it is indeed an async context and that the high FP registers have been saved in the context. (gdb) l *0x2000000000001f30 0x2000000000001f30 is in _pthread_create (/nfs/freebsd/5.x/src/lib/libpthread/thread/thr_create.c:202). 197 _kse_critical_leave(crit); 198 199 new_thread->tcb->tcb_tmbx.tm_udata = new_thread; 200 new_thread->tcb->tcb_tmbx.tm_context.uc_sigmask = 201 new_thread->sigmask; 202 new_thread->tcb->tcb_tmbx.tm_context.uc_stack.ss_size = 203 new_thread->attr.stacksize_attr; 204 new_thread->tcb->tcb_tmbx.tm_context.uc_stack.ss_sp = 205 new_thread->attr.stackaddr_attr; 206 makecontext(&new_thread->tcb->tcb_tmbx.tm_context, So, the page fault was really the SIGILL. This indicates that the internal consistency is reliable. Yet, our newly created thread structure is clobbered: (gdb) l 193 188 189 /* 190 * Initialize the machine context. 191 * Enter a critical region to get consistent context. 192 */ 193 crit = _kse_critical_enter(); 194 THR_GETCONTEXT(&new_thread->tcb->tcb_tmbx.tm_context); 195 /* Initialize the thread for signals: */ 196 new_thread->sigmask = curthread->sigmask; 197 _kse_critical_leave(crit); This suddenly looks very suspicious... (gdb) p /x curthread->sigmask $17 = {__bits = {0xfffefeff, 0xffffffff, 0xffffffff, 0xffffffff}} (gdb) p /x *new_thread $18 = {tcb = 0xfffffffffffefeff, magic = 0xffffffff, name = 0x0, uniqueid = 0x0, tle = {tqe_next = 0x9fffffffffffeaa0, tqe_prev = 0x0}, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net