From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 20 03:07:55 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B9E2106566C for ; Sun, 20 Apr 2008 03:07:55 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail35.syd.optusnet.com.au (mail35.syd.optusnet.com.au [211.29.133.51]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFD68FC27 for ; Sun, 20 Apr 2008 03:07:54 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from server.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mail35.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m3K37o8C005013 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 20 Apr 2008 13:07:50 +1000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.2/8.14.1) with ESMTP id m3K37oVx013757; Sun, 20 Apr 2008 13:07:50 +1000 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.2/8.14.2/Submit) id m3K37nw8013756; Sun, 20 Apr 2008 13:07:49 +1000 (EST) (envelope-from peter) Date: Sun, 20 Apr 2008 13:07:49 +1000 From: Peter Jeremy To: Randall Hyde Message-ID: <20080420030749.GL73016@server.vk2pj.dyndns.org> References: <29853546.1208628147652.JavaMail.root@elwamui-rustique.atl.sa.earthlink.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o41d8xLWOaLD8vYh" Content-Disposition: inline In-Reply-To: <29853546.1208628147652.JavaMail.root@elwamui-rustique.atl.sa.earthlink.net> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: chdir/rmdir X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 03:07:55 -0000 --o41d8xLWOaLD8vYh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 19, 2008 at 11:02:27AM -0700, Randall Hyde wrote: >Hi, >I recently made a couple of calls like the following > >// currently in /x/y/z > >chdir( "/x/y" ); >rmdir( "/x/y/z" ); Presumably you checked the return codes and both these succeeded. >When I did at "gwd" call, it returned "/x/y/z" along with ENOTDIR. >Is this a known issue? What do you mean by "gwd"? There's getcwd(3) which uses __getcwd(2) - but the syscall may fail, in which case getcwd(3) falls back to stat(2)ing =2E. until it reaches root and then using directory(3) to translate the inode numbers to a pathname. And, even if __getcwd(3) succeeds, the result may need massaging before being returned to the caller. Note that system calls very rarely both fail and return a value - normally, any output buffer will be returned untouched if there's an error. >P.S. I noticed that the man pages said something about using open on >"." and fchdir to more robustly switch back to some previous >directory; This is for security and reliability reasons: The process can still get back to the original directory even if components of its pathname have been renamed. --=20 Peter Jeremy Please excuse any delays as the result of my ISP's inability to implement an MTA that is either RFC2821-compliant or matches their claimed behaviour. --o41d8xLWOaLD8vYh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkgKs4UACgkQ/opHv/APuIc0uwCeMZGFjh5OQ+MVJshWcQ2ypuXG sgYAn1WeN141KiIAGK2dcTO8Yswnbrks =utDe -----END PGP SIGNATURE----- --o41d8xLWOaLD8vYh-- From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 20 09:27:23 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 240AF1065707 for ; Sun, 20 Apr 2008 09:27:23 +0000 (UTC) (envelope-from emily.bckr@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by mx1.freebsd.org (Postfix) with ESMTP id D38128FC0A for ; Sun, 20 Apr 2008 09:27:22 +0000 (UTC) (envelope-from emily.bckr@gmail.com) Received: by py-out-1112.google.com with SMTP id u52so1850959pyb.10 for ; Sun, 20 Apr 2008 02:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=7/jH6ub6y8KFmHiAZ1/HP+L7Ks+F/1CDrzq+WOrXyZ4=; b=yB4h/nZIl9dL58yp3x9G3ev+PkzE14PQdKwHHVa0oxaqoJtBSR5txnlpd/dwDwmUVYftMMDXQ+chQSY6UtZGxMkxzsr23Wf3EgSBqh+D16PnMsYzejGC8USWNVNxK1/YtCIpTf8k55+z6M87RNBbycXoS4cr/3co2DrhMccBh5s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=GzNbN2MBPaXnqDOOtjToVQQs4Fr/WlTfgT61bDxfUeKMmMXmH7H8YoFxycduJd2Ur82o3SqTHQAXkrPOHFydo80PQgpec6mVPyN+IRRRJWvehFjOIFsQgExTMnx3n9EgHgL+sEvUtOZeYSrCWugYRxQMPxpbhYqROYuixO5T4HQ= Received: by 10.142.141.21 with SMTP id o21mr1267124wfd.199.1208682129528; Sun, 20 Apr 2008 02:02:09 -0700 (PDT) Received: by 10.142.238.14 with HTTP; Sun, 20 Apr 2008 02:02:09 -0700 (PDT) Message-ID: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> Date: Sun, 20 Apr 2008 12:02:09 +0300 From: "emily becker" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 09:27:23 -0000 Hi, I have a question about symbol table. One of the section In symbol table is memory adress which symbol is located. I wonder if this memory adress is bound at run-time or compile-time? if it is compile-time, I don't understand how do we know whether the symbol is located this adress. Maybe this adress is already bound by other process or like this. I look forward to answers thank you From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 20 10:39:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA355106566C for ; Sun, 20 Apr 2008 10:39:14 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 7DF178FC1A for ; Sun, 20 Apr 2008 10:39:14 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:62932 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1JnWwz-0004Bx-7v for freebsd-hackers@freebsd.org; Sun, 20 Apr 2008 12:39:13 +0200 Received: (qmail 5040 invoked from network); 20 Apr 2008 12:39:10 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 20 Apr 2008 12:39:10 +0200 Received: (qmail 92889 invoked by uid 1001); 20 Apr 2008 12:39:10 +0200 Date: Sun, 20 Apr 2008 12:39:10 +0200 From: Erik Trulsson To: emily becker Message-ID: <20080420103910.GA92852@owl.midgard.homeip.net> Mail-Followup-To: emily becker , freebsd-hackers@freebsd.org References: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1JnWwz-0004Bx-7v. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1JnWwz-0004Bx-7v b960c9b3b398dd43430da97622dd3fdb Cc: freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 10:39:14 -0000 On Sun, Apr 20, 2008 at 12:02:09PM +0300, emily becker wrote: > Hi, > > I have a question about symbol table. > One of the section In symbol table is memory adress which symbol is located. > I wonder if this memory adress is bound at run-time or compile-time? It depends. Symbols referring to objects in a dynamically loaded library will be bound at run-time, the rest should be bound at compile-time. > if it is compile-time, I don't understand how do we know whether the symbol > is located this adress. > Maybe this adress is already bound by other process or like this. Each process runs in its own address space, and therefore the compiler (actually: the linker) can know exactly where in this address space things will end up. (The above is true for FreeBSD and just about all other Unix-derived systems. Other systems can do things differently.) -- Erik Trulsson ertr1013@student.uu.se From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 20 18:02:00 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDC7106566B for ; Sun, 20 Apr 2008 18:02:00 +0000 (UTC) (envelope-from fbsd06+VF=498723de@mlists.homeunix.com) Received: from turtle-out.mxes.net (turtle-out.mxes.net [216.86.168.191]) by mx1.freebsd.org (Postfix) with ESMTP id 0270E8FC13 for ; Sun, 20 Apr 2008 18:01:59 +0000 (UTC) (envelope-from fbsd06+VF=498723de@mlists.homeunix.com) Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by turtle-in.mxes.net (Postfix) with ESMTP id 334A4163F6C for ; Sun, 20 Apr 2008 13:31:40 -0400 (EDT) Received: from gumby.homeunix.com. (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id AF8FD23E3F6 for ; Sun, 20 Apr 2008 13:31:38 -0400 (EDT) Date: Sun, 20 Apr 2008 18:31:35 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20080420183135.78b8c710@gumby.homeunix.com.> In-Reply-To: References: <20080419175655.51a37bb2@gumby.homeunix.com.> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Yarrow's Counter X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Apr 2008 18:02:00 -0000 On Sat, 19 Apr 2008 23:30:23 +0400 Eygene Ryabinkin wrote: > I would not do it without consultations with Yarrow's creators: OK, I didn't realise it was actually specified, I thought it an implementation detail. > this modification seems not to help anything, It possibly doesn't help with an attack against Yarrow itself, but it means that 512 bits of entropy, rather than 256 bits, can be read-out from /dev/random. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 05:23:33 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE36E106564A for ; Mon, 21 Apr 2008 05:23:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 5CED38FC14 for ; Mon, 21 Apr 2008 05:23:33 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3L5KI1W015667; Sun, 20 Apr 2008 23:20:18 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Apr 2008 23:21:20 -0600 (MDT) Message-Id: <20080420.232120.320085198.imp@bsdimp.com> To: emily.bckr@gmail.com From: "M. Warner Losh" In-Reply-To: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> References: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 05:23:33 -0000 In message: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> "emily becker" writes: : Hi, : : I have a question about symbol table. : One of the section In symbol table is memory adress which symbol is located. : I wonder if this memory adress is bound at run-time or compile-time? Typically, run-time, but there are exceptions. : if it is compile-time, I don't understand how do we know whether the symbol : is located this adress. The exceptions are for things like 'start' which live at a fixed address by the ELF ABI specification for most processors. Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 05:26:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F0E11065672 for ; Mon, 21 Apr 2008 05:26:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 184348FC24 for ; Mon, 21 Apr 2008 05:26:41 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3L5NVIx015698; Sun, 20 Apr 2008 23:23:32 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Apr 2008 23:24:32 -0600 (MDT) Message-Id: <20080420.232432.-1175574853.imp@bsdimp.com> To: ertr1013@student.uu.se From: "M. Warner Losh" In-Reply-To: <20080420103910.GA92852@owl.midgard.homeip.net> References: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> <20080420103910.GA92852@owl.midgard.homeip.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: emily.bckr@gmail.com, freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 05:26:41 -0000 In message: <20080420103910.GA92852@owl.midgard.homeip.net> Erik Trulsson writes: : On Sun, Apr 20, 2008 at 12:02:09PM +0300, emily becker wrote: : > Hi, : > : > I have a question about symbol table. : > One of the section In symbol table is memory adress which symbol is located. : > I wonder if this memory adress is bound at run-time or compile-time? : : It depends. Symbols referring to objects in a dynamically loaded library : will be bound at run-time, the rest should be bound at compile-time. They are bound at link-time, not compile-time. This is splitting a fine hair, but compile-time is when a .o or .so is created, while link time combines .o-like things together into a bigger thing. When that bigger thing is a final link, the addresses for the static portions of the binary are set. When the final thing is a dynamic library, the addresses float (since all the code is PIC anyway, they don't really matter). Dynamic parts of executables are bound at run-time. : > if it is compile-time, I don't understand how do we know whether the symbol : > is located this adress. : > Maybe this adress is already bound by other process or like this. : : Each process runs in its own address space, and therefore the compiler : (actually: the linker) can know exactly where in this address space things : will end up. The run-time linker (ld.so) is the one that knows where things wind up in a given process... libc.so and other shared libraries can and do link at different addresses for different processes. Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 07:00:54 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0DEC1065670 for ; Mon, 21 Apr 2008 07:00:54 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 12B3E8FC13 for ; Mon, 21 Apr 2008 07:00:53 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:60981 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Jnq1D-0007rN-7Y for freebsd-hackers@freebsd.org; Mon, 21 Apr 2008 09:00:52 +0200 Received: (qmail 18560 invoked from network); 21 Apr 2008 09:00:50 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 21 Apr 2008 09:00:50 +0200 Received: (qmail 13768 invoked by uid 1001); 21 Apr 2008 09:00:50 +0200 Date: Mon, 21 Apr 2008 09:00:50 +0200 From: Erik Trulsson To: "M. Warner Losh" Message-ID: <20080421070050.GA13685@owl.midgard.homeip.net> Mail-Followup-To: "M. Warner Losh" , emily.bckr@gmail.com, freebsd-hackers@freebsd.org References: <5124a9390804200202h535112dcx4005e9df6e5e0f5e@mail.gmail.com> <20080420103910.GA92852@owl.midgard.homeip.net> <20080420.232432.-1175574853.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080420.232432.-1175574853.imp@bsdimp.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1Jnq1D-0007rN-7Y. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Jnq1D-0007rN-7Y 41ef3a82285c1bba06bf4e636eb7ab8c Cc: emily.bckr@gmail.com, freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 07:00:54 -0000 On Sun, Apr 20, 2008 at 11:24:32PM -0600, M. Warner Losh wrote: > In message: <20080420103910.GA92852@owl.midgard.homeip.net> > Erik Trulsson writes: > : On Sun, Apr 20, 2008 at 12:02:09PM +0300, emily becker wrote: > : > Hi, > : > > : > I have a question about symbol table. > : > One of the section In symbol table is memory adress which symbol is located. > : > I wonder if this memory adress is bound at run-time or compile-time? > : > : It depends. Symbols referring to objects in a dynamically loaded library > : will be bound at run-time, the rest should be bound at compile-time. > > They are bound at link-time, not compile-time. This is splitting a > fine hair, but compile-time is when a .o or .so is created, while link > time combines .o-like things together into a bigger thing. Well, I consider linking to be part of the compilation process so for me link-time is a subset of compile-time. You are however completely correct that it is at link-time that the binding happens (for those symbols that can be resolved at link-time anyway.) > When that > bigger thing is a final link, the addresses for the static portions of > the binary are set. When the final thing is a dynamic library, the > addresses float (since all the code is PIC anyway, they don't really > matter). Dynamic parts of executables are bound at run-time. > > : > if it is compile-time, I don't understand how do we know whether the symbol > : > is located this adress. > : > Maybe this adress is already bound by other process or like this. > : > : Each process runs in its own address space, and therefore the compiler > : (actually: the linker) can know exactly where in this address space things > : will end up. > > The run-time linker (ld.so) is the one that knows where things wind up > in a given process... libc.so and other shared libraries can and do > link at different addresses for different processes. My comment referred to those symbols that are bound at compile^W link-time. For those the linker does know what addresses they refer to. For dynamically loaded libraries it is indeed the runtime loader that knows where in the address space they will end up. -- Erik Trulsson ertr1013@student.uu.se From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 10:48:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A8F106566B for ; Mon, 21 Apr 2008 10:48:35 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id CA5128FC17 for ; Mon, 21 Apr 2008 10:48:34 +0000 (UTC) (envelope-from rea-fbsd@codelabs.ru) DomainKey-Signature: a=rsa-sha1; q=dns; c=simple; s=one; d=codelabs.ru; h=Received:Date:From:To:Cc:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:Sender:X-Spam-Status:Subject; b=U37iQCmFA/lzbdZE+eN/p21bHeqFYRBZDGpCYtmNaWF7kmrsFL5MYCTODDDrXintdWzkpJGwR7KuErVIoEeYBJpOdMqTrcZ4FA7AxDuY4Vqry/tlYBk/7NZNdt8PMqLJM71zueklk2UdgVEBMzl4XpFQgM/kvE2auCQ1VJuA60o=; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1JntZX-000Gf5-Po; Mon, 21 Apr 2008 14:48:31 +0400 Date: Mon, 21 Apr 2008 14:48:30 +0400 From: Eygene Ryabinkin To: RW Message-ID: References: <20080419175655.51a37bb2@gumby.homeunix.com.> <20080420183135.78b8c710@gumby.homeunix.com.> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20080420183135.78b8c710@gumby.homeunix.com.> Sender: rea-fbsd@codelabs.ru X-Spam-Status: No, score=-1.7 required=4.0 tests=ALL_TRUSTED,AWL,BAYES_50 Cc: freebsd-hackers@freebsd.org Subject: Re: Yarrow's Counter X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 10:48:35 -0000 Good day. Sun, Apr 20, 2008 at 06:31:35PM +0100, RW wrote: > > this modification seems not to help anything, > > It possibly doesn't help with an attack against Yarrow itself, but it > means that 512 bits of entropy, rather than 256 bits, can be read-out > from /dev/random. The only source of entropy is the entropy pool. The key and the counter are both derived from this pool, so if you will concatenate two 256 bit values you will not gain more entropy. Consider the following case: you have only two input values that are fed to you by the pool. And then you're doing whatever you want to generate the key and the counter: hash something, encrypt something, etc. The resulting entropy will be not more than one (if there are no additional sources of randomness and the algorithm is known): you just should test two input values to get the possible key and counter spaces. Am I missing something? -- Eygene From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 12:02:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F19171065671 for ; Mon, 21 Apr 2008 12:02:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B1F828FC1E for ; Mon, 21 Apr 2008 12:02:25 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3LC05hI027208; Mon, 21 Apr 2008 06:00:06 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 21 Apr 2008 06:01:07 -0600 (MDT) Message-Id: <20080421.060107.1079619394.imp@bsdimp.com> To: ertr1013@student.uu.se From: "M. Warner Losh" In-Reply-To: <20080421070050.GA13685@owl.midgard.homeip.net> References: <20080420103910.GA92852@owl.midgard.homeip.net> <20080420.232432.-1175574853.imp@bsdimp.com> <20080421070050.GA13685@owl.midgard.homeip.net> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: emily.bckr@gmail.com, freebsd-hackers@freebsd.org Subject: Re: symbol table X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 12:02:26 -0000 In message: <20080421070050.GA13685@owl.midgard.homeip.net> Erik Trulsson writes: : On Sun, Apr 20, 2008 at 11:24:32PM -0600, M. Warner Losh wrote: : > In message: <20080420103910.GA92852@owl.midgard.homeip.net> : > Erik Trulsson writes: : > : On Sun, Apr 20, 2008 at 12:02:09PM +0300, emily becker wrote: : > : > Hi, : > : > : > : > I have a question about symbol table. : > : > One of the section In symbol table is memory adress which symbol is located. : > : > I wonder if this memory adress is bound at run-time or compile-time? : > : : > : It depends. Symbols referring to objects in a dynamically loaded library : > : will be bound at run-time, the rest should be bound at compile-time. : > : > They are bound at link-time, not compile-time. This is splitting a : > fine hair, but compile-time is when a .o or .so is created, while link : > time combines .o-like things together into a bigger thing. : : Well, I consider linking to be part of the compilation process so for : me link-time is a subset of compile-time. : You are however completely correct that it is at link-time that the binding : happens (for those symbols that can be resolved at link-time anyway.) While you might consider them the same, these are very important differences that need to be taken into account. A compile-time constant, for example, can be used to size an automatic array. A link-time or run-time constant cannot without gcc's extensions (magic tricks can be played to make link-time constants size certain global objects, but then sizeof() those objects fail). The terminology is well worn, and matters in some contexts, so I tend to be a stickler here... Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 14:02:00 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51398106566B for ; Mon, 21 Apr 2008 14:02:00 +0000 (UTC) (envelope-from fbsd06+VG=93acc154@mlists.homeunix.com) Received: from turtle-out.mxes.net (turtle-out.mxes.net [216.86.168.191]) by mx1.freebsd.org (Postfix) with ESMTP id 277C08FC0C for ; Mon, 21 Apr 2008 14:01:59 +0000 (UTC) (envelope-from fbsd06+VG=93acc154@mlists.homeunix.com) Received: from mxout-03.mxes.net (mxout-03.mxes.net [216.86.168.178]) by turtle-in.mxes.net (Postfix) with ESMTP id 35696163F59 for ; Mon, 21 Apr 2008 09:34:15 -0400 (EDT) Received: from gumby.homeunix.com. (unknown [87.81.140.128]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTP id BF03823E3EF for ; Mon, 21 Apr 2008 09:34:13 -0400 (EDT) Date: Mon, 21 Apr 2008 14:34:10 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20080421143410.240f954b@gumby.homeunix.com.> In-Reply-To: References: <20080419175655.51a37bb2@gumby.homeunix.com.> <20080420183135.78b8c710@gumby.homeunix.com.> X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: Yarrow's Counter X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 14:02:00 -0000 On Mon, 21 Apr 2008 14:48:30 +0400 Eygene Ryabinkin wrote: > Good day. > > Sun, Apr 20, 2008 at 06:31:35PM +0100, RW wrote: > > > this modification seems not to help anything, > > > > It possibly doesn't help with an attack against Yarrow itself, but > > it means that 512 bits of entropy, rather than 256 bits, can be > > read-out from /dev/random. > > The only source of entropy is the entropy pool. The key and the > counter are both derived from this pool, so if you will concatenate > two 256 bit values you will not gain more entropy. > ... > > Am I missing something? If you encrypt the previous value of the counter, instead of zero, the counter will then depend on all the previous keys, and not just the current one. With the default settings any two keys more than one reseed apart are completely independent. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 16:24:46 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A938106564A for ; Mon, 21 Apr 2008 16:24:46 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx1.freebsd.org (Postfix) with ESMTP id 797A38FC12 for ; Mon, 21 Apr 2008 16:24:46 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 21 Apr 2008 09:23:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,690,1199692800"; d="scan'208,217";a="319505444" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by fmsmga002.fm.intel.com with ESMTP; 21 Apr 2008 09:10:46 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Apr 2008 09:12:23 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Mon, 21 Apr 2008 09:12:21 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: thread and ksegrp priorities Thread-Index: AcijynpQj5os5b8rSYKi74ER/wahgg== From: "Murty, Ravi" To: X-OriginalArrivalTime: 21 Apr 2008 16:12:23.0273 (UTC) FILETIME=[7B9DF590:01C8A3CA] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: thread and ksegrp priorities X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 16:24:46 -0000 Hello All, =20 I am working on the 6.2 FreeBSD code base and has a couple of simple questions. The thread structure defines two priority fields "td_base_pri" and "td_priority" while a ksegrp defines "kg_user_pri" and "kg_pri_class".=20 =20 1. Since a ksegrp can have multiple "process scope" threads, how is kg_user_pri used and how is it related to td_base_pri and td_priority? 2. What is the difference between td_base_pri and td_priority? 3. If kg_user_pri changes, does it mean that the priority of all threads that are part of the ksegrp change? =20 It appears that these things change when a thread returns to user mode (returns to normal user priority), when returning from a sleep (priority boost) etc. =20 Thanks Ravi =20 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 17:21:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BF11065672 for ; Mon, 21 Apr 2008 17:21:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id C15438FC13 for ; Mon, 21 Apr 2008 17:21:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 00:11:30 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 9A2D92D6010; Mon, 21 Apr 2008 10:21:33 -0700 (PDT) Message-ID: <480CCD1F.1010509@elischer.org> Date: Mon, 21 Apr 2008 10:21:35 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: thread and ksegrp priorities X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 17:21:35 -0000 Murty, Ravi wrote: > Hello All, > > > > I am working on the 6.2 FreeBSD code base and has a couple of simple > questions. The thread structure defines two priority fields > "td_base_pri" and "td_priority" while a ksegrp defines "kg_user_pri" and > "kg_pri_class". > > > > 1. Since a ksegrp can have multiple "process scope" threads, how is > kg_user_pri used and how is it related to td_base_pri and td_priority? > 2. What is the difference between td_base_pri and td_priority? > 3. If kg_user_pri changes, does it mean that the priority of all > threads that are part of the ksegrp change? > This is something that was never satisfactoraly worked out. The problem is that there is no 100% correct answer. the kg_user_pri was( I say was because the whole scheme was scrapped for 7 and 8 (so learning about 6.x is a bit of a dead end)) used to reinitialise a thread when it started running in userland again. so all threads, on transition back to user space or, rather were reatarted in user space had their priorities moved back away from privileged priorities. td_base Priority is what the thread was initialised to and td_priority is what it is actually running at at this time. if kg_user_pri changes than theoretically all associated threads would move as soon as they reached a point where their prioities were reinitialised. I can't remember the details but it was not successful and removed later. > > > It appears that these things change when a thread returns to user mode > (returns to normal user priority), when returning from a sleep (priority > boost) etc. > > > > Thanks > Ravi > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 19:01:31 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 964DB106566C for ; Mon, 21 Apr 2008 19:01:31 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx1.freebsd.org (Postfix) with ESMTP id 75A868FC1F for ; Mon, 21 Apr 2008 19:01:31 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 21 Apr 2008 11:59:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,691,1199692800"; d="scan'208,217";a="272961270" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by orsmga002.jf.intel.com with ESMTP; 21 Apr 2008 12:01:25 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Apr 2008 12:01:30 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Mon, 21 Apr 2008 12:01:29 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Do you really "sleep" when blocked on a mutex? Thread-Index: Acij4hsxyuwhOuasTOWlMUKiMZ/twQ== From: "Murty, Ravi" To: X-OriginalArrivalTime: 21 Apr 2008 19:01:30.0712 (UTC) FILETIME=[1BF64580:01C8A3E2] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 19:01:31 -0000 Hello, =20 When a thread cannot get a mutex (default mutex) and needs to be blocked, is it really put to sleep? From looking at the code it appears that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. =20 1. Why isn't it put to sleep - why can't it be treated the same? 2. The eventual question I am trying to answer is the difference between setrunnable() and setrunqueue() - this one simply finds a slot in the ksegrp and a runq to add the KSE/td. But setrunnable() also checks to see if the process is in memory (PS_INMEM) before calling sched_wakeup which eventually calls setrunqueue()? Why doesn't setrunqueue have to worry about the possibility that the process may have been swapped out while it was waiting to become runnable? =20 Thanks Ravi =20 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 19:54:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432DF106566B for ; Mon, 21 Apr 2008 19:54:25 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outL.internet-mail-service.net (outl.internet-mail-service.net [216.240.47.235]) by mx1.freebsd.org (Postfix) with ESMTP id 30FC28FC0A for ; Mon, 21 Apr 2008 19:54:25 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 02:44:28 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 86C772D601A; Mon, 21 Apr 2008 12:54:24 -0700 (PDT) Message-ID: <480CF0F2.20609@elischer.org> Date: Mon, 21 Apr 2008 12:54:26 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 19:54:25 -0000 Murty, Ravi wrote: > Hello, > > > > When a thread cannot get a mutex (default mutex) and needs to be > blocked, is it really put to sleep? From looking at the code it appears > that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. > it really has two answers. 1/ sleep has a lot of historical baggage and is expected to work in certain ways. 2/ there is a semantic difference between a sleep (which may sleep for an unbounded time) and being descheduled for a blocking lock, (Which is supposed to have a guaranteed "shortness" of duration. Because sleeps 'may never return' (in the short term) there is a limit of what you may hold when sleeping. In blocking locks you may hold other resources, with the expectation that the other threads will be following the correct locking order and that the nesting of held resources will be safe, because you will only be blocked for a moment. The lowest leven code is the same of course.. things are put on the run queue, or not.. Having different higher layers allows us to do various sanity checks and to enforce the different behaviour. > > > 1. Why isn't it put to sleep - why can't it be treated the same? > 2. The eventual question I am trying to answer is the difference > between setrunnable() and setrunqueue() - this one simply finds a slot > in the ksegrp and a runq to add the KSE/td. But setrunnable() also > checks to see if the process is in memory (PS_INMEM) before calling > sched_wakeup which eventually calls setrunqueue()? Why doesn't > setrunqueue have to worry about the possibility that the process may > have been swapped out while it was waiting to become runnable? > > > > Thanks > > Ravi > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 20:13:14 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75CE41065676 for ; Mon, 21 Apr 2008 20:13:14 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx1.freebsd.org (Postfix) with ESMTP id 550D58FC29 for ; Mon, 21 Apr 2008 20:13:14 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 21 Apr 2008 13:11:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,691,1199692800"; d="scan'208";a="319613187" Received: from orsmsx335.amr.corp.intel.com (HELO orsmsx335.jf.intel.com) ([10.22.226.40]) by fmsmga002.fm.intel.com with ESMTP; 21 Apr 2008 13:11:35 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Apr 2008 13:13:13 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Apr 2008 13:13:12 -0700 Message-ID: In-Reply-To: <480CF0F2.20609@elischer.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Do you really "sleep" when blocked on a mutex? Thread-Index: Acij6YnB27mady/SS/a4Y7CT4A4hxwAAgTYw References: <480CF0F2.20609@elischer.org> From: "Murty, Ravi" To: "Julian Elischer" X-OriginalArrivalTime: 21 Apr 2008 20:13:13.0370 (UTC) FILETIME=[208BC7A0:01C8A3EC] Cc: freebsd-hackers@freebsd.org Subject: RE: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 20:13:14 -0000 Fundamentally it seems that they both come down to inhibiting the thread and putting them on some queue before calling mi_switch(). But when a thread is woken up from a sleep, setrunnable is called and it checks to see if the process is swapped out. No such check is made when a thread is waiting for a lock (I'm wondering if this is related to how long they block before becoming runnable which might cause a swapout in one case and no swapout in the other case?) Ravi -----Original Message----- From: Julian Elischer [mailto:julian@elischer.org]=20 Sent: Monday, April 21, 2008 12:54 PM To: Murty, Ravi Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? Murty, Ravi wrote: > Hello, >=20 > =20 >=20 > When a thread cannot get a mutex (default mutex) and needs to be > blocked, is it really put to sleep? From looking at the code it appears > that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. >=20 it really has two answers. 1/ sleep has a lot of historical baggage and is expected to work in=20 certain ways. 2/ there is a semantic difference between a sleep (which may sleep for an unbounded time) and being descheduled for a blocking lock, (Which is supposed to have a guaranteed "shortness" of duration. Because sleeps 'may never return' (in the short term) there is a limit of what you may hold when sleeping. In blocking locks you may hold other resources, with the expectation that the other threads will be following the correct locking order and that the nesting of held resources will be safe, because you will only be blocked for a moment. The lowest leven code is the same of course.. things are put on the=20 run queue, or not.. Having different higher layers allows us to do various sanity checks and to enforce the different behaviour. > =20 >=20 > 1. Why isn't it put to sleep - why can't it be treated the same? > 2. The eventual question I am trying to answer is the difference > between setrunnable() and setrunqueue() - this one simply finds a slot > in the ksegrp and a runq to add the KSE/td. But setrunnable() also > checks to see if the process is in memory (PS_INMEM) before calling > sched_wakeup which eventually calls setrunqueue()? Why doesn't > setrunqueue have to worry about the possibility that the process may > have been swapped out while it was waiting to become runnable? >=20 > =20 >=20 > Thanks >=20 > Ravi >=20 > =20 >=20 > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 20:33:24 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C44F71065670 for ; Mon, 21 Apr 2008 20:33:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outL.internet-mail-service.net (outl.internet-mail-service.net [216.240.47.235]) by mx1.freebsd.org (Postfix) with ESMTP id B0D1E8FC1B for ; Mon, 21 Apr 2008 20:33:24 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 03:23:31 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 09EEC2D6016; Mon, 21 Apr 2008 13:33:24 -0700 (PDT) Message-ID: <480CFA15.9050807@elischer.org> Date: Mon, 21 Apr 2008 13:33:25 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: <480CF0F2.20609@elischer.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 20:33:24 -0000 Murty, Ravi wrote: > Fundamentally it seems that they both come down to inhibiting the thread > and putting them on some queue before calling mi_switch(). But when a > thread is woken up from a sleep, setrunnable is called and it checks to > see if the process is swapped out. No such check is made when a thread > is waiting for a lock (I'm wondering if this is related to how long they > block before becoming runnable which might cause a swapout in one case > and no swapout in the other case?) blocking processes/threads are not eligible to be swapped out. > > Ravi > > > -----Original Message----- > From: Julian Elischer [mailto:julian@elischer.org] > Sent: Monday, April 21, 2008 12:54 PM > To: Murty, Ravi > Cc: freebsd-hackers@freebsd.org > Subject: Re: Do you really "sleep" when blocked on a mutex? > > Murty, Ravi wrote: >> Hello, >> >> >> >> When a thread cannot get a mutex (default mutex) and needs to be >> blocked, is it really put to sleep? From looking at the code it > appears >> that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. >> > it really has two answers. > > 1/ sleep has a lot of historical baggage and is expected to work in > certain ways. > > 2/ there is a semantic difference between a sleep > (which may sleep for an unbounded time) and being descheduled for > a blocking lock, (Which is supposed to have a guaranteed "shortness" > of duration. > > Because sleeps 'may never return' (in the short term) there is a > limit of what you may hold when sleeping. In blocking locks > you may hold other resources, with the expectation that the > other threads will be following the correct locking order and that > the nesting of held resources will be safe, because you will > only be blocked for a moment. > > The lowest leven code is the same of course.. things are put on the > run queue, or not.. Having different higher layers allows us to do > various sanity checks and to enforce the different behaviour. > > >> >> >> 1. Why isn't it put to sleep - why can't it be treated the same? >> 2. The eventual question I am trying to answer is the difference >> between setrunnable() and setrunqueue() - this one simply finds a slot >> in the ksegrp and a runq to add the KSE/td. But setrunnable() also >> checks to see if the process is in memory (PS_INMEM) before calling >> sched_wakeup which eventually calls setrunqueue()? Why doesn't >> setrunqueue have to worry about the possibility that the process may >> have been swapped out while it was waiting to become runnable? >> >> >> >> Thanks >> >> Ravi >> >> >> >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 21:36:47 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C0D106566B for ; Mon, 21 Apr 2008 21:36:47 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx1.freebsd.org (Postfix) with ESMTP id 9F6F58FC14 for ; Mon, 21 Apr 2008 21:36:47 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 21 Apr 2008 14:35:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,691,1199692800"; d="scan'208";a="375037413" Received: from orsmsx334.amr.corp.intel.com (HELO orsmsx334.jf.intel.com) ([10.22.226.45]) by orsmga001.jf.intel.com with ESMTP; 21 Apr 2008 14:36:39 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 21 Apr 2008 14:36:46 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Mon, 21 Apr 2008 14:36:45 -0700 Message-ID: In-Reply-To: <480CFA15.9050807@elischer.org> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Do you really "sleep" when blocked on a mutex? Thread-Index: Acij7vMxWUHE/MjERKme35VKtWsswwACG1RQ References: <480CF0F2.20609@elischer.org> <480CFA15.9050807@elischer.org> From: "Murty, Ravi" To: "Julian Elischer" X-OriginalArrivalTime: 21 Apr 2008 21:36:46.0220 (UTC) FILETIME=[CC6FFCC0:01C8A3F7] Cc: freebsd-hackers@freebsd.org Subject: RE: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 21:36:47 -0000 That's actually what I was trying to get to. If I look at vm_daemon(), it checks to see if every thread of the process is running, on the runq or sleeping. If any threads fails the condition - and I can think of the case where a thread is blocked waiting for a lock - it is not a target to be swapped out. I guess this means that if a thread is holding a lock, it can be swapped out. How does this guarantee that the thread is not holding a kernel lock? Why don't they allow threads waiting for a lock (blocked threads/processes) to be swapped out? Related question: how can a process/thread running on a CPU be swapped out, do they suspend the threads before they pull out memory from underneath them? Thanks Ravi -----Original Message----- From: Julian Elischer [mailto:julian@elischer.org]=20 Sent: Monday, April 21, 2008 1:33 PM To: Murty, Ravi Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? Murty, Ravi wrote: > Fundamentally it seems that they both come down to inhibiting the thread > and putting them on some queue before calling mi_switch(). But when a > thread is woken up from a sleep, setrunnable is called and it checks to > see if the process is swapped out. No such check is made when a thread > is waiting for a lock (I'm wondering if this is related to how long they > block before becoming runnable which might cause a swapout in one case > and no swapout in the other case?) blocking processes/threads are not eligible to be swapped out. >=20 > Ravi >=20 >=20 > -----Original Message----- > From: Julian Elischer [mailto:julian@elischer.org]=20 > Sent: Monday, April 21, 2008 12:54 PM > To: Murty, Ravi > Cc: freebsd-hackers@freebsd.org > Subject: Re: Do you really "sleep" when blocked on a mutex? >=20 > Murty, Ravi wrote: >> Hello, >> >> =20 >> >> When a thread cannot get a mutex (default mutex) and needs to be >> blocked, is it really put to sleep? From looking at the code it > appears >> that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. >> > it really has two answers. >=20 > 1/ sleep has a lot of historical baggage and is expected to work in=20 > certain ways. >=20 > 2/ there is a semantic difference between a sleep > (which may sleep for an unbounded time) and being descheduled for > a blocking lock, (Which is supposed to have a guaranteed "shortness" > of duration. >=20 > Because sleeps 'may never return' (in the short term) there is a > limit of what you may hold when sleeping. In blocking locks > you may hold other resources, with the expectation that the > other threads will be following the correct locking order and that > the nesting of held resources will be safe, because you will > only be blocked for a moment. >=20 > The lowest leven code is the same of course.. things are put on the=20 > run queue, or not.. Having different higher layers allows us to do > various sanity checks and to enforce the different behaviour. >=20 >=20 >> =20 >> >> 1. Why isn't it put to sleep - why can't it be treated the same? >> 2. The eventual question I am trying to answer is the difference >> between setrunnable() and setrunqueue() - this one simply finds a slot >> in the ksegrp and a runq to add the KSE/td. But setrunnable() also >> checks to see if the process is in memory (PS_INMEM) before calling >> sched_wakeup which eventually calls setrunqueue()? Why doesn't >> setrunqueue have to worry about the possibility that the process may >> have been swapped out while it was waiting to become runnable? >> >> =20 >> >> Thanks >> >> Ravi >> >> =20 >> >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 21:46:12 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1C6106566B for ; Mon, 21 Apr 2008 21:46:12 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id CDF488FC13 for ; Mon, 21 Apr 2008 21:46:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2082720fgg.35 for ; Mon, 21 Apr 2008 14:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=uJyFTgJNiwcyiUjvW9ovy97tpltPWtHu3brBtHVFd/s=; b=TaZLWY7/PG2U3E+1jnDN6rI97QublqOrZh/iCmB8tgrbio7RLd8LHnZ5QoJ4bdGPDJI6JiDYLO4JDNGVNafzB+NcCX5fsWA10yZLN1ed4N8y/lPm4u3arOaKi0Pm/p7O4Sn3jSI9VuoQJkBi3kdTFcso39a5C768Dh6hCTZ10LY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=N4zCyZ6SPqHTE2/5ewiY/Xr+ktpRBKcD1SRNmqR4PlWen9w4ExBVuxFbNJNto6+w7tcBQKpL9OxLRLpnOsuq7tTsODvYvEO6IuOfkEnJZRhzXaoA9POvfTzyUEhan8ueEARUQS2meksz3Ofd6uA4GD1ekdPGqPP06ouKod1MAWY= Received: by 10.86.72.15 with SMTP id u15mr14170437fga.21.1208812796144; Mon, 21 Apr 2008 14:19:56 -0700 (PDT) Received: by 10.86.36.15 with HTTP; Mon, 21 Apr 2008 14:19:56 -0700 (PDT) Message-ID: <3bbf2fe10804211419r5a5178e1ndd2cdc65430b651c@mail.gmail.com> Date: Mon, 21 Apr 2008 23:19:56 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Murty, Ravi" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 914533151dcce9ad Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 21:46:12 -0000 2008/4/21, Murty, Ravi : > Hello, > > > > When a thread cannot get a mutex (default mutex) and needs to be > blocked, is it really put to sleep? From looking at the code it appears > that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. > >From a scheduler perspective, sleeping and blocking are 2 different events but from a low level look-through there is not much difference. What happens is that the thread is maked as inhibited, moved into a different queue than runqueue and switched out. What really changes is upper level behaviour. TD_SET_LOCK is used in conjuction with turnstiles which basically operate priority propagation on the 'lock owner' and so the turnstile becames the recipient for blocked thread (in other word, the turnstile is the 'different queue than runqueue' where the thread lives). TD_SET_SLEEP, on the other side, is used in conjuction with sleepqueue which doesn't operate priority propagation to lock owner (as long as, often, this owner is not present -- just think to wait channels). In this case the recipient is the sleepqueue and there the thread lives. On a low level the paradigm is similar when a thread blocks using the turnstile or sleeps using the sleepqueue: - the thread is running so it is nomore present on any runqueue - the thread is marked as inhibited - the relevant event is signalled (lock / sleep) - the thread is assigned to the new recipient (turnstile / sleepqueue) - the thread is switched out Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 22:50:22 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4A4D106566C for ; Mon, 21 Apr 2008 22:50:22 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outF.internet-mail-service.net (outf.internet-mail-service.net [216.240.47.229]) by mx1.freebsd.org (Postfix) with ESMTP id A35B08FC1A for ; Mon, 21 Apr 2008 22:50:22 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 05:40:39 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 10A4A2D6006; Mon, 21 Apr 2008 15:50:21 -0700 (PDT) Message-ID: <480D1A2F.2000605@elischer.org> Date: Mon, 21 Apr 2008 15:50:23 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: <480CF0F2.20609@elischer.org> <480CFA15.9050807@elischer.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 22:50:22 -0000 Murty, Ravi wrote: > That's actually what I was trying to get to. > > If I look at vm_daemon(), it checks to see if every thread of the > process is running, on the runq or sleeping. If any threads fails the > condition - and I can think of the case where a thread is blocked > waiting for a lock - it is not a target to be swapped out. I guess this > means that if a thread is holding a lock, it can be swapped out. no. because if it holds a lock it must be in the run queue, running or waiting for another lock. no other state is permitted. > How > does this guarantee that the thread is not holding a kernel lock? Why > don't they allow threads waiting for a lock (blocked threads/processes) > to be swapped out? > > Related question: how can a process/thread running on a CPU be swapped > out, do they suspend the threads before they pull out memory from > underneath them? not sure, I'd have to read the code again. > > Thanks > Ravi > From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 00:03:29 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26883106566C for ; Tue, 22 Apr 2008 00:03:29 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id ADCAE8FC1B for ; Tue, 22 Apr 2008 00:03:28 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2125772fgg.35 for ; Mon, 21 Apr 2008 17:03:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=cm/5jhPhFCPYPqJwGlwRS7z6hbhjbDapFq2keQfbGHw=; b=tqO8lnsJoITkq2RbrcOpeSTlDIRH+BqDVMRGmPdTn+P5Xr/adRfkIdGMsYe6xw+PYwUh5iKy7wgDl/HjDWPj9Y7gmYhMOzLm7kWKiTO49I1/Hh0f610b8fkb28/2PIdoTp8f1CDISciWtTr7cgtyIUyhs8k6aB2hIX5Q7ZvTKRs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=JDM83S18o3lVbgMRZMqabwFtbsOtHHDdn75ESWLXwJApNoAnYYmPHkTh2ete5mR5kyY6Hv1YoaKOG3QutRM1wIfGmkDbNU0f4srhhT1IwfEnJOAK32QM3wHr3YJeXjlubJH+E6yok86RX9A8c4wK56CADP9evWGVJfC6KeIqlR4= Received: by 10.86.73.7 with SMTP id v7mr6485277fga.31.1208822607288; Mon, 21 Apr 2008 17:03:27 -0700 (PDT) Received: by 10.86.36.15 with HTTP; Mon, 21 Apr 2008 17:03:27 -0700 (PDT) Message-ID: <3bbf2fe10804211703h6eebbde2q2054a30df1e0164b@mail.gmail.com> Date: Tue, 22 Apr 2008 02:03:27 +0200 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Murty, Ravi" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 37245f2f7782917e Cc: freebsd-hackers@freebsd.org Subject: Re: Do you really "sleep" when blocked on a mutex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 00:03:29 -0000 2008/4/21, Murty, Ravi : > Hello, > > > > When a thread cannot get a mutex (default mutex) and needs to be > blocked, is it really put to sleep? From looking at the code it appears > that it is inhibited (TD_SET_LOCK) but isn't really put to sleep. > > > > 1. Why isn't it put to sleep - why can't it be treated the same? > 2. The eventual question I am trying to answer is the difference > between setrunnable() and setrunqueue() - this one simply finds a slot > in the ksegrp and a runq to add the KSE/td. But setrunnable() also > checks to see if the process is in memory (PS_INMEM) before calling > sched_wakeup which eventually calls setrunqueue()? Why doesn't > setrunqueue have to worry about the possibility that the process may > have been swapped out while it was waiting to become runnable? I just forgot to answer this: on 6.x serie (note that setrunqueue() shouldn't be available on 7.x and above), setrunqueue() is just used as backend for setrunnable(). Usually, setrunqueue() was used in places where the state of the thread was alredy assumed and no further check were needed. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 08:24:48 2008 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08E081065671; Tue, 22 Apr 2008 08:24:48 +0000 (UTC) (envelope-from murray@freebsdmall.com) Received: from mail.freebsdmall.com (mail.freebsdmall.com [69.50.233.168]) by mx1.freebsd.org (Postfix) with ESMTP id E97AD8FC1F; Tue, 22 Apr 2008 08:24:47 +0000 (UTC) (envelope-from murray@freebsdmall.com) Received: by mail.freebsdmall.com (Postfix, from userid 2074) id C35A31D717D7; Tue, 22 Apr 2008 00:56:42 -0700 (PDT) Date: Tue, 22 Apr 2008 00:56:42 -0700 From: Murray Stokely To: hackers@FreeBSD.org Message-ID: <20080422075642.GA72273@freebsdmall.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG-Key-ID: 1024D/0E451F7D X-GPG-Key-Fingerprint: E2CA 411D DD44 53FD BB4B 3CB5 B4D7 10A2 0E45 1F7D User-Agent: Mutt/1.5.11 Cc: soc-students@FreeBSD.org Subject: Please welcome our Summer of Code Students X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 08:24:48 -0000 Google announced today that they are funding 21 of our Summer of Code applicants (out of over 100 applications). We had at least 10 highly competitive applications that were not funded by Google, and we've encouraged some of those students to work on FreeBSD this summer anyway. We are very much looking forward to working with these students this summer on the chosen FreeBSD related projects. So without further ado, the student/mentor pairs are : * Dynamic memory allocation for dirhash in UFS2, Sean Nicholas Barkas, mentored by David Malone * TCP/IP regression test suite, Victor Hugo Bilouro, mentored by George Neville-Neil * Improved Wine support under FreeBSD, Eric Durbin, mentored by Kristofer Paul Moore (PC-BSD) * Allowing for Parallel builds in the FreeBSD Ports Collection, David Forsythe, mentored by Mark Linimon * Implementation of MPLS in FreeBSD, Ryan French, mentored by Kip Macy * Audit Firewall Events from Kernel, Diego Giagio, mentored by Christian S.J. Peron * Embedded FreeBSD project, James Andrew Harrison, mentored by Warner Losh * FreeBSD auditing system testing, Vincenzo Iozzo, mentored by Attilio Rao * Multibyte collation support, Konrad Jankowski, mentored by Diomidis Spinellis * Porting BSD-licensed Text-Processing Tools from OpenBSD, Gabor Kovesdan, mentored by Max Khon * Reference implementation of the SNTP client, Johannes Maximilian Kuehn, mentored by Harlan Stenn (NTP) * Improving layer2 filtering in FreeBSD, Gleb Kurtsov, mentored by Andrew Thompson * DTrace Toolkit on FreeBSD, LIQUN LI, mentored by John Birrell * NFSv4 ACLs, Edward Tomasz Napierala, mentored by Robert Watson * Adding .db support to pkg_tools --> pkg_improved, Anders Nore, mentored by Florent Thoumie * 802.11 Fuzzing and Testing, Aniket Patankar, mentored by Sam Leffler * TCP anomaly detector, Rui Alexandre Cunha Paulo, mentored by Andre Oppermann * Ports license auditing infrastructure, Alejandro Pulver, mentored by Brooks Davis * VM Algorithm Improvement, Mayur Shardul, mentored by Jeffrey Roberson * Enhancing FreeBSD's Libarchive, Anselm Strauss, mentored by Timothy Kientzle * Porting FreeBSD to Efika SoC (PPC bring up), Przemek Witaszczyk, mentored by Rafal Jaworowski We are still in the process of getting them signed up for perforce and wiki accounts and such, but eventually the students will create project pages describing their plans and progress at : http://wiki.freebsd.org/SummerOfCode2008 Most of the students are still busy with coursework at the moment, and so this is a community bonding period before the summer work is supposed to begin. In the mean time if you want to send a note to congratulate them you can mail them all at soc-students@FreeBSD.org. Thanks to everyone (over 60 committers registered this year!) that helped review the student applications, and especially thanks to Google for this significant investment in the the FreeBSD development community. - Murray From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 14:02:42 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0821065670 for ; Tue, 22 Apr 2008 14:02:42 +0000 (UTC) (envelope-from frenchy@driven-monkey.com) Received: from oberon.wxnz.net (oberon.wxnz.net [58.28.6.13]) by mx1.freebsd.org (Postfix) with ESMTP id 583DB8FC1E for ; Tue, 22 Apr 2008 14:02:42 +0000 (UTC) (envelope-from frenchy@driven-monkey.com) Received: from Tank (ip-118-90-28-221.xdsl.xnet.co.nz [118.90.28.221]) by oberon.wxnz.net (Postfix) with SMTP id 5DFF346405D for ; Wed, 23 Apr 2008 01:48:13 +1200 (NZST) Message-ID: <76CA5E0B805944358D85EFAF5B49F824@Tank> From: "Ryan French" To: Date: Wed, 23 Apr 2008 01:47:32 +1200 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18000 X-Antivirus: avast! (VPS 080422-0, 22/04/2008), Outbound message X-Antivirus-Status: Clean Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 14:02:42 -0000 Hi All, My name is Ryan French. I am a Google Summer of Code participant this = year, and for my project I will be implementing MPLS in FreeBSD. I am in = my 5th year of university at the University of Waikato in New Zealand, = and this year I am working on obtaining my PostGraduate Diploma in = Computer Science (equivalent to the first year of a masters degree). I'm = really looking forward to working on this project, as it is also part of = my coursework for this year. I'm still in the process of getting through = all the introduction stuff to the GSoC, but once that has been done I'm = going to continue working on this project and hopefully come up with = something that I can be real proud of over the next few months. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 16:01:06 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3D85106566C for ; Tue, 22 Apr 2008 16:01:06 +0000 (UTC) (envelope-from infofarmer@FreeBSD.org) Received: from heka.cenkes.org (heka.cenkes.org [208.79.80.110]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9788FC16 for ; Tue, 22 Apr 2008 16:01:06 +0000 (UTC) (envelope-from infofarmer@FreeBSD.org) Received: from amilo.cenkes.org (ppp85-140-148-9.pppoe.mtu-net.ru [85.140.148.9]) (Authenticated sender: sat) by heka.cenkes.org (Postfix) with ESMTPSA id 4A595242FA0D; Tue, 22 Apr 2008 19:41:22 +0400 (MSD) Date: Tue, 22 Apr 2008 19:41:25 +0400 From: Andrew Pantyukhin To: Ryan French Message-ID: <20080422154120.GK54610@amilo.cenkes.org> References: <76CA5E0B805944358D85EFAF5B49F824@Tank> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <76CA5E0B805944358D85EFAF5B49F824@Tank> X-OS: FreeBSD 8.0-CURRENT amd64 User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: infofarmer@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 16:01:06 -0000 On Wed, Apr 23, 2008 at 01:47:32AM +1200, Ryan French wrote: > Hi All, > > My name is Ryan French. I am a Google Summer of Code > participant this year, and for my project I will be > implementing MPLS in FreeBSD. Welcome and good luck! From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 16:12:43 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D12E3106564A for ; Tue, 22 Apr 2008 16:12:43 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx1.freebsd.org (Postfix) with ESMTP id 9FF848FC17 for ; Tue, 22 Apr 2008 16:12:43 +0000 (UTC) (envelope-from ravi.murty@intel.com) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 22 Apr 2008 09:11:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.25,695,1199692800"; d="scan'208,217";a="319994849" Received: from orsmsx335.amr.corp.intel.com (HELO orsmsx335.jf.intel.com) ([10.22.226.40]) by fmsmga002.fm.intel.com with ESMTP; 22 Apr 2008 09:11:04 -0700 Received: from orsmsx416.amr.corp.intel.com ([10.22.226.46]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 22 Apr 2008 09:12:42 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Date: Tue, 22 Apr 2008 09:12:42 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Did the notion of ksegrp's go away in 7.x? Thread-Index: Acikk7FQ/ZsNPmSTSd2+2dWI4HNMGA== From: "Murty, Ravi" To: X-OriginalArrivalTime: 22 Apr 2008 16:12:42.0943 (UTC) FILETIME=[B1C11CF0:01C8A493] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Did the notion of ksegrp's go away in 7.x? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 16:12:43 -0000 Hello, =20 I was browsing through the 7.x code and in particular looking at kern/kern_switch.c and find ksegrp completely missing (I was looking for setrunqueue). Is the notion of process_scope vs system_scope out in 7.x? =20 Thanks Ravi =20 From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 16:45:08 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA766106566C for ; Tue, 22 Apr 2008 16:45:08 +0000 (UTC) (envelope-from jhs@berklix.org) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id 2066F8FC14 for ; Tue, 22 Apr 2008 16:45:07 +0000 (UTC) (envelope-from jhs@berklix.org) Received: from js.berklix.net (p549A6701.dip.t-dialin.net [84.154.103.1]) (authenticated bits=0) by flat.berklix.org (8.13.8/8.13.8) with ESMTP id m3MGN9NY046876; Tue, 22 Apr 2008 18:23:09 +0200 (CEST) (envelope-from jhs@berklix.org) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by js.berklix.net (8.13.8/8.13.8) with ESMTP id m3MGQOs3092519; Tue, 22 Apr 2008 18:26:24 +0200 (CEST) (envelope-from jhs@berklix.org) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.13.8/8.13.8) with ESMTP id m3MGQE6v053370; Tue, 22 Apr 2008 18:26:19 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <200804221626.m3MGQE6v053370@fire.js.berklix.net> To: "Ryan French" In-reply-to: <76CA5E0B805944358D85EFAF5B49F824@Tank> References: <76CA5E0B805944358D85EFAF5B49F824@Tank> Comments: In-reply-to "Ryan French" message dated "Wed, 23 Apr 2008 01:47:32 +1200." Date: Tue, 22 Apr 2008 18:26:14 +0200 From: "Julian H. Stacey" Cc: freebsd-hackers@freebsd.org Subject: Re: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 16:45:08 -0000 "Ryan French" wrote: > Hi All, > > My name is Ryan French. I am a Google Summer of Code participant this year, and for my project I will be implementing MPLS in FreeBSD. To save others also wondering "What's MPLS ?" ... Multi Protocol Label Switching http://www.webopedia.com/TERM/M/MPLS.html http://en.wikipedia.org/wiki/MPLS http://www.cisco.com/en/US/products/ps6557/products_ios_technology_home.html Wishing all SoC people fun & success. Julian -- Julian Stacey: BSDUnixLinux C Prog Admin SysEng Consult Munich www.berklix.com Mail just Ascii plain text. HTML & Base64 text are spam. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 16:51:59 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17F8E106566C for ; Tue, 22 Apr 2008 16:51:59 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mx1.freebsd.org (Postfix) with ESMTP id B6EBD8FC27 for ; Tue, 22 Apr 2008 16:51:58 +0000 (UTC) (envelope-from joao.barros@gmail.com) Received: by yw-out-2324.google.com with SMTP id 2so1162619ywt.13 for ; Tue, 22 Apr 2008 09:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=PAtHZiTVIKSF8q0z3NLhiq8B3PbLXqeh0/J1SOlYJJE=; b=VOcwjmcEYfJXfRQzzlcq1F+lAvIWAeP8cEwcsPRlHAsCgw/9kK5LGt+06pxB4I83PwY3jM1dq/xMNc2rdp0sME6rw6DuCUT9HUQUe3Ixc0ewIPogDAShw1S7GEDhLJPMsb/NHzvLImtrrhGH4xUPhNBGCZJaFURmUd8BKhoIxHU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=W2c5hnrvjBD8ZJwcoy9LIoDbkgzA9utanKtY0c6t/JoYkOrzkEuAyPhPl7fsLtbTDclCtx1s/ayKJZH0hKeKI0HB0ZM8e2AZWE8MzhwJJervnI9Gy+QW7vA7pmbXxtcqn8hNt7NZCnbKWIdIuNBeDvCAKU/agyKF/JFRCKDMFUM= Received: by 10.143.9.20 with SMTP id m20mr72904wfi.252.1208881656247; Tue, 22 Apr 2008 09:27:36 -0700 (PDT) Received: by 10.143.195.1 with HTTP; Tue, 22 Apr 2008 09:27:36 -0700 (PDT) Message-ID: <70e8236f0804220927jde661eaj3d7286b675eaf1ea@mail.gmail.com> Date: Tue, 22 Apr 2008 17:27:36 +0100 From: "Joao Barros" To: "Ryan French" In-Reply-To: <76CA5E0B805944358D85EFAF5B49F824@Tank> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <76CA5E0B805944358D85EFAF5B49F824@Tank> Cc: freebsd-hackers@freebsd.org Subject: Re: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 16:51:59 -0000 On Tue, Apr 22, 2008 at 2:47 PM, Ryan French wrote: > Hi All, > > My name is Ryan French. I am a Google Summer of Code participant this year, and for my project I will be implementing MPLS in FreeBSD. I am in my 5th year of university at the University of Waikato in New Zealand, and this year I am working on obtaining my PostGraduate Diploma in Computer Science (equivalent to the first year of a masters degree). I'm really looking forward to working on this project, as it is also part of my coursework for this year. I'm still in the process of getting through all the introduction stuff to the GSoC, but once that has been done I'm going to continue working on this project and hopefully come up with something that I can be real proud of over the next few months. Hi Ryan, Congratulations on being selected as a participant :-) I have a friend, Nuno Antunes, that started implementing MPLS in FreeBSD but then he went to the dark side (kidding) and continued the work on DragonFlyBSD. I talked to him today after seeing your application being selected to know how far he went. He based his work on the ayame project and nist switch and he has a semi functional patch here: http://leaf.dragonflybsd.org/~nant/wip/mpls-20071109.patch The sad news is that he doesn't have time to continue the implementation, so I'm hopping you make us all proud ;-) -- Joao Barros From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 17:02:45 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A45BF106564A for ; Tue, 22 Apr 2008 17:02:45 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outg.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 805C68FC19 for ; Tue, 22 Apr 2008 17:02:45 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 23:54:04 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 909BA2D6015; Tue, 22 Apr 2008 10:02:44 -0700 (PDT) Message-ID: <480E1A38.90403@elischer.org> Date: Tue, 22 Apr 2008 10:02:48 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Ryan French References: <76CA5E0B805944358D85EFAF5B49F824@Tank> In-Reply-To: <76CA5E0B805944358D85EFAF5B49F824@Tank> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 17:02:45 -0000 Ryan French wrote: > Hi All, > > My name is Ryan French. I am a Google Summer of Code participant this year, and for my project I will be implementing MPLS in FreeBSD. I am in my 5th year of university at the University of Waikato in New Zealand, and this year I am working on obtaining my PostGraduate Diploma in Computer Science (equivalent to the first year of a masters degree). I'm really looking forward to working on this project, as it is also part of my coursework for this year. I'm still in the process of getting through all the introduction stuff to the GSoC, but once that has been done I'm going to continue working on this project and hopefully come up with something that I can be real proud of over the next few months. > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" g'day There has been a noted shortage in "kuwus" in freebsd.. for some reason. :-) From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 17:11:27 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B8AA106570C for ; Tue, 22 Apr 2008 17:11:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outs.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id 36F1A8FC29 for ; Tue, 22 Apr 2008 17:11:27 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Wed, 23 Apr 2008 00:02:47 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 7B3B32D6004; Tue, 22 Apr 2008 10:11:26 -0700 (PDT) Message-ID: <480E1C41.3010506@elischer.org> Date: Tue, 22 Apr 2008 10:11:29 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Did the notion of ksegrp's go away in 7.x? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 17:11:27 -0000 Murty, Ravi wrote: > Hello, > > > > I was browsing through the 7.x code and in particular looking at > kern/kern_switch.c and find ksegrp completely missing (I was looking for > setrunqueue). > > Is the notion of process_scope vs system_scope out in 7.x? As I mentioned to you in previous mail, this all changed in 7.x and 8.x. So, yes it went away. The gain from having this complication was not balanced by the extra complexity. Also, in the real world, since Linux has no comparable abstraction, no software is being written to use it. It is possible that one could write a scheduler that would implement it again but keep the differences isolated within the scheduler. In 8.x the KSE threading library goes away for the same reason. The 1:1 library becomes the base implementation. If you have questions you can email me directly for more details. > > > > Thanks > Ravi > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 17:16:41 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC73106566C for ; Tue, 22 Apr 2008 17:16:41 +0000 (UTC) (envelope-from dgiagio@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.232]) by mx1.freebsd.org (Postfix) with ESMTP id 4818B8FC23 for ; Tue, 22 Apr 2008 17:16:41 +0000 (UTC) (envelope-from dgiagio@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so1420844rvf.43 for ; Tue, 22 Apr 2008 10:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=OvyEEMdhrPlFZ/wETalUd+iYy+Tp0poGoX2Xe2WYDw4=; b=aX1jO5xlT5P10p3lzZ3S1kmQrj8/xKbulMDhzC//8qkyV2b6g2Y3kq1YE4xOOGvCMYQk7PDrZdNjJm0Ub8yxK2SODmVzBUF5HCNuLarCk3UOqO1LWwsPdp2LJgG5oFQmcMlHyl4jiaI/R6OQUOROBZzCX9+LUPYG7+iRLgK982Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=I97NJy5R7+JAfnl1qn27UlsLsqPcj9WJ02bef2kOptzSMScdqsXYvgvpFz8mplsC8A/ihhqMFDg3Pkaeu6S0Rm8duuAUn5un5Yny+ioQS4kps4EvaXsTdOdmY6Eg64qkTiCNeSRHU0Kt7RcHYH8akAMWRJQbbASAolahkRqZQ2s= Received: by 10.141.44.13 with SMTP id w13mr9303rvj.13.1208883035626; Tue, 22 Apr 2008 09:50:35 -0700 (PDT) Received: by 10.141.129.11 with HTTP; Tue, 22 Apr 2008 09:50:35 -0700 (PDT) Message-ID: <1b0798830804220950i715da800n41019efddea073e6@mail.gmail.com> Date: Tue, 22 Apr 2008 13:50:35 -0300 From: "Diego Giagio" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Introducing myself - GSoC 2008 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 17:16:41 -0000 Hi, My name is Diego Giagio. I'm 25, brazilian, from Rio de Janeiro. I'm a student working towards my undergraduate degree on Candido Mendes University. In late 2006, I started working on OpenBSM library and got the privilege to have some small patches accepted. At that time, I introduced myself to Robert Watson (rwatson@). Since then, I've been following discussions on mailing lists, following commits, etc., all related to TrustedBSD project. I consider myself a security centric guy. In the past, I've found holes on Ethereal (now Wireshark) and OpenBSD's spamd, both with proof-of-concept programs to trigger the vulnerabilities. I usually spend part of my time reading and analyzing code on a daily basis, looking for bad written code, vulnerabilities and possible performance optimizations. I'm really honored for being selected to work on Audit Firewall Events on Kernel project, and I can asure you that I will do my best working on it. During this period, I hope to get to know as many FreeBSD developers and talented people as possible. I'm also very happy to have Christian S.J. Peron (csjp@) as my mentor on this project. So, let the work begin. -- DG From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 19:50:28 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BECCE106564A for ; Tue, 22 Apr 2008 19:50:28 +0000 (UTC) (envelope-from mayur.shardul@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.188]) by mx1.freebsd.org (Postfix) with ESMTP id 729698FC21 for ; Tue, 22 Apr 2008 19:50:28 +0000 (UTC) (envelope-from mayur.shardul@gmail.com) Received: by rn-out-0910.google.com with SMTP id j40so924198rnf.12 for ; Tue, 22 Apr 2008 12:50:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=IEANsAQdtcnWq5Q7RYh2KRMnjUB/LPtJKG56PshaZug=; b=UdKUhgJ+RNbDMh/iGcSesTsFUpmJbOhEQoQoB8bHviCGFCcWxmHEX/bkA8WnN9uZW7HHaUWUkXz06DnzLns40zdjRhsIcRQl6Grz5JRuR754t5Rk5FDQ96wZt6dwqHBXQMIKUzGcOiqejbcx+k6zxRsyUHpKXkgJ774NLV+/wXk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=bZO221Z0OHl3PM5/r2trjQO8ghJ12npOtAO3YQnRLQ2E+c4SWqF5qK9FXsbqrEjF6Yufy/qFIIV8xlRKmKkFoNTCZBWOAu7d9RZiDPhzufFEUDk1yfTXf6oqUFIE7RTO0iQinDLGxoAt1XYlfSAD4fUStTKNsMkjugZIgD7zTNo= Received: by 10.115.14.1 with SMTP id r1mr39353wai.97.1208888416631; Tue, 22 Apr 2008 11:20:16 -0700 (PDT) Received: by 10.70.31.15 with HTTP; Tue, 22 Apr 2008 11:20:16 -0700 (PDT) Message-ID: <2ac427a0804221120h3965edf0v39a15ef67c46f66@mail.gmail.com> Date: Tue, 22 Apr 2008 23:50:16 +0530 From: Mayur To: hackers@freebsd.org MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 22 Apr 2008 20:12:05 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Introducing myself. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 19:50:28 -0000 Hello All, Myself is Mayur Shardul from Indian Institute of Technology Kanpur, India. I am doing Masters in Computer Science. Investigating for GSoC 07 proposal was my first exposure to FreeBSD, last time I missed my chance so I prepared better this time. I am very happy to be part of BSD community and want to continue the relation even after GSoC. For GSoC 08 I will be working under the guidance of Jeffrey Roberson. I plan to improve some of the VM data structures. Thanks, Mayur From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 20:48:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70965106564A for ; Tue, 22 Apr 2008 20:48:25 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 34AD58FC18 for ; Tue, 22 Apr 2008 20:48:25 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1JoOTQ-000NbQ-UD for freebsd-hackers@freebsd.org; Tue, 22 Apr 2008 22:48:16 +0300 Message-ID: <480E4100.4040000@icyb.net.ua> Date: Tue, 22 Apr 2008 22:48:16 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: commit messages and post-CVS tools X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 20:48:25 -0000 Not sure where to address this, so starting here. As you might know some "post-CVS" VCS-es use a convention where a first line of commit message serves as a kind of commit subject and the rest is a body that further describes the commit. Could we please start thinking about thinking of possible future support of such tools and start thinking of possibly considering a policy for commit messages that would adhere to the above mentioned convention. I mean, when you look at commit history (of the whole project) and see lines like "MFC 1.33" it is not very convenient, you have to look at the complete commit message to see what it is about really. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 21:03:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D74BE106567C for ; Tue, 22 Apr 2008 21:03:26 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9B2DE8FC26 for ; Tue, 22 Apr 2008 21:03:26 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1JoOZG-000OqY-5R for freebsd-hackers@freebsd.org; Tue, 22 Apr 2008 22:54:18 +0300 Message-ID: <480E4269.2090604@icyb.net.ua> Date: Tue, 22 Apr 2008 22:54:17 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 21:03:26 -0000 Maybe this is a crazy idea or maybe we already have something like this. Is it possible to get notifications about changes in devfs - appearance and disappearance of devices (in devfs sense of the word)? devctl currently notifies about real (hardware) devices handled by device drivers and some notifications about hardware/driver events. But what if I want to automatically run some action if /dev/ufs/magic-label appears? Or if I want to monitor appearance and disappearance of ad* and da* devices (without having to monitor low level drivers like umass)? -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 22 21:32:58 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25A6C1065675 for ; Tue, 22 Apr 2008 21:32:58 +0000 (UTC) (envelope-from jille@quis.cx) Received: from smtp4.versatel.nl (smtp4.versatel.nl [62.58.50.91]) by mx1.freebsd.org (Postfix) with ESMTP id 8D58A8FC1B for ; Tue, 22 Apr 2008 21:32:57 +0000 (UTC) (envelope-from jille@quis.cx) Received: (qmail 25969 invoked by uid 0); 22 Apr 2008 21:06:16 -0000 Received: from ip83-113-174-82.adsl2.versatel.nl (HELO istud.quis.cx) ([82.174.113.83]) (envelope-sender ) by smtp4.versatel.nl (qmail-ldap-1.03) with SMTP for < >; 22 Apr 2008 21:06:16 -0000 Received: by istud.quis.cx (Postfix, from userid 100) id 98B0D39864; Tue, 22 Apr 2008 23:06:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on istud.quis.cx X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.4 Received: from [192.168.1.4] (ille [192.168.1.4]) by istud.quis.cx (Postfix) with ESMTP id 6EBBC39860; Tue, 22 Apr 2008 23:06:08 +0200 (CEST) Message-ID: <480E533C.60301@quis.cx> Date: Tue, 22 Apr 2008 23:06:04 +0200 From: Jille User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: Andriy Gapon References: <480E4269.2090604@icyb.net.ua> In-Reply-To: <480E4269.2090604@icyb.net.ua> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Apr 2008 21:32:58 -0000 Andriy Gapon wrote: > Maybe this is a crazy idea or maybe we already have something like this. > Is it possible to get notifications about changes in devfs - appearance > and disappearance of devices (in devfs sense of the word)? > devctl currently notifies about real (hardware) devices handled by > device drivers and some notifications about hardware/driver events. > But what if I want to automatically run some action if > /dev/ufs/magic-label appears? > Or if I want to monitor appearance and disappearance of ad* and da* > devices (without having to monitor low level drivers like umass)? > I don't know whether it is what you are looking for, but take a look at devd(8). -- Jille From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 02:22:41 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B220D106566B for ; Wed, 23 Apr 2008 02:22:41 +0000 (UTC) (envelope-from oscartheduck@gmail.com) Received: from rn-out-0910.google.com (rn-out-0910.google.com [64.233.170.187]) by mx1.freebsd.org (Postfix) with ESMTP id 87E488FC30 for ; Wed, 23 Apr 2008 02:22:41 +0000 (UTC) (envelope-from oscartheduck@gmail.com) Received: by rn-out-0910.google.com with SMTP id j40so1037172rnf.12 for ; Tue, 22 Apr 2008 19:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=64P4CMCCaeP2p3aY6gbQFilpbBg+TYu62zjqKxQwNkk=; b=O2xJR+HRg/mYUj6QB52F9EQ4hjkvr9zN2QebwWTaEA8Mz6vkSh/523u8vXOCAFf+lurupT2jyzKc8N3RYexEczhPtih45ib3YgDNmpJTtM5FqAivBFLzSxGQVAS1nVZZXbzpjh4juFT0FdewojP0YQ0sCY3kqjIGPnHFAgKlBa8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=Mgk+fVUiDVy1nTr/wvPbudxkNqT4oE2MoMyaOifNUL2EGlKBbLUaMTDVr1DTrcFRKsT4SVLTbRWdYZDD8iZ8PbtGDQB5mqxE4ERhsPW9+YXbRiAWkWCYEsleRHEd50PChY1tweECnkWGKy7WNDPgGhnX6BFTpEa6CaalyTdNTOM= Received: by 10.142.12.14 with SMTP id 14mr67146wfl.336.1208915713832; Tue, 22 Apr 2008 18:55:13 -0700 (PDT) Received: by 10.142.232.5 with HTTP; Tue, 22 Apr 2008 18:55:13 -0700 (PDT) Message-ID: Date: Tue, 22 Apr 2008 19:55:13 -0600 From: James To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 02:22:41 -0000 Hi folks, my name is James Harrison; I'm a computer science student at the University of New Mexico, studying mostly at the Los Alamos branch. I'm also a Unix systems administrator/developer at Los Alamos National Lab, where I've been working with embedded linux for a while. I've been working with FreeBSD for a few years now; a friend introduced me to it as a way to get a wireless card working that was stubbornly refusing to cooperate with any other operating system. After spending six months repeatedly breaking and ignoring the system by mixing packages and ports, I finally knuckled down and started learning how the system works. I'm working on the embedded FreeBSD project; I find embedded development to be difficult and extremely enjoyable. It covers a lot of bases, while also hearkening back to days when there were fewer resources available on any system, so that I feel like I'm working in an environment from the late seventies or early eighties. Which means I feel retro cool without actually being limited in resources in the real world. Best James From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 05:40:23 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8626C1065676 for ; Wed, 23 Apr 2008 05:40:23 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6308FC17 for ; Wed, 23 Apr 2008 05:40:22 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2672147fgg.35 for ; Tue, 22 Apr 2008 22:40:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=eQRloYhOwrrhCTnQ5iS2EyL5yVjlDk8IoP/majk05hw=; b=liN4w2NnD9ElxMbcwn0Bb7jSFlQ6QcO4Ppt+E8Kr/vDISoK8g6z5JGKu1uBhsJKpzUEM0LKAv7eR2/IlOdXC1mZxEuDzKkkJhAqRTcjxLTLLVLsgBPtXIZ06UyXESKtOwUMrjUv0SNq8GPlH4ipo16lDZ738GgdWo5DiXfzx7HI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=qiaveYq+i8V8m01t/jI7FXpkkykPWng5jz6qlfx6CCOY4DWDxhtEDOGcCGCDWSNBm18S+jc215Xl1ifMLkj0M5c+XLlI1zjHsQRY5xq9glgsoXiwPdtSc6rBJ0o4M1YDjv0ayVH3D2J+yBoEMPU2xK4xQ4QGzYKGOaAR+YoVNqA= Received: by 10.86.79.19 with SMTP id c19mr2376477fgb.16.1208929221664; Tue, 22 Apr 2008 22:40:21 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Tue, 22 Apr 2008 22:40:21 -0700 (PDT) Message-ID: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> Date: Tue, 22 Apr 2008 22:40:21 -0700 From: "Garrett Cooper" To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 05:40:23 -0000 Hi all, I made an oops in a program, which uncovered "feature" in strdup(2) that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) supposed to segfault should this just return NULL and set errno? Good news is that Linux does the same thing (yay?), so at least FreeBSD isn't alone.. Sample: [gcooper@optimus ~]$ ss="strdup_segfault"; gcc -o $ss $ss.c; ./$ss; cat $ss.c Segmentation fault: 11 (core dumped) #include int main() { const char *null_src_p = NULL; char *null_dest_p = strdup(null_src_p); return 0; } My sources are a bit old (last sync and userland recompile was mid~March) but I don't think that libc changes all that often. [gcooper@optimus ~]$ uname -a FreeBSD optimus 8.0-CURRENT FreeBSD 8.0-CURRENT #10: Wed Apr 16 19:47:39 PDT 200 8 root@optimus:/usr/obj/usr/src/sys/OPTIMUS i386 Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 05:41:25 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60EC71065680 for ; Wed, 23 Apr 2008 05:41:25 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.155]) by mx1.freebsd.org (Postfix) with ESMTP id EF9BA8FC1C for ; Wed, 23 Apr 2008 05:41:24 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2672475fgg.35 for ; Tue, 22 Apr 2008 22:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=dsA8mq/q/rhsaMIKkpMqhvcQYQqdlD4vYhnnjE61yUk=; b=usg2JN/xN1snXUsyOpXxCMcHNMXdT0PxY/S7YP1c1D7LzZVLIIbQ3e0z2ttqoINpD2hJ4cGG1e/EKJdMfOw1WthoCZmfDqsYPHA/X0CndioGknb5UUgsZP97d1yAefbLz9ecZpSm+9KWQu/9uLZg2dUSXhvN2vycw3Sscug5oeM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=w5LD5PrHKXLBqdPVEPk/o3+BGZmA4DrLvuVeAQfFfCz/ieL1bbf1HwvkuN8CxnAp1oZFjPz0D5TevXaDU615J0GkTOx/prIbUwmItlvUXgiWvR1cy4itk6zfoN3csDP02Iu0Pt9R42Koexbs0azfqPAS/HDM5VJtuYPvRoi9c9k= Received: by 10.86.51.2 with SMTP id y2mr2333508fgy.50.1208929283861; Tue, 22 Apr 2008 22:41:23 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Tue, 22 Apr 2008 22:41:23 -0700 (PDT) Message-ID: <7d6fde3d0804222241q4cf9b0d7t5e673023fc7fe1ca@mail.gmail.com> Date: Tue, 22 Apr 2008 22:41:23 -0700 From: "Garrett Cooper" To: James , hackers@freebsd.org In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 05:41:25 -0000 On Tue, Apr 22, 2008 at 6:55 PM, James wrote: > Hi folks, > > my name is James Harrison; I'm a computer science student at the > University > of New Mexico, studying mostly at the Los Alamos branch. I'm also a Unix > systems administrator/developer at Los Alamos National Lab, where I've > been > working with embedded linux for a while. > > I've been working with FreeBSD for a few years now; a friend introduced me > to it as a way to get a wireless card working that was stubbornly refusing > to cooperate with any other operating system. After spending six months > repeatedly breaking and ignoring the system by mixing packages and ports, > I > finally knuckled down and started learning how the system works. > > I'm working on the embedded FreeBSD project; I find embedded development > to > be difficult and extremely enjoyable. It covers a lot of bases, while also > hearkening back to days when there were fewer resources available on any > system, so that I feel like I'm working in an environment from the late > seventies or early eighties. Which means I feel retro cool without > actually > being limited in resources in the real world. > > Best > James Congratulations James and welcome onboard :). -Garrett From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 07:18:55 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88A65106564A for ; Wed, 23 Apr 2008 07:18:55 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 14C668FC3D for ; Wed, 23 Apr 2008 07:18:54 +0000 (UTC) (envelope-from mwm-keyword-freebsdhackers2.e313df@mired.org) Received: (qmail 41941 invoked by uid 1001); 23 Apr 2008 02:50:51 -0400 Received: from bhuda.mired.org (192.168.195.1) by bhuda.mired.org (tmda-ofmipd) with ESMTP; Wed, 23 Apr 2008 02:50:50 -0400 Date: Wed, 23 Apr 2008 02:50:48 -0400 To: "Garrett Cooper" Message-ID: <20080423025048.6b51a580@bhuda.mired.org> In-Reply-To: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Mike Meyer Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 07:18:55 -0000 On Tue, 22 Apr 2008 22:40:21 -0700 "Garrett Cooper" wrote: > Hi all, > I made an oops in a program, which uncovered "feature" in strdup(2) > that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) > supposed to segfault should this just return NULL and set errno? Yes, it's supposed to segfault. Check out what, say, strcpy does if you ask it to copy a NULL pointer. And this is an improvement from the bad old days, when they would happily walk through memory starting at 0..... Besides, errno is used to signal errors from system calls. strdup isn't a system call, it's a library function (says so at the top of the man page). > Good news is that Linux does the same thing (yay?), so at least FreeBSD > isn't alone.. Do you have examples of systems where strdup doesn't behave this way? http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 07:21:14 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7106D1065673 for ; Wed, 23 Apr 2008 07:21:14 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 499CC8FC1C for ; Wed, 23 Apr 2008 07:21:14 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from [IPv6:2001:7b8:3a7:0:60e1:fceb:2bfc:7da0] (unknown [IPv6:2001:7b8:3a7:0:60e1:fceb:2bfc:7da0]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTP id CDA053C; Wed, 23 Apr 2008 09:21:12 +0200 (CEST) Message-ID: <480EE369.5090508@andric.com> Date: Wed, 23 Apr 2008 09:21:13 +0200 From: Dimitry Andric User-Agent: Thunderbird 2.0.0.15pre (Windows/20080409) MIME-Version: 1.0 To: Garrett Cooper References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> In-Reply-To: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 07:21:14 -0000 On 2008-04-23 07:40, Garrett Cooper wrote: > I made an oops in a program, which uncovered "feature" in strdup(2) > that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) > supposed to segfault should this just return NULL and set errno? It could, in fact, tear up the fabric of the universe, or blow up your machine, if it wanted. :) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 07:29:10 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 713361065670 for ; Wed, 23 Apr 2008 07:29:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 440CB8FC36 for ; Wed, 23 Apr 2008 07:29:10 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1JoZPd-000Gx4-QG; Wed, 23 Apr 2008 10:29:05 +0300 Message-ID: <480EE53C.40800@icyb.net.ua> Date: Wed, 23 Apr 2008 10:29:00 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: Jille References: <480E4269.2090604@icyb.net.ua> <480E533C.60301@quis.cx> In-Reply-To: <480E533C.60301@quis.cx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 07:29:10 -0000 on 23/04/2008 00:06 Jille said the following: > Andriy Gapon wrote: >> Maybe this is a crazy idea or maybe we already have something like this. >> Is it possible to get notifications about changes in devfs - appearance >> and disappearance of devices (in devfs sense of the word)? >> devctl currently notifies about real (hardware) devices handled by >> device drivers and some notifications about hardware/driver events. >> But what if I want to automatically run some action if >> /dev/ufs/magic-label appears? >> Or if I want to monitor appearance and disappearance of ad* and da* >> devices (without having to monitor low level drivers like umass)? >> > > I don't know whether it is what you are looking for, but take a look at > devd(8). devd reads devctl -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 07:38:35 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59A31065673 for ; Wed, 23 Apr 2008 07:38:35 +0000 (UTC) (envelope-from mureninc@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by mx1.freebsd.org (Postfix) with ESMTP id 739708FC1B for ; Wed, 23 Apr 2008 07:38:35 +0000 (UTC) (envelope-from mureninc@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2713846fgg.35 for ; Wed, 23 Apr 2008 00:38:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=0iSy2rcREd4srskPObTmfipv4sWaHSM5hz9Iy5pAvA0=; b=N6d1dPQwPMZ9O6nFzT2m1aCChCwe1zk1GYkMzhh9l+Vw8ZUx9HXpV6Y4bSO0V2zmfRM21gjZN/RyVLak9IoY1zkDRddbMlq7epInT2PLhK9DxTds4k2tAtsgSJe69USVwsVidH0w9cyRGcGRKBPoYZaVL6XPM1EuUIROVteEKvY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PhYm3epH6wDzw/mzrpQ7nSQozUm+Pi3kPZNsQgJTdWcPxJhCUnJ8OcppKJfwx0LgpeqW5Toe/j6YKxGSkDp6nxBgdEj/LvbGHUI1PUKAm9szK/fiwx49BDFgxl2XuF98w5PQ98vKpUY5CVbmIOLpXmliiNG2+lvJuF7YEoyi0B0= Received: by 10.86.50.8 with SMTP id x8mr2526074fgx.30.1208934794209; Wed, 23 Apr 2008 00:13:14 -0700 (PDT) Received: by 10.86.72.3 with HTTP; Wed, 23 Apr 2008 00:13:14 -0700 (PDT) Message-ID: Date: Wed, 23 Apr 2008 03:13:14 -0400 From: "Constantine A. Murenin" To: "Garrett Cooper" In-Reply-To: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 07:38:35 -0000 On 23/04/2008, Garrett Cooper wrote: > Hi all, > I made an oops in a program, which uncovered "feature" in strdup(2) > that I wasn't aware of before. So I was wondering, is strdup(pointer = NULL) > supposed to segfault should this just return NULL and set errno? > Good news is that Linux does the same thing (yay?), so at least FreeBSD > isn't alone.. strdup(3) duplicates a string, and NULL is obviously not a string. Or would you expect strlen(NULL) to return 0 and set errno, too? But then you have to redesign most, if not all, libc string functions (http://cvsweb.freebsd.org/src/lib/libc/string/), breaking the expected behaviour of many existing applications and promoting unportable code. C. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 09:03:08 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAC94106564A for ; Wed, 23 Apr 2008 09:03:08 +0000 (UTC) (envelope-from bvgastel@bitpowder.com) Received: from smtpout1.ru.nl (smtpout1.ru.nl [131.174.66.174]) by mx1.freebsd.org (Postfix) with ESMTP id 774DA8FC16 for ; Wed, 23 Apr 2008 09:03:08 +0000 (UTC) (envelope-from bvgastel@bitpowder.com) X-Virus-Scanned: by AMaViS & ClamAV Received: from smaug.bitpowder.com (vhe-410001.sshn.net [195.169.215.64]) by smtp.ru.nl (Postfix) with ESMTP id E9DE480298; Wed, 23 Apr 2008 10:30:41 +0200 (CEST) Received: from shadowfax.bitpowder.com (localhost [127.0.0.1]) by smaug.bitpowder.com (8.14.2/8.13.6) with ESMTP id m3N8UZgn013881; Wed, 23 Apr 2008 08:30:36 GMT (envelope-from bvgastel@bitpowder.com) Message-Id: <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> From: Bernard van Gastel To: Mike Meyer In-Reply-To: <20080423025048.6b51a580@bhuda.mired.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Wed, 23 Apr 2008 10:30:39 +0200 References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> X-Mailer: Apple Mail (2.919.2) Cc: Garrett Cooper , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 09:03:08 -0000 Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: > On Tue, 22 Apr 2008 22:40:21 -0700 > "Garrett Cooper" wrote: > >> Hi all, >> I made an oops in a program, which uncovered "feature" in >> strdup(2) >> that I wasn't aware of before. So I was wondering, is >> strdup(pointer = NULL) >> supposed to segfault should this just return NULL and set errno? > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > you ask it to copy a NULL pointer. And this is an improvement from the > bad old days, when they would happily walk through memory starting at > 0..... I don't like it this way. I would like: strdup(NULL) = NULL strdup(string) = copy of string strcpy(NULL, NULL) = NULL strcpy(s1, NULL) = ERROR strcpy(NULL, s2) = NULL (with s2 unchanged) strcpy(s1, s2) = normal But I am not sure of the implications. Maybe in some situation it is bad... Anyone? > > Besides, errno is used to signal errors from system calls. strdup > isn't a system call, it's a library function (says so at the top of > the man page). But strdup uses malloc, which is a system call (from the strdup manual: If insufficient memory is available, NULL is returned and errno is set to ENOMEM.) Regards, Bernard From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 09:09:01 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 393D0106566B for ; Wed, 23 Apr 2008 09:09:01 +0000 (UTC) (envelope-from miauris@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.174]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA0A8FC0A for ; Wed, 23 Apr 2008 09:09:00 +0000 (UTC) (envelope-from miauris@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so1893365wfa.7 for ; Wed, 23 Apr 2008 02:09:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=7SqhEvMOnFn6l3RnZ7ZICgJSfIrrzAhYAk+BnxFkgkU=; b=IqGTkW2NXEPcEiyuLpNvKUV8SuDLAwB8K3fLgD9o5QX/ybwEE9N6Lyrx2YzbW0i6UO7+gBYXxNRXYfbA7+MqWymi0f/irbfpRjtLnqnqDjMY6XGMF+A7GG6MU9RXqVmgZQqnhWgbGCWXp//BxX408VXG3yg3pl3xad6jtlYiBJc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=l9T1lmEM2LkuncF+n/XV0aZGDUjHtZnKqyj4h980T738KkutECa3nckzkWiAMOMv5nXQHVeXe/JwEyplvC8pE9vnuGYzkyhsRrvC2fSqw+B5jol+p2OHe+FlkTS/o6edMfqarIfj6YFuOfMiR30IoTOoNiP5oAn/BO8DSaBzSzk= Received: by 10.142.216.9 with SMTP id o9mr52416wfg.93.1208941740404; Wed, 23 Apr 2008 02:09:00 -0700 (PDT) Received: by 10.142.131.21 with HTTP; Wed, 23 Apr 2008 02:09:00 -0700 (PDT) Message-ID: <1dd0a33d0804230209m2e1f81e0pe6cd5060134872a@mail.gmail.com> Date: Wed, 23 Apr 2008 12:09:00 +0300 From: "Mihai Serb" To: "Li, Qing" , freebsd-hackers@freebsd.org In-Reply-To: MIME-Version: 1.0 References: <1dd0a33d0804160337o3090ac08g4a2cbc3be0d58b19@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Multipath routing - failover version X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 09:09:01 -0000 On 4/16/08, Li, Qing wrote: > > > Hi, > > I recently incorporated multipath support into -CURRENT, > for the upcoming 8.0. This patch originated from the KAME > project and builds on the existing routing data structures > and infrastructure. As a result I did not have to > modify the userland programs, however, I think netstat > can use some tweaking in its output. > > The reason why I've made this patch is that I needed some sort of failover and not load balancing. Corect me if I'm wrong but it seams that you've added support for some sort of load balancing. Anyway, I will certainly take a closer look at your work and maybe try to adjust it to my needs. Hmm... in the current code if_unroute() would remove > the interface route when the interface is down. That is corect but it does not remove the ifp reference of a gateway route. Mihai Serb From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 09:11:40 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D8331065675 for ; Wed, 23 Apr 2008 09:11:40 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 2724A8FC1F for ; Wed, 23 Apr 2008 09:11:39 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2747658fgg.35 for ; Wed, 23 Apr 2008 02:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=ZjIHwe31owFmMi1jglofvRHfrbrFn0+4QX1hkiDBjVk=; b=BCOoaQUimksKS2PbSjhpylPmf2EdXfz1FxloUu1e9RxLZ6Grj8JIVQ/6bh0gNO2fZlT/fggfY/VrZw1IoCaEMvaF9wFNZbvtBlBzD0IiSjQRRfPntlZhNQMoItP5M6nvkAPuIZoq+Y9NHnXkq1yzspsd35oN32XOzEjA5Dn3Z44= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=cJcT6yoH4aCB6GS8VHUj/3ugqJcOGtBj9QlCA3jmhdkw/V8AZtYD2SMtYLK+Wlt51DgntZ10F3m1zBWwsr9srqHX1KeUZCvavgq9mc9nmcELV0NtbulioPovPdBvRwENxD5k/R80MePtOmo5DUeMynwesnw1VVzVFb5tkdWQrec= Received: by 10.86.36.11 with SMTP id j11mr2791624fgj.5.1208941899074; Wed, 23 Apr 2008 02:11:39 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Wed, 23 Apr 2008 02:11:38 -0700 (PDT) Message-ID: <7d6fde3d0804230211x4c6d1fa4v19118d6104c09f4@mail.gmail.com> Date: Wed, 23 Apr 2008 02:11:38 -0700 From: "Garrett Cooper" To: "Mike Meyer" , hackers@freebsd.org In-Reply-To: <20080423025048.6b51a580@bhuda.mired.org> MIME-Version: 1.0 References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 09:11:40 -0000 On Tue, Apr 22, 2008 at 11:50 PM, Mike Meyer wrote: > On Tue, 22 Apr 2008 22:40:21 -0700 > "Garrett Cooper" wrote: > > > Hi all, > > I made an oops in a program, which uncovered "feature" in strdup(2) > > that I wasn't aware of before. So I was wondering, is strdup(pointer = > NULL) > > supposed to segfault should this just return NULL and set errno? > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > you ask it to copy a NULL pointer. And this is an improvement from the > bad old days, when they would happily walk through memory starting at > 0..... > > Besides, errno is used to signal errors from system calls. strdup > isn't a system call, it's a library function (says so at the top of > the man page). > > > Good news is that Linux does the same thing (yay?), so at least > FreeBSD > > isn't alone.. > > Do you have examples of systems where strdup doesn't behave this way? > > Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F5A7106566C for ; Wed, 23 Apr 2008 09:12:40 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id A45F68FC12 for ; Wed, 23 Apr 2008 09:12:39 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2748095fgg.35 for ; Wed, 23 Apr 2008 02:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=lTKeAto29eUPCZUHtA0FXtvkJi3I4B+O9eTIb9IE4zo=; b=BhPIbq5T+uYllS9euvkoMXZp8rpU7GkZfiOZN4/YduK1ylPHJopiBRkKfneZIaJ+Ii00D27ksU1p9ezghcgmKAU/ssaZhXXnjod5qR+LJNbTb6ti6Qek/dvH35Mv39GyXYUaJkp5qkvTYjo9oAeURQf6tDcpH9BDRESbRkhglUM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fhRVzuys0o14n4H6oIkQB6iCFiMAiZw9dZKgoNqPQNTMx8biYrzrdInLKDQmN9CmHPRof+G7MbULAPE8dXdyxc/diyG//MXZ15/2dq2cBbpz8Xcd9bbWHD2pRbVNOmuVOU70sJYIJuYAJ/MKNzrlO0xujorQsvAsWgdxc74kSj4= Received: by 10.86.59.2 with SMTP id h2mr2668840fga.78.1208941957637; Wed, 23 Apr 2008 02:12:37 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Wed, 23 Apr 2008 02:12:37 -0700 (PDT) Message-ID: <7d6fde3d0804230212o6cef38fesb2e7d87848ed74b1@mail.gmail.com> Date: Wed, 23 Apr 2008 02:12:37 -0700 From: "Garrett Cooper" To: hackers@freebsd.org In-Reply-To: <7d6fde3d0804230211x4c6d1fa4v19118d6104c09f4@mail.gmail.com> MIME-Version: 1.0 References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <7d6fde3d0804230211x4c6d1fa4v19118d6104c09f4@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 09:12:40 -0000 On Wed, Apr 23, 2008 at 2:11 AM, Garrett Cooper wrote: > On Tue, Apr 22, 2008 at 11:50 PM, Mike Meyer wrote: > > > On Tue, 22 Apr 2008 22:40:21 -0700 > > "Garrett Cooper" wrote: > > > > > Hi all, > > > I made an oops in a program, which uncovered "feature" in > > strdup(2) > > > that I wasn't aware of before. So I was wondering, is strdup(pointer = > > NULL) > > > supposed to segfault should this just return NULL and set errno? > > > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > > you ask it to copy a NULL pointer. And this is an improvement from the > > bad old days, when they would happily walk through memory starting at > > 0..... > > > > Besides, errno is used to signal errors from system calls. strdup > > isn't a system call, it's a library function (says so at the top of > > the man page). > > > > > Good news is that Linux does the same thing (yay?), so at least > > FreeBSD > > > isn't alone.. > > > > Do you have examples of systems where strdup doesn't behave this way? > > > > > > No, I don't, but then again I just noticed this. > -Garrett > (and thanks for clarifying about errno; didn't realize that) -Garrett From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 09:19:55 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3091065675 for ; Wed, 23 Apr 2008 09:19:55 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.153]) by mx1.freebsd.org (Postfix) with ESMTP id 17A448FC18 for ; Wed, 23 Apr 2008 09:19:54 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so2750721fgg.35 for ; Wed, 23 Apr 2008 02:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=UjRSVyOdO4vVW4OcIHDKhwZBd+VKdXxJHL+GkiIonYc=; b=PktifkfiBtYwZhxOXv8JofYMcPWvXgFDeaRpTQ4W0/e8iOFyP6hb5EI2PsLudRrjJHwGW/3WBVZlejnGmOhbm5v0A7sanxDpZjMVOut/aaao0kamu49xhZ0KK1t8CiYOq5TItG0vOyuvq0gzrT4GZGUm9I2nBNLkvWvgvKJyRzQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=AB5TfNUeecPTcb2vt9Wbxuoxn0nlWDR+PGe3sQVCMWGO0AjLgtz7UJs1JY1CM4I4oxT9Cedai7eEa1dMtzA9jvPdaJpqJJ0vqtKKwf+wIo4NDZPIvdCl5E2TC4jMTwpgVlnGwUvOytbs+sHjlMCzr55GdU2z6kZzEtCbUltC+/k= Received: by 10.86.82.16 with SMTP id f16mr2710040fgb.60.1208942393307; Wed, 23 Apr 2008 02:19:53 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Wed, 23 Apr 2008 02:19:53 -0700 (PDT) Message-ID: <7d6fde3d0804230219q13d204f2wda4a5f271b9a0e66@mail.gmail.com> Date: Wed, 23 Apr 2008 02:19:53 -0700 From: "Garrett Cooper" To: hackers@freebsd.org In-Reply-To: <7d6fde3d0804230219x209bd707u30150581abc74802@mail.gmail.com> MIME-Version: 1.0 References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <7d6fde3d0804230219x209bd707u30150581abc74802@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Fwd: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 09:19:55 -0000 On Wed, Apr 23, 2008 at 1:30 AM, Bernard van Gastel wrote: > > Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: > > > On Tue, 22 Apr 2008 22:40:21 -0700 > > "Garrett Cooper" wrote: > > > > Hi all, > > > I made an oops in a program, which uncovered "feature" in strdup(2) > > > that I wasn't aware of before. So I was wondering, is strdup(pointer = > > > NULL) > > > supposed to segfault should this just return NULL and set errno? > > > > > > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > > you ask it to copy a NULL pointer. And this is an improvement from the > > bad old days, when they would happily walk through memory starting at > > 0..... > > > > I don't like it this way. I would like: > > strdup(NULL) = NULL > strdup(string) = copy of string > > strcpy(NULL, NULL) = NULL > strcpy(s1, NULL) = ERROR > strcpy(NULL, s2) = NULL (with s2 unchanged) > strcpy(s1, s2) = normal > > But I am not sure of the implications. Maybe in some situation it is > bad... Anyone? > > > > Besides, errno is used to signal errors from system calls. strdup > > isn't a system call, it's a library function (says so at the top of > > the man page). > > > > But strdup uses malloc, which is a system call (from the strdup manual: If > insufficient memory is available, NULL is returned and errno is set to > ENOMEM.) > > Regards, > Bernard > > I was more concerned about the fact that there wasn't any documentation that said something -- either implicitly or explicitly -- that strdup(NULL) causes a segfault. Of course I did some more research after you guys gave me some replies and realized I'm not the first person to bumble across this fact, but I haven't found FreeBSD or Linux documentation supporting that errata. It was harmless in my tiny program, but I would hate to be someone adding that assumption to a larger project with multiple threads and a fair number of lines... *shrugs*. -Garrett PS I'm as much against POLA changes as the next guy. I just don't like shooting myself in the foot too terribly much :). From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 10:03:11 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0755D106564A for ; Wed, 23 Apr 2008 10:03:11 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id D12818FC17 for ; Wed, 23 Apr 2008 10:03:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 3DF8746B80; Wed, 23 Apr 2008 06:03:10 -0400 (EDT) Date: Wed, 23 Apr 2008 11:03:10 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Garrett Cooper In-Reply-To: <7d6fde3d0804230219q13d204f2wda4a5f271b9a0e66@mail.gmail.com> Message-ID: <20080423105319.V35222@fledge.watson.org> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <7d6fde3d0804230219x209bd707u30150581abc74802@mail.gmail.com> <7d6fde3d0804230219q13d204f2wda4a5f271b9a0e66@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: hackers@freebsd.org Subject: Re: Fwd: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 10:03:11 -0000 On Wed, 23 Apr 2008, Garrett Cooper wrote: >> But strdup uses malloc, which is a system call (from the strdup manual: If >> insufficient memory is available, NULL is returned and errno is set to >> ENOMEM.) FYI, malloc(3) is actually a library call, and while it obviously does invoke system calls (mmap(2) on modern systems), it has some fairly complex logic for managing and caching memory provided by the kernel. > I was more concerned about the fact that there wasn't any documentation that > said something -- either implicitly or explicitly -- that strdup(NULL) > causes a segfault. > > Of course I did some more research after you guys gave me some replies and > realized I'm not the first person to bumble across this fact, but I haven't > found FreeBSD or Linux documentation supporting that errata. It was harmless > in my tiny program, but I would hate to be someone adding that assumption to > a larger project with multiple threads and a fair number of lines... Consider the following counter-arguments: - In C, a string is a sequence of non-nul characters followed by a nul character terminating the string. NULL is therefore not a valid string. - Currently, strdup(3) has an unambiguous error model: if it returns a non-NULL string has succeeded, and if it has failed, it returns NULL and sets errno. If NULL becomes a successful return from strdup(3), then this is no longer the case, breaking the assumptions of currently correct consumers. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 10:37:30 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32DBD1065674 for ; Wed, 23 Apr 2008 10:37:30 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC1C8FC1B for ; Wed, 23 Apr 2008 10:37:29 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl23-13.kln.forthnet.gr [77.49.150.13]) (authenticated bits=128) by igloo.linux.gr (8.14.2/8.14.2/Debian-3) with ESMTP id m3NAIqh1032008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 23 Apr 2008 13:18:58 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m3NAIqtZ003652; Wed, 23 Apr 2008 13:18:52 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m3NAIjsT003651; Wed, 23 Apr 2008 13:18:45 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Bernard van Gastel References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> Date: Wed, 23 Apr 2008 13:18:45 +0300 In-Reply-To: <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> (Bernard van Gastel's message of "Wed, 23 Apr 2008 10:30:39 +0200") Message-ID: <87ej8w3md6.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m3NAIqh1032008 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.908, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.49, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: hackers@freebsd.org, Garrett Cooper , Mike Meyer Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 10:37:30 -0000 On Wed, 23 Apr 2008 10:30:39 +0200, Bernard van Gastel wrote: > Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: >> On Tue, 22 Apr 2008 22:40:21 -0700 >> "Garrett Cooper" wrote: >> >>> Hi all, >>> I made an oops in a program, which uncovered "feature" in >>> strdup(2) >>> that I wasn't aware of before. So I was wondering, is strdup(pointer >>> = NULL) >>> supposed to segfault should this just return NULL and set errno? >> >> Yes, it's supposed to segfault. Check out what, say, strcpy does if >> you ask it to copy a NULL pointer. And this is an improvement from the >> bad old days, when they would happily walk through memory starting at >> 0..... > > I don't like it this way. I would like: > > strdup(NULL) = NULL > strdup(string) = copy of string > > strcpy(NULL, NULL) = NULL > strcpy(s1, NULL) = ERROR > strcpy(NULL, s2) = NULL (with s2 unchanged) > strcpy(s1, s2) = normal > > But I am not sure of the implications. Maybe in some situation it is > bad... Anyone? Well-written programs already check for NULL before they call strdup(), so they won't be affected by changing strdup() to return NULL when a null pointer is passed to strdup(). What is more likely to happen is that _badly_ written programs will crash further down, at the place where the null pointer is actually used. So we'll be "hiding" the bug of strdup(NULL) and causing faults in other, possibly very far places in the program's execution path. That's not really a very good idea :( >> Besides, errno is used to signal errors from system calls. strdup >> isn't a system call, it's a library function (says so at the top of >> the man page). > > But strdup uses malloc, which is a system call (from the strdup manual: > If insufficient memory is available, NULL is returned and errno is set > to ENOMEM.) I have to disagree I'm afraid. The malloc() function is *not* a system call, although it may be mapped to low-level primitives like sbrk() or mmap(). In general, malloc() is a `special' library function that abstracts away the implementation specific details of obtaining memory from the kernel. There are implementations of malloc() out there that rely on certain system-specific features but are, otherwise, implemented *entirely* in userland code. Our own is one. The sources of FreeBSD's malloc() are in `/usr/src/lib/libc/stdlib/malloc.c' for anyone interested to read the source and see all the cool things Jason has done :) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 10:05:36 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D859106574E for ; Wed, 23 Apr 2008 10:05:36 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: from web36602.mail.mud.yahoo.com (web36602.mail.mud.yahoo.com [209.191.85.19]) by mx1.freebsd.org (Postfix) with SMTP id 07F4E8FC31 for ; Wed, 23 Apr 2008 10:05:35 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: (qmail 1979 invoked by uid 60001); 23 Apr 2008 09:38:54 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=DSn+NWXmG9kIhnVcFAcqvKbFPKPOexu1X7/53Zn9DJkseABNFtyhwVEAgj3QenGeIRiwOfTy7t0REAdDfqB8MXX3NixgOUOK/zBHlpfBc5NsudKGFsK3I+dVTrassHJXzxO2utHGhFMLAtS+f7G6JasAF0hkeioqlJ09RuDe3Eo=; X-YMail-OSG: fV0Vqp8VM1lc39bgwP_KY4UeRs_pdJ4chWliwoZcxaNuUfDJjqEtYGcDFsjiBoS4_DTPmpifq275EVRltg41jcoBGP.YnSZruPUbrQqifVRDgioJlbIWvsRL9aA- Received: from [85.10.55.94] by web36602.mail.mud.yahoo.com via HTTP; Wed, 23 Apr 2008 02:38:54 PDT Date: Wed, 23 Apr 2008 02:38:54 -0700 (PDT) From: Simun Mikecin To: mwm-keyword-freebsdhackers2.e313df@mired.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <251738.1147.qm@web36602.mail.mud.yahoo.com> X-Mailman-Approved-At: Wed, 23 Apr 2008 11:20:37 +0000 Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 10:05:36 -0000 >Yes, it's supposed to segfault. Check out what, say, strcpy does if >you ask it to copy a NULL pointer. And this is an improvement from the >bad old days, when they would happily walk through memory starting at >0..... >Besides, errno is used to signal errors from system calls. strdup >isn't a system call, it's a library function (says so at the top of >the man page). >Do you have examples of systems where strdup doesn't behave this way? According to Open Group strdup should return NULL and set errno. Look at: http://www.opengroup.org/onlinepubs/009695399/functions/strdup.html There is no valid argument for doing segfault instead of above behavior. ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 11:26:26 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C98F1065672 for ; Wed, 23 Apr 2008 11:26:26 +0000 (UTC) (envelope-from modelnine@modelnine.org) Received: from jord.modelnine.org (jord.modelnine.org [83.246.72.120]) by mx1.freebsd.org (Postfix) with ESMTP id 367268FC21 for ; Wed, 23 Apr 2008 11:26:26 +0000 (UTC) (envelope-from modelnine@modelnine.org) Received: from [192.168.1.37] (unknown [89.182.20.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: modelnine) by jord.modelnine.org (Postfix) with ESMTPSA id B54F2A47260 for ; Wed, 23 Apr 2008 13:26:24 +0200 (CEST) From: Heiko Wundram To: freebsd-hackers@freebsd.org Date: Wed, 23 Apr 2008 13:28:23 +0200 User-Agent: KMail/1.9.7 References: <251738.1147.qm@web36602.mail.mud.yahoo.com> In-Reply-To: <251738.1147.qm@web36602.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804231328.23777.modelnine@modelnine.org> Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 11:26:26 -0000 Am Mittwoch, 23. April 2008 11:38:54 schrieb Simun Mikecin: > >Yes, it's supposed to segfault. Check out what, say, strcpy does if > >you ask it to copy a NULL pointer. And this is an improvement from the > >bad old days, when they would happily walk through memory starting at > >0..... > >Besides, errno is used to signal errors from system calls. strdup > >isn't a system call, it's a library function (says so at the top of > >the man page). > >Do you have examples of systems where strdup doesn't behave this way? > > According to Open Group strdup should return NULL and set errno. Look at: > http://www.opengroup.org/onlinepubs/009695399/functions/strdup.html > > There is no valid argument for doing segfault instead of above behavior. Read the standard closely. If you pass in something that is defined as having undefined behaviour (a NULL pointer is defined in such a way at other points of the standard), do not expect to get defined behaviour out. What the standard talks about is when the memory for the duplicate string cannot be allocated, WHEN you pass in a valid pointer. -- Heiko Wundram From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 11:28:32 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF8311065674 for ; Wed, 23 Apr 2008 11:28:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 63DB08FC25 for ; Wed, 23 Apr 2008 11:28:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1Jod9L-000MOb-3X for hackers@freebsd.org; Wed, 23 Apr 2008 14:28:31 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3NBSWGc023221 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Apr 2008 14:28:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3NBSPTJ082863; Wed, 23 Apr 2008 14:28:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3NBSPVJ082862; Wed, 23 Apr 2008 14:28:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Apr 2008 14:28:25 +0300 From: Kostik Belousov To: Simun Mikecin Message-ID: <20080423112825.GX18958@deviant.kiev.zoral.com.ua> References: <251738.1147.qm@web36602.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y+QtaVjtxOtr8cXH" Content-Disposition: inline In-Reply-To: <251738.1147.qm@web36602.mail.mud.yahoo.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 7155bbd8d023de41950ebecbe4708355 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2695 [Apr 23 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: hackers@freebsd.org, mwm-keyword-freebsdhackers2.e313df@mired.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 11:28:32 -0000 --Y+QtaVjtxOtr8cXH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 23, 2008 at 02:38:54AM -0700, Simun Mikecin wrote: > >Yes, it's supposed to segfault. Check out what, say, strcpy does if > >you ask it to copy a NULL pointer. And this is an improvement from the > >bad old days, when they would happily walk through memory starting at > >0..... > >Besides, errno is used to signal errors from system calls. strdup > >isn't a system call, it's a library function (says so at the top of > >the man page). > >Do you have examples of systems where strdup doesn't behave this way? >=20 > According to Open Group strdup should return NULL and set errno. Look at: > http://www.opengroup.org/onlinepubs/009695399/functions/strdup.html >=20 > There is no valid argument for doing segfault instead of above behavior. No, the Open Group specification says the following in the System Interfaces -> 2.1 Use and Implementation of Functions: ### If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer), the behavior is undefined. ### Also, see my another answer with the proper incantation from the ANSI C standard. --Y+QtaVjtxOtr8cXH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgPHVkACgkQC3+MBN1Mb4gIQgCbBk7CjAO1FJ13NEf6tjXjSBQt mzcAoIksACyHmxOG8DRi0GYuzDhVJCFD =mhIg -----END PGP SIGNATURE----- --Y+QtaVjtxOtr8cXH-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 11:57:48 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 515B7106566B for ; Wed, 23 Apr 2008 11:57:48 +0000 (UTC) (envelope-from freebsd-nospam@yaxom.com) Received: from gw.yaxom.com (gw.yaxom.com [59.167.217.197]) by mx1.freebsd.org (Postfix) with SMTP id 6735C8FC0A for ; Wed, 23 Apr 2008 11:57:47 +0000 (UTC) (envelope-from freebsd-nospam@yaxom.com) Received: (qmail 28223 invoked from network); 23 Apr 2008 21:31:04 +1000 Received: from joker.yaxom.com (172.16.1.10) by iliad.yaxom.com with SMTP; 23 Apr 2008 21:31:04 +1000 Received: (qmail 18835 invoked by uid 1001); 23 Apr 2008 21:31:04 +1000 Message-ID: Date: Wed, 23 Apr 2008 21:31:03 +1000 From: Greg Black To: Simun Mikecin References: <251738.1147.qm@web36602.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <251738.1147.qm@web36602.mail.mud.yahoo.com> User-Agent: Mutt/1.4.2.2i; gjb-muttsend.sh 1.7 2004-10-05 X-Uptime: 26 days X-Operating-System: FreeBSD 6.2-RELEASE-p5 i386 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.yaxom.com/gjb.html X-Blog: http://www.yaxom.com/gjb/blog/ X-Image-URL: http://www.yaxom.com/gjb/gjb-auug048.gif X-PGP-Key-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-Request-PGP: http://www.yaxom.com/keys/4B04B7D6.asc Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 11:57:48 -0000 On 2008-04-23, Simun Mikecin wrote: > According to Open Group strdup should return NULL and set errno. Look at: > http://www.opengroup.org/onlinepubs/009695399/functions/strdup.html If you're going to quote documents to support your ideas, it's probably better to read them first. That document gives only lack of memory as a reason for failure. It does not state clearly, but clearly requires, correct behaviour from the caller who is required to provide a string argument. NULL is not a string, so the behaviour of the function is undefined. Basic C programming requires people not to step into the wilderness of undefined behaviour. > There is no valid argument for doing segfault instead of above behavior. If you can find an alternative that is not actually wrong, then by all means share it. To me, it seems like a good choice. Clearly, I am not alone. Greg From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 12:03:49 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2199106564A for ; Wed, 23 Apr 2008 12:03:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by mx1.freebsd.org (Postfix) with ESMTP id 591478FC14 for ; Wed, 23 Apr 2008 12:03:49 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay01.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JocrG-000CC4-1i for hackers@freebsd.org; Wed, 23 Apr 2008 14:09:50 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3NB9nbX022639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Apr 2008 14:09:49 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3NB9hj8060988; Wed, 23 Apr 2008 14:09:43 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3NB9gWA060978; Wed, 23 Apr 2008 14:09:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 23 Apr 2008 14:09:42 +0300 From: Kostik Belousov To: Garrett Cooper Message-ID: <20080423110942.GU18958@deviant.kiev.zoral.com.ua> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <7d6fde3d0804230219x209bd707u30150581abc74802@mail.gmail.com> <7d6fde3d0804230219q13d204f2wda4a5f271b9a0e66@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dicp5grlxus9uUnk" Content-Disposition: inline In-Reply-To: <7d6fde3d0804230219q13d204f2wda4a5f271b9a0e66@mail.gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 0a40947aa5a9674afbdd30b0de777e4b X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2695 [Apr 23 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: hackers@freebsd.org Subject: Re: Fwd: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 12:03:49 -0000 --dicp5grlxus9uUnk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 23, 2008 at 02:19:53AM -0700, Garrett Cooper wrote: > On Wed, Apr 23, 2008 at 1:30 AM, Bernard van Gastel > wrote: >=20 > > > > Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: > > > > > On Tue, 22 Apr 2008 22:40:21 -0700 > > > "Garrett Cooper" wrote: > > > > > > Hi all, > > > > I made an oops in a program, which uncovered "feature" in strdup= (2) > > > > that I wasn't aware of before. So I was wondering, is strdup(pointe= r =3D > > > > NULL) > > > > supposed to segfault should this just return NULL and set errno? > > > > > > > > > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > > > you ask it to copy a NULL pointer. And this is an improvement from the > > > bad old days, when they would happily walk through memory starting at > > > 0..... > > > > > > > I don't like it this way. I would like: > > > > strdup(NULL) =3D NULL > > strdup(string) =3D copy of string > > > > strcpy(NULL, NULL) =3D NULL > > strcpy(s1, NULL) =3D ERROR > > strcpy(NULL, s2) =3D NULL (with s2 unchanged) > > strcpy(s1, s2) =3D normal > > > > But I am not sure of the implications. Maybe in some situation it is > > bad... Anyone? > > > > > > > Besides, errno is used to signal errors from system calls. strdup > > > isn't a system call, it's a library function (says so at the top of > > > the man page). > > > > > > > But strdup uses malloc, which is a system call (from the strdup manual:= If > > insufficient memory is available, NULL is returned and errno is set to > > ENOMEM.) > > > > Regards, > > Bernard > > > > > I was more concerned about the fact that there wasn't any documentation t= hat > said something -- either implicitly or explicitly -- that strdup(NULL) > causes a segfault. >=20 > Of course I did some more research after you guys gave me some replies and > realized I'm not the first person to bumble across this fact, but I haven= 't > found FreeBSD or Linux documentation supporting that errata. It was harml= ess > in my tiny program, but I would hate to be someone adding that assumption= to > a larger project with multiple threads and a fair number of lines... >=20 > *shrugs*. >=20 > -Garrett >=20 > PS I'm as much against POLA changes as the next guy. I just don't like > shooting myself in the foot too terribly much :). =46rom the ISO/IEC 9899:1999 (E), 7.1.4, clause 1 Each of the following statements applies unless explicitly stated otherwise in the detailed descriptions that follow: If an argument to a function has an invalid value (such as a value outside the domain of the function, or a pointer outside the address space of the program, or a null pointer, or a pointer to non-modifiable storage when the corresponding parameter is not const-qualified) or a type (after promotion) not expected by a function with variable number of arguments, the behavior is undefined. --dicp5grlxus9uUnk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgPGPYACgkQC3+MBN1Mb4jiQgCg209XplMxDf7aeX+OluO/u3WA M6IAn3aRbycSlXZMNMuSh0LiC9TS2M1D =F942 -----END PGP SIGNATURE----- --dicp5grlxus9uUnk-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 14:03:38 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBC631065675 for ; Wed, 23 Apr 2008 14:03:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id AD18F8FC2D for ; Wed, 23 Apr 2008 14:03:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 5762B1A4D83; Wed, 23 Apr 2008 07:03:38 -0700 (PDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Wed, 23 Apr 2008 09:55:10 -0400 User-Agent: KMail/1.9.7 References: <480E4269.2090604@icyb.net.ua> In-Reply-To: <480E4269.2090604@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804230955.10390.jhb@freebsd.org> Cc: Andriy Gapon Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 14:03:38 -0000 On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: > Maybe this is a crazy idea or maybe we already have something like this. > Is it possible to get notifications about changes in devfs - appearance > and disappearance of devices (in devfs sense of the word)? > devctl currently notifies about real (hardware) devices handled by > device drivers and some notifications about hardware/driver events. > But what if I want to automatically run some action if > /dev/ufs/magic-label appears? > Or if I want to monitor appearance and disappearance of ad* and da* > devices (without having to monitor low level drivers like umass)? You would just need to add new hooks to devfs to feed events to devctl when devices come and go. Other non-new-bus things like ifnet's already do this, so there is precedent. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:06:38 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4331065672 for ; Wed, 23 Apr 2008 16:06:38 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 0D22A8FC13 for ; Wed, 23 Apr 2008 16:06:37 +0000 (UTC) (envelope-from mwm@mired.org) Received: (qmail 53403 invoked from network); 23 Apr 2008 11:38:36 -0400 Received: from unknown (HELO mbook-fbsd) (192.168.195.251) by 0 with SMTP; 23 Apr 2008 11:38:36 -0400 Date: Wed, 23 Apr 2008 11:39:51 -0400 From: Mike Meyer To: Bernard van Gastel Message-ID: <20080423113951.020f0130@mbook-fbsd> In-Reply-To: <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 23 Apr 2008 16:11:11 +0000 Cc: hackers@freebsd.org, Garrett Cooper , Mike Meyer Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:06:38 -0000 On Wed, 23 Apr 2008 10:30:39 +0200 Bernard van Gastel wrote: > Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: > > On Tue, 22 Apr 2008 22:40:21 -0700 > > "Garrett Cooper" wrote: > > > >> Hi all, > >> I made an oops in a program, which uncovered "feature" in > >> strdup(2) > >> that I wasn't aware of before. So I was wondering, is > >> strdup(pointer = NULL) > >> supposed to segfault should this just return NULL and set errno? > > > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > > you ask it to copy a NULL pointer. And this is an improvement from the > > bad old days, when they would happily walk through memory starting at > > 0..... > > I don't like it this way. I would like: > > strdup(NULL) = NULL > strdup(string) = copy of string > > strcpy(NULL, NULL) = NULL > strcpy(s1, NULL) = ERROR > strcpy(NULL, s2) = NULL (with s2 unchanged) > strcpy(s1, s2) = normal > > But I am not sure of the implications. Maybe in some situation it is > bad... Anyone? I think someone gave the reason I'm about to: trying to copy a NULL pointer means I have a bug somewhere earlier in my code that will eventually produce visibly wrong results - a segfault being such. The sooner that happens after the bug, the less code I have to search to find it, the better for me. So quietly propagating the error is bad in general. Actually, I'd like to reverse the question: under what conditions would you be trying to copy a string where not having a string isn't a sign that something is broken? > > Besides, errno is used to signal errors from system calls. strdup > > isn't a system call, it's a library function (says so at the top of > > the man page). > > But strdup uses malloc, which is a system call (from the strdup > manual: If insufficient memory is available, NULL is returned and > errno is set to ENOMEM.) As others have pointed out, malloc isn't a system call. However, what strdup (and malloc) are doing in this case is passing the system error from what is eventually an internal system call out to their caller. Basically, errno being set means some system call went wrong, even if it was made deep in the heart of a library somewhere. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:06:45 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A9801065670 for ; Wed, 23 Apr 2008 16:06:45 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: from web36608.mail.mud.yahoo.com (web36608.mail.mud.yahoo.com [209.191.85.25]) by mx1.freebsd.org (Postfix) with SMTP id EA2FC8FC27 for ; Wed, 23 Apr 2008 16:06:44 +0000 (UTC) (envelope-from numisemis@yahoo.com) Received: (qmail 48293 invoked by uid 60001); 23 Apr 2008 16:06:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=qD68y4k2Hhq6hWTmteYkz+O1R9hGLqiiG2q6Yhbjwk9K02bN0/62/F5dgJMLhdAZ5R+s2Jeik4/Xlc8LA1l5PhEk0D5fHxUDwke15N/VEhN2q3BJ4sn0j3JS9qIcvQkzhTbbXqCTO6VY3vEjESZu0Db1wsDpoVrn3gKsmvyatrk=; X-YMail-OSG: gXmjozgVM1m9jCmarEcUvZUsZtmb0.N4tsbvgS9J22CYscRl0wIIdHuIPjcAP.M0e6eif7ZDtlpuaB40Kpk2SMZr5NA_ro5r6s8RALZXstNDStVhO8NpUUDt6yE- Received: from [85.10.53.173] by web36608.mail.mud.yahoo.com via HTTP; Wed, 23 Apr 2008 09:06:44 PDT Date: Wed, 23 Apr 2008 09:06:44 -0700 (PDT) From: Simun Mikecin To: freebsd-nospam@yaxom.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <293918.47889.qm@web36608.mail.mud.yahoo.com> X-Mailman-Approved-At: Wed, 23 Apr 2008 16:11:35 +0000 Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:06:45 -0000 >If you're going to quote documents to support your ideas, it's probably >better to read them first. My apologies. My fingers were faster than my mind. But this made me read it the way I should have done in the first place. And I see that it says: "A null pointer is returned if the new string cannot be created." Does that also mean that a null pointer is returned if the input is a NULL pointer (cause in that case new string could not be created)? As other have concluded, standard says that behavior is undefined if the input is invalid (NULL pointer). So what is right? ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:13:27 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0F9D1065674 for ; Wed, 23 Apr 2008 16:13:27 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC5E8FC0A for ; Wed, 23 Apr 2008 16:13:27 +0000 (UTC) (envelope-from mwm@mired.org) Received: (qmail 54122 invoked from network); 23 Apr 2008 12:12:06 -0400 Received: from unknown (HELO mbook-fbsd) (192.168.195.251) by 0 with SMTP; 23 Apr 2008 12:12:06 -0400 Date: Wed, 23 Apr 2008 11:39:51 -0400 From: Mike Meyer To: Bernard van Gastel Message-ID: <20080423113951.020f0130@mbook-fbsd> In-Reply-To: <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 23 Apr 2008 16:24:30 +0000 Cc: hackers@freebsd.org, Garrett Cooper , Mike Meyer Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:13:27 -0000 On Wed, 23 Apr 2008 10:30:39 +0200 Bernard van Gastel wrote: > Op 23 apr 2008, om 08:50 heeft Mike Meyer het volgende geschreven: > > On Tue, 22 Apr 2008 22:40:21 -0700 > > "Garrett Cooper" wrote: > > > >> Hi all, > >> I made an oops in a program, which uncovered "feature" in > >> strdup(2) > >> that I wasn't aware of before. So I was wondering, is > >> strdup(pointer = NULL) > >> supposed to segfault should this just return NULL and set errno? > > > > Yes, it's supposed to segfault. Check out what, say, strcpy does if > > you ask it to copy a NULL pointer. And this is an improvement from the > > bad old days, when they would happily walk through memory starting at > > 0..... > > I don't like it this way. I would like: > > strdup(NULL) = NULL > strdup(string) = copy of string > > strcpy(NULL, NULL) = NULL > strcpy(s1, NULL) = ERROR > strcpy(NULL, s2) = NULL (with s2 unchanged) > strcpy(s1, s2) = normal > > But I am not sure of the implications. Maybe in some situation it is > bad... Anyone? I think someone gave the reason I'm about to: trying to copy a NULL pointer means I have a bug somewhere earlier in my code that will eventually produce visibly wrong results - a segfault being such. The sooner that happens after the bug, the less code I have to search to find it, the better for me. So quietly propagating the error is bad in general. Actually, I'd like to reverse the question: under what conditions would you be trying to copy a string where not having a string isn't a sign that something is broken? > > Besides, errno is used to signal errors from system calls. strdup > > isn't a system call, it's a library function (says so at the top of > > the man page). > > But strdup uses malloc, which is a system call (from the strdup > manual: If insufficient memory is available, NULL is returned and > errno is set to ENOMEM.) As others have pointed out, malloc isn't a system call. However, what strdup (and malloc) are doing in this case is passing the system error from what is eventually an internal system call out to their caller. Basically, errno being set means some system call went wrong, even if it was made deep in the heart of a library somewhere. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:27:09 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B596D106564A for ; Wed, 23 Apr 2008 16:27:09 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id 0C9C28FC14 for ; Wed, 23 Apr 2008 16:27:07 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id AF21E679BFC; Wed, 23 Apr 2008 18:26:41 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0nBcb80Vpz+v; Wed, 23 Apr 2008 18:26:36 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 4B87E679B12; Wed, 23 Apr 2008 18:26:36 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m3NGQZxP042659; Wed, 23 Apr 2008 18:26:35 +0200 (CEST) (envelope-from rdivacky) Date: Wed, 23 Apr 2008 18:26:35 +0200 From: Roman Divacky To: Mike Meyer Message-ID: <20080423162635.GA42593@freebsd.org> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <20080423113951.020f0130@mbook-fbsd> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080423113951.020f0130@mbook-fbsd> User-Agent: Mutt/1.4.2.3i Cc: hackers@freebsd.org, Garrett Cooper , Mike Meyer Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:27:09 -0000 > I think someone gave the reason I'm about to: trying to copy a NULL > pointer means I have a bug somewhere earlier in my code that will > eventually produce visibly wrong results - a segfault being such. The > sooner that happens after the bug, the less code I have to search to > find it, the better for me. if only the fix was something else than if (ptr != NULL) strdup(ptr); :) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:40:26 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FE461065670 for ; Wed, 23 Apr 2008 16:40:26 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 1C55F8FC19 for ; Wed, 23 Apr 2008 16:40:26 +0000 (UTC) (envelope-from mwm@mired.org) Received: (qmail 54657 invoked from network); 23 Apr 2008 12:39:04 -0400 Received: from unknown (HELO mbook-fbsd) (192.168.195.251) by 0 with SMTP; 23 Apr 2008 12:39:04 -0400 Date: Wed, 23 Apr 2008 12:40:23 -0400 From: Mike Meyer To: Simun Mikecin Message-ID: <20080423124023.54ca505e@mbook-fbsd> In-Reply-To: <293918.47889.qm@web36608.mail.mud.yahoo.com> References: <293918.47889.qm@web36608.mail.mud.yahoo.com> Organization: Meyer Consulting X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 23 Apr 2008 16:52:43 +0000 Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:40:26 -0000 On Wed, 23 Apr 2008 09:06:44 -0700 (PDT) Simun Mikecin wrote: > >If you're going to quote documents to support your ideas, it's probably > >better to read them first. > > My apologies. My fingers were faster than my mind. But this made me read it the way I should have > done in the first place. And I see that it says: > "A null pointer is returned if the new string cannot be created." > > Does that also mean that a null pointer is returned if the input is a NULL pointer (cause in that > case new string could not be created)? Are you sure? I'd say that the act of returning a NULL pointer created the not-really-a-string that was passed in. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 16:43:54 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C1BB1065680 for ; Wed, 23 Apr 2008 16:43:54 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mired.org (student.mired.org [66.92.153.77]) by mx1.freebsd.org (Postfix) with ESMTP id 137F18FC1A for ; Wed, 23 Apr 2008 16:43:53 +0000 (UTC) (envelope-from mwm@mired.org) Received: (qmail 54751 invoked from network); 23 Apr 2008 12:42:33 -0400 Received: from unknown (HELO mbook-fbsd) (192.168.195.251) by 0 with SMTP; 23 Apr 2008 12:42:33 -0400 Date: Wed, 23 Apr 2008 12:43:51 -0400 From: Mike Meyer To: Roman Divacky Message-ID: <20080423124351.426627d3@mbook-fbsd> In-Reply-To: <20080423162635.GA42593@freebsd.org> References: <7d6fde3d0804222240j6b42b77yd86d8accb5a959fa@mail.gmail.com> <20080423025048.6b51a580@bhuda.mired.org> <5F412E73-29FC-4876-A6F0-9BC269876192@bitpowder.com> <20080423113951.020f0130@mbook-fbsd> <20080423162635.GA42593@freebsd.org> Organization: Meyer Consulting X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.5; amd64-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 23 Apr 2008 17:44:09 +0000 Cc: Mike Meyer , Garrett Cooper , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 16:43:54 -0000 On Wed, 23 Apr 2008 18:26:35 +0200 Roman Divacky wrote: > > I think someone gave the reason I'm about to: trying to copy a NULL > > pointer means I have a bug somewhere earlier in my code that will > > eventually produce visibly wrong results - a segfault being such. The > > sooner that happens after the bug, the less code I have to search to > > find it, the better for me. > > if only the fix was something else than > > if (ptr != NULL) > strdup(ptr); > > :) Again, under what conditions would this "fix" be considered correct? I.e. - when does it make sense to try and duplicate a string that isn't? http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 18:39:06 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CA31065676 for ; Wed, 23 Apr 2008 18:39:06 +0000 (UTC) (envelope-from modelnine@modelnine.org) Received: from jord.modelnine.org (jord.modelnine.org [83.246.72.120]) by mx1.freebsd.org (Postfix) with ESMTP id CBBA28FC0A for ; Wed, 23 Apr 2008 18:39:05 +0000 (UTC) (envelope-from modelnine@modelnine.org) Received: from phoenix (hnvr-4dbb925f.pool.einsundeins.de [77.187.146.95]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: modelnine) by jord.modelnine.org (Postfix) with ESMTPSA id 20425A47260 for ; Wed, 23 Apr 2008 20:39:04 +0200 (CEST) From: Heiko Wundram To: freebsd-hackers@freebsd.org Date: Wed, 23 Apr 2008 20:41:04 +0200 User-Agent: KMail/1.9.7 References: <293918.47889.qm@web36608.mail.mud.yahoo.com> In-Reply-To: <293918.47889.qm@web36608.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804232041.04913.modelnine@modelnine.org> Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 18:39:06 -0000 Am Mittwoch, 23. April 2008 18:06:44 schrieb Simun Mikecin: > >If you're going to quote documents to support your ideas, it's probably > >better to read them first. > > My apologies. My fingers were faster than my mind. But this made me read it > the way I should have done in the first place. And I see that it says: > "A null pointer is returned if the new string cannot be created." Again: strdup's input domain is implicitly defined as the set of all VALID strings, which in C are a long value interpreted as a pointer to a VALID (i.e., at least read-accessible by you) memory location which is interpreted as a sequence of bytes leading up to a NECESSARY terminal zero byte somewhere at or after that memory position and completely INSIDE a readable memory range. In the case of passing in a value that is from the input domain, the standard says that in case the string cannot be duplicated, a NULL pointer should be returned and errno set. What the standard explicitly says at other locations (that have been mentioned here) is that if a value is passed in that's not from the input domain, the behaviour is undefined. In FreeBSD's case it's a segfault, it could of course also be a NULL return, it could also be self-destruction of your computer, killing you or your user from high velocity flying parts. But, again, the behaviour is UNDEFINED, so do not count on it doing anything to (or against) your liking. Incidentally, a segfault is generally considered useful by many programmer, because it makes debugging a hell-of-a-lot easier (guess why gdb breaks to the debugger prompt on one). That's why you'd get a segfault on most (modern) operating systems. On DOS, however, you overwrote/copied the (real-mode) interrupt descriptor table, and thus when doing a write-access (by for example passing a FAR NULL pointer as the destination parameter of strcpy) basically broke your complete operating environment. That's so much less usable for development, isn't it? It's YOUR responsibility to pass in values that are from the valid input domain, and in case you don't do that, it's YOUR fault that you didn't and everything that follows is, again, UNDEFINED, as it depends on so many parameters that simply can't all be accounted in the standard you're citing. That's why it's UNDEFINED. Sorry for the many caps in the mail, but I really can't understand why people keep insisting that library functions have to do all and any kind of error checking for the programmer. For one, doing error checking like invalid pointers in library functions is a performance killer, and secondly, it's the friggin' programmers responsibility to make sure his input is in the input domain for the functions he calls. If he doesn't/can't do that, he should look for another job. -- Heiko Wundram From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 18:56:34 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91469106567F; Wed, 23 Apr 2008 18:56:34 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swipnet.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id D2CF98FC22; Wed, 23 Apr 2008 18:56:33 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [62.113.133.152] (account mc467741@c2i.net [62.113.133.152] verified) by mailfe14.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 170495761; Wed, 23 Apr 2008 19:56:29 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Wed, 23 Apr 2008 19:57:47 +0200 User-Agent: KMail/1.9.7 References: <293918.47889.qm@web36608.mail.mud.yahoo.com> <20080423124023.54ca505e@mbook-fbsd> In-Reply-To: <20080423124023.54ca505e@mbook-fbsd> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804231957.49035.hselasky@c2i.net> Cc: Simun Mikecin , Mike Meyer , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 18:56:34 -0000 Hi, I recently had to tell someone that "strncpy" does not always zero terminate the destination string. Surprised by what I was telling they immediately wanted to change the way the function worked. When a function is defined by an ISO standard you are not supposed to change the definition. Instead I pointed the person at "strlcpy". Else you will have serious trouble when code is ported to a new platform. http://www.gratisoft.us/todd/papers/strlcpy.html The name "strdup" is very appealing, but it has already been taken and defined. You have to give your variant a different name and convince everyone that your function is good and solves a problem so that it deserves to be in the C-library. Then you simply run a script on your code: sed -s "s/ strdup[(]/ strsdup(/g" *.[ch] --HPS :-) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 18:56:34 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91469106567F; Wed, 23 Apr 2008 18:56:34 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe14.swipnet.se [212.247.155.161]) by mx1.freebsd.org (Postfix) with ESMTP id D2CF98FC22; Wed, 23 Apr 2008 18:56:33 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [62.113.133.152] (account mc467741@c2i.net [62.113.133.152] verified) by mailfe14.swip.net (CommuniGate Pro SMTP 5.1.13) with ESMTPA id 170495761; Wed, 23 Apr 2008 19:56:29 +0200 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org Date: Wed, 23 Apr 2008 19:57:47 +0200 User-Agent: KMail/1.9.7 References: <293918.47889.qm@web36608.mail.mud.yahoo.com> <20080423124023.54ca505e@mbook-fbsd> In-Reply-To: <20080423124023.54ca505e@mbook-fbsd> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804231957.49035.hselasky@c2i.net> Cc: Simun Mikecin , Mike Meyer , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 18:56:34 -0000 Hi, I recently had to tell someone that "strncpy" does not always zero terminate the destination string. Surprised by what I was telling they immediately wanted to change the way the function worked. When a function is defined by an ISO standard you are not supposed to change the definition. Instead I pointed the person at "strlcpy". Else you will have serious trouble when code is ported to a new platform. http://www.gratisoft.us/todd/papers/strlcpy.html The name "strdup" is very appealing, but it has already been taken and defined. You have to give your variant a different name and convince everyone that your function is good and solves a problem so that it deserves to be in the C-library. Then you simply run a script on your code: sed -s "s/ strdup[(]/ strsdup(/g" *.[ch] --HPS :-) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 19:22:36 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 609791065673; Wed, 23 Apr 2008 19:22:36 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from mail.bitblocks.com (mail.bitblocks.com [64.142.15.60]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCC58FC15; Wed, 23 Apr 2008 19:22:36 +0000 (UTC) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost.bitblocks.com [127.0.0.1]) by mail.bitblocks.com (Postfix) with ESMTP id 3FA615BB1; Wed, 23 Apr 2008 11:54:31 -0700 (PDT) To: Robert Watson In-reply-to: Your message of "Wed, 23 Apr 2008 11:03:10 BST." <20080423105319.V35222@fledge.watson.org> Date: Wed, 23 Apr 2008 11:54:30 -0700 From: Bakul Shah Message-Id: <20080423185431.3FA615BB1@mail.bitblocks.com> Cc: Garrett Cooper , hackers@freebsd.org Subject: Re: Fwd: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 19:22:36 -0000 On Wed, 23 Apr 2008 11:03:10 BST Robert Watson wrote: > On Wed, 23 Apr 2008, Garrett Cooper wrote: > > Of course I did some more research after you guys gave me some replies and > > realized I'm not the first person to bumble across this fact, but I haven't > > found FreeBSD or Linux documentation supporting that errata. It was harmless > > in my tiny program, but I would hate to be someone adding that assumption to > > a larger project with multiple threads and a fair number of lines... > > Consider the following counter-arguments: > > - In C, a string is a sequence of non-nul characters followed by a nul > character terminating the string. NULL is therefore not a valid string. > > - Currently, strdup(3) has an unambiguous error model: if it returns a > non-NULL string has succeeded, and if it has failed, it returns NULL and > sets errno. If NULL becomes a successful return from strdup(3), then this > is no longer the case, breaking the assumptions of currently correct > consumers. I suspect Garrett has a more fundamental misunderstanding. C is a low level language and for efficiency sake most of its standard functions *do not check* that their inputs are legal -- it is the caller's responsibility to give valid inputs and when that is not done, all bets are off! In general a NULL is an illegal value to pass in place of any kind of pointer. The *exception* is where a function is explicitly prepared to handle NULLs. One must read its man page carefully and if it doesn't say anything about how NULLs in place of ptrs are handled, one must not pass in NULLs! He should also note that function specifications (e.g. man pages) will specify what are legal inputs but usually they will *not* specify what happens when illegal inputs are given since a) that set is usually much much larger, and b) the effect is likely to be machine dependent. FWIW! From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 19:25:30 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6EC1106566B; Wed, 23 Apr 2008 19:25:30 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 4D7258FC1A; Wed, 23 Apr 2008 19:25:30 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1Jokau-000OjF-Ju; Wed, 23 Apr 2008 22:25:28 +0300 Message-ID: <480F8D23.9040005@icyb.net.ua> Date: Wed, 23 Apr 2008 22:25:23 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: John Baldwin References: <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> In-Reply-To: <200804230955.10390.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 19:25:30 -0000 on 23/04/2008 16:55 John Baldwin said the following: > On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: >> Maybe this is a crazy idea or maybe we already have something like this. >> Is it possible to get notifications about changes in devfs - appearance >> and disappearance of devices (in devfs sense of the word)? >> devctl currently notifies about real (hardware) devices handled by >> device drivers and some notifications about hardware/driver events. >> But what if I want to automatically run some action if >> /dev/ufs/magic-label appears? >> Or if I want to monitor appearance and disappearance of ad* and da* >> devices (without having to monitor low level drivers like umass)? > > You would just need to add new hooks to devfs to feed events to devctl when > devices come and go. Other non-new-bus things like ifnet's already do this, > so there is precedent. > Thank you! This sounds like something rather simple, I'll try to create a patch. I think it would be a good idea to include "dev/" prefix in device name, so that devfs device is not confused with "driver device" (e.g. dev/umass0 vs umass0). -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 19:54:50 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A8910656B6 for ; Wed, 23 Apr 2008 19:54:50 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D77278FC2C for ; Wed, 23 Apr 2008 19:54:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id 924761A4D80; Wed, 23 Apr 2008 12:54:49 -0700 (PDT) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m3NJsWx4031333; Wed, 23 Apr 2008 15:54:33 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andriy Gapon Date: Wed, 23 Apr 2008 15:49:54 -0400 User-Agent: KMail/1.9.7 References: <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> <480F8D23.9040005@icyb.net.ua> In-Reply-To: <480F8D23.9040005@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804231549.54722.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 23 Apr 2008 15:54:34 -0400 (EDT) X-Virus-Scanned: ClamAV 0.91.2/6905/Wed Apr 23 11:20:18 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 19:54:50 -0000 On Wednesday 23 April 2008 03:25:23 pm Andriy Gapon wrote: > on 23/04/2008 16:55 John Baldwin said the following: > > On Tuesday 22 April 2008 03:54:17 pm Andriy Gapon wrote: > >> Maybe this is a crazy idea or maybe we already have something like this. > >> Is it possible to get notifications about changes in devfs - appearance > >> and disappearance of devices (in devfs sense of the word)? > >> devctl currently notifies about real (hardware) devices handled by > >> device drivers and some notifications about hardware/driver events. > >> But what if I want to automatically run some action if > >> /dev/ufs/magic-label appears? > >> Or if I want to monitor appearance and disappearance of ad* and da* > >> devices (without having to monitor low level drivers like umass)? > > > > You would just need to add new hooks to devfs to feed events to devctl when > > devices come and go. Other non-new-bus things like ifnet's already do this, > > so there is precedent. > > > > Thank you! This sounds like something rather simple, I'll try to create > a patch. > I think it would be a good idea to include "dev/" prefix in device name, > so that devfs device is not confused with "driver device" (e.g. > dev/umass0 vs umass0). Events have a subsystem associated with them, so devfs events would use their own subsystem type to avoid that sort of confusion. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 22:12:36 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E5EE1065675 for ; Wed, 23 Apr 2008 22:12:36 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id CD4688FC0A for ; Wed, 23 Apr 2008 22:12:35 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl23-13.kln.forthnet.gr [77.49.150.13]) (authenticated bits=128) by igloo.linux.gr (8.14.2/8.14.2/Debian-3) with ESMTP id m3NMCEAn021621 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 24 Apr 2008 01:12:24 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m3NMCEul002340; Thu, 24 Apr 2008 01:12:14 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m3NMC9eW002339; Thu, 24 Apr 2008 01:12:10 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Simun Mikecin References: <293918.47889.qm@web36608.mail.mud.yahoo.com> Date: Thu, 24 Apr 2008 01:12:09 +0300 In-Reply-To: <293918.47889.qm@web36608.mail.mud.yahoo.com> (Simun Mikecin's message of "Wed, 23 Apr 2008 09:06:44 -0700 (PDT)") Message-ID: <87d4og9q6e.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: m3NMCEAn021621 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.908, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.49, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 22:12:36 -0000 On Wed, 23 Apr 2008 09:06:44 -0700 (PDT), Simun Mikecin wrote: >>If you're going to quote documents to support your ideas, it's probably >>better to read them first. > > My apologies. My fingers were faster than my mind. But this made me > read it the way I should have done in the first place. And I see that > it says: > > "A null pointer is returned if the new string cannot be created." > > Does that also mean that a null pointer is returned if the input is a > NULL pointer (cause in that case new string could not be created)? No. It means that if the input is *valid* but the is a problem with completing the operation of strdup(validstring), then an error is returned to let you know something bad is going on. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 22:20:32 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC1C10656AC; Wed, 23 Apr 2008 22:20:32 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6AE8FC22; Wed, 23 Apr 2008 22:20:31 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl23-13.kln.forthnet.gr [77.49.150.13]) (authenticated bits=128) by igloo.linux.gr (8.14.2/8.14.2/Debian-3) with ESMTP id m3NMKF7j022023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 24 Apr 2008 01:20:21 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m3NMKEnc002357; Thu, 24 Apr 2008 01:20:15 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m3NMKCuW002356; Thu, 24 Apr 2008 01:20:12 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Hans Petter Selasky References: <293918.47889.qm@web36608.mail.mud.yahoo.com> <20080423124023.54ca505e@mbook-fbsd> <200804231957.49035.hselasky@c2i.net> Date: Thu, 24 Apr 2008 01:20:11 +0300 In-Reply-To: <200804231957.49035.hselasky@c2i.net> (Hans Petter Selasky's message of "Wed, 23 Apr 2008 19:57:47 +0200") Message-ID: <878wz49pt0.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: m3NMKF7j022023 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.908, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.49, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Simun Mikecin , freebsd-hackers@freebsd.org, Mike Meyer , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 22:20:32 -0000 On Wed, 23 Apr 2008 19:57:47 +0200, Hans Petter Selasky = wrote: > Hi, > > I recently had to tell someone that "strncpy" does not always zero > terminate the destination string. Surprised by what I was telling they > immediately wanted to change the way the function worked. When a > function is defined by an ISO standard you are not supposed to change > the definition. Instead I pointed the person at "strlcpy". Else you > will have serious trouble when code is ported to a new platform. > > http://www.gratisoft.us/todd/papers/strlcpy.html > > The name "strdup" is very appealing, but it has already been taken and > defined. You have to give your variant a different name and convince > everyone that your function is good and solves a problem so that it > deserves to be in the C-library. Right on the spot, Hans :) You may have to pick a name that doesn't start from "str", though, because the "str*" function names are reserved for future extensions to the standard. ISO/IEC 9899:1999 (E), page 401, =C2=A77.26.11 says: 7.26 Future library directions [...] 7.26.11 String handling 1 Function names that begin with "str", "mem", or "wcs" and a lowercase letter may be added to the declarations in the header. You're quite right about 'not replacing' the standard functions in a lighthearted manner though. The short-term benefits of making a single application "easier to write", are dwarfed by the possibilities for introducing gratuitous incompatibilities for all the _other_ programs running on the same platform, and any other platforms conforming to the "real" standard behavior. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 22:20:32 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDC1C10656AC; Wed, 23 Apr 2008 22:20:32 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2E6AE8FC22; Wed, 23 Apr 2008 22:20:31 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl23-13.kln.forthnet.gr [77.49.150.13]) (authenticated bits=128) by igloo.linux.gr (8.14.2/8.14.2/Debian-3) with ESMTP id m3NMKF7j022023 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 24 Apr 2008 01:20:21 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.2/8.14.2) with ESMTP id m3NMKEnc002357; Thu, 24 Apr 2008 01:20:15 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.2/8.14.2/Submit) id m3NMKCuW002356; Thu, 24 Apr 2008 01:20:12 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: Hans Petter Selasky References: <293918.47889.qm@web36608.mail.mud.yahoo.com> <20080423124023.54ca505e@mbook-fbsd> <200804231957.49035.hselasky@c2i.net> Date: Thu, 24 Apr 2008 01:20:11 +0300 In-Reply-To: <200804231957.49035.hselasky@c2i.net> (Hans Petter Selasky's message of "Wed, 23 Apr 2008 19:57:47 +0200") Message-ID: <878wz49pt0.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MailScanner-ID: m3NMKF7j022023 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.908, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.49, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Simun Mikecin , freebsd-hackers@freebsd.org, Mike Meyer , hackers@freebsd.org Subject: Re: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 22:20:32 -0000 On Wed, 23 Apr 2008 19:57:47 +0200, Hans Petter Selasky = wrote: > Hi, > > I recently had to tell someone that "strncpy" does not always zero > terminate the destination string. Surprised by what I was telling they > immediately wanted to change the way the function worked. When a > function is defined by an ISO standard you are not supposed to change > the definition. Instead I pointed the person at "strlcpy". Else you > will have serious trouble when code is ported to a new platform. > > http://www.gratisoft.us/todd/papers/strlcpy.html > > The name "strdup" is very appealing, but it has already been taken and > defined. You have to give your variant a different name and convince > everyone that your function is good and solves a problem so that it > deserves to be in the C-library. Right on the spot, Hans :) You may have to pick a name that doesn't start from "str", though, because the "str*" function names are reserved for future extensions to the standard. ISO/IEC 9899:1999 (E), page 401, =C2=A77.26.11 says: 7.26 Future library directions [...] 7.26.11 String handling 1 Function names that begin with "str", "mem", or "wcs" and a lowercase letter may be added to the declarations in the header. You're quite right about 'not replacing' the standard functions in a lighthearted manner though. The short-term benefits of making a single application "easier to write", are dwarfed by the possibilities for introducing gratuitous incompatibilities for all the _other_ programs running on the same platform, and any other platforms conforming to the "real" standard behavior. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 22:39:54 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98DED1065672; Wed, 23 Apr 2008 22:39:54 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 507648FC21; Wed, 23 Apr 2008 22:39:54 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1Jond3-0007HM-Gd; Thu, 24 Apr 2008 01:39:53 +0300 Message-ID: <480FBAB9.1000904@icyb.net.ua> Date: Thu, 24 Apr 2008 01:39:53 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: John Baldwin References: <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> <480F8D23.9040005@icyb.net.ua> <200804231549.54722.jhb@freebsd.org> In-Reply-To: <200804231549.54722.jhb@freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 22:39:54 -0000 on 23/04/2008 22:49 John Baldwin said the following: > > Events have a subsystem associated with them, so devfs events would use their > own subsystem type to avoid that sort of confusion. Thank you for straightening me - for some reason I was thinking about "+"/"-" (attach/detach) events, but I see that "!" (notification) would be much more appropriate. As you said, this can be completely modeled after IF notifications. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 23 23:10:50 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CB1106566C for ; Wed, 23 Apr 2008 23:10:50 +0000 (UTC) (envelope-from lichave@gmail.com) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.170]) by mx1.freebsd.org (Postfix) with ESMTP id E41338FC21 for ; Wed, 23 Apr 2008 23:10:49 +0000 (UTC) (envelope-from lichave@gmail.com) Received: by wf-out-1314.google.com with SMTP id 25so2165569wfa.7 for ; Wed, 23 Apr 2008 16:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=XBmAoaerMcbm2+w6+0G4tHaDTKf8bmtuBHZim5nKe/0=; b=fsjXyLI7nQ0uLrupKXzLzkcC+bfoEffew9YeWGw+V2/Gf9uB8hmuKzGuVoAEhupjyUEUUl/DfzBtE0gkkgWXMKQVu/VbHX2F9qppLJmbYKqEE8XExbG3pK9PyRygtLKFX+nv8pDV2ROvWcTeKrf/PKSq/xfHvxCimbb+Hd9tVh4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nQ/xTCDve0Amc6zL5U15jY7qrV9BPia8SL2tG1gkMp3qFjv5A8gN1x2IabhzyrHPLwIgGU1lwI23qnSuV5IlYrSXKGgs5OnOaccLYo58yKx0n/puEml9OnmB40GKC3Ten2RxcvflpWkxmeXnJnD3sWp5CfUsY6t+e8vsIPXkg2s= Received: by 10.142.237.20 with SMTP id k20mr261774wfh.112.1208990748875; Wed, 23 Apr 2008 15:45:48 -0700 (PDT) Received: by 10.143.165.15 with HTTP; Wed, 23 Apr 2008 15:45:48 -0700 (PDT) Message-ID: <716a8d5f0804231545v5b3ba923u9f20b763fcea33cf@mail.gmail.com> Date: Thu, 24 Apr 2008 00:45:48 +0200 From: "Konrad Jankowski" To: hackers@freebsd.org In-Reply-To: <20080422075642.GA72273@freebsdmall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080422075642.GA72273@freebsdmall.com> Cc: Subject: Re: Please welcome our Summer of Code Students X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Apr 2008 23:10:50 -0000 Greetings to all in the FreeBSD community! My long-time dream of joining has come! As for the introduction: I am a 3'rd year Informatics student at Gdansk University of Technology. My interests are low level (kernel, library) coding. (surprise!) I have some bigger projects on my account: 1. DOORS operating system (http://netg.pl/~doors/) and 2. DOORS C compiler (http://netg.pl/~doors/dcc/) One of my biggest concerns was always creating software that works everywhere and as expected. By that I mean: standardized interfaces, clean code and no dependence on exotic libraries. My another related concern is: documented and standardized hardware (things like 3D driver portability). I think in future I will try to contribute to FreeBSD in this area by porting more DRM drivers. Another thing, this time more FreeBSD related: we have some basic subsystems that not always behave as expected. I means USB for example. I will be happy in the future to help test and integrate patches. I am also a system administrator at Blue Media (http://www.bluemedia.pl/), my work was the reason I started working on collation. Nearly all of our systems work on FreeBSD, and now we are moving the database systems to it. In this project I will be working on collation in UTF-8 locales, more info soon on my wiki. I want to say one important thing: four years ago, when I began my journey with FreeBSD, I started to analyze the source, and I was amazed by the cleanliness and discipline found there. That's when I begun to refactor my coding style to resonate with that. Now I thing I have got much of this cleanliness and discipline myself, and I am very proud of it. That makes me even more happy I can contribute back! Thank you, Konrad Jankowski From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 07:22:52 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49DBF1065673 for ; Thu, 24 Apr 2008 07:22:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 436048FC14 for ; Thu, 24 Apr 2008 07:22:52 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id C0FBD46B0C; Thu, 24 Apr 2008 03:22:51 -0400 (EDT) Date: Thu, 24 Apr 2008 08:22:51 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Bakul Shah In-Reply-To: <20080423185431.3FA615BB1@mail.bitblocks.com> Message-ID: <20080424082155.G10114@fledge.watson.org> References: <20080423185431.3FA615BB1@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Garrett Cooper , hackers@freebsd.org Subject: Re: Fwd: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 07:22:52 -0000 On Wed, 23 Apr 2008, Bakul Shah wrote: > The *exception* is where a function is explicitly prepared to handle NULLs. > One must read its man page carefully and if it doesn't say anything about > how NULLs in place of ptrs are handled, one must not pass in NULLs! While I recognize there are some useful consumer simplicity benefits to accepting NULL as an argument to free(3), it's always made me a bit uneasy for this reason. Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 07:47:08 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 261A2106567B for ; Thu, 24 Apr 2008 07:47:08 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (vlk.vlakno.cz [62.168.28.247]) by mx1.freebsd.org (Postfix) with ESMTP id EEC7B8FC26 for ; Thu, 24 Apr 2008 07:47:07 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 8B5E767A24D; Thu, 24 Apr 2008 09:46:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (vlk.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E7qpuCxZManU; Thu, 24 Apr 2008 09:46:41 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A0739678BE4; Thu, 24 Apr 2008 09:46:41 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.2/8.14.2/Submit) id m3O7kfEH078059; Thu, 24 Apr 2008 09:46:41 +0200 (CEST) (envelope-from rdivacky) Date: Thu, 24 Apr 2008 09:46:41 +0200 From: Roman Divacky To: Konrad Jankowski Message-ID: <20080424074641.GA77979@freebsd.org> References: <20080422075642.GA72273@freebsdmall.com> <716a8d5f0804231545v5b3ba923u9f20b763fcea33cf@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <716a8d5f0804231545v5b3ba923u9f20b763fcea33cf@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: hackers@freebsd.org Subject: Re: Please welcome our Summer of Code Students X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 07:47:08 -0000 On Thu, Apr 24, 2008 at 12:45:48AM +0200, Konrad Jankowski wrote: > Greetings to all in the FreeBSD community! > My long-time dream of joining has come! welcome! your project will help tons of people who are (attempting to) run databases on fbsd ;) thnx! roman From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 08:05:12 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A44C01065678; Thu, 24 Apr 2008 08:05:12 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 7FA388FC1B; Thu, 24 Apr 2008 08:05:12 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1JowS7-0000dw-BR; Thu, 24 Apr 2008 11:05:11 +0300 Message-ID: <48103F36.6060707@icyb.net.ua> Date: Thu, 24 Apr 2008 11:05:10 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: John Baldwin References: <480E4269.2090604@icyb.net.ua> <200804230955.10390.jhb@freebsd.org> <480F8D23.9040005@icyb.net.ua> <200804231549.54722.jhb@freebsd.org> <480FBAB9.1000904@icyb.net.ua> In-Reply-To: <480FBAB9.1000904@icyb.net.ua> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 08:05:12 -0000 on 24/04/2008 01:39 Andriy Gapon said the following: > on 23/04/2008 22:49 John Baldwin said the following: >> Events have a subsystem associated with them, so devfs events would use their >> own subsystem type to avoid that sort of confusion. > > Thank you for straightening me - for some reason I was thinking about > "+"/"-" (attach/detach) events, but I see that "!" (notification) would > be much more appropriate. As you said, this can be completely modeled > after IF notifications. Do you think it would be better to post notification from make_dev*() in kern_conf.c or from devfs_create()? I mean will such notification be useful if there is no devfs to access the device from userland? -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 08:31:18 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8FA211065673 for ; Thu, 24 Apr 2008 08:31:18 +0000 (UTC) (envelope-from andenore@start.no) Received: from bgo1smout1.broadpark.no (bgo1smout1.broadpark.no [217.13.4.94]) by mx1.freebsd.org (Postfix) with ESMTP id 6E7458FC16 for ; Thu, 24 Apr 2008 08:31:18 +0000 (UTC) (envelope-from andenore@start.no) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; format=flowed; delsp=yes; charset=us-ascii Received: from bgo1sminn1.broadpark.no ([217.13.4.93]) by bgo1smout1.broadpark.no (Sun Java(tm) System Messaging Server 6.3-3.01 (built Jul 12 2007; 32bit)) with ESMTP id <0JZT00L3HJJQ1640@bgo1smout1.broadpark.no> for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 09:31:02 +0200 (CEST) Received: from duckjen.nextgentel.no ([84.48.194.205]) by bgo1sminn1.broadpark.no (Sun Java(tm) System Messaging Server 6.3-3.01 (built Jul 12 2007; 32bit)) with ESMTP id <0JZT002VSJJPW480@bgo1sminn1.broadpark.no> for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 09:31:02 +0200 (CEST) Date: Thu, 24 Apr 2008 09:30:06 +0200 To: freebsd-hackers@freebsd.org From: Anders Nore Message-id: User-Agent: Opera Mail/9.27 (FreeBSD) Subject: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 08:31:18 -0000 Hello everyone, my name is Anders Nore, I'm in my second year studying Computer Science at the Norwegian University of Science and Technology. I've been selected to work on adding .db support to the pkg_* tools. The first time I was introduced to FreeBSD was on an irc channel called #htmlhelp believe it or not, I were using Linux at the time and found out that I had chosen completely wrong and FreeBSD would become my weapon of choice. Becoming a FreeBSD developer has been dream for a long time, and just the FreeBSD mail alias is enough payment for me ;-) Anders Nore From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 09:30:16 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70A961065678 for ; Thu, 24 Apr 2008 09:30:16 +0000 (UTC) (envelope-from snb@moduli.net) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.178]) by mx1.freebsd.org (Postfix) with ESMTP id 54BDC8FC12 for ; Thu, 24 Apr 2008 09:30:16 +0000 (UTC) (envelope-from snb@moduli.net) Received: by py-out-1112.google.com with SMTP id u52so4875665pyb.10 for ; Thu, 24 Apr 2008 02:30:15 -0700 (PDT) Received: by 10.140.136.6 with SMTP id j6mr683966rvd.50.1209027711006; Thu, 24 Apr 2008 02:01:51 -0700 (PDT) Received: by 10.141.69.20 with HTTP; Thu, 24 Apr 2008 02:01:50 -0700 (PDT) Message-ID: Date: Thu, 24 Apr 2008 11:01:50 +0200 From: "Nick Barkas" Sender: snb@moduli.net To: hackers@freebsd.org In-Reply-To: <20080422075642.GA72273@freebsdmall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20080422075642.GA72273@freebsdmall.com> X-Google-Sender-Auth: a33da4451e4b0664 Cc: Subject: Re: Please welcome our Summer of Code Students X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 09:30:16 -0000 Hi everyone I'm Nick Barkas, and will be working on making memory usage for dirhash dynamic. I'm a master's student studying scientific computing at Kungliga Tekniska h=F6gskolan (Royal Institute of Technology) in Stockholm. I have been using FreeBSD for several years and I am very happy to get this chance to spend a lot of time hacking on it, learning more about what goes on in the kernel, and hopefully making UFS2 faster. I also work for a game company called Three Rings Design based in San Francisco. We use FreeBSD for most of our servers there, and I do backend software engineering and system administration. Thanks! Nick On Tue, Apr 22, 2008 at 9:56 AM, Murray Stokely wrote: > Google announced today that they are funding 21 of our Summer of Code > applicants (out of over 100 applications). We had at least 10 highly > competitive applications that were not funded by Google, and we've > encouraged some of those students to work on FreeBSD this summer > anyway. We are very much looking forward to working with these > students this summer on the chosen FreeBSD related projects. So > without further ado, the student/mentor pairs are : > > * Dynamic memory allocation for dirhash in UFS2, > Sean Nicholas Barkas, mentored by David Malone > * TCP/IP regression test suite, > Victor Hugo Bilouro, mentored by George Neville-Neil > * Improved Wine support under FreeBSD, > Eric Durbin, mentored by Kristofer Paul Moore (PC-BSD) > * Allowing for Parallel builds in the FreeBSD Ports Collection, > David Forsythe, mentored by Mark Linimon > * Implementation of MPLS in FreeBSD, > Ryan French, mentored by Kip Macy > * Audit Firewall Events from Kernel, > Diego Giagio, mentored by Christian S.J. Peron > * Embedded FreeBSD project, > James Andrew Harrison, mentored by Warner Losh > * FreeBSD auditing system testing, > Vincenzo Iozzo, mentored by Attilio Rao > * Multibyte collation support, > Konrad Jankowski, mentored by Diomidis Spinellis > * Porting BSD-licensed Text-Processing Tools from OpenBSD, > Gabor Kovesdan, mentored by Max Khon > * Reference implementation of the SNTP client, > Johannes Maximilian Kuehn, mentored by Harlan Stenn (NTP) > * Improving layer2 filtering in FreeBSD, > Gleb Kurtsov, mentored by Andrew Thompson > * DTrace Toolkit on FreeBSD, > LIQUN LI, mentored by John Birrell > * NFSv4 ACLs, > Edward Tomasz Napierala, mentored by Robert Watson > * Adding .db support to pkg_tools --> pkg_improved, > Anders Nore, mentored by Florent Thoumie > * 802.11 Fuzzing and Testing, > Aniket Patankar, mentored by Sam Leffler > * TCP anomaly detector, > Rui Alexandre Cunha Paulo, mentored by Andre Oppermann > * Ports license auditing infrastructure, > Alejandro Pulver, mentored by Brooks Davis > * VM Algorithm Improvement, > Mayur Shardul, mentored by Jeffrey Roberson > * Enhancing FreeBSD's Libarchive, > Anselm Strauss, mentored by Timothy Kientzle > * Porting FreeBSD to Efika SoC (PPC bring up), > Przemek Witaszczyk, mentored by Rafal Jaworowski > > We are still in the process of getting them signed up for perforce and > wiki accounts and such, but eventually the students will create > project pages describing their plans and progress at : > > http://wiki.freebsd.org/SummerOfCode2008 > > Most of the students are still busy with coursework at the moment, and > so this is a community bonding period before the summer work is > supposed to begin. In the mean time if you want to send a note to > congratulate them you can mail them all at soc-students@FreeBSD.org. > > Thanks to everyone (over 60 committers registered this year!) that > helped review the student applications, and especially thanks to > Google for this significant investment in the the FreeBSD development > community. > > - Murray > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 10:07:12 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6140106564A for ; Thu, 24 Apr 2008 10:07:12 +0000 (UTC) (envelope-from crquan@gmail.com) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.186]) by mx1.freebsd.org (Postfix) with ESMTP id 88FF98FC12 for ; Thu, 24 Apr 2008 10:07:12 +0000 (UTC) (envelope-from crquan@gmail.com) Received: by ti-out-0910.google.com with SMTP id j2so1199460tid.3 for ; Thu, 24 Apr 2008 03:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=LvBkvYABVhJ6nT1KIRarsA9X5cIY+dn/03NH6CMmGKQ=; b=ncdj3uFEfPh9z/cR3dFy3V+UMHb9GgoOOFydsMXa5VGUGpIcJWtGrl7tVH3zxEJbmT2ApteFl+Ooj8oCsgbheGj8Y7UNifxxolfdgKwjQ9+l+5iAxDMkm0nrJ5iyPeMVFGTVabbX30BmCkNMiDvGfRGMGtp9P2t4AHVEVEEyAX0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NgzIMP2P+U2lYLDLCh1wqFOH74oZXzkSAbKOB2mrv92oIhgmxQb1cUKaGGMo8QVEtHIhf7AnXndoqHOWpbtpdAB1qgFJpU5ZfCtCzhBng7ry/v7FX2E1T/BM8XhHb0bUGUwrsysvD017qhRLQq6+B72He2W+jmBpnnNIVuX4MFs= Received: by 10.110.47.17 with SMTP id u17mr279941tiu.4.1209029895361; Thu, 24 Apr 2008 02:38:15 -0700 (PDT) Received: by 10.110.60.16 with HTTP; Thu, 24 Apr 2008 02:38:15 -0700 (PDT) Message-ID: <91b13c310804240238j2c73bbcat65695c579d2481f0@mail.gmail.com> Date: Thu, 24 Apr 2008 17:38:15 +0800 From: "rae l" To: "Anders Nore" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-hackers@freebsd.org Subject: Re: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 10:07:12 -0000 On Thu, Apr 24, 2008 at 3:30 PM, Anders Nore wrote: > > Hello everyone, > > my name is Anders Nore, I'm in my second year studying Computer Science at > the Norwegian University of Science and Technology. I've been selected to > work on adding .db support to the pkg_* tools. > > The first time I was introduced to FreeBSD was on an irc channel called > #htmlhelp believe it or not, I were using Linux at the time and found out > that I had chosen completely wrong and FreeBSD would become my weapon of > choice. Becoming a FreeBSD developer has been dream for a long time, and > just the FreeBSD mail alias is enough payment for me ;-) great! From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:27:38 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99056106564A for ; Thu, 24 Apr 2008 12:27:38 +0000 (UTC) (envelope-from sanjeevfiles@yahoo.com) Received: from web57705.mail.re3.yahoo.com (web57705.mail.re3.yahoo.com [68.142.236.59]) by mx1.freebsd.org (Postfix) with SMTP id 6125C8FC12 for ; Thu, 24 Apr 2008 12:27:37 +0000 (UTC) (envelope-from sanjeevfiles@yahoo.com) Received: (qmail 36858 invoked by uid 60001); 24 Apr 2008 12:27:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=sshzLavYVJK6slBPOZaeY6g1hc3VLF99XmhHtjsy+ZoH2twag08BWXe8BHwWsHxI2jj6m2IV0OqD2h3g32C2RV/rT87f1kqSr5tRJzC8B+rciMFEB7RAI2K4XxLeH0RiEohAaJ9T4XOxa7xCUnsvpbh0888MBOqyLgr+me/0vfU=; X-YMail-OSG: b5i5XasVM1moWBlTNH9z4f37jd4tgOVqSskD.eE63TOhvgT46.n6yjDNPAHYQuBnyea4OS4.E6eKapJ0ky80sd8UtTB1K.2cjLL5dIBOuWrg5bDt485Tc0g.3Ck- Received: from [124.30.112.50] by web57705.mail.re3.yahoo.com via HTTP; Thu, 24 Apr 2008 05:27:36 PDT Date: Thu, 24 Apr 2008 05:27:36 -0700 (PDT) From: "Sanjeev Kumar.S" To: Hans Petter Selasky , freebsd-hackers@freebsd.org In-Reply-To: <200804231957.49035.hselasky@c2i.net> MIME-Version: 1.0 Message-ID: <991663.36827.qm@web57705.mail.re3.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Simun Mikecin , Mike Meyer , hackers@freebsd.org Subject: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:27:38 -0000 Hi, Is there any way to save entire console sessions ? Screen asks me to copy and paste what I want. I don't want to do that I need to save entire sessions. like a start till I do a exit or quit the application. Is there a utility like that ? Regards, Sanjeev. --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:38:37 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2ACB106566B for ; Thu, 24 Apr 2008 12:38:37 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from pd3mo2so.prod.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by mx1.freebsd.org (Postfix) with ESMTP id CD5F78FC1B for ; Thu, 24 Apr 2008 12:38:37 +0000 (UTC) (envelope-from soralx@cydem.org) Received: from pd3mr3so.prod.shaw.ca (pd3mr3so-qfe3.prod.shaw.ca [10.0.141.179]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0JZT00045XRSKN00@l-daemon> for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 06:38:16 -0600 (MDT) Received: from pn2ml1so.prod.shaw.ca ([10.0.121.145]) by pd3mr3so.prod.shaw.ca (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0JZT003H8XRSQT10@pd3mr3so.prod.shaw.ca> for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 06:38:17 -0600 (MDT) Received: from soralx ([24.87.3.133]) by l-daemon (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0JZT00N69XRR2900@l-daemon> for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 06:38:16 -0600 (MDT) Date: Thu, 24 Apr 2008 05:38:15 -0700 From: soralx@cydem.org In-reply-to: <991663.36827.qm@web57705.mail.re3.yahoo.com> To: freebsd-hackers@freebsd.org Message-id: <20080424053815.4507ddb1@soralx> MIME-version: 1.0 X-Mailer: Claws Mail 3.3.1 (GTK+ 2.12.9; i386-portbld-freebsd7.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit References: <200804231957.49035.hselasky@c2i.net> <991663.36827.qm@web57705.mail.re3.yahoo.com> Cc: sanjeevfiles@yahoo.com Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:38:37 -0000 > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? man 1 script > Regards, > Sanjeev. [SorAlx] ridin' VS1400 From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:42:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37D911065676 for ; Thu, 24 Apr 2008 12:42:35 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 0CA7F8FC13 for ; Thu, 24 Apr 2008 12:42:35 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-253-25-183.bredband.comhem.se ([83.253.25.183]:57425 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1Jp0mX-00007a-9A for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 14:42:34 +0200 Received: (qmail 28146 invoked from network); 24 Apr 2008 14:42:30 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 24 Apr 2008 14:42:30 +0200 Received: (qmail 73376 invoked by uid 1001); 24 Apr 2008 14:42:30 +0200 Date: Thu, 24 Apr 2008 14:42:30 +0200 From: Erik Trulsson To: "Sanjeev Kumar.S" Message-ID: <20080424124230.GA73346@owl.midgard.homeip.net> Mail-Followup-To: "Sanjeev Kumar.S" , freebsd-hackers@freebsd.org References: <200804231957.49035.hselasky@c2i.net> <991663.36827.qm@web57705.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <991663.36827.qm@web57705.mail.re3.yahoo.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Originating-IP: 83.253.25.183 X-Scan-Result: No virus found in message 1Jp0mX-00007a-9A. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1Jp0mX-00007a-9A b5d993515ebfa18aa8f4b5f94e5bb0b9 Cc: freebsd-hackers@freebsd.org Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:42:35 -0000 [Trimmed Cc: list] On Thu, Apr 24, 2008 at 05:27:36AM -0700, Sanjeev Kumar.S wrote: > Hi, > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? You mean something like script(1) ? -- Erik Trulsson ertr1013@student.uu.se From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:48:05 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0965106566B; Thu, 24 Apr 2008 12:48:05 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id 91A218FC15; Thu, 24 Apr 2008 12:48:05 +0000 (UTC) (envelope-from rink@rink.nu) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 7A3016D41F; Thu, 24 Apr 2008 14:30:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JYUCgGsqYRiq; Thu, 24 Apr 2008 14:30:47 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id 1FCEE6D42B; Thu, 24 Apr 2008 14:30:47 +0200 (CEST) Date: Thu, 24 Apr 2008 14:30:47 +0200 From: Rink Springer To: "Sanjeev Kumar.S" Message-ID: <20080424123047.GF38660@rink.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Simun Mikecin , freebsd-hackers@freebsd.org, Mike Meyer , hackers@freebsd.org, Hans Petter Selasky Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:48:05 -0000 Hi, On Thu, Apr 24, 2008 at 05:27:36AM -0700, Sanjeev Kumar.S wrote: > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? Please, don't hijack the thread next time :-) Either way, have a look at script(1) - I think that is what you are looking for. Regards, -- Rink P.W. Springer - http://rink.nu "Anyway boys, this is America. Just because you get more votes doesn't mean you win." - Fox Mulder From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:48:05 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0965106566B; Thu, 24 Apr 2008 12:48:05 +0000 (UTC) (envelope-from rink@rink.nu) Received: from mx1.rink.nu (gloom.rink.nu [213.34.49.2]) by mx1.freebsd.org (Postfix) with ESMTP id 91A218FC15; Thu, 24 Apr 2008 12:48:05 +0000 (UTC) (envelope-from rink@rink.nu) Received: from localhost (localhost [127.0.0.1]) by mx1.rink.nu (Postfix) with ESMTP id 7A3016D41F; Thu, 24 Apr 2008 14:30:50 +0200 (CEST) X-Virus-Scanned: amavisd-new at rink.nu Received: from mx1.rink.nu ([213.34.49.2]) by localhost (gloom.rink.nu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JYUCgGsqYRiq; Thu, 24 Apr 2008 14:30:47 +0200 (CEST) Received: by mx1.rink.nu (Postfix, from userid 1000) id 1FCEE6D42B; Thu, 24 Apr 2008 14:30:47 +0200 (CEST) Date: Thu, 24 Apr 2008 14:30:47 +0200 From: Rink Springer To: "Sanjeev Kumar.S" Message-ID: <20080424123047.GF38660@rink.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Simun Mikecin , freebsd-hackers@freebsd.org, Mike Meyer , hackers@freebsd.org, Hans Petter Selasky Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:48:05 -0000 Hi, On Thu, Apr 24, 2008 at 05:27:36AM -0700, Sanjeev Kumar.S wrote: > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? Please, don't hijack the thread next time :-) Either way, have a look at script(1) - I think that is what you are looking for. Regards, -- Rink P.W. Springer - http://rink.nu "Anyway boys, this is America. Just because you get more votes doesn't mean you win." - Fox Mulder From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 12:54:18 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 438B1106566C for ; Thu, 24 Apr 2008 12:54:18 +0000 (UTC) (envelope-from sanjeevfiles@yahoo.com) Received: from web57705.mail.re3.yahoo.com (web57705.mail.re3.yahoo.com [68.142.236.59]) by mx1.freebsd.org (Postfix) with SMTP id 0709F8FC18 for ; Thu, 24 Apr 2008 12:54:17 +0000 (UTC) (envelope-from sanjeevfiles@yahoo.com) Received: (qmail 36858 invoked by uid 60001); 24 Apr 2008 12:27:37 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=sshzLavYVJK6slBPOZaeY6g1hc3VLF99XmhHtjsy+ZoH2twag08BWXe8BHwWsHxI2jj6m2IV0OqD2h3g32C2RV/rT87f1kqSr5tRJzC8B+rciMFEB7RAI2K4XxLeH0RiEohAaJ9T4XOxa7xCUnsvpbh0888MBOqyLgr+me/0vfU=; X-YMail-OSG: b5i5XasVM1moWBlTNH9z4f37jd4tgOVqSskD.eE63TOhvgT46.n6yjDNPAHYQuBnyea4OS4.E6eKapJ0ky80sd8UtTB1K.2cjLL5dIBOuWrg5bDt485Tc0g.3Ck- Received: from [124.30.112.50] by web57705.mail.re3.yahoo.com via HTTP; Thu, 24 Apr 2008 05:27:36 PDT Date: Thu, 24 Apr 2008 05:27:36 -0700 (PDT) From: "Sanjeev Kumar.S" To: Hans Petter Selasky , freebsd-hackers@freebsd.org In-Reply-To: <200804231957.49035.hselasky@c2i.net> MIME-Version: 1.0 Message-ID: <991663.36827.qm@web57705.mail.re3.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Simun Mikecin , Mike Meyer , hackers@freebsd.org Subject: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 12:54:18 -0000 Hi, Is there any way to save entire console sessions ? Screen asks me to copy and paste what I want. I don't want to do that I need to save entire sessions. like a start till I do a exit or quit the application. Is there a utility like that ? Regards, Sanjeev. --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 13:01:56 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C184106564A for ; Thu, 24 Apr 2008 13:01:56 +0000 (UTC) (envelope-from freebsd.lists@fsck.ch) Received: from secure.socket.ch (secure.socket.ch [212.103.70.36]) by mx1.freebsd.org (Postfix) with ESMTP id E20D58FC16 for ; Thu, 24 Apr 2008 13:01:55 +0000 (UTC) (envelope-from freebsd.lists@fsck.ch) Received: from bl04svfw01.bns-group.com ([62.2.233.2] helo=default.fsck.ch) by secure.socket.ch with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Jp0gR-0002IY-26; Thu, 24 Apr 2008 14:36:21 +0200 Message-ID: <48107EB1.7060002@fsck.ch> Date: Thu, 24 Apr 2008 14:36:01 +0200 From: Tobias Roth User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: "Sanjeev Kumar.S" , freebsd-hackers@freebsd.org References: <991663.36827.qm@web57705.mail.re3.yahoo.com> In-Reply-To: <991663.36827.qm@web57705.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.9 (----) X-Spam-Report: Spam detection software, running on the system "secure.socket.ch", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 04/24/08 14:27, Sanjeev Kumar.S wrote: > Hi, > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? [...] Content analysis details: (-4.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] -0.6 AWL AWL: From: address is in the auto white-list X-SA-Exim-Connect-IP: 62.2.233.2 X-SA-Exim-Mail-From: freebsd.lists@fsck.ch X-SA-Exim-Scanned: No (on secure.socket.ch); SAEximRunCond expanded to false Cc: Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 13:01:56 -0000 On 04/24/08 14:27, Sanjeev Kumar.S wrote: > Hi, > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? Maybe screen(1) is what you are looking for? It makes typescripts of terminal sessions. Kind regards, Tobias -- Tobias Roth || http://fsck.ch || PGP: 0xCE599B4D | Go down deep enough into anything and you will find mathematics. | - Dean Schlicter From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 13:07:02 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4106B106566B for ; Thu, 24 Apr 2008 13:07:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB1C8FC2B for ; Thu, 24 Apr 2008 13:07:02 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (unknown [208.65.91.234]) by elvis.mu.org (Postfix) with ESMTP id C78CA1A4D8B; Thu, 24 Apr 2008 06:07:01 -0700 (PDT) From: John Baldwin To: Andriy Gapon Date: Thu, 24 Apr 2008 08:11:26 -0400 User-Agent: KMail/1.9.7 References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> In-Reply-To: <48103F36.6060707@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804240811.26183.jhb@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 13:07:02 -0000 On Thursday 24 April 2008 04:05:10 am Andriy Gapon wrote: > on 24/04/2008 01:39 Andriy Gapon said the following: > > on 23/04/2008 22:49 John Baldwin said the following: > >> Events have a subsystem associated with them, so devfs events would use > >> their own subsystem type to avoid that sort of confusion. > > > > Thank you for straightening me - for some reason I was thinking about > > "+"/"-" (attach/detach) events, but I see that "!" (notification) would > > be much more appropriate. As you said, this can be completely modeled > > after IF notifications. > > Do you think it would be better to post notification from make_dev*() in > kern_conf.c or from devfs_create()? > I mean will such notification be useful if there is no devfs to access > the device from userland? I'm not sure. Probably just make_dev*() as all systems will have a devfs on /dev. -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 13:25:04 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70825106566C for ; Thu, 24 Apr 2008 13:25:04 +0000 (UTC) (envelope-from jhs@berklix.org) Received: from flat.berklix.org (flat.berklix.org [83.236.223.115]) by mx1.freebsd.org (Postfix) with ESMTP id D33C48FC15 for ; Thu, 24 Apr 2008 13:25:03 +0000 (UTC) (envelope-from jhs@berklix.org) Received: from js.berklix.net (p549A7259.dip.t-dialin.net [84.154.114.89]) (authenticated bits=0) by flat.berklix.org (8.13.8/8.13.8) with ESMTP id m3ODOvRq085005; Thu, 24 Apr 2008 15:24:59 +0200 (CEST) (envelope-from jhs@berklix.org) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by js.berklix.net (8.13.8/8.13.8) with ESMTP id m3ODSNMq010078; Thu, 24 Apr 2008 15:28:23 +0200 (CEST) (envelope-from jhs@berklix.org) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.13.8/8.13.8) with ESMTP id m3ODS8BB095437; Thu, 24 Apr 2008 15:28:13 +0200 (CEST) (envelope-from jhs@fire.js.berklix.net) Message-Id: <200804241328.m3ODS8BB095437@fire.js.berklix.net> To: Tobias Roth In-reply-to: <48107EB1.7060002@fsck.ch> References: <991663.36827.qm@web57705.mail.re3.yahoo.com> <48107EB1.7060002@fsck.ch> Comments: In-reply-to Tobias Roth message dated "Thu, 24 Apr 2008 14:36:01 +0200." Date: Thu, 24 Apr 2008 15:28:08 +0200 From: "Julian H. Stacey" Cc: freebsd-hackers@freebsd.org, "Sanjeev Kumar.S" Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 13:25:04 -0000 Tobias Roth wrote: > On 04/24/08 14:27, Sanjeev Kumar.S wrote: > > Hi, > > Is there any way to save entire console > > sessions ? > > Screen asks me to copy and paste what > > I want. I don't want to do that I need to save > > entire sessions. like a start till I do a exit or > > quit the application. Is there a utility like > > that ? > > Maybe screen(1) is what you are looking for? It makes typescripts of > terminal sessions. man script Julian -- Julian Stacey: BSDUnixLinux C Prog Admin SysEng Consult Munich www.berklix.com Mail just Ascii plain text. HTML & Base64 text are spam. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 13:33:05 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB438106564A for ; Thu, 24 Apr 2008 13:33:05 +0000 (UTC) (envelope-from freebsd.lists@fsck.ch) Received: from secure.socket.ch (secure.socket.ch [212.103.70.36]) by mx1.freebsd.org (Postfix) with ESMTP id 9424D8FC14 for ; Thu, 24 Apr 2008 13:33:05 +0000 (UTC) (envelope-from freebsd.lists@fsck.ch) Received: from bl04svfw01.bns-group.com ([62.2.233.2] helo=default.fsck.ch) by secure.socket.ch with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Jp1ZF-0002Sz-Pj; Thu, 24 Apr 2008 15:33:03 +0200 Message-ID: <48108BF8.2060404@fsck.ch> Date: Thu, 24 Apr 2008 15:32:40 +0200 From: Tobias Roth User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: "Julian H. Stacey" References: <991663.36827.qm@web57705.mail.re3.yahoo.com> <48107EB1.7060002@fsck.ch> <200804241328.m3ODS8BB095437@fire.js.berklix.net> In-Reply-To: <200804241328.m3ODS8BB095437@fire.js.berklix.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Score: -4.9 (----) X-Spam-Report: Spam detection software, running on the system "secure.socket.ch", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 04/24/08 15:28, Julian H. Stacey wrote: > Tobias Roth wrote: >> On 04/24/08 14:27, Sanjeev Kumar.S wrote: >>> Hi, >>> Is there any way to save entire console >>> sessions ? >>> Screen asks me to copy and paste what >>> I want. I don't want to do that I need to save >>> entire sessions. like a start till I do a exit or >>> quit the application. Is there a utility like >>> that ? >> Maybe screen(1) is what you are looking for? It makes typescripts of >> terminal sessions. > > man script [...] Content analysis details: (-4.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] -0.6 AWL AWL: From: address is in the auto white-list X-SA-Exim-Connect-IP: 62.2.233.2 X-SA-Exim-Mail-From: freebsd.lists@fsck.ch X-SA-Exim-Scanned: No (on secure.socket.ch); SAEximRunCond expanded to false Cc: freebsd-hackers@freebsd.org, "Sanjeev Kumar.S" Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 13:33:05 -0000 On 04/24/08 15:28, Julian H. Stacey wrote: > Tobias Roth wrote: >> On 04/24/08 14:27, Sanjeev Kumar.S wrote: >>> Hi, >>> Is there any way to save entire console >>> sessions ? >>> Screen asks me to copy and paste what >>> I want. I don't want to do that I need to save >>> entire sessions. like a start till I do a exit or >>> quit the application. Is there a utility like >>> that ? >> Maybe screen(1) is what you are looking for? It makes typescripts of >> terminal sessions. > > man script yeah, right... that's of course what I meant :-) -- Tobias Roth || http://fsck.ch || PGP: 0xCE599B4D | You're a pushy little bastard, ain't you? | - Cobra Kai Sensei John Kreese From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 14:38:16 2008 Return-Path: Delivered-To: hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442E7106566C for ; Thu, 24 Apr 2008 14:38:16 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1AAE58FC15 for ; Thu, 24 Apr 2008 14:38:16 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 4B6AD2089; Thu, 24 Apr 2008 16:38:14 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Murray Stokely References: <20080422075642.GA72273@freebsdmall.com> Date: Thu, 24 Apr 2008 16:38:13 +0200 In-Reply-To: <20080422075642.GA72273@freebsdmall.com> (Murray Stokely's message of "Tue\, 22 Apr 2008 00\:56\:42 -0700") Message-ID: <86k5inmi7e.fsf@ds4.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: soc-students@FreeBSD.org, hackers@FreeBSD.org Subject: Re: Please welcome our Summer of Code Students X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 14:38:16 -0000 Murray Stokely writes: > * Reference implementation of the SNTP client, > Johannes Maximilian Kuehn, mentored by Harlan Stenn (NTP) Bummer. I've already written one, and Harlan is aware of it. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 15:29:01 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7AFA61065672 for ; Thu, 24 Apr 2008 15:29:01 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-06.arcor-online.net (mail-in-06.arcor-online.net [151.189.21.46]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE538FC20 for ; Thu, 24 Apr 2008 15:29:01 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-18-z2.arcor-online.net (mail-in-18-z2.arcor-online.net [151.189.8.35]) by mail-in-06.arcor-online.net (Postfix) with ESMTP id 86C2531E83F for ; Thu, 24 Apr 2008 16:24:17 +0200 (CEST) Received: from mail-in-12.arcor-online.net (mail-in-12.arcor-online.net [151.189.21.52]) by mail-in-18-z2.arcor-online.net (Postfix) with ESMTP id 76B8E5109BF for ; Thu, 24 Apr 2008 16:24:17 +0200 (CEST) Received: from kemoauc.mips.inka.de (dslb-088-064-177-169.pools.arcor-ip.net [88.64.177.169]) by mail-in-12.arcor-online.net (Postfix) with ESMTP id 48CCF8C47F for ; Thu, 24 Apr 2008 16:24:17 +0200 (CEST) Received: from kemoauc.mips.inka.de (localhost [127.0.0.1]) by kemoauc.mips.inka.de (8.13.8/8.13.8) with ESMTP id m3OEOGWi073039 for ; Thu, 24 Apr 2008 16:24:16 +0200 (CEST) (envelope-from mailnull@kemoauc.mips.inka.de) Received: (from mailnull@localhost) by kemoauc.mips.inka.de (8.13.8/8.13.8/Submit) id m3OEOG1B073038 for freebsd-hackers@freebsd.org; Thu, 24 Apr 2008 16:24:16 +0200 (CEST) (envelope-from mailnull) From: naddy@mips.inka.de (Christian Weisgerber) Date: Thu, 24 Apr 2008 14:24:15 +0000 (UTC) Message-ID: References: <76CA5E0B805944358D85EFAF5B49F824@Tank> <480E1A38.90403@elischer.org> Originator: naddy@mips.inka.de (Christian Weisgerber) To: freebsd-hackers@freebsd.org X-Virus-Scanned: ClamAV 0.92.1/6924/Thu Apr 24 12:04:50 2008 on mail-in-12.arcor-online.net X-Virus-Status: Clean Subject: Re: Introducing me!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 15:29:01 -0000 Julian Elischer wrote: > > My name is Ryan French. I am a Google Summer of Code participant this > year, and for my project I will be implementing MPLS in FreeBSD. FWIW, OpenBSD has just started on this: Import MPLS (Multi Protocol Label Switching) MPLS support partly based on the (abandoned?) AYAME project. > There has been a noted shortage in "kuwus" in freebsd.. for some reason. ^^^^^ Bed choice of word to dimonstrate the Kiwi accint, I thunk. "Kiwi" us pronounced wuth long e, not short i. :-) -- Christian "naddy" Weisgerber naddy@mips.inka.de From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 16:06:44 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8300D106564A; Thu, 24 Apr 2008 16:06:44 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by mx1.freebsd.org (Postfix) with ESMTP id 5EA4E8FC17; Thu, 24 Apr 2008 16:06:43 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp5-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp5-g19.free.fr (Postfix) with ESMTP id 855403F626B; Thu, 24 Apr 2008 18:06:42 +0200 (CEST) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp5-g19.free.fr (Postfix) with ESMTP id 6AF5D3F6257; Thu, 24 Apr 2008 18:06:42 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id D41799BF12; Thu, 24 Apr 2008 16:04:15 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id C52F8405B; Thu, 24 Apr 2008 18:04:15 +0200 (CEST) Date: Thu, 24 Apr 2008 18:04:15 +0200 From: Jeremie Le Hen To: Ruslan Ermilov Message-ID: <20080424160415.GC55613@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.15 (2007-04-06) Cc: freebsd-hackers@FreeBSD.org Subject: Using special CFLAGS for a single file without writing the rule X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 16:06:44 -0000 Hi Ruslan, hi all, I don't know if you followed the thread on -arch@, but the outcome is basically that SSP should be disabled for a couple of files: lib/csu/* gnu/lib/csu/* (reported by antoine@, but I couldn't verify this one) lib/libc/sys/stack_protector.c sys/kern/stack_protector.c Antoine Brodin supplied a patch for the kernel part: +kern/stack_protector.c standard \ + compile-with "${NORMAL_C:N-fstack-protector*}" As for lib/csu/*, this is straightforward, I just have to set WITHOUT_SSP in the Makefile. The hardest one is lib/libc/sys/stack_protector.c. I endeavored to find a way to compile a single file with ${CFLAGS:N-fstack-protector*}, but I found no recipe but writing the whole rule for this file. I would really like to avoid this solution so as to not override bsd.lib.mk settings. Considering your big experience with the build infrastructure, I suspect you would have a solution. Thank you for your help. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 16:18:54 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EABEE106564A for ; Thu, 24 Apr 2008 16:18:54 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by mx1.freebsd.org (Postfix) with ESMTP id C82B18FC13 for ; Thu, 24 Apr 2008 16:18:54 +0000 (UTC) (envelope-from tataz@tataz.chchile.org) Received: from smtp5-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp5-g19.free.fr (Postfix) with ESMTP id DC4973F62A2 for ; Thu, 24 Apr 2008 18:18:53 +0200 (CEST) Received: from tatooine.tataz.chchile.org (tataz.chchile.org [82.233.239.98]) by smtp5-g19.free.fr (Postfix) with ESMTP id D37F63F62A0 for ; Thu, 24 Apr 2008 18:18:53 +0200 (CEST) Received: from obiwan.tataz.chchile.org (unknown [192.168.1.25]) by tatooine.tataz.chchile.org (Postfix) with ESMTP id 72DA19BF12 for ; Thu, 24 Apr 2008 16:16:27 +0000 (UTC) Received: by obiwan.tataz.chchile.org (Postfix, from userid 1000) id 6CDA7405B; Thu, 24 Apr 2008 18:16:27 +0200 (CEST) Date: Thu, 24 Apr 2008 18:16:27 +0200 From: Jeremie Le Hen To: freebsd-hackers@FreeBSD.org Message-ID: <20080424161627.GD55613@obiwan.tataz.chchile.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.15 (2007-04-06) Cc: Subject: MK_SSP used for both libssp and -fstack-protector X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 16:18:55 -0000 Hi all, Another problem I have is that MK_SSP is used for both libssp and -fstack-protector. This could be a problem. I think moving libssp under MK_GNU_SUPPORT would make sense, but this would break backward compatibility WRT RELENG_7. What to do about this? FYI, libssp is not used at all currently since the few symbols required by SSP are provided in libc. The only use I can figure is when you want to link a program without libc while still protecting it with SSP. Thank you for your help. Regards, -- Jeremie Le Hen < jeremie at le-hen dot org >< ttz at chchile dot org > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 18:00:14 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37FB71065678; Thu, 24 Apr 2008 18:00:14 +0000 (UTC) (envelope-from vi0@semihalf.com) Received: from semihalf.com (semihalf.com [206.130.101.55]) by mx1.freebsd.org (Postfix) with ESMTP id 1CCDC8FC20; Thu, 24 Apr 2008 18:00:14 +0000 (UTC) (envelope-from vi0@semihalf.com) Received: from mail.semihalf.com (mail.semihalf.com [83.15.139.206]) by semihalf.com (8.13.1/8.13.1) with ESMTP id m3OHlgGl025193; Thu, 24 Apr 2008 11:47:43 -0600 Message-ID: <4810C7A2.40206@semihalf.com> Date: Thu, 24 Apr 2008 19:47:14 +0200 From: vi0 MIME-Version: 1.0 To: hackers@freebsd.org, ppc@freebsd.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: My GSoC Intro... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: vi0@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 18:00:14 -0000 Hello everybody!!! My name is Przemek Witaszczyk and I am one of those very happy FreeBSD GSoCers of 2008:) I am 25 years old and I come from Polad. Currently I'm working on my PhD in the field of theoretical physics (AdS/CFT correspondence, one nifty thing that came out from the superstrings theory...). MSc also in theory, two years ago at Jagiellonian University, Krakow... My story of open source operating systems began in high school, when I met Linux and was persuaded by the fact that you can never stop configuring them:>. Since then I've checked out several OSes such like Solaris, Tru64 and even Plan9, but no doubt FreeBSD was the one I'd liked the most. So here I am. Partially by an accident I began working with embedded systems developer, Rafal Jaworowski (and his UltraTeam:>), who asked me if I'd liked to take a try in GSoC. So eventually we did it and now with him as my Mentor I'm going to port FreeBSD to Efika - a PPC based system on a chip eval board. What I expect the most is learning as much as possible about the unix kernel and getting to know with as many fbsd developers as possible. And - to succeed, of course.. Greets! Przemek Witaszczyk From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 18:45:30 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C49106566B for ; Thu, 24 Apr 2008 18:45:30 +0000 (UTC) (envelope-from pranavpeshwe@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.30]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFB68FC19 for ; Thu, 24 Apr 2008 18:45:30 +0000 (UTC) (envelope-from pranavpeshwe@gmail.com) Received: by yw-out-2324.google.com with SMTP id 5so301700ywh.13 for ; Thu, 24 Apr 2008 11:45:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=LvYctdNoJy9S4VGJLppwfTBk5Ek2QWZEhX0woP8xYHI=; b=tlXxorQ9nabcnl2MazEbHZ3fcqkByY9jOAEVgRYk4Vajz9u0+OYLysCWQFZw5t98PIh1NteEWj/dis4TDv/4xr84rkyRR838LJVRHYQfV1mbH71WIDodsAy6CtAmC+QSSINOwf60cJ486oOci2NmXM7HiyTJZCZctbyYn9+GzI4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=aSwZMuUSMnqiemVTjda6i0T/C/nYLPXOQQ6xKUvv4hkVRALn0VIB8qf4zq5JpjnqUulzwJR/L7xuUOBvzRFQyESPRWKIrQPTXyNG8znIes5bxTmCyau8P+VQS7+xAUA+oTp6kRS5FYkLy5YeYU9XimM4UX7PTfT0N1VrLm6GqQ0= Received: by 10.142.125.5 with SMTP id x5mr598953wfc.40.1209061107909; Thu, 24 Apr 2008 11:18:27 -0700 (PDT) Received: by 10.143.35.21 with HTTP; Thu, 24 Apr 2008 11:18:27 -0700 (PDT) Message-ID: Date: Thu, 24 Apr 2008 23:48:27 +0530 From: "Pranav Peshwe" To: "Sanjeev Kumar.S" In-Reply-To: <991663.36827.qm@web57705.mail.re3.yahoo.com> MIME-Version: 1.0 References: <200804231957.49035.hselasky@c2i.net> <991663.36827.qm@web57705.mail.re3.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: Saving entire console sessions X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 18:45:30 -0000 On Thu, Apr 24, 2008 at 5:57 PM, Sanjeev Kumar.S wrote: > Hi, > Is there any way to save entire console > sessions ? > Screen asks me to copy and paste what > I want. I don't want to do that I need to save > entire sessions. like a start till I do a exit or > quit the application. Is there a utility like > that ? > Did you try enabling logging for a screen window ? `screen -L` may be of help. Best regards, Pranav -------------------------------------------------------------------------- Blessed are the pessimists, for they take backups!! From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 21:35:28 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A71D6106566B; Thu, 24 Apr 2008 21:35:28 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from hosted.kievnet.com (hosted.kievnet.com [193.138.144.10]) by mx1.freebsd.org (Postfix) with ESMTP id 705638FC16; Thu, 24 Apr 2008 21:35:28 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost ([127.0.0.1] helo=edge.pp.kiev.ua) by hosted.kievnet.com with esmtpa (Exim 4.62) (envelope-from ) id 1Jp96F-0002mQ-3F; Fri, 25 Apr 2008 00:35:27 +0300 Message-ID: <4810FD1E.70602@icyb.net.ua> Date: Fri, 25 Apr 2008 00:35:26 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080320) MIME-Version: 1.0 To: John Baldwin References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> In-Reply-To: <200804240811.26183.jhb@freebsd.org> Content-Type: multipart/mixed; boundary="------------020809000909070204020502" Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 21:35:28 -0000 This is a multi-part message in MIME format. --------------020809000909070204020502 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit I decided to do it in devfs_devs.c because there are less entry points there and the code is much simpler (you know: aliases, clones). I also had to add !cold condition, because apparently we have devices created so early in the boot, that devctl is not ready to handle a notification. My system hanged after only getting to the following line in verbose boot: ULE: setup cpu 0 However it is possible that it did something wrong - at that time I had devctl calls in kern_conf. I guess this also should be OK from the user perspective because they would be interested in device events after a system is booted and devd is running. Here is a log of devd started with -dD flags in single-user mode, then I attached and later detached an external hdd: http://www.icyb.net.ua/~avg/devd.log.gz Search for DEVFS for interesting lines. -- Andriy Gapon --------------020809000909070204020502 Content-Type: text/plain; name="devfs.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="devfs.patch" ZGlmZiAtLWdpdCBhL3N5cy9mcy9kZXZmcy9kZXZmc19kZXZzLmMgYi9zeXMvZnMvZGV2ZnMv ZGV2ZnNfZGV2cy5jCmluZGV4IGNhNWMyZGUuLjM1NTY3OTkgMTAwNjQ0Ci0tLSBhL3N5cy9m cy9kZXZmcy9kZXZmc19kZXZzLmMKKysrIGIvc3lzL2ZzL2RldmZzL2RldmZzX2RldnMuYwpA QCAtMzMsNiArMzMsNyBAQAogI2luY2x1ZGUgPHN5cy9wYXJhbS5oPgogI2luY2x1ZGUgPHN5 cy9zeXN0bS5oPgogI2luY2x1ZGUgPHN5cy9jb25mLmg+CisjaW5jbHVkZSA8c3lzL2J1cy5o PgogI2luY2x1ZGUgPHN5cy9kaXJlbnQuaD4KICNpbmNsdWRlIDxzeXMva2VybmVsLmg+CiAj aW5jbHVkZSA8c3lzL2xpbWl0cy5oPgpAQCAtNTE4LDYgKzUxOSw5IEBAIGRldmZzX2NyZWF0 ZShzdHJ1Y3QgY2RldiAqZGV2KQogCWRldl9yZWZsKGRldik7CiAJVEFJTFFfSU5TRVJUX1RB SUwoJmNkZXZwX2xpc3QsIGNkcCwgY2RwX2xpc3QpOwogCWRldmZzX2dlbmVyYXRpb24rKzsK KworCWlmICghY29sZCkKKwkJZGV2Y3RsX25vdGlmeSgiREVWRlMiLCBkZXYtPnNpX25hbWUs ICJBVFRBQ0giLCBOVUxMKTsKIH0KIAogdm9pZApAQCAtNTI5LDYgKzUzMyw5IEBAIGRldmZz X2Rlc3Ryb3koc3RydWN0IGNkZXYgKmRldikKIAljZHAgPSBkZXYtPnNpX3ByaXY7CiAJY2Rw LT5jZHBfZmxhZ3MgJj0gfkNEUF9BQ1RJVkU7CiAJZGV2ZnNfZ2VuZXJhdGlvbisrOworCisJ aWYgKCFjb2xkKQorCQlkZXZjdGxfbm90aWZ5KCJERVZGUyIsIGRldi0+c2lfbmFtZSwgIkRF VEFDSCIsIE5VTEwpOwogfQogCiBzdGF0aWMgdm9pZAo= --------------020809000909070204020502-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 21:58:22 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5EDD106564A for ; Thu, 24 Apr 2008 21:58:22 +0000 (UTC) (envelope-from Amidamaru@mxiesoft.com) Received: from mo-p07-ob.rzone.de (mo-p07-ob.rzone.de [81.169.146.189]) by mx1.freebsd.org (Postfix) with ESMTP id 1EA918FC24 for ; Thu, 24 Apr 2008 21:58:21 +0000 (UTC) (envelope-from Amidamaru@mxiesoft.com) X-RZG-CLASS-ID: mo07 X-RZG-AUTH: owCvphjUpEA5UgvdvjAxUyYDOWktSB6LxqUO1ffi/ulT8pt1UJksc/NJAk3hHUGmAiGeXHZuT1bo Received: from localhost (p3EE0CF35.dip.t-dialin.net [62.224.207.53]) by post.webmailer.de (klopstock mo45) (RZmta 16.27) with ESMTP id 606c9bk3OJT7KB for ; Thu, 24 Apr 2008 23:47:04 +0200 (MEST) (envelope-from: ) Date: Fri, 25 Apr 2008 06:47:08 +0900 From: Johannes Maximilian =?utf-8?Q?K=FChn?= To: freebsd-hackers@freebsd.org Message-ID: <20080424214708.GA23401@mxiesoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.3i Subject: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 21:58:22 -0000 Hello everyone, I'm one of the GSoC students. My name is Johannes Maximilian Kuehn and my project is the reference implementation of the SNTP protocol. I was exposed to FreeBSD about 6 years ago and I'm using it since then as my primary operating system. Similar to Anders I started with Linux and then got introduced to FreeBSD by a good friend. After that I found my favorite operating system and wanted to get involved with it, too. I think GSoC is a great opportunity to do that! :) I'm a first year student studying computer science and Japanese Studies at the "Eberhard Karls Universität Tübingen" (Eberhard Karls university in Tuebingen, Germany). I'm happy to be aboard! Max From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 21:18:48 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F18FD1065672 for ; Thu, 24 Apr 2008 21:18:48 +0000 (UTC) (envelope-from Amidamaru@mxiesoft.com) Received: from mo-p07-ob.rzone.de (mo-p07-ob.rzone.de [81.169.146.188]) by mx1.freebsd.org (Postfix) with ESMTP id 5B8458FC15 for ; Thu, 24 Apr 2008 21:18:48 +0000 (UTC) (envelope-from Amidamaru@mxiesoft.com) X-RZG-CLASS-ID: mo07 X-RZG-AUTH: owCvphjUpEA5UgvdvjAxUyYDOWktSB6LxqUO1ffi/ulT8pt1UJksc/NJAk3hHUGmAiGeXHZuT1bo Received: from localhost (p3EE0CF35.dip.t-dialin.net [62.224.207.53]) by post.webmailer.de (klopstock mo30) (RZmta 16.27) with ESMTP id n06791k3OJaWTE for ; Thu, 24 Apr 2008 23:06:48 +0200 (MEST) (envelope-from: ) Date: Fri, 25 Apr 2008 06:06:52 +0900 From: Johannes Maximilian K To: hackers@freebsd.org Message-ID: <20080424210652.GB11034@mxiesoft.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.3i X-Mailman-Approved-At: Thu, 24 Apr 2008 23:21:04 +0000 Cc: Subject: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 21:18:49 -0000 Hello everyone! I'm one of the GSoC students. My name is Johannes Maximilian Kuehn and my project is the reference implementation of the SNTP protocol. I was exposed to FreeBSD about 6 years ago and I'm using it since then as my primary operating system. Similar to Anders I started with Linux and then got introduced to FreeBSD by a good friend. After that I found my favorite operating system and wanted to get involved with it, too. I think GSoC is a great opportunity to do that! :) I'm a first year student studying computer science and Japanese Studies at the "Eberhard Karls Universität Tübingen" (Eberhard Karls university in Tuebingen, Germany). I'm happy to be aboard! Max From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 23:45:25 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDA60106564A for ; Thu, 24 Apr 2008 23:45:25 +0000 (UTC) (envelope-from miwi@bsdcrew.de) Received: from bsdcrew.de (duro.unixfreunde.de [85.214.90.4]) by mx1.freebsd.org (Postfix) with ESMTP id C4B878FC17 for ; Thu, 24 Apr 2008 23:45:25 +0000 (UTC) (envelope-from miwi@bsdcrew.de) Received: by bsdcrew.de (Postfix, from userid 1001) id 308454AC8D; Fri, 25 Apr 2008 01:26:46 +0200 (CEST) Date: Fri, 25 Apr 2008 01:26:46 +0200 From: Martin Wilke To: Johannes Maximilian K Message-ID: <20080424232646.GA33122@bsdcrew.de> References: <20080424214708.GA23401@mxiesoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080424214708.GA23401@mxiesoft.com> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-hackers@freebsd.org Subject: Re: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 23:45:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Fri, Apr 25, 2008 at 06:47:08AM +0900, Johannes Maximilian K wrote: > Hello everyone, > > I'm one of the GSoC students. My name is Johannes Maximilian Kuehn and > my project is the reference implementation of the SNTP protocol. > > I was exposed to FreeBSD about 6 years ago and I'm using it since > then as my primary operating system. Similar to Anders I started with > Linux and then got introduced to FreeBSD by a good friend. After that I > found my favorite operating system and wanted to get involved with it, > too. I think GSoC is a great opportunity to do that! :) > > I'm a first year student studying computer science and Japanese Studies > at the "Eberhard Karls Universität Tübingen" (Eberhard Karls university > in Tuebingen, Germany). > > I'm happy to be aboard! Welcome and Good Luck! > > > Max > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > - -- +-----------------------+-------------------------------+ | PGP : 0x05682353 | Jabber : miwi(at)BSDCrew.de | | ICQ : 169139903 | Mail : miwi(at)FreeBSD.org | +-----------------------+-------------------------------+ | Mess with the Best, Die like the Rest! | +-----------------------+-------------------------------+ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFIERc1FwpycAVoI1MRAgqXAKCOwX3ZtKOJBoanOHUDVUGwOLJ+qgCgikuw uLcEt8acYvKCQUpJQ3kMyiQ= =Vgbt -----END PGP SIGNATURE----- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 00:15:13 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9A81065670 for ; Fri, 25 Apr 2008 00:15:13 +0000 (UTC) (envelope-from dforsythe@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id E04D38FC13 for ; Fri, 25 Apr 2008 00:15:12 +0000 (UTC) (envelope-from dforsythe@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so957667anc.13 for ; Thu, 24 Apr 2008 17:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:from; bh=LWR2yFqNYmWTWjHBLwf7LwH6HhoNuw1JeJnvkjwD5K8=; b=v2B1Qb9nn4JC3JcKOty6uXEXxTorzlGRpq0TPJHWM/EKowDhTzUr6Yg5jsm9XdrNf7IlD+YKZ1Yc+ci1G7fwM8mbLJRVMQ5EBtXoNYj0707hs3u0iPYmdhlHqXmjgC3dnNfGf6X+pUr2VBApWl/q2f3y4LGVyfleN96Cl1WZcm8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:to:subject:message-id:mime-version:content-type:content-disposition:user-agent:from; b=Gf/+geYBEJDStleMZnI8zTMHjimSsooKKffj4CgN7GZhTAwipoY1FGnpvqFSXV5JsmJ9Nfq5QuVx+9mFmw2oxkVWW/aGpF+PkA6F8R5J8XuSVTTanPMjd9lw/fwiYb0/qJEGqy2r0rm7z81GEaRiq9vRvhs6QYlEGdNl14lrhnQ= Received: by 10.100.206.11 with SMTP id d11mr6473755ang.29.1209080784079; Thu, 24 Apr 2008 16:46:24 -0700 (PDT) Received: from rat.umd.edu ( [129.2.175.85]) by mx.google.com with ESMTPS id i16sm1638532wxd.30.2008.04.24.16.46.23 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Apr 2008 16:46:23 -0700 (PDT) Date: Thu, 24 Apr 2008 19:46:02 -0400 To: freebsd-hackers@freebsd.org Message-ID: <20080424234600.GA40079@rat.umd.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) From: David Forsythe Subject: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 00:15:13 -0000 Hello everybody, My name is David Forsythe and I'll be working on allowing parallel builds in the ports collection for Summer of Code this year. I'm a second year student at the University of Maryland, College Park studying computer science. I'm extremely excited to work on this project over the summer and I hope my work is beneficial to the FreeBSD community. I was already planning on devoting a bunch of my free time this summer to working on this type of thing, so an @freebsd.org alias, a t-shirt, and a bit of cash are just icing on the cake (no seriously, getting a FreeBSD mail alias excited me so much I'm a little bit embarrassed...) I hope that my project turns out well and I can continue to work with the FreeBSD development community far into the future. Working with you guys is really a dream come true! Dave From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 09:20:51 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84BC01065677; Fri, 25 Apr 2008 09:20:51 +0000 (UTC) (envelope-from stas@ht-systems.ru) Received: from smtp.ht-systems.ru (mr0.ht-systems.ru [78.110.50.55]) by mx1.freebsd.org (Postfix) with ESMTP id 2B8DE8FC2A; Fri, 25 Apr 2008 09:20:51 +0000 (UTC) (envelope-from stas@ht-systems.ru) Received: from [78.110.49.49] (helo=quasar.ht-systems.ru) by smtp.ht-systems.ru with esmtpa (Exim 4.62) (envelope-from ) id 1JpJki-0005rQ-8h; Fri, 25 Apr 2008 12:57:56 +0400 Received: by quasar.ht-systems.ru (Postfix, from userid 1024) id 18961CD8E; Fri, 25 Apr 2008 12:57:55 +0400 (MSD) Date: Fri, 25 Apr 2008 12:57:54 +0400 From: Stanislav Sedov To: vi0@freebsd.org Message-Id: <20080425125754.16ef8c45.stas@FreeBSD.org> In-Reply-To: <4810C7A2.40206@semihalf.com> References: <4810C7A2.40206@semihalf.com> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org, vi0 , ppc@freebsd.org Subject: Re: My GSoC Intro... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 09:20:51 -0000 On Thu, 24 Apr 2008 19:47:14 +0200 vi0 mentioned: > Hello everybody!!! > > My name is Przemek Witaszczyk and I am one of those very happy > FreeBSD GSoCers of 2008:) > > I am 25 years old and I come from Polad. Currently I'm working on > my PhD in the field of theoretical physics (AdS/CFT correspondence, > one nifty thing that came out from the superstrings theory...). MSc also > in theory, two years ago at Jagiellonian University, Krakow... > > My story of open source operating systems began in high school, > when I met Linux and was persuaded by the fact that you can never stop > configuring them:>. Since then I've checked out several OSes such like > Solaris, Tru64 and even Plan9, but no doubt FreeBSD was the one > I'd liked the most. > > So here I am. Partially by an accident I began working with embedded > systems developer, Rafal Jaworowski (and his UltraTeam:>), who > asked me if I'd liked to take a try in GSoC. So eventually we did it > and now with him as my Mentor I'm going to port FreeBSD to Efika - > a PPC based system on a chip eval board. What I expect the most > is learning as much as possible about the unix kernel and > getting to know with as many fbsd developers as possible. > And - to succeed, of course.. > Congrats! And good luck in your work! -- Stanislav Sedov ST4096-RIPE From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 09:50:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD2AF1065670; Fri, 25 Apr 2008 09:50:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2A8F08FC1C; Fri, 25 Apr 2008 09:50:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay01.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JpKZa-0004Cr-3y; Fri, 25 Apr 2008 12:50:32 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3P9oFFF013160 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Apr 2008 12:50:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3P9oADv010851; Fri, 25 Apr 2008 12:50:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3P9o92T010850; Fri, 25 Apr 2008 12:50:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Apr 2008 12:50:09 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20080425095009.GD18958@deviant.kiev.zoral.com.ua> References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Xc2zRdLclVh020+J" Content-Disposition: inline In-Reply-To: <4810FD1E.70602@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 717fb1dce93df3d9117221529acf11a8 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2719 [Apr 24 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Method: none X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0278], KAS30/Release Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 09:50:35 -0000 --Xc2zRdLclVh020+J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2008 at 12:35:26AM +0300, Andriy Gapon wrote: >=20 > I decided to do it in devfs_devs.c because there are less entry points > there and the code is much simpler (you know: aliases, clones). > I also had to add !cold condition, because apparently we have devices > created so early in the boot, that devctl is not ready to handle a > notification. My system hanged after only getting to the following line > in verbose boot: > ULE: setup cpu 0 > However it is possible that it did something wrong - at that time I had > devctl calls in kern_conf. >=20 > I guess this also should be OK from the user perspective because they > would be interested in device events after a system is booted and devd > is running. >=20 > Here is a log of devd started with -dD flags in single-user mode, then I > attached and later detached an external hdd: > http://www.icyb.net.ua/~avg/devd.log.gz > Search for DEVFS for interesting lines. >=20 > --=20 > Andriy Gapon > diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c > index ca5c2de..3556799 100644 > --- a/sys/fs/devfs/devfs_devs.c > +++ b/sys/fs/devfs/devfs_devs.c > @@ -33,6 +33,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -518,6 +519,9 @@ devfs_create(struct cdev *dev) > dev_refl(dev); > TAILQ_INSERT_TAIL(&cdevp_list, cdp, cdp_list); > devfs_generation++; > + > + if (!cold) > + devctl_notify("DEVFS", dev->si_name, "ATTACH", NULL); > } > =20 > void > @@ -529,6 +533,9 @@ devfs_destroy(struct cdev *dev) > cdp =3D dev->si_priv; > cdp->cdp_flags &=3D ~CDP_ACTIVE; > devfs_generation++; > + > + if (!cold) > + devctl_notify("DEVFS", dev->si_name, "DETACH", NULL); > } > =20 > static void Did you run this with WITNESS ? You put the whole devctl_notify() call under the dev_mtx. This includes the malloc(), PROC_LOCK() and signalling, and some internal devctl_queue() stuff. This is wrong. --Xc2zRdLclVh020+J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgRqVEACgkQC3+MBN1Mb4hTrgCeLqWrGFHU2nVieITScAHlZL6x f5UAoJ8tOstn8GmRE2XbmmUDv0yeO3lf =9Tr4 -----END PGP SIGNATURE----- --Xc2zRdLclVh020+J-- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 10:09:23 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF1D6106566B for ; Fri, 25 Apr 2008 10:09:23 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from mout2.freenet.de (mout2.freenet.de [IPv6:2001:748:100:40::2:4]) by mx1.freebsd.org (Postfix) with ESMTP id 752E88FC2C for ; Fri, 25 Apr 2008 10:09:23 +0000 (UTC) (envelope-from gary.jennejohn@freenet.de) Received: from [195.4.92.22] (helo=12.mx.freenet.de) by mout2.freenet.de with esmtpa (Exim 4.69) (envelope-from ) id 1JpKrn-0004VB-BE; Fri, 25 Apr 2008 12:09:19 +0200 Received: from r8519.r.pppool.de ([89.54.133.25]:39695 helo=peedub.jennejohn.org) by 12.mx.freenet.de with esmtpa (ID gary.jennejohn@freenet.de) (port 25) (Exim 4.69 #12) id 1JpKrn-000728-1J; Fri, 25 Apr 2008 12:09:19 +0200 Date: Fri, 25 Apr 2008 12:09:18 +0200 From: Gary Jennejohn To: David Forsythe Message-ID: <20080425120918.0bfba02a@peedub.jennejohn.org> In-Reply-To: <20080424234600.GA40079@rat.umd.edu> References: <20080424234600.GA40079@rat.umd.edu> X-Mailer: Claws Mail 3.4.0 (GTK+ 2.10.14; amd64-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gary.jennejohn@freenet.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 10:09:24 -0000 On Thu, 24 Apr 2008 19:46:02 -0400 David Forsythe wrote: > My name is David Forsythe and I'll be working on allowing parallel builds in the > ports collection for Summer of Code this year. > This would definitely be of benefit! Good luck. --- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 06:41:46 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B116106566B for ; Fri, 25 Apr 2008 06:41:46 +0000 (UTC) (envelope-from wb@freebie.xs4all.nl) Received: from smtp-vbr13.xs4all.nl (smtp-vbr13.xs4all.nl [194.109.24.33]) by mx1.freebsd.org (Postfix) with ESMTP id CD2B88FC15 for ; Fri, 25 Apr 2008 06:41:45 +0000 (UTC) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (freebie.xs4all.nl [82.95.250.254]) by smtp-vbr13.xs4all.nl (8.13.8/8.13.8) with ESMTP id m3P6QNm4023552; Fri, 25 Apr 2008 08:26:23 +0200 (CEST) (envelope-from wb@freebie.xs4all.nl) Received: from freebie.xs4all.nl (localhost [127.0.0.1]) by freebie.xs4all.nl (8.14.2/8.13.3) with ESMTP id m3P6QNc6003279; Fri, 25 Apr 2008 08:26:23 +0200 (CEST) (envelope-from wb@freebie.xs4all.nl) Received: (from wb@localhost) by freebie.xs4all.nl (8.14.2/8.14.2/Submit) id m3P6QNTw003278; Fri, 25 Apr 2008 08:26:23 +0200 (CEST) (envelope-from wb) Date: Fri, 25 Apr 2008 08:26:22 +0200 From: Wilko Bulte To: David Forsythe Message-ID: <20080425062622.GA3258@freebie.xs4all.nl> References: <20080424234600.GA40079@rat.umd.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080424234600.GA40079@rat.umd.edu> User-Agent: Mutt/1.5.11 X-Virus-Scanned: by XS4ALL Virus Scanner X-Mailman-Approved-At: Fri, 25 Apr 2008 11:21:35 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Introduction X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 06:41:46 -0000 Quoting David Forsythe, who wrote on Thu, Apr 24, 2008 at 07:46:02PM -0400 .. > Hello everybody, > > My name is David Forsythe and I'll be working on allowing parallel builds in the > ports collection for Summer of Code this year. I'm a second year student at the > University of Maryland, College Park studying computer science. > > I'm extremely excited to work on this project over the summer and I hope my work > is beneficial to the FreeBSD community. I was already planning on devoting a > bunch of my free time this summer to working on this type of thing, so an > @freebsd.org alias, a t-shirt, and a bit of cash are just icing on the cake (no > seriously, getting a FreeBSD mail alias excited me so much I'm a little bit > embarrassed...) Heh.. you will get used to that ;-) -- Wilko Bulte wilko@FreeBSD.org From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 12:26:13 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 618A91065672 for ; Fri, 25 Apr 2008 12:26:13 +0000 (UTC) (envelope-from neko@genesi-usa.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id D63728FC34 for ; Fri, 25 Apr 2008 12:26:12 +0000 (UTC) (envelope-from neko@genesi-usa.com) Received: by nf-out-0910.google.com with SMTP id b2so1875628nfb.33 for ; Fri, 25 Apr 2008 05:26:11 -0700 (PDT) Received: by 10.210.26.10 with SMTP id 10mr2263638ebz.63.1209124725565; Fri, 25 Apr 2008 04:58:45 -0700 (PDT) Received: from ?192.168.1.102? ( [82.37.194.116]) by mx.google.com with ESMTPS id i7sm15507273nfh.14.2008.04.25.04.58.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 25 Apr 2008 04:58:44 -0700 (PDT) Message-ID: <4811C774.9000407@genesi-usa.com> Date: Fri, 25 Apr 2008 12:58:44 +0100 From: Matt Sealey User-Agent: Thunderbird 2.0.0.15pre (Windows/20080424) MIME-Version: 1.0 To: vi0@freebsd.org References: <4810C7A2.40206@semihalf.com> In-Reply-To: <4810C7A2.40206@semihalf.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: Matt Sealey X-Mailman-Approved-At: Fri, 25 Apr 2008 12:31:17 +0000 Cc: hackers@freebsd.org, ppc@freebsd.org Subject: Re: My GSoC Intro... X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 12:26:13 -0000 Hi Przemek, If you need any help at all, feel free to bug me :) We're very excited about the FreeBSD port to Efika. -- Matt Sealey Genesi, Manager, Developer Relations vi0 wrote: > Hello everybody!!! > > My name is Przemek Witaszczyk and I am one of those very happy > FreeBSD GSoCers of 2008:) > > I am 25 years old and I come from Polad. Currently I'm working on > my PhD in the field of theoretical physics (AdS/CFT correspondence, > one nifty thing that came out from the superstrings theory...). MSc also > in theory, two years ago at Jagiellonian University, Krakow... > > My story of open source operating systems began in high school, > when I met Linux and was persuaded by the fact that you can never stop > configuring them:>. Since then I've checked out several OSes such like > Solaris, Tru64 and even Plan9, but no doubt FreeBSD was the one > I'd liked the most. > > So here I am. Partially by an accident I began working with embedded > systems developer, Rafal Jaworowski (and his UltraTeam:>), who > asked me if I'd liked to take a try in GSoC. So eventually we did it > and now with him as my Mentor I'm going to port FreeBSD to Efika - > a PPC based system on a chip eval board. What I expect the most > is learning as much as possible about the unix kernel and > getting to know with as many fbsd developers as possible. > And - to succeed, of course.. > > Greets! > > Przemek Witaszczyk > > _______________________________________________ > freebsd-ppc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ppc > To unsubscribe, send any mail to "freebsd-ppc-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 14:12:15 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 463FA106567D; Fri, 25 Apr 2008 14:12:15 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id CE2518FC12; Fri, 25 Apr 2008 14:12:14 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id B4C36744021; Fri, 25 Apr 2008 17:12:13 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oTcVZOEbLMdm; Fri, 25 Apr 2008 17:12:13 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 3E48474400C; Fri, 25 Apr 2008 17:12:13 +0300 (EEST) Message-ID: <4811E6BC.4060306@icyb.net.ua> Date: Fri, 25 Apr 2008 17:12:12 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: Kostik Belousov References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> <20080425095009.GD18958@deviant.kiev.zoral.com.ua> In-Reply-To: <20080425095009.GD18958@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 14:12:15 -0000 on 25/04/2008 12:50 Kostik Belousov said the following: > Did you run this with WITNESS ? > > You put the whole devctl_notify() call under the dev_mtx. This includes > the malloc(), PROC_LOCK() and signalling, and some internal devctl_queue() > stuff. This is wrong. Kostik, I tried this patch only with my working (non-debug) configuration. I will try with WITNESS. You think that acquiring all those locks while holding dev_mtx is bad? I can try to place devctl_notify calls in make_dev_credv, make_dev_alias and destroy_dev. The problem that I see is that destroy_devl ('l' at the end) calls itself recursively for child devices, this is all done under dev_mtx. So I am not sure how to call devctl_notify for those child devices properly. -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 14:37:00 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B091065677; Fri, 25 Apr 2008 14:37:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 9C6638FC15; Fri, 25 Apr 2008 14:36:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.226] (helo=skuns.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1JpP2n-000IUa-Ti; Fri, 25 Apr 2008 17:36:58 +0300 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by skuns.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3PEaqws023265 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Apr 2008 17:36:53 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m3PEalua078532; Fri, 25 Apr 2008 17:36:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m3PEakEE078531; Fri, 25 Apr 2008 17:36:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 25 Apr 2008 17:36:46 +0300 From: Kostik Belousov To: Andriy Gapon Message-ID: <20080425143646.GF18958@deviant.kiev.zoral.com.ua> References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> <20080425095009.GD18958@deviant.kiev.zoral.com.ua> <4811E6BC.4060306@icyb.net.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yc07lwn3HUDqPfE2" Content-Disposition: inline In-Reply-To: <4811E6BC.4060306@icyb.net.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.91.2, clamav-milter version 0.91.2 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on skuns.kiev.zoral.com.ua X-Scanner-Signature: 1118cf21f7425d415ed61e91afc5cb63 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 2723 [Apr 25 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 14:37:00 -0000 --Yc07lwn3HUDqPfE2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 25, 2008 at 05:12:12PM +0300, Andriy Gapon wrote: > on 25/04/2008 12:50 Kostik Belousov said the following: > >Did you run this with WITNESS ? > > > >You put the whole devctl_notify() call under the dev_mtx. This includes > >the malloc(), PROC_LOCK() and signalling, and some internal devctl_queue= () > >stuff. This is wrong. >=20 > Kostik, >=20 > I tried this patch only with my working (non-debug) configuration. > I will try with WITNESS. > You think that acquiring all those locks while holding dev_mtx is bad? > I can try to place devctl_notify calls in make_dev_credv, make_dev_alias= =20 > and destroy_dev. The problem that I see is that destroy_devl ('l' at the= =20 > end) calls itself recursively for child devices, this is all done under= =20 > dev_mtx. So I am not sure how to call devctl_notify for those child=20 > devices properly. The malloc and free cannot be called while holding dev_mtx, this causes the LORs. Please, look at the rev. 1.207, 1.210 of the kern/kern_conf.c for the workarounds for the malloc issues. It seems that you may abuse the dev_unlock_and_free() to make the notifications. Also, I think it is wrong to establish the lock ordering relations between the process subsystem and cdev. --Yc07lwn3HUDqPfE2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEARECAAYFAkgR7H0ACgkQC3+MBN1Mb4jLJACg5zBTTG2ns1TaqjSQM7QhXRcI OUEAnjzCEmI2MlE2YOTyhJSYgUIhUD60 =HMoF -----END PGP SIGNATURE----- --Yc07lwn3HUDqPfE2-- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 14:43:16 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB4241065674; Fri, 25 Apr 2008 14:43:16 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from falcon.cybervisiontech.com (falcon.cybervisiontech.com [217.20.163.9]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3968FC22; Fri, 25 Apr 2008 14:43:16 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from localhost (localhost [127.0.0.1]) by falcon.cybervisiontech.com (Postfix) with ESMTP id 114BF74401A; Fri, 25 Apr 2008 17:43:15 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at falcon.cybervisiontech.com Received: from falcon.cybervisiontech.com ([127.0.0.1]) by localhost (falcon.cybervisiontech.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QLoApSOOKk+Y; Fri, 25 Apr 2008 17:43:14 +0300 (EEST) Received: from [10.2.1.87] (gateway.cybervisiontech.com.ua [88.81.251.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by falcon.cybervisiontech.com (Postfix) with ESMTP id 8D6EB74400C; Fri, 25 Apr 2008 17:43:14 +0300 (EEST) Message-ID: <4811EE01.7050207@icyb.net.ua> Date: Fri, 25 Apr 2008 17:43:13 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.12 (X11/20080311) MIME-Version: 1.0 To: Kostik Belousov References: <480E4269.2090604@icyb.net.ua> <480FBAB9.1000904@icyb.net.ua> <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> <20080425095009.GD18958@deviant.kiev.zoral.com.ua> <4811E6BC.4060306@icyb.net.ua> <20080425143646.GF18958@deviant.kiev.zoral.com.ua> In-Reply-To: <20080425143646.GF18958@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 14:43:16 -0000 on 25/04/2008 17:36 Kostik Belousov said the following: > The malloc and free cannot be called while holding dev_mtx, this causes > the LORs. Please, look at the rev. 1.207, 1.210 of the kern/kern_conf.c > for the workarounds for the malloc issues. It seems that you may abuse the > dev_unlock_and_free() to make the notifications. > > Also, I think it is wrong to establish the lock ordering relations > between the process subsystem and cdev. Thank you for hand-guiding me! This seems to be a bit more complex than I originally thought, so I guess I'll have to get back to this after vacation (I want to stay as far from computers as possible during it). -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 14:35:15 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D625810656B4 for ; Fri, 25 Apr 2008 14:35:15 +0000 (UTC) (envelope-from adamw@signallake.com) Received: from pro38.abac.com (pro38.abac.com [66.226.64.39]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA3F8FC20 for ; Fri, 25 Apr 2008 14:35:15 +0000 (UTC) (envelope-from adamw@signallake.com) Received: from [192.168.1.200] (c-24-218-111-132.hsd1.ma.comcast.net [24.218.111.132]) (authenticated bits=0) by pro38.abac.com (8.14.1/8.14.1) with ESMTP id m3PDxuRl013957 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Fri, 25 Apr 2008 06:59:57 -0700 (PDT) (envelope-from adamw@signallake.com) Message-Id: From: Adam To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v919.2) Date: Fri, 25 Apr 2008 09:59:55 -0400 X-Mailer: Apple Mail (2.919.2) X-Spam-Score: 0.101 (HTML_MESSAGE) X-Mailman-Approved-At: Fri, 25 Apr 2008 14:52:51 +0000 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: CopyOut Size Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 14:35:16 -0000 Hi, I am writing a custom system call that needs to transfer 16kb of data from the kernel to userspace. I am transferring the data out of the kernel by using copyout. This seems to work for a small struct of data < 4k. int my_system_call(struct thread *td, struct my_system_call_args *uap) { my_structtype_t my_type; copyout(&my_type,uap->my_type,sizeof(my_type) ))!=0) { printf("\n copyout failed ret%d\n",error); return error; } printf("exiting kernel %d\n",error); return (0); } However once I expand my struct size beyond around 4k that I get a "Fatal Double Fault." It seems like I am overrunning the kernel stack. Does copyout use memory from the kernel stack? What is the limit for copyout? Is there some way to allocate additional space? Alternatively what is the appropriate method for transferring kbs of data from kernel to userspace? Thanks, Adam From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 15:36:59 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8C171065675 for ; Fri, 25 Apr 2008 15:36:59 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from www.pkgsrc-box.org (www.ostsee-abc.de [62.206.222.50]) by mx1.freebsd.org (Postfix) with ESMTP id 6E84E8FC1A for ; Fri, 25 Apr 2008 15:36:59 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from britannica.bec.de (www.pkgsrc-box.org [127.0.0.1]) by www.pkgsrc-box.org (Postfix) with ESMTP id 96A60E506A7 for ; Fri, 25 Apr 2008 15:36:55 +0000 (UTC) Received: by britannica.bec.de (Postfix, from userid 1000) id 5443416FC4; Fri, 25 Apr 2008 17:35:12 +0200 (CEST) Date: Fri, 25 Apr 2008 17:35:12 +0200 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20080425153511.GB11467@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Subject: Re: CopyOut Size Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 15:36:59 -0000 On Fri, Apr 25, 2008 at 09:59:55AM -0400, Adam wrote: > Hi, I am writing a custom system call that needs to transfer 16kb of data > from the kernel to userspace. I am transferring the data out of the kernel > by using copyout. This seems to work for a small struct of data < 4k. You are not allowed to use more than a bit of stack space. You are placing a of data on the stack and the kernel stack is typically only a few pages long. Use malloc for this. Joerg From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 25 21:00:13 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D291065676 for ; Fri, 25 Apr 2008 21:00:13 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.28]) by mx1.freebsd.org (Postfix) with ESMTP id 850ED8FC0A for ; Fri, 25 Apr 2008 21:00:13 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by yw-out-2324.google.com with SMTP id 5so515213ywh.13 for ; Fri, 25 Apr 2008 14:00:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=yyWw9ogP6hx8OIRvwKTSc+gSM5quwRlO3h1YuKdewsc=; b=TU5LDpqzBTDwfcZcWvsnGX28Kkn4NSH/+7COU/VIhsCZ6hTRT3zaLIt2mZZ31qAjxGAQ7yGFYaiOtUi/hXSce9ZYNqqrJ9xHB3ffazm/Vu2uWL5DD1uy/jMFSOE8zGsW1WXGBR/JIcCahxqD0YG98yOzEtq/O6ZnGINFPu4PbHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=eTij3wNghwV+hYxDyh27d+gVfXJRd40QYSrN28UGduTcmmCxURiV3CDVdBpmHxdsr9Ke9Q5WWTVgpTcph4hr+cQ92vIHV89A32F7Y1rS5EXdNAKDR1z6iC830ARWW5Sy7YdzffkvdwwNfVgfEh14Tkk2A8czSED8IUUIV3KNETA= Received: by 10.150.86.10 with SMTP id j10mr1177801ybb.202.1209157210658; Fri, 25 Apr 2008 14:00:10 -0700 (PDT) Received: by 10.151.11.1 with HTTP; Fri, 25 Apr 2008 14:00:10 -0700 (PDT) Message-ID: <3c0b01820804251400r68335fd2geaf9889b939f8379@mail.gmail.com> Date: Fri, 25 Apr 2008 17:00:10 -0400 From: "Alexander Sack" To: Adam In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-hackers@freebsd.org Subject: Re: CopyOut Size Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2008 21:00:13 -0000 On Fri, Apr 25, 2008 at 9:59 AM, Adam wrote: > Hi, I am writing a custom system call that needs to transfer 16kb of data > from the kernel to userspace. I am transferring the data out of the kernel > by using copyout. This seems to work for a small struct of data < 4k. > > int my_system_call(struct thread *td, struct my_system_call_args *uap) > { > my_structtype_t my_type; > > copyout(&my_type,uap->my_type,sizeof(my_type) ))!=0) > { > printf("\n copyout failed ret%d\n",error); > return error; > } > > printf("exiting kernel %d\n",error); > return (0); > } > > However once I expand my struct size beyond around 4k that I get a "Fatal > Double Fault." It seems like I am overrunning the kernel stack. Does > copyout use memory from the kernel stack? What is the limit for copyout? > Is there some way to allocate additional space? Alternatively what is the > appropriate method for transferring kbs of data from kernel to userspace? > > Thanks, > Adam Adam, I have no idea the context and Joerg hit it on the head but have you considered using shared memory instead of a system call to achieve what you want? shmat(2) and its elk? Thanks! -aps From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 06:34:22 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F64106564A for ; Sat, 26 Apr 2008 06:34:22 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 4EC0D8FC22 for ; Sat, 26 Apr 2008 06:34:22 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so4387867fgg.35 for ; Fri, 25 Apr 2008 23:34:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=4reMHDG1PLfmgQ7Sd1W3X5HwaHdxVeHemgFRUg4IO4U=; b=VwwWM7ER6oGChwmRuiWzH412d1CBnhGM6pE90WAL1A2B91mABcg65RqmpIErF+mUq1uolrJvyKh3Ny8oboE2RNorYW0j6IKZtBcRia1YZ4Xo6tjZNVayD5Gzp5dmfk0Ni265CQh9oysHS9BsSJawidIuQrYQoxldqIwaa7NccJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=auuuqx/eZFEwy9cZkimTFYrT7qlsII45mt03NsYIKVIKmZxThAJrN7w5VkX1tSYFg2tMcscufXO3LlourKG/1urcZCnlxlDA5sQnzJyQ0oEA3MPFMYdFOb+fu2kizrXmVN3oLGMym0YPtYjhy/Q6rAxvXkBRvUHppaSLnFOHFK4= Received: by 10.86.60.15 with SMTP id i15mr2718768fga.36.1209191660893; Fri, 25 Apr 2008 23:34:20 -0700 (PDT) Received: by 10.86.26.8 with HTTP; Fri, 25 Apr 2008 23:34:20 -0700 (PDT) Message-ID: <7d6fde3d0804252334l38ecfd55oaaf69e2428dbf520@mail.gmail.com> Date: Fri, 25 Apr 2008 23:34:20 -0700 From: "Garrett Cooper" To: hackers@freebsd.org In-Reply-To: <7d6fde3d0804252333t499daa3bh1f07bcdd795bef44@mail.gmail.com> MIME-Version: 1.0 References: <7d6fde3d0804232334k2bd569d1j76f128c4157ed75a@mail.gmail.com> <20080424082453.03C1B5B57@mail.bitblocks.com> <7d6fde3d0804252333t499daa3bh1f07bcdd795bef44@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: strdup(NULL) supposed to create SIGSEGV? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 06:34:22 -0000 On Thu, Apr 24, 2008 at 1:24 AM, Bakul Shah wrote: > On Wed, 23 Apr 2008 23:34:41 PDT "Garrett Cooper" > wrote: > > I know that dereferencing a NULL pointer yields a segfault because > address 0 > > can't be accessed. > > > > The point is that I didn't realize that something unadvertised causes a > > SIGSEGV. > > I understood that. We all learn this the hard way! Reading > that something will cause SIGSEGV doesn't have the same > impact as actually seeing your program crash! > > > If someone noted that strdup(2) used memcpy(2) (at least) and didn't > check > > input (at most), I would completely understand.. I'm more than happy to > > write that up in the revised manpage if that's what it takes, so others > > unaware of this can avoid this issue.. > > strdup(NULL) is an example of the more general case of using > an illegal value for a function argument. Are you going to > update all the manpages for functions that segfault when > given a NULL? I guess what I am trying to say is don't waste > your time on that -- even if you update all manpages, people > are still going to trip over this at least once. > > cc -Wall can help find such problems. For strdup(NULL) > you will get something like > > x.c:5: warning: null argument where non-null required (argument 1) > > So if you want to help others, make them use cc -Wall :-) > When using things such as getopt, which depend on user input, you can't do that. gcc is good at mapping out graphs, but it's no more proficient of a guesser than I am. Besides, it doesn't have a fake Jamaican accent :].. I agree though to some extent about the manpage thing, even though this stupid mistake bit me in the ass due to my own ignorance. Also, strdup(3) should reference memcpy(3) in the manpage. I'll submit a patch for that. Discussion closed. -Garrett From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 06:50:30 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C80FD1065673 for ; Sat, 26 Apr 2008 06:50:30 +0000 (UTC) (envelope-from fazaeli@sepehrs.com) Received: from sepehrs.com (www.sepehrs.com [213.217.59.98]) by mx1.freebsd.org (Postfix) with ESMTP id 0442C8FC17 for ; Sat, 26 Apr 2008 06:50:29 +0000 (UTC) (envelope-from fazaeli@sepehrs.com) Received: from [192.168.1.180] ([192.168.1.180]) by sepehrs.com (8.13.6/8.13.6) with ESMTP id m3Q9qXZF029933 for ; Sat, 26 Apr 2008 09:52:33 GMT (envelope-from fazaeli@sepehrs.com) Message-ID: <4812CA4E.8030004@sepehrs.com> Date: Sat, 26 Apr 2008 10:53:10 +0430 From: "H.fazaeli" User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 CC: freebsd-hackers@freebsd.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sepehr-MailScanner-Information: Please contact the ISP for more information X-Sepehr-MailScanner: Found to be clean X-Sepehr-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.921, required 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60, DATE_IN_PAST_03_06 0.48) X-MailScanner-From: fazaeli@sepehrs.com X-Spam-Status: No Subject: Re: CopyOut Size Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 06:50:30 -0000 Do not allocate my_type (in general, big data structures) on kernel stack (e.g, use malloc(9)). Adam wrote: > Hi, I am writing a custom system call that needs to transfer 16kb of > data from the kernel to userspace. I am transferring the data out of > the kernel by using copyout. This seems to work for a small struct of > data < 4k. > > int my_system_call(struct thread *td, struct my_system_call_args *uap) > { > my_structtype_t my_type; > > copyout(&my_type,uap->my_type,sizeof(my_type) ))!=0) > { > printf("\n copyout failed ret%d\n",error); > return error; > } > > printf("exiting kernel %d\n",error); > return (0); > } > > However once I expand my struct size beyond around 4k that I get a > "Fatal Double Fault." It seems like I am overrunning the kernel > stack. Does copyout use memory from the kernel stack? What is the > limit for copyout? Is there some way to allocate additional space? > Alternatively what is the appropriate method for transferring kbs of > data from kernel to userspace? > > Thanks, > Adam > > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > > > -- With best regards. Hooman Fazaeli Sepehr S. T. Co. Ltd. Web: http://www.sepehrs.com Tel: (9821)88975701-2 Fax: (9821)88983352 From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 11:11:47 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3F21106564A for ; Sat, 26 Apr 2008 11:11:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id AA1188FC1C for ; Sat, 26 Apr 2008 11:11:47 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3QB8jpB051158; Sat, 26 Apr 2008 05:08:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 26 Apr 2008 05:09:51 -0600 (MDT) Message-Id: <20080426.050951.-1676911029.imp@bsdimp.com> To: avg@icyb.net.ua From: "M. Warner Losh" In-Reply-To: <480EE53C.40800@icyb.net.ua> References: <480E4269.2090604@icyb.net.ua> <480E533C.60301@quis.cx> <480EE53C.40800@icyb.net.ua> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, jille@quis.cx Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 11:11:48 -0000 In message: <480EE53C.40800@icyb.net.ua> Andriy Gapon writes: : on 23/04/2008 00:06 Jille said the following: : > Andriy Gapon wrote: : >> Maybe this is a crazy idea or maybe we already have something like this. : >> Is it possible to get notifications about changes in devfs - appearance : >> and disappearance of devices (in devfs sense of the word)? : >> devctl currently notifies about real (hardware) devices handled by : >> device drivers and some notifications about hardware/driver events. : >> But what if I want to automatically run some action if : >> /dev/ufs/magic-label appears? : >> Or if I want to monitor appearance and disappearance of ad* and da* : >> devices (without having to monitor low level drivers like umass)? : >> : > : > I don't know whether it is what you are looking for, but take a look at : > devd(8). : : devd reads devctl The device events from devctl(4) don't necessarily correspond to /dev entries that devfs deals with. Warner From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 11:20:49 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E768B1065678; Sat, 26 Apr 2008 11:20:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 96DA58FC16; Sat, 26 Apr 2008 11:20:49 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id m3QBJ0oE051345; Sat, 26 Apr 2008 05:19:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 26 Apr 2008 05:20:06 -0600 (MDT) Message-Id: <20080426.052006.1299799376.imp@bsdimp.com> To: avg@icyb.net.ua From: "M. Warner Losh" In-Reply-To: <4810FD1E.70602@icyb.net.ua> References: <48103F36.6060707@icyb.net.ua> <200804240811.26183.jhb@freebsd.org> <4810FD1E.70602@icyb.net.ua> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@FreeBSD.ORG, jhb@FreeBSD.ORG Subject: Re: devctl (alike?) for devfs X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 11:20:50 -0000 In message: <4810FD1E.70602@icyb.net.ua> : However it is possible that it did something wrong - at that time I had : devctl calls in kern_conf. I'd be inclined to say 'create' and 'destroy' for the events. ATTACH and DETACH are typically reserved for device driver events, not for device node events. Warner From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 18:11:27 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8205106566B for ; Sat, 26 Apr 2008 18:11:27 +0000 (UTC) (envelope-from liqlee@gmail.com) Received: from hs-out-0708.google.com (hs-out-0708.google.com [64.233.178.245]) by mx1.freebsd.org (Postfix) with ESMTP id AB11A8FC29 for ; Sat, 26 Apr 2008 18:11:27 +0000 (UTC) (envelope-from liqlee@gmail.com) Received: by hs-out-0708.google.com with SMTP id m63so3532829hsc.11 for ; Sat, 26 Apr 2008 11:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=C16c58URNoIbsOFjajOpqTauDTYnZHFEXhTFAzgn7FI=; b=HgIcq73uG28aubvP1PAqTMAiUOMBEWCfLdW8loeTo43dyHVnBM4iQh5LivnFRfkeOm1tAIzgyBafzzyatRQ1ofauJ1FXaiWlM1UohuFdnoGWzD0InRh9H3UK27fqINMYowwkBr0j0OrOU5BrudiutE2n3V9e6x0v3xLdvGd+8A0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=N5qMkzRDkfWj69myyHNvgHZgTmlKsdop1D1RpWuTz2ME+Lzd5SWYRKuY30Ub2GraHqnVGbiMJUpkZjg1no2Lmfd99M973fXr7OLGG8nsqtST7hzTDh/XoYph0dahkd/wVyqD0UDnY9aVIJpF9Nn3k5RoXiPRv/Na8cK5kKdIoOA= Received: by 10.90.49.3 with SMTP id w3mr7796030agw.5.1209231750969; Sat, 26 Apr 2008 10:42:30 -0700 (PDT) Received: by 10.90.68.8 with HTTP; Sat, 26 Apr 2008 10:42:30 -0700 (PDT) Message-ID: Date: Sat, 26 Apr 2008 12:42:30 -0500 From: "LiQun Li" To: hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Mailman-Approved-At: Sat, 26 Apr 2008 20:01:53 +0000 Cc: Subject: soc2008 DTrace toolkit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 18:11:28 -0000 Hi, all, My name is LiQun Li, originally from China, now study in University of Iowa. I am a graduate student, majored in Computer Science. I have used Open Source Software for a while, most time under Linux, a little bit under FreeBSD. DTrace is a really cool feature for Solaris, it will be great if OSS has this one too. This sumer, Google sponsors this SOC, and FreeBSD has this project. I am going to have a try. Since my courses will end after the middle of May, I would not spend too much time on this project before that. Sorry about that, Liqun From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 20:35:48 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E4DE106564A for ; Sat, 26 Apr 2008 20:35:48 +0000 (UTC) (envelope-from snagg@freebsd.org) Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by mx1.freebsd.org (Postfix) with ESMTP id DE06C8FC1A for ; Sat, 26 Apr 2008 20:35:47 +0000 (UTC) (envelope-from snagg@freebsd.org) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: snagg@autistici.org) with ESMTP id AE10E98348 Message-Id: <68E76BB1-BB4B-4B87-885C-FC09254C84B5@freebsd.org> From: Vincenzo Iozzo To: hackers@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Sat, 26 Apr 2008 22:04:00 +0200 References: <324AB044-9E12-4ACE-9DAA-A218F230661E@freebsd.org> X-Mailer: Apple Mail (2.919.2) Cc: Subject: Fwd: Presentation and soc project X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 20:35:48 -0000 Inizio messaggio inoltrato: > Da: Vincenzo Iozzo > Data: 26 aprile 2008 20:05:51 GMT+02:00 > A: trustedbsd-audit@freebsd.org > Oggetto: Presentation and soc project > > Hi, > I'm Vincenzo Iozzo, one of the student selected for this year summer > of code. My project is aim at improving audit_pipe and regression > testing of the audit infrastructure. Specifically I'll modify the > audit_pipe ioctl interface in order to provide more granularity in > the event selection. As regards the testing phase I'll create a > framework which would test the audit system by comparing the > audit_pipe output with some "models" based on the testing program in > exams. > A brief, but more specifical, description of the first phase of my > project could be found here: > http://www1.autistici.org/snagg/proposal-soc.pdf > > Please do let me know your opinions, > Thanks. > Vincenzo From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 21:57:54 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11F3D106566B for ; Sat, 26 Apr 2008 21:57:54 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from postfix2-g20.free.fr (postfix2-g20.free.fr [212.27.60.43]) by mx1.freebsd.org (Postfix) with ESMTP id 896E98FC0C for ; Sat, 26 Apr 2008 21:57:53 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by postfix2-g20.free.fr (Postfix) with ESMTP id E63C125B6A3B for ; Sat, 26 Apr 2008 21:35:33 +0200 (CEST) Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 518AF17B540; Sat, 26 Apr 2008 23:35:58 +0200 (CEST) Received: from marvin.blogreen.org (marvin.blogreen.org [82.247.213.140]) by smtp3-g19.free.fr (Postfix) with ESMTP id 0ADAB17B530; Sat, 26 Apr 2008 23:35:58 +0200 (CEST) Received: by marvin.blogreen.org (Postfix, from userid 1001) id B20AF5C059; Sat, 26 Apr 2008 23:35:57 +0200 (CEST) Date: Sat, 26 Apr 2008 23:35:57 +0200 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: hackers@freebsd.org Message-ID: <20080426213557.GA88577@marvin.blogreen.org> Mail-Followup-To: hackers@freebsd.org, Romuald Conty Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://romain.blogreen.org/pubkey.asc X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Romuald Conty Subject: indent(1) support for gcc(1) 0b prefix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 21:57:54 -0000 --LpQ9ahxlCli8rRTG Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline --2oS5YaxWCcQjTEyO Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello FreeBSD hackers! I'm using avr-gcc from the ports and relying on the 0b prefix notation for binary constants, that is: foo =3D 0b00101010; Thanks to /usr/ports/devel/avr-gcc/files/patch-0b-constants this is possible :-) But I would like to use indent(1) to reformat contributed code automatically. Unfortunately, the 0b notation is not supported by that program, and the resulting code looks like this: foo =3D 0 b00101010; =2E.. then compilation fails, bla bla bla... A quick look at indent(1) source code leaded me to tweak /usr/src/usr.bin/indent/lexi.c so that the 0b notation is supported (patch attached). I was so wondering how useful(less) it was to support this extension in FreeBSD indent(1) program. The version of gcc provided with the base system does not support this syntax, and AFAIK, only the avr-gcc port support this kind of constructs... So options are: - Add support for 0b notation to FreeBSD indent(1) (maybe requiring the use of an extra command line argument to support this feature); - Provide a patch for indent(1) that can be conditionally applied on the code when compiling the world; - Create another port, say avr-indent(1), that is not more than a copy of indent(1) with support of 0b constructs; - Do nothing: tweaking indent(1) for supporting this is so trivial that the few individuals interested in this can have their local version of indent. Can you please tell me your opinion about this? Thank you in advance, Romain PS: I also took a look at GNU indent (gindent(1) from the ports), but it does not support 0b notation too. --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --2oS5YaxWCcQjTEyO-- --LpQ9ahxlCli8rRTG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkgToD0ACgkQ2OmjP/9W/0O6ogCeOxVteaXp7Gs/yVdVrIiEj2zD aL8Anj7kyGvF5b8qLrRn30k+fRjBsWQj =yhc5 -----END PGP SIGNATURE----- --LpQ9ahxlCli8rRTG-- From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 26 22:51:15 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD3C01065673 for ; Sat, 26 Apr 2008 22:51:15 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from smtp3-g19.free.fr (smtp3-g19.free.fr [212.27.42.29]) by mx1.freebsd.org (Postfix) with ESMTP id 9EEDC8FC16 for ; Sat, 26 Apr 2008 22:51:15 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from smtp3-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp3-g19.free.fr (Postfix) with ESMTP id 9D93417B530; Sun, 27 Apr 2008 00:51:14 +0200 (CEST) Received: from marvin.blogreen.org (marvin.blogreen.org [82.247.213.140]) by smtp3-g19.free.fr (Postfix) with ESMTP id 5DCFA17B52D; Sun, 27 Apr 2008 00:51:14 +0200 (CEST) Received: by marvin.blogreen.org (Postfix, from userid 1001) id 328D85C059; Sun, 27 Apr 2008 00:51:14 +0200 (CEST) Date: Sun, 27 Apr 2008 00:51:14 +0200 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: hackers@freebsd.org Message-ID: <20080426225114.GA91402@marvin.blogreen.org> Mail-Followup-To: hackers@freebsd.org, Romuald Conty References: <20080426213557.GA88577@marvin.blogreen.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Dxnq1zWXvFF0Q93v" Content-Disposition: inline In-Reply-To: <20080426213557.GA88577@marvin.blogreen.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key: http://romain.blogreen.org/pubkey.asc Cc: Romuald Conty Subject: Re: indent(1) support for gcc(1) 0b prefix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Apr 2008 22:51:15 -0000 --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 26, 2008 at 11:35:57PM +0200, Romain Tarti=E8re wrote: > (patch attached). Humm ... the patch seems to have been eaten by the list manager. I uploaded it here: http://romain.blogreen.org/files/patch-lexi.c Kind regards, Romain --=20 Romain Tarti=E8re http://romain.blogreen.org/ pgp: 8DAB A124 0DA4 7024 F82A E748 D8E9 A33F FF56 FF43 (ID: 0xFF56FF43) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --Dxnq1zWXvFF0Q93v Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.8 (FreeBSD) iEYEARECAAYFAkgTseIACgkQ2OmjP/9W/0P4JgCfUwVDEkjL8Y+9g2YZZ6zb0iSY CXgAn0HXIHjt45hRxQUBjC11bayUXNsO =7Num -----END PGP SIGNATURE----- --Dxnq1zWXvFF0Q93v--