From owner-freebsd-threads@FreeBSD.ORG Fri Nov 5 20:46:30 2004 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 EE17D16A4CE for ; Fri, 5 Nov 2004 20:46:30 +0000 (GMT) Received: from mail.ntplx.net (mail.ntplx.net [204.213.176.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 707BA43D41 for ; Fri, 5 Nov 2004 20:46:30 +0000 (GMT) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) iA5KkRRD011102; Fri, 5 Nov 2004 15:46:27 -0500 (EST) Date: Fri, 5 Nov 2004 15:46:27 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Julian Elischer In-Reply-To: <418BC8AD.8030207@elischer.org> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY=------------030803020700050405040308 Content-ID: X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.ntplx.net) cc: threads@freebsd.org Subject: Re: [Fwd: Re: 5.3-RC2: kqueue descriptor leak in resolver functions?] X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 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: Fri, 05 Nov 2004 20:46:31 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --------------030803020700050405040308 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed Content-ID: On Fri, 5 Nov 2004, Julian Elischer wrote: > > The namespace changes are not necessary unless the libc code that uses kqueue() is changed to use _kqueue() (in libc/net/ and libc/rpc/). -- Dan Eischen --------------030803020700050405040308 Content-Type: MESSAGE/RFC822; NAME="Re: 5.3-RC2: kqueue descriptor leak in resolver functions?" Content-ID: Content-Description: Content-Disposition: INLINE; FILENAME="Re: 5.3-RC2: kqueue descriptor leak in resolver functions?" Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by idiom.com (8.12.11/8.12.11) with ESMTP id iA5DR0eM076633 for ; Fri, 5 Nov 2004 05:27:00 -0800 (PST) (envelope-from owner-freebsd-current@freebsd.org) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 5F5DF56436 for ; Fri, 5 Nov 2004 13:26:59 +0000 (GMT) (envelope-from owner-freebsd-current@freebsd.org) Received: by hub.freebsd.org (Postfix) id C2BE616A50E; Fri, 5 Nov 2004 13:26:53 +0000 (GMT) Delivered-To: julian@freebsd.org Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id B10FF16A50B; Fri, 5 Nov 2004 13:26:53 +0000 (GMT) Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E30EF16A4CE; Thu, 4 Nov 2004 22:24:21 +0000 (GMT) Received: from cs.columbia.edu (cs.columbia.edu [128.59.16.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A4EF43D46; Thu, 4 Nov 2004 22:24:21 +0000 (GMT) (envelope-from lennox@cs.columbia.edu) Received: from cnr.cs.columbia.edu (cnr.cs.columbia.edu [128.59.19.133]) by cs.columbia.edu (8.12.10/8.12.10) with ESMTP id iA4MNTRX027889; Thu, 4 Nov 2004 17:23:30 -0500 (EST) Received: from cnr.cs.columbia.edu (localhost [127.0.0.1]) by cnr.cs.columbia.edu (8.12.10/8.12.10) with ESMTP id iA4MNTi7058350; Thu, 4 Nov 2004 17:23:29 -0500 (EST) (envelope-from lennox@cnr.cs.columbia.edu) Received: (from lennox@localhost) by cnr.cs.columbia.edu (8.12.10/8.12.10/Submit) id iA4MNT7g058344; Thu, 4 Nov 2004 17:23:29 -0500 (EST) (envelope-from lennox) From: Jonathan Lennox MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16778.44000.981070.769175@cnr.cs.columbia.edu> Date: Thu, 4 Nov 2004 17:23:28 -0500 To: Arjan de Vet In-Reply-To: <20041102094145.GA4698@adv.devet.org> X-Mailer: VM 7.19 under Emacs 21.3.1 X-PMX-Version: 4.7.0.111621, Antispam-Engine: 2.0.2.0, Antispam-Data: 2004.11.4.2 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_VERSION 0, __SANE_MSGID 0' X-Mailman-Approved-At: Fri, 05 Nov 2004 13:26:50 +0000 Cc: re@freebsd.org Cc: current@freebsd.org Subject: Re: 5.3-RC2: kqueue descriptor leak in resolver functions? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: owner-freebsd-current@freebsd.org Errors-To: owner-freebsd-current@freebsd.org X-Accessio-Status: NO, score=0.00,none version=6.0 count=0 X-Accessio-Spam-Flag: NO X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on mx.idiom.com X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS autolearn=failed version=3.0.0 X-Idiom-Reporting: If this was spam, please report it to spamcop.net Arjan de Vet writes: > A ktrace of the mozilla process seems to point to the DNS resolver code > leaking kqueue descriptors (I could not find any kqueue() calls in the > mozilla code itself). I've noticed (and reported) this with 5.2.1, in the specific case when you're using libc_r and linking statically. I never heard anything back, though. The problem is that 'kqueue' isn't namespace'd (#defined as _kqueue) in lib/libc/include/[un]namespace.h, and the thread libraries don't draw in _kqueue in their 'references' array. Attached below is a patch against 5.2.1. It should apply to 5.3-RC2 as well. The patch for lib/libc_r/uthread/uthread_init.c may also need to be applied to lib/libpthread/thread/thr_init.c and lib/libthr/thread/thr_init.c. See PR bin/58687. --- lib/libc_r/uthread/uthread_init.c.orig Wed Oct 29 11:00:53 2003 +++ lib/libc_r/uthread/uthread_init.c Wed Oct 29 11:01:21 2003 @@ -99,6 +99,7 @@ &_getsockopt, &_ioctl, &_kevent, + &_kqueue, &_listen, &_nanosleep, &_open, --- lib/libc/include/namespace.h.orig Wed Oct 29 14:13:09 2003 +++ lib/libc/include/namespace.h Wed Oct 29 14:13:31 2003 @@ -77,6 +77,7 @@ #define getsockopt _getsockopt #define ioctl _ioctl /* #define kevent _kevent */ +#define kqueue _kqueue #define listen _listen #define nanosleep _nanosleep #define open _open --- lib/libc/include/un-namespace.h.orig Wed Oct 29 14:13:13 2003 +++ lib/libc/include/un-namespace.h Wed Oct 29 14:13:55 2003 @@ -58,6 +58,7 @@ #undef getsockopt #undef ioctl #undef kevent +#undef kqueue #undef listen #undef nanosleep #undef open -- Jonathan Lennox lennox@cs.columbia.edu _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" --------------030803020700050405040308 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: Content-Description: Content-Disposition: INLINE _______________________________________________ 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" --------------030803020700050405040308--