From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 03:40:09 2010 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 23E5C106566B for ; Sun, 25 Apr 2010 03:40:09 +0000 (UTC) (envelope-from qhwt+fbsd@les.ath.cx) Received: from les.ath.cx (x219233.ppp.asahi-net.or.jp [122.249.219.233]) by mx1.freebsd.org (Postfix) with ESMTP id F1B608FC12 for ; Sun, 25 Apr 2010 03:40:08 +0000 (UTC) Received: by les.ath.cx (Postfix, from userid 1000) id 7AC27749236BA; Sun, 25 Apr 2010 12:20:48 +0900 (JST) Date: Sun, 25 Apr 2010 12:20:48 +0900 From: YONETANI Tomokazu To: freebsd-hackers@freebsd.org Message-ID: <20100425032047.GA89136@les.ath.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Subject: BIO_FLUSH and ips(4) 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, 25 Apr 2010 03:40:09 -0000 Hello. The ServeRAID driver, or ips(4), seems to distinguish read or write requests with a macro called ips_read_request(), which is defined as #define ips_read_request(iobuf) ((iobuf)->bio_cmd == BIO_READ) in its strategy routine and a few other places. So when the request is BIO_FLUSH, the ips driver issues a write command (IPS_WRITE_CMD) with length == 0, right? My question is, do ServeRAID controllers treat 0-byte write command as a sync-to-disk request, or is there any command for that purpose? There's a command called IPS_CACHE_FLUSH_CMD defined in ipsreg.h, but it's not used anywhere in the normal code path. Best regards, YONETANI Tomokazu. From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 05:39:35 2010 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 BE70C106564A for ; Sun, 25 Apr 2010 05:39:35 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9430D8FC0C for ; Sun, 25 Apr 2010 05:39:35 +0000 (UTC) Received: by pxi17 with SMTP id 17so1359119pxi.13 for ; Sat, 24 Apr 2010 22:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1b7ozL8uRZoR1GB2FMNN8KUbSY/U7UTGmk6b1kKtUj8=; b=clZ77PXnKY1lh/47Ha2nPYt1gwI9w+fJzVg6Aup0kVhCb27S/z5jNxVw4sHke/ji17 7IxpHbNkzQyCggdqr0vdkvbV25DTfbdjCk7WjQW+kZ1DvtuwzxiaDpGL7eoHnFtJgNfm SuOM+ZjmHgH70FQUJfNVu/JIDeiF3T6tEQScM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=PJFqDm58u9HASDJ20zsKCI9P8EFexUBczpR0oEtYAHphOGBDrFc/9xcTmhT0Ea0BJf z32LvHPWjUAcMOhMgAdd4pe9oAdbzXeNA4pBPli6iByt4HCBHoB/WOYTwgNoJqaaq/zM uYjdZWpIDPNz1dbsRjl23PNbpTkuRyDeVP0i0= MIME-Version: 1.0 Received: by 10.141.91.13 with SMTP id t13mr2011860rvl.266.1272173966163; Sat, 24 Apr 2010 22:39:26 -0700 (PDT) Received: by 10.140.169.10 with HTTP; Sat, 24 Apr 2010 22:39:26 -0700 (PDT) In-Reply-To: <20100425032047.GA89136@les.ath.cx> References: <20100425032047.GA89136@les.ath.cx> Date: Sat, 24 Apr 2010 22:39:26 -0700 Message-ID: From: Xin LI To: YONETANI Tomokazu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: BIO_FLUSH and ips(4) 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, 25 Apr 2010 05:39:35 -0000 Hi, On Sat, Apr 24, 2010 at 8:20 PM, YONETANI Tomokazu w= rote: > Hello. > > The ServeRAID driver, or ips(4), seems to distinguish read or write reque= sts > with a macro called ips_read_request(), which is defined as > > =C2=A0#define ips_read_request(iobuf) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ((iobuf)->bio_cmd =3D=3D BIO_READ) > > in its strategy routine and a few other places. =C2=A0So when the request= is > BIO_FLUSH, the ips driver issues a write command (IPS_WRITE_CMD) with > length =3D=3D 0, right? > > My question is, do ServeRAID controllers treat 0-byte write command > as a sync-to-disk request, or is there any command for that purpose? > There's a command called IPS_CACHE_FLUSH_CMD defined in ipsreg.h, > but it's not used anywhere in the normal code path. It seems Linux driver is using it (on shutdown/reset) but I'm not sure if this would have some side effect, etc.? Cheers, --=20 Xin LI http://www.delphij.net From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 11:17:42 2010 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 7567A1065673; Sun, 25 Apr 2010 11:17:42 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id 338828FC0A; Sun, 25 Apr 2010 11:17:42 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (Postfix) with ESMTPS id 1B0975CAC; Sun, 25 Apr 2010 13:17:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1272194261; bh=XXpP//J7BKmFrJfL6jvGnHrHzs0FTstZcR/dKAuASU4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=j6btTZ0w7EuNpUcuaXKFWRIURrtP1g7PgHR1J65oNZVjey0w/JgSojpbFZGfeidxb aHH+IXOKdeOQJsaKad3lxVeHSErUNyTRFTsKv3OAYGhFSRxVBZtkEnFA6rKNxHYO4Q DVvu4Ns4UGpuCzJDpmBhI80yss/WTrACca3lBLLE= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o3PBHebc037821; Sun, 25 Apr 2010 13:17:40 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Sun, 25 Apr 2010 13:17:40 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Pegasus Mc Cleaft Message-ID: <20100425111740.GI92627@acme.spoerlein.net> Mail-Followup-To: Pegasus Mc Cleaft , freebsd-hackers@freebsd.org, freebsd-current@freebsd.org References: <201004241642.38017.ken@mthelicon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201004241642.38017.ken@mthelicon.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org, freebsd-current@freebsd.org Subject: Re: kern+world / ports make options 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, 25 Apr 2010 11:17:42 -0000 On Sat, 24.04.2010 at 16:42:37 +0000, Pegasus Mc Cleaft wrote: > Hello Hackers & Current, > > I was wondering it if is possible, or if it can be done so a separate set > of CC, CXX, etc can be specified for building the world and kernel > independently of a ports build? > > Right now, I use the base GCC to compile the world and kernel, and GCC44 > for most of the other ports (when it complies cleanly). But I have to keep > editing the /etc/make.conf file to switch between the two. > > It may already be implemented, but it would be nice if there was > something defined while the kernel and/or world is being built to that a > nested block of ifdefs can select which env variables to be set. src.conf has already been mentioned, I don't use it myself but have the following set in make.conf .if ${.CURDIR:M*/usr/ports/*} NOCLEANDEPENDS= true WRKDIRPREFIX= /usr/obj .include "/etc/ports.conf" .endif I guess you can figure it out from there ... hth Ulrich Spörlein From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 14:59:34 2010 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 9FDB4106566B for ; Sun, 25 Apr 2010 14:59:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E5D578FC0A for ; Sun, 25 Apr 2010 14:59:33 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3PExUbq041351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 25 Apr 2010 17:59:30 +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.4/8.14.4) with ESMTP id o3PExUos051435; Sun, 25 Apr 2010 17:59:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3PExTHL051434; Sun, 25 Apr 2010 17:59:29 +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: Sun, 25 Apr 2010 17:59:29 +0300 From: Kostik Belousov To: Alexander Krizhanovsky Message-ID: <20100425145929.GJ2422@deviant.kiev.zoral.com.ua> References: <4BCBA7F8.3060109@natsys-lab.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eDyw1yV8HuEtd7LH" Content-Disposition: inline In-Reply-To: <4BCBA7F8.3060109@natsys-lab.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, ur4ina@gmail.com Subject: Re: [PATCH] RUSAGE_THREAD 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, 25 Apr 2010 14:59:34 -0000 --eDyw1yV8HuEtd7LH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 19, 2010 at 12:46:48AM +0000, Alexander Krizhanovsky wrote: > Hi all! >=20 > This patch implements per-thread rusage statistic (like RUSAGE_THREAD in= =20 > Linux and RUSAGE_LWP in OpenSolaris). >=20 > Unfortunately, we have to acquire a number of locks to read/update=20 > system and user times for current thread rusage information because it's= =20 > also used for whole process statistic and needs to be zeroed. >=20 > Any comments are very appreciated. >=20 > It's tested against 8.0-RELEASE. Appropriate PR is submitted. >=20 > --=20 > Alexander Krizhanovsky > NatSys Lab. (http://natsys-lab.com) > tel: +7 (916) 717-3899, +7 (499) 747-6304 > e-mail: ak@natsys-lab.com >=20 I think this should be somewhat modified before commit. First, please separate patch into two pieces. One would introduce ruxagg_tlock() helper and use it in existing locations instead of three-liners. Possibly, add K&R->ANSI C kern_getrusage definition change. Second would actually add RUSAGE_THREAD. There, please follow the style(9), in particular, do not initialize the local variables at the declaration, instead, use explicit initialization in the code. Should calctru() share the code with calcru1() ? I am esp. concerned with sanity check like negative runtime etc. Possibly, this code from calcru1() should be separated into function used from both calcru1() and calctru(). Man page for getrusage(2) should be updated. Thanks for the submission. > --- sys/sys/resource.h.orig 2009-10-25 01:10:29.000000000 +0000 > +++ sys/sys/resource.h 2010-04-11 23:31:14.000000000 +0000 > @@ -56,6 +56,7 @@ > =20 > #define RUSAGE_SELF 0 > #define RUSAGE_CHILDREN -1 > +#define RUSAGE_THREAD 1 > =20 > struct rusage { > struct timeval ru_utime; /* user time used */ > --- sys/kern/kern_resource.c.orig 2009-10-25 01:10:29.000000000 +0000 > +++ sys/kern/kern_resource.c 2010-04-18 23:49:04.000000000 +0000 > @@ -76,6 +76,7 @@ static void calcru1(struct proc *p, stru > struct timeval *up, struct timeval *sp); > static int donice(struct thread *td, struct proc *chgp, int n); > static struct uidinfo *uilookup(uid_t uid); > +static void ruxagg_tlock(struct proc *p, struct thread *td); > =20 > /* > * Resource controls and accounting. > @@ -623,9 +624,7 @@ lim_cb(void *arg) > return; > PROC_SLOCK(p); > FOREACH_THREAD_IN_PROC(p, td) { > - thread_lock(td); > - ruxagg(&p->p_rux, td); > - thread_unlock(td); > + ruxagg_tlock(p, td); > } > PROC_SUNLOCK(p); > if (p->p_rux.rux_runtime > p->p_cpulimit * cpu_tickrate()) { > @@ -836,9 +835,7 @@ calcru(struct proc *p, struct timeval *u > FOREACH_THREAD_IN_PROC(p, td) { > if (td->td_incruntime =3D=3D 0) > continue; > - thread_lock(td); > - ruxagg(&p->p_rux, td); > - thread_unlock(td); > + ruxagg_tlock(p, td); > } > calcru1(p, &p->p_rux, up, sp); > } > @@ -918,6 +915,29 @@ calcru1(struct proc *p, struct rusage_ex > sp->tv_usec =3D su % 1000000; > } > =20 > +static void > +calctru(struct thread *td) > +{ > + u_int64_t tu =3D cputick2usec(td->td_incruntime); > + u_int64_t ut =3D td->td_uticks; > + u_int64_t it =3D td->td_iticks; > + u_int64_t st =3D td->td_sticks; > + u_int64_t tt, uu, su; > + > + tt =3D ut + st + it; > + if (!tt) { > + /* Avoid divide by zero */ > + st =3D 1; > + tt =3D 1; > + } > + uu =3D td->td_ru.ru_utime.tv_usec + (ut * tu) / tt; > + su =3D td->td_ru.ru_stime.tv_usec + (st * tu) / tt; > + td->td_ru.ru_utime.tv_sec +=3D uu / 1000000; > + td->td_ru.ru_utime.tv_usec =3D uu % 1000000; > + td->td_ru.ru_stime.tv_sec +=3D su / 1000000; > + td->td_ru.ru_stime.tv_usec =3D su % 1000000; > +} > + > #ifndef _SYS_SYSPROTO_H_ > struct getrusage_args { > int who; > @@ -939,10 +959,7 @@ getrusage(td, uap) > } > =20 > int > -kern_getrusage(td, who, rup) > - struct thread *td; > - int who; > - struct rusage *rup; > +kern_getrusage(struct thread *td, int who, struct rusage *rup) > { > struct proc *p; > int error; > @@ -961,6 +978,13 @@ kern_getrusage(td, who, rup) > calccru(p, &rup->ru_utime, &rup->ru_stime); > break; > =20 > + case RUSAGE_THREAD: > + PROC_SLOCK(p); > + ruxagg_tlock(p, td); > + PROC_SUNLOCK(p); > + *rup =3D td->td_ru; > + break; > + > default: > error =3D EINVAL; > } > @@ -1010,12 +1034,24 @@ ruxagg(struct rusage_ext *rux, struct th > rux->rux_uticks +=3D td->td_uticks; > rux->rux_sticks +=3D td->td_sticks; > rux->rux_iticks +=3D td->td_iticks; > + > + /* update thread rusage before ticks counters cleaning */ > + calctru(td); > + > td->td_incruntime =3D 0; > td->td_uticks =3D 0; > td->td_iticks =3D 0; > td->td_sticks =3D 0; > } > =20 > +static void > +ruxagg_tlock(struct proc *p, struct thread *td) > +{ > + thread_lock(td); > + ruxagg(&p->p_rux, td); > + thread_unlock(td); > +} > + > /* > * Update the rusage_ext structure and fetch a valid aggregate rusage > * for proc p if storage for one is supplied. > @@ -1030,9 +1066,7 @@ rufetch(struct proc *p, struct rusage *r > *ru =3D p->p_ru; > if (p->p_numthreads > 0) { > FOREACH_THREAD_IN_PROC(p, td) { > - thread_lock(td); > - ruxagg(&p->p_rux, td); > - thread_unlock(td); > + ruxagg_tlock(p, td); > rucollect(ru, &td->td_ru); > } > } > _______________________________________________ > 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" --eDyw1yV8HuEtd7LH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvUWNEACgkQC3+MBN1Mb4jeewCfT9Wa1XBzGzGo0OwT9b5WZ5pX f6UAnjEOf6mZt2EbxncwXCii0DdZVSAO =zjd2 -----END PGP SIGNATURE----- --eDyw1yV8HuEtd7LH-- From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 18:38:03 2010 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 28A451065670; Sun, 25 Apr 2010 18:38:03 +0000 (UTC) (envelope-from ken@mthelicon.com) Received: from hercules.mthelicon.com (hercules.mthelicon.com [IPv6:2001:49f0:2023::2]) by mx1.freebsd.org (Postfix) with ESMTP id EECC78FC1F; Sun, 25 Apr 2010 18:38:02 +0000 (UTC) Received: from feathers.peganest.com (feathers.peganest.com [78.33.110.3]) (authenticated bits=0) by hercules.mthelicon.com (8.14.3/8.14.3) with ESMTP id o3PIc1b9044744; Sun, 25 Apr 2010 18:38:01 GMT (envelope-from ken@mthelicon.com) From: Pegasus Mc Cleaft Organization: Feathers To: freebsd-current@freebsd.org Date: Sun, 25 Apr 2010 18:38:01 +0000 User-Agent: KMail/1.12.4 (FreeBSD/9.0-CURRENT; KDE/4.3.5; amd64; ; ) References: <201004241642.38017.ken@mthelicon.com> <20100425111740.GI92627@acme.spoerlein.net> In-Reply-To: <20100425111740.GI92627@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201004251838.01073.ken@mthelicon.com> Cc: freebsd-hackers@freebsd.org, Ulrich =?utf-8?q?Sp=C3=B6rlein?= Subject: Re: kern+world / ports make options 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, 25 Apr 2010 18:38:03 -0000 On Sunday 25 April 2010 11:17:40 Ulrich Sp=C3=B6rlein wrote: > On Sat, 24.04.2010 at 16:42:37 +0000, Pegasus Mc Cleaft wrote: > > It may already be implemented, but it would be nice if there was > > something defined while the kernel and/or world is being built to that a > > nested block of ifdefs can select which env variables to be set. >=20 > src.conf has already been mentioned, I don't use it myself but have the > following set in make.conf >=20 > .if ${.CURDIR:M*/usr/ports/*} > NOCLEANDEPENDS=3D true > WRKDIRPREFIX=3D /usr/obj > .include "/etc/ports.conf" > .endif Hi Ulrich,=20 Thank you for that. This is pretty much what I was looking for as I can=20 use the .if block to add in only the pieces I want. The src.conf solution w= as=20 an option, but since both make.conf and src.conf are called, I ended up=20 basically undoing everything in src.conf that I did in make.conf; and that= =20 didn't work so well as I kept breaking the build (couldn't find headers and= =20 all sorts of thing). No doubt, it was the way that I did it.. Your solution= is=20 cleaner and makes sense to me.=20 Thanks again,=20 Peg From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 25 20:01:30 2010 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 ABAB11065691 for ; Sun, 25 Apr 2010 20:01:30 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-relay3.uni-muenster.de (ZIVM-RELAY3.UNI-MUENSTER.DE [128.176.192.19]) by mx1.freebsd.org (Postfix) with ESMTP id 364C38FC17 for ; Sun, 25 Apr 2010 20:01:29 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.52,270,1270418400"; d="scan'208";a="32238227" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER05.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay3.uni-muenster.de with ESMTP; 25 Apr 2010 22:01:28 +0200 Received: by ZIVMAILUSER05.UNI-MUENSTER.DE (Postfix, from userid 149459) id C70A21B07E7; Sun, 25 Apr 2010 22:01:28 +0200 (CEST) Date: Sun, 25 Apr 2010 22:01:28 +0200 (CEST) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: Subject: unquoted variables in /usr/share/mk/*.mk 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, 25 Apr 2010 20:01:30 -0000 hi there, i was wondering why almost all variables in /usr/share/mk/*.mk are unquoted? it's pretty obvious that something like mkdir "(test)" ; echo ".include " > "(test)"/Makefile ; make -C "(test)" cleandir will fail. -- Alexander Best From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 02:34:07 2010 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 8207D1065674 for ; Mon, 26 Apr 2010 02:34:07 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id 2643F8FC12 for ; Mon, 26 Apr 2010 02:34:06 +0000 (UTC) Received: (qmail 3912 invoked by uid 399); 26 Apr 2010 02:34:05 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Apr 2010 02:34:05 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BD4FB8C.2050000@FreeBSD.org> Date: Sun, 25 Apr 2010 19:33:48 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Eitan Adler References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Ruben de Groot , "Aryeh M. Friedman" , =?UTF-8?B?VHJvbmQgRW5kcmVzdMO4bA==?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 02:34:07 -0000 FWIW, this looks fine to me. Have you submitted a PR? Doug On 04/22/10 10:05, Eitan Adler wrote: > Same as before - if all is good I'll send a PR > > #!/bin/sh > # > # $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.6.36.1.2.1 > 2009/10/25 01:10:29 kensmith Exp $ > # > > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > . /etc/defaults/periodic.conf > source_periodic_confs > fi > > bak=/var/backups > db_loc=$(/usr/bin/make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null) > bk_loc="$bak/pkgdb.bak.tar.bz2" > > case "$daily_backup_pkgdb_enable" in > [Yy][Ee][Ss]) > if [ ! -d $db_loc ] > then > echo '$daily_backup_pkgdb_enable is enabled but' \ > "$db_loc doesn't exist" > rc=2 > else > rc=0 > > echo "" > echo "Backing up package db directory:" > > [ -e $bk_loc ] && unlink $bk_loc > tar -cjf $bk_loc $db_loc || rc=3 > fi;; > > *) rc=0;; > esac > > exit $rc > -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 02:44:42 2010 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 32CA11065672; Mon, 26 Apr 2010 02:44:42 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id C3ABE8FC15; Mon, 26 Apr 2010 02:44:41 +0000 (UTC) Received: by qyk11 with SMTP id 11so14313396qyk.13 for ; Sun, 25 Apr 2010 19:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=cV2/V7swZCtqO/JsofX5VMnTLJG3nNAjIQ0uMf1xA1Q=; b=vZ7nZj0A6UqdWA+TNFsxsuxiwYVnrcRb2StJc4avm9sa1XNmCmZhtV1pNXgJDgGi6d Iv9CjBk2cYA5mh0UWg95CtUc62lhAP2qZcPqSHqMJaF78wyQJS0ECK+PbRg4RxOc9Iua t7j5tbXgSexKoupO9V+JDuiYaOOTwMg85GilE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hgqtnd5Czn3A1+g9KjAUxXlmJD/D2tV9+RMxQeSHTrm8ce37XBamv9ykwQDc8ORjQZ O+WIgD47KIP0RRCdIGF9Kcft6c/4IgXVlhBeEqbsXMf5B5YE1cWjYTSfuM8ZAjaqr6wL RDSde+keI+vz1ALO6tzrcaoVxZgkbXkQkIfjA= MIME-Version: 1.0 Received: by 10.229.232.198 with SMTP id jv6mr4112461qcb.11.1272249874985; Sun, 25 Apr 2010 19:44:34 -0700 (PDT) Received: by 10.229.233.11 with HTTP; Sun, 25 Apr 2010 19:44:34 -0700 (PDT) In-Reply-To: References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> Date: Sun, 25 Apr 2010 19:44:34 -0700 Message-ID: From: Garrett Cooper To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Ruben de Groot , Doug Barton , "Aryeh M. Friedman" , =?ISO-8859-1?Q?Trond_Endrest=F8l?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 02:44:42 -0000 On Thu, Apr 22, 2010 at 10:05 AM, Eitan Adler wr= ote: > Same as before - if all is good I'll send a PR > > #!/bin/sh > # > # $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.6.36.1.2.1 > 2009/10/25 01:10:29 kensmith Exp $ > # > > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > =A0 =A0. /etc/defaults/periodic.conf > =A0 =A0source_periodic_confs > fi > > bak=3D/var/backups > db_loc=3D$(/usr/bin/make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/= null) > bk_loc=3D"$bak/pkgdb.bak.tar.bz2" > > case "$daily_backup_pkgdb_enable" in > =A0 =A0[Yy][Ee][Ss]) This could be done via rc.subr's checkyesno function. > =A0 =A0 =A0 =A0if [ ! -d $db_loc ] Please quote the string. > =A0 =A0 =A0 =A0then > =A0 =A0 =A0 =A0 =A0 =A0echo '$daily_backup_pkgdb_enable is enabled but' \ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"$db_loc doesn't exist" > =A0 =A0 =A0 =A0 =A0 =A0rc=3D2 > =A0 =A0 =A0 =A0else > =A0 =A0 =A0 =A0 =A0 =A0rc=3D0 > > =A0 =A0 =A0 =A0 =A0 =A0echo "" > =A0 =A0 =A0 =A0 =A0 =A0echo "Backing up package db directory:" > > =A0 =A0 =A0 =A0 =A0 =A0[ -e $bk_loc ] && unlink $bk_loc Please quote. > =A0 =A0 =A0 =A0 =A0 =A0tar -cjf $bk_loc $db_loc || rc=3D3 Same here. > =A0 =A0 =A0 =A0fi;; > > =A0 =A0*) =A0rc=3D0;; > esac > > exit $rc Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 02:56:09 2010 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 3C590106566C for ; Mon, 26 Apr 2010 02:56:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id D27958FC18 for ; Mon, 26 Apr 2010 02:56:08 +0000 (UTC) Received: (qmail 26871 invoked by uid 399); 26 Apr 2010 02:56:05 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Apr 2010 02:56:05 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BD5009C.20300@FreeBSD.org> Date: Sun, 25 Apr 2010 19:55:24 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Garrett Cooper References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eitan Adler , "Aryeh M. Friedman" , freebsd-hackers@freebsd.org, Ruben de Groot , =?ISO-8859-1?Q?ndrest=F8l?= , =?ISO-8859-1?Q?Trond_E?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 02:56:09 -0000 On 04/25/10 19:44, Garrett Cooper wrote: > On Thu, Apr 22, 2010 at 10:05 AM, Eitan Adler wrote: >> Same as before - if all is good I'll send a PR >> >> #!/bin/sh >> # >> # $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.6.36.1.2.1 >> 2009/10/25 01:10:29 kensmith Exp $ >> # >> >> # If there is a global system configuration file, suck it in. >> # >> if [ -r /etc/defaults/periodic.conf ] >> then >> . /etc/defaults/periodic.conf >> source_periodic_confs >> fi >> >> bak=/var/backups >> db_loc=$(/usr/bin/make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null) >> bk_loc="$bak/pkgdb.bak.tar.bz2" >> >> case "$daily_backup_pkgdb_enable" in >> [Yy][Ee][Ss]) > > This could be done via rc.subr's checkyesno function. It's periodic, not rc.d. :) >> if [ ! -d $db_loc ] > > Please quote the string. I generally do quote the string as a matter of paranoia, however the practical result is likely to be the same. Doug -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 04:43:53 2010 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 08851106566C for ; Mon, 26 Apr 2010 04:43:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx23.fluidhosting.com [204.14.89.6]) by mx1.freebsd.org (Postfix) with ESMTP id 84BE78FC2B for ; Mon, 26 Apr 2010 04:43:52 +0000 (UTC) Received: (qmail 16970 invoked by uid 399); 26 Apr 2010 04:43:51 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Apr 2010 04:43:51 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4BD51A03.4080406@FreeBSD.org> Date: Sun, 25 Apr 2010 21:43:47 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.9) Gecko/20100330 Thunderbird/3.0.4 MIME-Version: 1.0 To: Garrett Cooper References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <4BD5009C.20300@FreeBSD.org> In-Reply-To: <4BD5009C.20300@FreeBSD.org> X-Enigmail-Version: 1.0.1 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Eitan Adler , "Aryeh M. Friedman" , =?ISO-8859-1?Q?Trond_E?=@FreeBSD.ORG, freebsd-hackers@freebsd.org, Ruben de Groot , =?ISO-8859-1?Q?ndrest=F8l?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 04:43:53 -0000 On 04/25/10 19:55, Doug Barton wrote: >>> if [ ! -d $db_loc ] > > I generally do quote the string as a matter of paranoia, however the > practical result is likely to be the same. ... unless it's possible that the path name will have spaces in it, which is the main reason for my paranoia. -- ... and that's just a little bit of history repeating. -- Propellerheads Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 07:54:23 2010 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 0D299106566B; Mon, 26 Apr 2010 07:54:23 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 614918FC13; Mon, 26 Apr 2010 07:54:22 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1507591fge.13 for ; Mon, 26 Apr 2010 00:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=kpmk2D5kdPIUSmf3YgdQX66J3q8S9HFa8C5vKLBEZ0U=; b=ANNtMRVWwkG9ZpE3tNhH2oC+QcrwixiX9swwXWiIdSa+CxNVd6QlkoTR6rnzpF+OAO RuVoHn4Lkxm6emrZfQmteIngN/o4MHs8ggM8zdWeTXiYbRaY/AeUR0NDyqcUfJJJFMTe evVe84q7c7B2uRMYUmxQT2++J8pn+SRcF589c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=ckIrkKm9Y+W2Rr0kERRyV5o+Vmk//sLyz8Vi+v2de9uJmBBdb+KLzPxz1OWJVJ3Moc NUimey74gDOw5UyGI7VRizCqM3FJxl8Lo4RzxydP3i4LM5NiqJYl8VqBCOUmos9+zdKt V+c/P2uKRUmjOQ2Fqi5eiQ4dEBqzo8OGGnXYM= Received: by 10.239.180.201 with SMTP id j9mr308938hbg.5.1272268456115; Mon, 26 Apr 2010 00:54:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Mon, 26 Apr 2010 00:53:56 -0700 (PDT) In-Reply-To: <4BD4FB8C.2050000@FreeBSD.org> References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <4BD4FB8C.2050000@FreeBSD.org> From: Eitan Adler Date: Mon, 26 Apr 2010 10:53:56 +0300 Message-ID: To: Doug Barton Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ruben de Groot , "Aryeh M. Friedman" , =?UTF-8?Q?Trond_Endrest=C3=B8l?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 07:54:23 -0000 On Mon, Apr 26, 2010 at 5:33 AM, Doug Barton wrote: > FWIW, this looks fine to me. Have you submitted a PR? > Yes, http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/145957 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 07:59:12 2010 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 C23741065672; Mon, 26 Apr 2010 07:59:12 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 5D81F8FC18; Mon, 26 Apr 2010 07:59:12 +0000 (UTC) Received: by qyk11 with SMTP id 11so14656032qyk.13 for ; Mon, 26 Apr 2010 00:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=8zLr6oPxvMmYeldOSqyd69tagbGuhSkD2CCTHyzEYVo=; b=N/Xa24LSVSd+qPVeJHwvfKup6GjBFo8JWUPd34x0ZXSwhgj13phLJKLVpCWr9RLNDT 10lzUX4I1xTd/tjsmXNGVoeCnV1JNkUl//G6e37auWBaATZmI7MJ7rtnQb1cKVk8kK7V RG/t4x8onRdYo9AUB6PMvUoDyDPfPH9P3WVZQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LWGzapWrN5RrZZtANLf5mUsSGzEDCOTYsmbogIs7BwlP3IjThCW/8nyT27GgQWVS26 ncOMRTaWg8P6RSdpGyHEFRe+axYfshhchmM7nFFDXl+ZMoMN1AeWs4k6+Y9I20HBQA4J RmTadW1mkJlAaSqU2xknExQXk4SovrKM0z/rg= MIME-Version: 1.0 Received: by 10.229.228.83 with SMTP id jd19mr4486708qcb.72.1272268742956; Mon, 26 Apr 2010 00:59:02 -0700 (PDT) Received: by 10.229.233.11 with HTTP; Mon, 26 Apr 2010 00:59:02 -0700 (PDT) In-Reply-To: <4BD5009C.20300@FreeBSD.org> References: <4BCE5ECC.6070202@gmail.com> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <4BD5009C.20300@FreeBSD.org> Date: Mon, 26 Apr 2010 00:59:02 -0700 Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org, Eitan Adler , "Aryeh M. Friedman" , Ruben de Groot , =?ISO-8859-1?Q?Trond_Endrest=F8l?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 07:59:12 -0000 2010/4/25 Doug Barton : > On 04/25/10 19:44, Garrett Cooper wrote: >> On Thu, Apr 22, 2010 at 10:05 AM, Eitan Adler = wrote: >>> Same as before - if all is good I'll send a PR >>> >>> #!/bin/sh >>> # >>> # $FreeBSD: src/etc/periodic/daily/210.backup-aliases,v 1.6.36.1.2.1 >>> 2009/10/25 01:10:29 kensmith Exp $ >>> # >>> >>> # If there is a global system configuration file, suck it in. >>> # >>> if [ -r /etc/defaults/periodic.conf ] >>> then >>> =A0 =A0. /etc/defaults/periodic.conf >>> =A0 =A0source_periodic_confs >>> fi >>> >>> bak=3D/var/backups >>> db_loc=3D$(/usr/bin/make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/de= v/null) >>> bk_loc=3D"$bak/pkgdb.bak.tar.bz2" >>> >>> case "$daily_backup_pkgdb_enable" in >>> =A0 =A0[Yy][Ee][Ss]) >> >> This could be done via rc.subr's checkyesno function. > > It's periodic, not rc.d. =A0:) It would be nice if some of the more usable functions got moved out of rc.subr though :(... It would cure 20 lines of duplicate code here and elsewhere outside of rc land... >>> =A0 =A0 =A0 =A0if [ ! -d $db_loc ] >> >> Please quote the string. > > I generally do quote the string as a matter of paranoia, however the > practical result is likely to be the same. Yes, and you're assuming that users won't do: PKG_DBDIR :=3D /my /super /special/ directory with spaces Granted, a lot of things probably won't work that way, but just compounding to the issue of not quoting variables seems like a silly mistake to make :/. Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 08:10:44 2010 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 A8148106564A; Mon, 26 Apr 2010 08:10:44 +0000 (UTC) (envelope-from eitanadlerlist@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 09EA88FC12; Mon, 26 Apr 2010 08:10:43 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1514499fge.13 for ; Mon, 26 Apr 2010 01:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=sbX8Zf0mdje7tH+dIpVhm72YtKdWCMxfyIYxMo64ajM=; b=jcqygMWPNIkO5kzqSnXYSn+2oP/BxKm6Q87NK4YV0vbxDu681Ch1NEzsT+Oghpa3Si P624Ii4AmSzkMMXXi9g/MwNzcbSHsClIfKcGl57pPeK5dElaouyqcGhrZ92IVx6SiZvk 1yNx7GUqiq9e/trsAIxQ2OHAs3N6P0d+XcAWg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=dI3/VsJXBOLoyWzxI70GnudcHW8Uy6HIpQgDWNT3kQfTlG+XwSngXeHPUvL6Cn8IKM +pO4XUroOIvtzlxtKJE83KDaqkSXXJ/3jue+nCpIqV3uLljqjc/26NSX6BLpoCpeThaD XyMGVqka11WuYOzfZPWqS3bNLfFQSgn+SJnfg= Received: by 10.239.180.201 with SMTP id j9mr310462hbg.5.1272269438087; Mon, 26 Apr 2010 01:10:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Mon, 26 Apr 2010 01:10:18 -0700 (PDT) In-Reply-To: References: <4BCE5ECC.6070202@gmail.com> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <4BD5009C.20300@FreeBSD.org> From: Eitan Adler Date: Mon, 26 Apr 2010 11:10:18 +0300 Message-ID: To: Garrett Cooper Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ruben de Groot , Doug Barton , "Aryeh M. Friedman" , =?UTF-8?Q?Trond_Endrest=C3=B8l?= Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 08:10:44 -0000 > It would be nice if some of the more usable functions got moved out of > rc.subr though :(... It would cure 20 lines of duplicate code here and > elsewhere outside of rc land... Where should they go? I'll gladly work on a patch to make them available to periodic scripts. > > Yes, and you're assuming that users won't do: > > PKG_DBDIR := /my /super /special/ directory with spaces > > Granted, a lot of things probably won't work that way, but just > compounding to the issue of not quoting variables seems like a silly > mistake to make :/. IMHO a user that uses crazy things should know that things will break Almost no program around correctly handles all filenames: http://www.dwheeler.com/essays/filenames-in-shell.html From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 11:02:07 2010 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 2A377106564A for ; Mon, 26 Apr 2010 11:02:07 +0000 (UTC) (envelope-from rwmaillists@googlemail.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 A7B748FC1A for ; Mon, 26 Apr 2010 11:02:06 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1586755fge.13 for ; Mon, 26 Apr 2010 04:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=PoTgdinFbSkLO50gN3Z1JzJrLB77LuOptiGCDLQU3zU=; b=TCClo58O0+PSCuQnRx34Pdlvbh5UGlFgK2DdYcgO6KyD9EYUM044EV9Iq3V26h3nKh GcW8FYsKYJYggm24owFutzpS5/c7UtsbSt7/zxA8PLz6lojaIrjIzdtbKQ1r+HzLJgQl JeWLATMjFmVLD+P8P1aMb0umal5BZyx4sfLP0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=vdQYrMlaGoBV7rH5AAhWQzVR9BguqXRFcTrtXr3blBuF13bSUluganHHa/sVTDhNea LtASnVQIJRPm5fdWIW6o3Xocly6d6iZ5nOSdj7RITKXieHI7B5GuZu2h6vVpf2X9jVFd ThULvWR0SqygR/jzKKryLaq7Ck1Dxfhspg57A= Received: by 10.87.42.2 with SMTP id u2mr1606560fgj.79.1272279718379; Mon, 26 Apr 2010 04:01:58 -0700 (PDT) Received: from gumby.homeunix.com (bb-87-81-140-128.ukonline.co.uk [87.81.140.128]) by mx.google.com with ESMTPS id 3sm3239163fge.15.2010.04.26.04.01.56 (version=SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 04:01:57 -0700 (PDT) Date: Mon, 26 Apr 2010 12:01:55 +0100 From: RW To: freebsd-hackers@freebsd.org Message-ID: <20100426120155.5b39532c@gumby.homeunix.com> In-Reply-To: References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 11:02:07 -0000 On Thu, 22 Apr 2010 20:05:48 +0300 Eitan Adler wrote: > bak=/var/backups This should be configurable IMO. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 12:32:50 2010 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 175D31065672 for ; Mon, 26 Apr 2010 12:32:50 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 8FA028FC14 for ; Mon, 26 Apr 2010 12:32:45 +0000 (UTC) Received: by bwz8 with SMTP id 8so11120594bwz.3 for ; Mon, 26 Apr 2010 05:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=eXfDcdJbAAQdv/IZGpr0g7S+5T10wFIYuVd0e0U/neI=; b=c4oBto53mYMywsiKhBNNGg+wsAaPL3SJuQfARmC05nb8yMyAENxkiHuhCzeshW3igz 2iBL1hLrH//SW7x3sLW58coLa+DSx88mFoxSabwOlu/ih4i6gJ8cxUMpKcBe+EU9DMHu qk7U1m29e86TkNlMYLN/mZYkK8CReebkcaM3g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=MMH10gqobMQfuNFsnx7dRPlDLbCK5A5nedYiXSB65v6JUvCGEx0Orw1gFMMSub+F0g 6RK6gZB5xtsV9+YzyzhCvX6dLVJSs3ZXLKtlu7/EvX8pebmLFPrWrScdI5nLmnI5i7jh Lrgw0uyhosBQ9tAEertBBZbOfHEifZUIQnXcE= Received: by 10.239.134.72 with SMTP id 8mr393946hby.0.1272285161099; Mon, 26 Apr 2010 05:32:41 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Mon, 26 Apr 2010 05:32:21 -0700 (PDT) In-Reply-To: <20100426120155.5b39532c@gumby.homeunix.com> References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> <20100422111758.GA39338@ei.bzerk.org> <4BD07F2D.3030809@FreeBSD.org> <4BD07FCB.4030604@FreeBSD.org> <20100426120155.5b39532c@gumby.homeunix.com> From: Eitan Adler Date: Mon, 26 Apr 2010 15:32:21 +0300 Message-ID: To: RW Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: regenerating /var/db/pkg 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, 26 Apr 2010 12:32:50 -0000 On Mon, Apr 26, 2010 at 2:01 PM, RW wrote: > On Thu, 22 Apr 2010 20:05:48 +0300 > Eitan Adler wrote: > >> bak=/var/backups > > This should be configurable IMO. This currently isn't configurable in 210.backup-aliases which is where I copied this from. I'm going to submit a *separate* PR with an enhancement allowing configuration of the backup location. If accepted I'll update my 220.backup.pkgdb script. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 17:59:36 2010 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 381D91065670 for ; Mon, 26 Apr 2010 17:59:36 +0000 (UTC) (envelope-from eirnym@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id B943D8FC0C for ; Mon, 26 Apr 2010 17:59:35 +0000 (UTC) Received: by ewy24 with SMTP id 24so3671042ewy.33 for ; Mon, 26 Apr 2010 10:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:cc:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:subject :mime-version:date:references:x-mailer; bh=PtrYDLU4t55brNv07T3BLzn/ROCgF2tro+bTbB5N+OE=; b=ux8/3vQh7MNP6fhBinMAWodmY4LvXMCiq/+c+DVIhII28GjbJacxLfom96ngJUzVzc O2u1mI8++czKbGfdu7hc1azTx4FqQLEH7Etm7gTK98H+2HCcC3xU8ZkMk9377CFHRCYc 6rrCzOLZObHFac/uDR0O6TVMAHRjkYNN76syU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:subject:mime-version:date:references :x-mailer; b=ZU6q6xwrg7a305WtapFEPKTO3l86LgYvaXyREzzbzHv851Nj+3QI+r59NHyxA6BS8Z c1tkn0CxUK3NPakRsyStyjXOZToXloaLbjdBe7Krboz8ii+qRebBVJPE3w7ZgJ5nrZTy XS/gxuAitM3pjsmH/Kc0ISXM5B+KugNwuttXk= Received: by 10.103.80.25 with SMTP id h25mr2496060mul.60.1272303377065; Mon, 26 Apr 2010 10:36:17 -0700 (PDT) Received: from [10.0.0.1] ([77.41.31.122]) by mx.google.com with ESMTPS id i5sm18246077mue.49.2010.04.26.10.36.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 10:36:16 -0700 (PDT) Message-Id: From: Arseny Nasokin To: Pegasus Mc Cleaft In-Reply-To: <201004241642.38017.ken@mthelicon.com> Content-Type: text/plain; charset=windows-1251; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (iPhone Mail 7E18) Date: Mon, 26 Apr 2010 01:42:22 +0400 References: <201004241642.38017.ken@mthelicon.com> X-Mailer: iPhone Mail (7E18) X-Mailman-Approved-At: Mon, 26 Apr 2010 18:03:21 +0000 Cc: "freebsd-hackers@freebsd.org" , "freebsd-current@freebsd.org" Subject: Re: kern+world / ports make options 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, 26 Apr 2010 17:59:36 -0000 On 24 Apr 2010, at 20:42, Pegasus Mc Cleaft wrote: > Hello Hackers & Current, > > I was wondering it if is possible, or if it can be done so a =20 > separate set > of CC, CXX, etc can be specified for building the world and kernel > independently of a ports build? > > Right now, I use the base GCC to compile the world and kernel, =20 > and GCC44 > for most of the other ports (when it complies cleanly). But I have =20 > to keep > editing the /etc/make.conf file to switch between the two. > > It may already be implemented, but it would be nice if there was > something defined while the kernel and/or world is being built to =20 > that a > nested block of ifdefs can select which env variables to be set. > # make toolchain buildworld buildkernel =85 This forces build core gcc and others to build world & kernel > Peg > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to = "freebsd-current-unsubscribe@freebsd.org=20 > " From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 18:03:34 2010 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 F0791106564A for ; Mon, 26 Apr 2010 18:03:34 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.25]) by mx1.freebsd.org (Postfix) with ESMTP id 87DD08FC26 for ; Mon, 26 Apr 2010 18:03:34 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id d26so821539eyd.9 for ; Mon, 26 Apr 2010 11:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=uFN6vP8CjQMb6XID4sSA0bnMNBZe5AYRW3PetoG31uo=; b=xYU+nWhEnK8HYLUwWQGgL8N46XUvQ5li7AtdmIsjKvhop3k7gch4Cqfa1uuwcdIwBL 1MIWgVF+xCdb41arNV/xfBa7v3UQs7L+SAxoOkh9HjPwqQlBFfupYK0QOdoJLfi/s5WN leZOcdDyMWYXnLcooghBgvsiB+XcptR0ZY8eo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=JGSqXRUdx7xFfe4mqV+FYxzH6QeG7u11VPw8gMQdm3RmYsPKI5DW0SIQ3ARkEGKOOC HjTnFk3jUWFuOA3xIdYTPfcXd/QFhV6jZBLZrktjIcjw/xEjacSevmoG2SS579kYm4/U VIQvoNtie5/TyFYjWit/H+6LkKjHx9mUoiXuQ= Received: by 10.239.182.204 with SMTP id r12mr399263hbg.193.1272305010821; Mon, 26 Apr 2010 11:03:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Mon, 26 Apr 2010 10:57:31 -0700 (PDT) From: Eitan Adler Date: Mon, 26 Apr 2010 20:57:31 +0300 Message-ID: To: FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 Subject: [patch] [RFC] pathchk quiet flag 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, 26 Apr 2010 18:03:35 -0000 This path adds a -q flag to stop pathchk from outputting error messages but still return an error code. Index: pathchk.c =================================================================== --- pathchk.c (revision 207232) +++ pathchk.c (working copy) @@ -51,18 +51,20 @@ static void usage(void); static int pflag; /* Perform portability checks */ - -int +static int qflag = 0; /* stop pathchk from talking */ main(int argc, char *argv[]) { int ch, rval; const char *arg; - while ((ch = getopt(argc, argv, "p")) > 0) { + while ((ch = getopt(argc, argv, "pq")) > 0) { switch (ch) { case 'p': pflag = 1; break; + case 'q': + qflag = 1; + break; default: usage(); /*NOTREACHED*/ @@ -85,7 +87,7 @@ usage(void) { - fprintf(stderr, "usage: pathchk [-p] pathname ...\n"); + fprintf(stderr, "usage: pathchk [-qp] pathname ...\n"); exit(1); } @@ -118,20 +120,29 @@ *end = '\0'; if (namemax != -1 && complen > namemax) { - warnx("%s: %s: component too long (limit %ld)", path, - p, namemax); + if (!qflag) + { + warnx("%s: %s: component too long (limit %ld)", path, + p, namemax); + } goto bad; } if (!pflag && stat(pathd, &sb) == -1 && errno != ENOENT) { - warn("%s: %.*s", path, (int)(strlen(pathd) - - complen - 1), pathd); + if (!qflag) + { + warn("%s: %.*s", path, (int)(strlen(pathd) - + complen - 1), pathd); + } goto bad; } if (pflag && (badch = portable(p)) >= 0) { - warnx("%s: %s: component contains non-portable " - "character `%c'", path, p, badch); + if (!qflag) + { + warnx("%s: %s: component contains non-portable " + "character `%c'", path, p, badch); + } goto bad; } @@ -158,7 +169,10 @@ } else pathmax = _POSIX_PATH_MAX; if (pathmax != -1 && strlen(path) >= (size_t)pathmax) { - warnx("%s: path too long (limit %ld)", path, pathmax - 1); + if (!qflag) + { + warnx("%s: path too long (limit %ld)", path, pathmax - 1); + } goto bad; } From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 21:33:49 2010 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 B9FE11065676 for ; Mon, 26 Apr 2010 21:33:49 +0000 (UTC) (envelope-from lgj@usenix.org) Received: from lonestar.usenix.org (lonestar.usenix.org [131.106.3.102]) by mx1.freebsd.org (Postfix) with ESMTP id 88CC48FC0A for ; Mon, 26 Apr 2010 21:33:49 +0000 (UTC) Received: from vesper.usenix.org (vesper.usenix.org [131.106.3.142]) by lonestar.usenix.org (8.14.2/8.14.2) with ESMTP id o3QLWF8u007443 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 26 Apr 2010 14:33:49 -0700 (PDT) Message-Id: From: Lionel Garth Jones To: freebsd-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 v936) Date: Mon, 26 Apr 2010 14:33:49 -0700 X-Mailer: Apple Mail (2.936) X-DCC-Usenix-Metrics: lonestar; whitelist X-Spam-Status: No, score=0.7 required=6.0 tests=ALL_TRUSTED, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on lonestar X-Mailman-Approved-At: Mon, 26 Apr 2010 21:42:15 +0000 Subject: Reminder: USENIX OSDI Submission Deadline is May 7 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, 26 Apr 2010 21:33:49 -0000 We're writing to remind you that the submission deadline for the 9th USENIX Symposium on Operating Systems Design and Implementation (OSDI '10) is approaching. Please submit your work by Friday, May 7, 2010, 9:00 p.m. PDT. Please note: The page limit for submissions is 12 pages not including references. http://www.usenix.org/osdi10/cfpb/ OSDI brings together professionals from academic and industrial backgrounds in what has become a premier forum for discussing the design, implementation, and implications of systems software. The OSDI Symposium emphasizes innovative research as well as quantified or insightful experiences in systems design and implementation. OSDI takes a broad view of the systems area and solicits contributions from many fields of systems practice, including, but not limited to: * Operating systems * File and storage systems * Distributed systems * Mobile systems * Secure systems * Embedded systems * Virtualization * Networking as it relates to operating systems * The interaction of hardware and software development We particularly encourage contributions containing highly original ideas, new approaches, and/or groundbreaking results. Submissions will be judged on originality, significance, interest, clarity, relevance, and correctness. Accepted papers will be shepherded through an editorial review process by a member of the program committee. For more details on the submission process, please see the complete Call for Papers at: http://www.usenix.org/osdi10/cfpb/ We look forward to receiving your submissions! Remzi Arpaci-Dusseau, University of Wisconsin, Madison Brad Chen, Google, Inc. OSDI '10 Program Co-Chairs osdi10chairs@usenix.org --------------------------------- Call for Papers 9th USENIX Symposium on Operating Systems Design and Implementation October 4-6, 2010 Vancouver, BC, Canada http://www.usenix.org/osdi10/cfpb/ Submissions Deadline: May 7, 2010 Sponsored by USENIX in cooperation with ACM SIGOPS --------------------------------- From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 22:18:06 2010 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 A9D23106566C for ; Mon, 26 Apr 2010 22:18:06 +0000 (UTC) (envelope-from stephen.hocking@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 82B648FC1F for ; Mon, 26 Apr 2010 22:18:06 +0000 (UTC) Received: by pwi9 with SMTP id 9so9052831pwi.13 for ; Mon, 26 Apr 2010 15:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type:content-transfer-encoding; bh=ecdp1uRhPEItCpg1QPcFjRbPzwa43yh2fzxoioY2+xE=; b=oMSzBhE3MJ+FG2kuqIMNcpMoFZCa0Hn5n5SMJuFMAEItz9bVVP+B49kHBZ1HklmDyM 2YQLjGLC63spCVCtaQI8cbe0kOCz5SChR0h+s0zmgwPcdrTcK0cfIRN8zRxITZPntnbk +E8EQyJHQL9XPW+2PZKTu3HaRpLghlZZuDTeA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=La0hpcnUJuI1jW1GdFCCSndKrBhlx9FQxT05UM9fN6brG2buEREUOiBQ1c7abWcqDa pgoRH0Lpbd3/0o6XTtMHWbKfy8Xdp9+9+Bv9vbnWweGr2hpNoyTjCYZEeWQWGfHrvwlj jmNUVvkH5m5+a5Od/MV17Rw5UmPjszbpn184M= MIME-Version: 1.0 Received: by 10.141.90.1 with SMTP id s1mr4653745rvl.57.1272318880890; Mon, 26 Apr 2010 14:54:40 -0700 (PDT) Received: by 10.140.127.6 with HTTP; Mon, 26 Apr 2010 14:54:40 -0700 (PDT) Date: Tue, 27 Apr 2010 07:54:40 +1000 Message-ID: From: Stephen Hocking To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Building kernels broken under AMD64 Releng 8 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, 26 Apr 2010 22:18:06 -0000 Hi all, Am noticing the following when attempting to build a kernel: [root@blurfl /usr/src]# make buildkernel -------------------------------------------------------------- >>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST 2010 -------------------------------------------------------------- =3D=3D=3D> GENERIC mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys -------------------------------------------------------------- >>> stage 1: configuring the kernel -------------------------------------------------------------- cd /src/FreeBSD/STABLE/src/sys/amd64/conf; PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/obj/src/Free= BSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABLE/src/tmp/legacy= /usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:/usr/obj/src/FreeBSD= /STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/src/tmp/usr/games:/sbin:= /bin:/usr/sbin:/usr/bin config -d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. *** Error code 1 Stop in /src/FreeBSD/STABLE/src. *** Error code 1 Stop in /src/FreeBSD/STABLE/src. Any clues? I believe it's related to the COMPAT_IA32 option being replaced (I haven't built a kernel since the beginning of the month). Stephen From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 23:13:49 2010 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 870A2106564A; Mon, 26 Apr 2010 23:13:49 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 2BE618FC13; Mon, 26 Apr 2010 23:13:48 +0000 (UTC) Received: by qyk11 with SMTP id 11so15689372qyk.13 for ; Mon, 26 Apr 2010 16:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dYOwGZvf0mViJd5Djln0E6qnihcD6GkNfS2Mtd03+mM=; b=a/3IZz8sU6GWwVbc0V5eqPLEYrlzFvLPQ8b7YBI7F4UcPbk60cp6LZicmbTZNp15aJ Nm8ukYq10QxSl3VNUWVp7wwYwCFxzy/RI2BwkY92q8wR3ZSgP4KWoQcxCAzRDKqjsTnw 9VnLe3qw9vXAD60dXZ9jcjo2/qgbvc8/RQnXE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=HNxzQibx2qgnCVYYo3u4NOuFcxAi/C0Brhjf7/4H4dwRJdwCRnEme4iDhPrkiUl1/p HzsvsUIvA5Mzr9XrTDvckhn111FBZBZLYZfKUDjhvge6s6XSE9+js0RrkmeXtzhftGpW QjhvQhK/QmqbkClgvOiFNwarqv/ITCrStlrN4= MIME-Version: 1.0 Received: by 10.229.96.82 with SMTP id g18mr5735837qcn.82.1272323619936; Mon, 26 Apr 2010 16:13:39 -0700 (PDT) Received: by 10.229.233.11 with HTTP; Mon, 26 Apr 2010 16:13:39 -0700 (PDT) In-Reply-To: References: Date: Mon, 26 Apr 2010 16:13:39 -0700 Message-ID: From: Garrett Cooper To: Stephen Hocking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org, Warner Losh Subject: Re: Building kernels broken under AMD64 Releng 8 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, 26 Apr 2010 23:13:49 -0000 On Mon, Apr 26, 2010 at 2:54 PM, Stephen Hocking wrote: > Hi all, > > Am noticing the following when attempting to build a kernel: > > [root@blurfl /usr/src]# make buildkernel > > -------------------------------------------------------------- >>>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST 2010 > -------------------------------------------------------------- > =3D=3D=3D> GENERIC > mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys > > -------------------------------------------------------------- >>>> stage 1: configuring the kernel > -------------------------------------------------------------- > cd /src/FreeBSD/STABLE/src/sys/amd64/conf; > PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/obj/src/Fr= eeBSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABLE/src/tmp/lega= cy/usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:/usr/obj/src/FreeB= SD/STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/src/tmp/usr/games:/sbi= n:/bin:/usr/sbin:/usr/bin > =A0config =A0-d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC > /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. > *** Error code 1 > > Stop in /src/FreeBSD/STABLE/src. > *** Error code 1 > > Stop in /src/FreeBSD/STABLE/src. > > > Any clues? I believe it's related to the COMPAT_IA32 option being > replaced (I haven't built a kernel since the beginning of the month). This was reported approximately a week ago and Warner (imp@) was made aware of the problem, and fixed the issue in a later revision of 8-STABLE I think. Please see: http://lists.freebsd.org/pipermail/svn-src-all/2010-April/022969.html for more details. Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 23:28:09 2010 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 36816106566B for ; Mon, 26 Apr 2010 23:28:09 +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 CF6BB8FC16 for ; Mon, 26 Apr 2010 23:28:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3QNJjbD063755; Mon, 26 Apr 2010 17:19:46 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 26 Apr 2010 17:19:56 -0600 (MDT) Message-Id: <20100426.171956.431102609571762985.imp@bsdimp.com> To: yanefbsd@gmail.com From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: stephen.hocking@gmail.com, hackers@FreeBSD.org Subject: Re: Building kernels broken under AMD64 Releng 8 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, 26 Apr 2010 23:28:09 -0000 In message: Garrett Cooper writes: : On Mon, Apr 26, 2010 at 2:54 PM, Stephen Hocking : wrote: : > Hi all, : > : > Am noticing the following when attempting to build a kernel: : > : > [root@blurfl /usr/src]# make buildkernel : > : > -------------------------------------------------------------- : >>>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST 2010= : > -------------------------------------------------------------- : > =3D=3D=3D> GENERIC : > mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys : > : > -------------------------------------------------------------- : >>>> stage 1: configuring the kernel : > -------------------------------------------------------------- : > cd /src/FreeBSD/STABLE/src/sys/amd64/conf; : > PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/obj/= src/FreeBSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABLE/sr= c/tmp/legacy/usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:/usr= /obj/src/FreeBSD/STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/src/= tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin : > =A0config =A0-d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC : > /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC : > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. : > *** Error code 1 : > : > Stop in /src/FreeBSD/STABLE/src. : > *** Error code 1 : > : > Stop in /src/FreeBSD/STABLE/src. : > : > : > Any clues? I believe it's related to the COMPAT_IA32 option being : > replaced (I haven't built a kernel since the beginning of the month= ). : = : This was reported approximately a week ago and Warner (imp@) was : made aware of the problem, and fixed the issue in a later revision of= : 8-STABLE I think. Please see: : http://lists.freebsd.org/pipermail/svn-src-all/2010-April/022969.html= : for more details. You always have to rebuild world before rebuilding the kernel. You often can get away with not doing that, but not aways. I'm adding a safety belt to config, and that should be done soon. Warner From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 26 23:51:05 2010 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 475121065675 for ; Mon, 26 Apr 2010 23:51:05 +0000 (UTC) (envelope-from stephen.hocking@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1B4398FC15 for ; Mon, 26 Apr 2010 23:51:04 +0000 (UTC) Received: by pwi9 with SMTP id 9so9095855pwi.13 for ; Mon, 26 Apr 2010 16:51:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=5mHyG/vSEKayLJ1rm2EjKgpLCLtZ3JWavJihBcrSk9E=; b=G0Xx8Scw2JPewtyGHJomCRPZNYIJM7Oj4GTou29mHReo4VaPDKcyLNjB2nN+KJXy8p ncmoqWp6G8zKwrbdHZT2qSqluxQAdB2oPHuFTrrPMV8XGkYEpS8VZYvMDP77p+nKlDHd hsu27TCMpxhd+ZRphZbVvFc2eZPrFhs6Z7SCg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Ubp6c5fx4f9ewCEkC28iJa81Sc+IME6Jbsyo+KO7lN/E0rnB99vTxtw3qAwm+f1qA7 mvyKgToicWrxxA+WHE+L2efcvpnOaK8ySAcaxqDBnRtgGdSCWYWzJj6ZTrTgWiV8r86U KlnQ1M79ntbKCGuQRXZB4wHCa3TQsBssj/vYk= MIME-Version: 1.0 Received: by 10.141.188.24 with SMTP id q24mr159664rvp.0.1272325860528; Mon, 26 Apr 2010 16:51:00 -0700 (PDT) Received: by 10.140.127.6 with HTTP; Mon, 26 Apr 2010 16:51:00 -0700 (PDT) In-Reply-To: <20100426.171956.431102609571762985.imp@bsdimp.com> References: <20100426.171956.431102609571762985.imp@bsdimp.com> Date: Tue, 27 Apr 2010 09:51:00 +1000 Message-ID: From: Stephen Hocking To: "M. Warner Losh" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: yanefbsd@gmail.com, hackers@freebsd.org Subject: Re: Building kernels broken under AMD64 Releng 8 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, 26 Apr 2010 23:51:05 -0000 On Tue, Apr 27, 2010 at 9:19 AM, M. Warner Losh wrote: > In message: > =A0 =A0 =A0 =A0 =A0 =A0Garrett Cooper writes: > : On Mon, Apr 26, 2010 at 2:54 PM, Stephen Hocking > : wrote: > : > Hi all, > : > > : > Am noticing the following when attempting to build a kernel: > : > > : > [root@blurfl /usr/src]# make buildkernel > : > > : > -------------------------------------------------------------- > : >>>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST 2010 > : > -------------------------------------------------------------- > : > =3D=3D=3D> GENERIC > : > mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys > : > > : > -------------------------------------------------------------- > : >>>> stage 1: configuring the kernel > : > -------------------------------------------------------------- > : > cd /src/FreeBSD/STABLE/src/sys/amd64/conf; > : > PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/obj/sr= c/FreeBSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABLE/src/tmp/= legacy/usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:/usr/obj/src/F= reeBSD/STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/src/tmp/usr/games:= /sbin:/bin:/usr/sbin:/usr/bin > : > =A0config =A0-d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC > : > /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC > : > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. > : > *** Error code 1 > : > > : > Stop in /src/FreeBSD/STABLE/src. > : > *** Error code 1 > : > > : > Stop in /src/FreeBSD/STABLE/src. > : > > : > > : > Any clues? I believe it's related to the COMPAT_IA32 option being > : > replaced (I haven't built a kernel since the beginning of the month). > : > : =A0 =A0 This was reported approximately a week ago and Warner (imp@) wa= s > : made aware of the problem, and fixed the issue in a later revision of > : 8-STABLE I think. Please see: > : http://lists.freebsd.org/pipermail/svn-src-all/2010-April/022969.html > : for more details. > > You always have to rebuild world before rebuilding the kernel. =A0You > often can get away with not doing that, but not aways. > > I'm adding a safety belt to config, and that should be done soon. > OK, thanks - wasn't immediately clear. Now, one should usually do an installkernel prior to an installworld, in case system calls change, is this correct? Stephen From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 00:57:03 2010 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 8975C10656BA for ; Tue, 27 Apr 2010 00:57:03 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3978FC08 for ; Tue, 27 Apr 2010 00:57:02 +0000 (UTC) Received: by qyk11 with SMTP id 11so15811189qyk.13 for ; Mon, 26 Apr 2010 17:56:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uuH7Zsg78EtVw8e0IZRlrV5ZiQURGB1DA6842FO3Djs=; b=N5K9llc41NZIQKaFZupBMjiF+wey3YrnT6y+FWwq8/F2UF6WGi4bgorgjY/9TOakRP +OTykjJ1TSM5hnsC8fPFrtgFuKZCilBsHGpAuVjdhMYYAFmQWYeq8bxg/RXt3CP5G7Fa WtSNSFjpC7rUcIaAKIDX/nRvZE/FTE4+suF4w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=NSnd0HJX09bnE3sBT8LX3+TE2w5P00Dmwne7HQTUCWzkE/N/govg9KKckGZ4j2hbr2 JOXhHCyMXVAiAjfrHc10b5FlIJFYl9iIs7lcMA1Ecw4wGwk1W/irJYzY/X3peh1fsSOp NxRkPfa2R/L4JIdW4xtaG4e/1pzYpnNztHbOo= MIME-Version: 1.0 Received: by 10.229.234.68 with SMTP id kb4mr6084477qcb.103.1272329813798; Mon, 26 Apr 2010 17:56:53 -0700 (PDT) Received: by 10.229.233.11 with HTTP; Mon, 26 Apr 2010 17:56:53 -0700 (PDT) In-Reply-To: References: <20100426.171956.431102609571762985.imp@bsdimp.com> Date: Mon, 26 Apr 2010 17:56:53 -0700 Message-ID: From: Garrett Cooper To: Stephen Hocking Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: hackers@freebsd.org Subject: Re: Building kernels broken under AMD64 Releng 8 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, 27 Apr 2010 00:57:03 -0000 On Mon, Apr 26, 2010 at 4:51 PM, Stephen Hocking wrote: > On Tue, Apr 27, 2010 at 9:19 AM, M. Warner Losh wrote: >> In message: >> =A0 =A0 =A0 =A0 =A0 =A0Garrett Cooper writes: >> : On Mon, Apr 26, 2010 at 2:54 PM, Stephen Hocking >> : wrote: >> : > Hi all, >> : > >> : > Am noticing the following when attempting to build a kernel: >> : > >> : > [root@blurfl /usr/src]# make buildkernel >> : > >> : > -------------------------------------------------------------- >> : >>>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST 2010 >> : > -------------------------------------------------------------- >> : > =3D=3D=3D> GENERIC >> : > mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys >> : > >> : > -------------------------------------------------------------- >> : >>>> stage 1: configuring the kernel >> : > -------------------------------------------------------------- >> : > cd /src/FreeBSD/STABLE/src/sys/amd64/conf; >> : > PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/obj/s= rc/FreeBSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABLE/src/tmp= /legacy/usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:/usr/obj/src/= FreeBSD/STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/src/tmp/usr/games= :/sbin:/bin:/usr/sbin:/usr/bin >> : > =A0config =A0-d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC >> : > /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC >> : > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. >> : > *** Error code 1 >> : > >> : > Stop in /src/FreeBSD/STABLE/src. >> : > *** Error code 1 >> : > >> : > Stop in /src/FreeBSD/STABLE/src. >> : > >> : > >> : > Any clues? I believe it's related to the COMPAT_IA32 option being >> : > replaced (I haven't built a kernel since the beginning of the month)= . >> : >> : =A0 =A0 This was reported approximately a week ago and Warner (imp@) w= as >> : made aware of the problem, and fixed the issue in a later revision of >> : 8-STABLE I think. Please see: >> : http://lists.freebsd.org/pipermail/svn-src-all/2010-April/022969.html >> : for more details. >> >> You always have to rebuild world before rebuilding the kernel. =A0You >> often can get away with not doing that, but not aways. >> >> I'm adding a safety belt to config, and that should be done soon. >> > > OK, thanks - wasn't immediately clear. Now, one should usually do an > installkernel prior to an installworld, in case system calls change, > is this correct? Wouldn't kernel-toolchain accomplish the same thing? Thanks, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 02:07:48 2010 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 5D1FD106570D for ; Tue, 27 Apr 2010 02:07:48 +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 10DA48FC19 for ; Tue, 27 Apr 2010 02:07:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o3R23HWc065191; Mon, 26 Apr 2010 20:03:17 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Mon, 26 Apr 2010 20:03:27 -0600 (MDT) Message-Id: <20100426.200327.10150326159295013.imp@bsdimp.com> To: stephen.hocking@gmail.com From: "M. Warner Losh" In-Reply-To: References: <20100426.171956.431102609571762985.imp@bsdimp.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: yanefbsd@gmail.com, hackers@FreeBSD.org Subject: Re: Building kernels broken under AMD64 Releng 8 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, 27 Apr 2010 02:07:48 -0000 In message: Stephen Hocking writes: : On Tue, Apr 27, 2010 at 9:19 AM, M. Warner Losh wrot= e: : > In message: : > =A0 =A0 =A0 =A0 =A0 =A0Garrett Cooper writes: : > : On Mon, Apr 26, 2010 at 2:54 PM, Stephen Hocking : > : wrote: : > : > Hi all, : > : > : > : > Am noticing the following when attempting to build a kernel: : > : > : > : > [root@blurfl /usr/src]# make buildkernel : > : > : > : > -------------------------------------------------------------- : > : >>>> Kernel build for GENERIC started on Tue Apr 27 07:53:29 EST = 2010 : > : > -------------------------------------------------------------- : > : > =3D=3D=3D> GENERIC : > : > mkdir -p /usr/obj/src/FreeBSD/STABLE/src/sys : > : > : > : > -------------------------------------------------------------- : > : >>>> stage 1: configuring the kernel : > : > -------------------------------------------------------------- : > : > cd /src/FreeBSD/STABLE/src/sys/amd64/conf; : > : > PATH=3D/usr/obj/src/FreeBSD/STABLE/sr/tmp/legacy/usr/sbin:/usr/= obj/src/FreeBSD/STABLE/src/tmp/legacy/usr/bin:/usr/ob/src/FreeBSD/STABL= E/src/tmp/legacy/usr/games:/usr/obj/src/FreeBSD/STABLE/src/tm/usr/sbin:= /usr/obj/src/FreeBSD/STABLE/src/tmp/usr/bin:/usr/obj/src/FreeBSD/STABE/= src/tmp/usr/games:/sbin:/bin:/usr/sbin:/usr/bin : > : > =A0config =A0-d /usr/obj/src/FreeSD/STABLE/src/sys/GENERIC : > : > /src/FreeBSD/STABLE/src/sys/amd64/conf/GENERIC : > : > ../../conf/options.amd64: Duplicate option COMPAT_FREEBSD32. : > : > *** Error code 1 : > : > : > : > Stop in /src/FreeBSD/STABLE/src. : > : > *** Error code 1 : > : > : > : > Stop in /src/FreeBSD/STABLE/src. : > : > : > : > : > : > Any clues? I believe it's related to the COMPAT_IA32 option bei= ng : > : > replaced (I haven't built a kernel since the beginning of the m= onth). : > : : > : =A0 =A0 This was reported approximately a week ago and Warner (im= p@) was : > : made aware of the problem, and fixed the issue in a later revisio= n of : > : 8-STABLE I think. Please see: : > : http://lists.freebsd.org/pipermail/svn-src-all/2010-April/022969.= html : > : for more details. : > : > You always have to rebuild world before rebuilding the kernel. =A0Y= ou : > often can get away with not doing that, but not aways. : > : > I'm adding a safety belt to config, and that should be done soon. : > : = : OK, thanks - wasn't immediately clear. Now, one should usually do an : installkernel prior to an installworld, in case system calls change, : is this correct? Yes. installkernel, reboot, installworld. For stable branches, the rate of new system call addition is slow, so you can sometimes get away with not doing the reboot. But when it fails, it can leave your system unbootable. Warner From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 10:59:01 2010 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 C0280106566C for ; Tue, 27 Apr 2010 10:59:01 +0000 (UTC) (envelope-from gleb.kurtsou@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id 48B448FC13 for ; Tue, 27 Apr 2010 10:59:00 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so2160982fge.13 for ; Tue, 27 Apr 2010 03:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=BAT+oBei8w7+bCkMIQ4w6uedLsJEo3bHIDO4hZheBYQ=; b=vecnYtTHqi6Y9MzEOZWtU8ut4pQxKKtu2Z00w8lUa+Zsu+3PzVHeHxzQQxHe+tKI+l irFQurLd4xmRa6yUBPSAfdSRb6TR6EJMdiVode9PZTe/MPrhje7XQc1jJZGRQVfoWPMF kgw+IKE2fESqatzST3gjlnk1W57KvhluHz3I8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=YY6Tg9GLceNYVMmZBaYFHjqDeeqbot6xE82msLuytLOEc7vyF3f7g6xBmTr8dkSMXv lNDZDdh8g+izYYX5YHUv1x80n9q3Ilt9iFgruR4g+z+0QBJP+cnWVasLFPgstu4dCTS+ p2jDu25c/ldj8aa5/+ANfnKhAX677u6lVC/GA= Received: by 10.87.63.21 with SMTP id q21mr5161246fgk.52.1272365934903; Tue, 27 Apr 2010 03:58:54 -0700 (PDT) Received: from localhost ([91.187.8.184]) by mx.google.com with ESMTPS id 28sm5145871fkx.6.2010.04.27.03.58.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Apr 2010 03:58:53 -0700 (PDT) Date: Tue, 27 Apr 2010 13:58:48 +0300 From: Gleb Kurtsou To: =?utf-8?B?THVrw6HFoQ==?= Czerner Message-ID: <20100427105848.GA2003@tops> References: <20100422191849.GA9895@tops> <20100423092257.GA2446@tops> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-hackers@freebsd.org Subject: Re: How to change vnode operations ? 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, 27 Apr 2010 10:59:01 -0000 On (24/04/2010 12:26), Lukáš Czerner wrote: > On Fri, 23 Apr 2010, Gleb Kurtsou wrote: > > > Date: Fri, 23 Apr 2010 12:22:57 +0300 > > From: Gleb Kurtsou > > To: Lukáš Czerner > > Cc: freebsd-hackers@freebsd.org > > Subject: Re: How to change vnode operations ? > > > > On (23/04/2010 08:10), Lukáš Czerner wrote: > > > On Thu, 22 Apr 2010, Gleb Kurtsou wrote: > > > > > > > Date: Thu, 22 Apr 2010 22:18:49 +0300 > > > > From: Gleb Kurtsou > > > > To: Lukáš Czerner > > > > Cc: freebsd-hackers@freebsd.org > > > > Subject: Re: How to change vnode operations ? > > > > > > > > On (22/04/2010 16:02), Lukáš Czerner wrote: > > > > > Hi all, > > > > > > > > > > this may sound a little odd, since I have noticed that there is much > > > > > work done to not allow such a thing ($SUBJ). But may be you can help > > > > > me and point me to the right direction. > > > > > > > > > > I am writing a kernel module with somewhat similar functionality > > > > > like nullfs has, BUT it has to have some features which nullfs > > > > > itself does not provide : > > > > > > > > > > 1. I need the new layer to completely hide underlaying layer so no > > > > > one can bypass it. > > > > Is hypothetic 'mount -t mynullfs /a /a' good enough for you? I'm not sure > > > > what your goals are but completely finding underlaying filesystem won't > > > > be easy because of VFS_GET, getfh and other stuff operating with inode > > > > numbers. > > > > > > Well, it may be good enough, or not. Thats what I am trying to find > > > out. Obviously there are problems, as you mentioned, which will not > > > exist when I change the vop_vector of the vnode, but as I thought > > > and you mentioned it as well, this is not very clean way. > > Why don't you like stacked filesystem approach? It's designed to solve > > the problem you are describing if I get it right. Although creating > > pefs-like filesystem altering data and names is not so easy within > > existing framework. > > > > > > > 2. Nullfs allows me to to overlay just one directory, but i want to > > > > > include another directories and/or exclude subdirectories/files. > > > > > 3. Nullfs just redirects vnode operations to lower layer, I need to > > > > > catch that operation, do something (for example alter the arguments > > > > > somehow etc..), pass the operation (with possibly altered arguments) > > > > > to the lower layer, get the result and then return the result. > > > > I'd suggest to take a look at pefs: http://github.com/glk/pefs > > > > It's cryptographic stacked filesystem for FreeBSD. It changes file > > > > names, hides directory entries, modifies data from lower layer > > > > (encrypts or decrypts), supports mounting on same directory, etc. > > > > > > Thats great, thanks! I will look at it. > > > > > > > > > > > > The best way to do that (I think) is to change vnode operations of > > > > > particular vnodes to point to functions defined in that module. At > > > > > this point, I can catch any operations with the vnode and this is > > > > > the base of what i want. > > > > > > > > > > So my question is. I there any "clean" way to chande vnode > > > > > operations ? If not, is there any "not so clean" way ? Anyway I will > > > > > appreciate any good idea how to do what I have described. > > > > Imho, stacked filesystem is the only right way to do it (see null, > > > > unionfs, pefs). > > > > > > OK. Thanks for pointing me to the pefs, it is interesting and looks > > > like a good start. But I would appreciate more comment on the side > > > of the whole idea about changing vnode operations from the kernel > > > module. It is a little hacky, but aside this I do not see any bigger > > > problems, do you ? > > Changing vop_vector is too hackish for me. Basically, changing vnode > > operations is what stacked filesystems are about. Vnode operations are > > the top of the problem, you would also have to deal with parent lookup, > > namecache consistency and buffering, which is going to be complicated. > > I.e. you'd have to partially reimplement part of VFS layer. > > > > nullfs and unionfs pass vnode vobject (buffering layer) from lower > > layer, adding your own vobject to vnode would complicate filesystem > > significantly. Besides you won't be able to assign 2 vobjects (original > > and your own) to a single vnode if you decide to change operations > > vector. > > This is exactly how I feel about it and I am glad that you actually > confirm that, so thank you. Now I am convinced to use stacked > filesystem. > > But I have one last question, though. It may be stupid, but when I > am looking at your pefs I can not figure out how you manage to mount > directory above itself. I am staring at the code and just do not see > that. It seems to me, like the check is done before the > {pefs|nullfs}_mount is even called. Can you point me out to the > right direction ? It's nullfs that forbids it. VFS is fine about mounting on top of the same directory. As far as I remember lower vnode should be unlocked to prevent locking against itself and pefs_lock and pefs_unlock had to be adjusted to support it. Do not remember specifics, sorry. I do 'pefs mount /home/gleb /home/gleb' since October, it works for me. > > Thanks again! > -Lukas. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 15:02:34 2010 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 D159C1065672 for ; Tue, 27 Apr 2010 15:02:34 +0000 (UTC) (envelope-from ozawa@t-oza.net) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 75BC48FC29 for ; Tue, 27 Apr 2010 15:02:33 +0000 (UTC) Received: by wyb34 with SMTP id 34so314433wyb.13 for ; Tue, 27 Apr 2010 08:02:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.87.74 with SMTP id x52mr494086wee.4.1272380546309; Tue, 27 Apr 2010 08:02:26 -0700 (PDT) Sender: ozawa@t-oza.net Received: by 10.216.135.135 with HTTP; Tue, 27 Apr 2010 08:02:25 -0700 (PDT) X-Originating-IP: [61.26.205.33] Date: Tue, 27 Apr 2010 07:02:25 -0800 X-Google-Sender-Auth: b1d092595cf64a7a Message-ID: From: Tsuyoshi Ozawa To: freebsd-hackers Content-Type: text/plain; charset=ISO-8859-1 Subject: [PATCH v2] Dynamic tick support 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, 27 Apr 2010 15:02:34 -0000 Hello, I'd like you to review dynticks v2 patch for FreeBSD 8.0. http://gist.github.com/380820 This v2 patch to add dynamic tick support can switch its tick mode automatically. Switch from pertick mode to dyntick mode before cpu_idle() is called in sched_idled. Doing this reduces needless tick. After being called cpu_idle(), switch its mode vice versa. By taking on this algorithm, I think I can eliminate the need for modifiying callout queue operation - callout_reset() and callout_delete(). When CPU is idle, callout queue ops may not be called, because no process is on the CPU. As the result, no ciritical section is born. Is this OK? If I'm wrong, please point out:) I did the benchmark that I posted my blog against this new kernel. ( http://tsuyoshiozawa.blogspot.com/2010/03/started-to-implement-dynticks-in.html ) If CPU is active(=in pertick mode), VMM process consumes about 35%. Meanwhile if CPU is idle(in dyntick mode), VMM process consumes only 10% on my environment. Of course, its mode switching is done automatically. It seems work well :D As a next step, I'll implement HPET timer to work correctly in the case that CPU is sleeping deeply (e.g. CPU is sleeping deeply to the point of local apic timer's stopping). However, it cause a lot of code duplication to add dynamic tick support for each timer device driver layer. I think it's time to divorse timer device driver from callout queue. To accomplish this, I propose vtimer - timer operation abstraction layer. Its name is from vfs. By defining some callback APIs such as vtimer->oneshot(), vtimer->periodic() or something, it's possible to avoid code dupulication and tight coupling around some switching code (e.g switch_to_dyntick() and switch_to_periodic()). But I know that it must be very big change to modify all timer device driver's code. I think hybrid architecture - we can select existing drivers and modified drivers to support dynticks - is down to earth. This is only my opinion, so let's discuss :D Thank you! Very truly yours OZAWA Tsuyoshi From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 18:57:22 2010 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 944141065676 for ; Tue, 27 Apr 2010 18:57:22 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id 255958FC16 for ; Tue, 27 Apr 2010 18:57:22 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 0A77035A822; Tue, 27 Apr 2010 20:57:21 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id F3F7A17531; Tue, 27 Apr 2010 20:57:20 +0200 (CEST) Date: Tue, 27 Apr 2010 20:57:20 +0200 From: Jilles Tjoelker To: Eitan Adler Message-ID: <20100427185720.GA7165@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: FreeBSD Hackers Subject: Re: [patch] [RFC] pathchk quiet flag 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, 27 Apr 2010 18:57:22 -0000 On Mon, Apr 26, 2010 at 08:57:31PM +0300, Eitan Adler wrote: > This path adds a -q flag to stop pathchk from outputting error > messages but still return an error code. Why do you need this; can't you do something like pathconf -- "$pathname" 2>/dev/null -- Jilles Tjoelker From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 20:51:09 2010 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 DFE9D1065673 for ; Tue, 27 Apr 2010 20:51:09 +0000 (UTC) (envelope-from eitanadlerlist@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3FC8FC29 for ; Tue, 27 Apr 2010 20:51:08 +0000 (UTC) Received: by bwz8 with SMTP id 8so12735618bwz.3 for ; Tue, 27 Apr 2010 13:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=mxVBdPfG6nsZdMGE/IrsziTOy+hq+SkXqTupZrGbE+s=; b=Hw8SXF1oqKlw7OFTZKiK2qeh/Gzie/RFHdMTHtagx6b69/NNHnI0W/13jWGeYSIPHw 3tYQFwkvbOmrULAsN0SRs1g2xPeSUCkcSIUsOFjlsb7BfdR1i0jPCiVTW8OdPkcrff9d pIDQ3hnf0tuN4RauDqXXwJ6YU/KwA5sIhvLwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=M0ilZRkI1gYqW2Oe5Cb/xi/tqCJ+neSCoDSU75TRqvBiQCEqrkBItxVwuDpg+Ot3s6 vvqYtTEvm7YG6pljeccHxYWF0Jet2koKtp3EgurTNldzZ+hYASn/6+SOsQner40m2x9i qMOZ6r7lyl5CWczuK2ZGZfg0M9LOmydKkUzcg= Received: by 10.239.180.200 with SMTP id j8mr616524hbg.166.1272401463112; Tue, 27 Apr 2010 13:51:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.239.193.77 with HTTP; Tue, 27 Apr 2010 13:50:43 -0700 (PDT) In-Reply-To: <20100427185720.GA7165@stack.nl> References: <20100427185720.GA7165@stack.nl> From: Eitan Adler Date: Tue, 27 Apr 2010 23:50:43 +0300 Message-ID: To: Jilles Tjoelker Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers Subject: Re: [patch] [RFC] pathchk quiet flag 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, 27 Apr 2010 20:51:10 -0000 > Why do you need this; can't you do something like > =C2=A0pathconf -- "$pathname" 2>/dev/null Not much but I thought it goes along with other quiet flags (make -Q; grep -q; gzip -q; gunzip -q; etc) From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 21:03:40 2010 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 484581065670 for ; Tue, 27 Apr 2010 21:03:40 +0000 (UTC) (envelope-from knoseeker@googlemail.com) Received: from mail-pz0-f201.google.com (mail-pz0-f201.google.com [209.85.222.201]) by mx1.freebsd.org (Postfix) with ESMTP id 1C2C28FC13 for ; Tue, 27 Apr 2010 21:03:39 +0000 (UTC) Received: by pzk39 with SMTP id 39so1959136pzk.7 for ; Tue, 27 Apr 2010 14:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=SXyF0EwyMW+ZXoC1vFS3YG4EtyMy2FHjHkDVKiS8Tv8=; b=oYAD7DTdyfvIzTMafL7mr55w8vZqw4h1tWEkXHkOs6kSZwnleWcveL5iUZx9a1Z+q8 4khgg0blyLLCw6CE5ONe+VTt3dP4uIZE0slzZkNwCOqYHbri0k8irz+5Oo9Ek1CMyuEG N5aj6+WJNUtfZcOpj4KHMAAAz3pN9yb8DPlgY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=E4/nf6Ozz4nyJtaWGx2/V3BQsh3PEM3IHuSXhHpFuIa8/q5p+mn0DgdD2frkiFYoYh OzNlAD0Muf4RVtbDnoWpe/Fb6YavpQZEVHL2/2u4qEK4rUeExFU8v3aCBPpWJBg3Cay5 xnpRipgsyWyBCXpUxq/lrMrDHp+Sh74kyGkDs= MIME-Version: 1.0 Received: by 10.140.87.41 with SMTP id k41mr2152889rvb.109.1272402216911; Tue, 27 Apr 2010 14:03:36 -0700 (PDT) Received: by 10.150.139.17 with HTTP; Tue, 27 Apr 2010 14:03:36 -0700 (PDT) In-Reply-To: <20100414023414.GD81708@lor.one-eyed-alien.net> References: <20100414023414.GD81708@lor.one-eyed-alien.net> Date: Tue, 27 Apr 2010 21:03:36 +0000 Message-ID: From: Knowledge Seeker To: Brooks Davis Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org Subject: Re: RPC and NFS more than 16 groups 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, 27 Apr 2010 21:03:40 -0000 Hi, I made the changes in 2 FreeBSD 8.0 stable boxes. One I've configured one as a server and the other as the client. But the 16 groups limit persists. Even when I tried using a GNU/Linux Debian machine as a client with a Kernel patched to work with the number of groups advertised by the server (kernel-patch-nfs-ngroups), it does not work. The files and lines changed in FreeBSD src were: include/rpc/auth_unix.h:#define NGRPS 64 lib/libc/rpc/PSD.doc/xdr.nts.ms:#define NGRPS 64 lib/libc/rpc/PSD.doc/xdr.nts.ms:#define NGRPS 64 sys/rpc/authunix_prot.c:#define NGRPS 64 sys/rpc/svc_auth_unix.c:#define NGRPS 64 I wish to do that as a temporary solution, once we intend to do a complete migration to OpenAFS soon. But now, It's really important to have this working. Migrate to NFSv4 first, will be too much work, especially on clients. (Only the server is a FreeBSD machine) Thanks in advance. Regards -- Knoseeker On Wed, Apr 14, 2010 at 2:34 AM, Brooks Davis wrote: > On Tue, Apr 13, 2010 at 11:00:48PM +0000, Knowledge Seeker wrote: > > Hi, > > I need to have my NFS server to authenticate more than 16 groups when > there > > is a file access. > > > > I would like to know if I can just redefine my MACROS to accomplish that. > > > > The macro would be: NGRPS, because it is tested against the variable > > ngroups which comes from NGROUPS value. > > > > /* gids compose part of a credential; there may not be more than 16 of > them > > */ > > #define NGRPS 16 > > > > In: > > > > sys/rpc/authunix_prot.c > > sys/rpc/svc_auth_unix.c > > usr.sbin/rpc.lockd/kern.c > > include/rpc/auth_unix.h > > lib/libc/rpc/PSD.doc/xdr.nts.ms > > > > Is there any critical issue in change the defs and recompile the kernel > and > > the world? > > It won't work unless you also change the clients and then you will be > sending invalid RPC packets over the wire. If you can live with that it > may well work. The real answer is switch to NFSv4 and GSSAPI > authentication where the group checking all takes place on the server > where it belongs in the first place. > > -- Brooks > From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 27 21:44:51 2010 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 699C2106566B; Tue, 27 Apr 2010 21:44:51 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id DFB568FC18; Tue, 27 Apr 2010 21:44:50 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o3RLhYNC069592; Tue, 27 Apr 2010 16:43:34 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o3RLhYSU069591; Tue, 27 Apr 2010 16:43:34 -0500 (CDT) (envelope-from brooks) Date: Tue, 27 Apr 2010 16:43:34 -0500 From: Brooks Davis To: Knowledge Seeker Message-ID: <20100427214334.GA69365@lor.one-eyed-alien.net> References: <20100414023414.GD81708@lor.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="liOOAslEiF7prFVr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 27 Apr 2010 16:43:35 -0500 (CDT) Cc: freebsd-hackers@freebsd.org, Brooks Davis Subject: Re: RPC and NFS more than 16 groups 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, 27 Apr 2010 21:44:51 -0000 --liOOAslEiF7prFVr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 27, 2010 at 09:03:36PM +0000, Knowledge Seeker wrote: > Hi, > I made the changes in 2 FreeBSD 8.0 stable boxes. One I've configured one= as > a server and the other as the client. > But the 16 groups limit persists. > Even when I tried using a GNU/Linux Debian machine as a client with a Ker= nel > patched to work with the number of groups advertised by the server > (kernel-patch-nfs-ngroups), it does not work. >=20 >=20 > The files and lines changed in FreeBSD src were: >=20 > include/rpc/auth_unix.h:#define NGRPS 64 > lib/libc/rpc/PSD.doc/xdr.nts.ms:#define NGRPS 64 > lib/libc/rpc/PSD.doc/xdr.nts.ms:#define NGRPS 64 > sys/rpc/authunix_prot.c:#define NGRPS 64 > sys/rpc/svc_auth_unix.c:#define NGRPS 64 >=20 > I wish to do that as a temporary solution, once we intend to do a complete > migration to OpenAFS soon. > But now, It's really important to have this working. > Migrate to NFSv4 first, will be too much work, especially on clients. (On= ly > the server is a FreeBSD machine) Realistically you're going to have to dig through the code and find all the hidden hard codings of 16. I don't know of any exisitng patches. -- Brooks --liOOAslEiF7prFVr Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFL11qFXY6L6fI4GtQRAsBSAJ9MwzcB/YVqI3cuCBgPpYWzr6qiBACeN+Ym rJrD/WfOm2N3gHcCd4Z3oh0= =ehR8 -----END PGP SIGNATURE----- --liOOAslEiF7prFVr-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 06:28:08 2010 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 4A2441065673 for ; Wed, 28 Apr 2010 06:28:08 +0000 (UTC) (envelope-from czerner.lukas@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 C26388FC22 for ; Wed, 28 Apr 2010 06:28:07 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so2581219fge.13 for ; Tue, 27 Apr 2010 23:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=XCWEBaV5Cxo7fjrNDOhWEzsdlxEeu+yitRKN8AFG4B4=; b=P7xvEmulxQdEIT8wy8O2rezRMArgYsWuv0tMZq6PhQjFnqHG9PPWEzA4htizU7DBco z5qiX0QQSFf0kLTc+tied2dwlqgpPg7v7Uzkeqt5Za2SghZP5HmiJxdlcV+F/7xUTp1J znmXl73w5xhXTtdSisSIPF8QJa5I2mtZZK2mg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=MAj2UFagrXFrKQgZ5vNbHKGwLxE7zoHFzMOn7z6NqPSX8jsVpzcnNkfRcFRDycj0kc ZG1lF+QAVK/Gll22dOGDjI+c4l1E+dFjcolZC/zZIxXlaT+KTJansxkcBdKdq2cdjB9S QwZYSGgmFeiItUJOnxSYtgFANotUMm/paUTA8= Received: by 10.87.31.36 with SMTP id i36mr3889951fgj.56.1272436080862; Tue, 27 Apr 2010 23:28:00 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id e3sm7451133fga.29.2010.04.27.23.27.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 27 Apr 2010 23:27:59 -0700 (PDT) Date: Wed, 28 Apr 2010 08:28:02 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: Gleb Kurtsou In-Reply-To: <20100427105848.GA2003@tops> Message-ID: References: <20100422191849.GA9895@tops> <20100423092257.GA2446@tops> <20100427105848.GA2003@tops> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-220880250-1272436083=:7101" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: How to change vnode operations ? 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, 28 Apr 2010 06:28:08 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-220880250-1272436083=:7101 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: 8BIT On Tue, 27 Apr 2010, Gleb Kurtsou wrote: > Date: Tue, 27 Apr 2010 13:58:48 +0300 > From: Gleb Kurtsou > To: Lukáš Czerner > Cc: freebsd-hackers@freebsd.org > Subject: Re: How to change vnode operations ? > > On (24/04/2010 12:26), Lukáš Czerner wrote: > > On Fri, 23 Apr 2010, Gleb Kurtsou wrote: > > > > > Date: Fri, 23 Apr 2010 12:22:57 +0300 > > > From: Gleb Kurtsou > > > To: Lukáš Czerner > > > Cc: freebsd-hackers@freebsd.org > > > Subject: Re: How to change vnode operations ? > > > > > > On (23/04/2010 08:10), Lukáš Czerner wrote: > > > > On Thu, 22 Apr 2010, Gleb Kurtsou wrote: > > > > > > > > > Date: Thu, 22 Apr 2010 22:18:49 +0300 > > > > > From: Gleb Kurtsou > > > > > To: Lukáš Czerner > > > > > Cc: freebsd-hackers@freebsd.org > > > > > Subject: Re: How to change vnode operations ? > > > > > > > > > > On (22/04/2010 16:02), Lukáš Czerner wrote: > > > > > > Hi all, > > > > > > > > > > > > this may sound a little odd, since I have noticed that there is much > > > > > > work done to not allow such a thing ($SUBJ). But may be you can help > > > > > > me and point me to the right direction. > > > > > > > > > > > > I am writing a kernel module with somewhat similar functionality > > > > > > like nullfs has, BUT it has to have some features which nullfs > > > > > > itself does not provide : > > > > > > > > > > > > 1. I need the new layer to completely hide underlaying layer so no > > > > > > one can bypass it. > > > > > Is hypothetic 'mount -t mynullfs /a /a' good enough for you? I'm not sure > > > > > what your goals are but completely finding underlaying filesystem won't > > > > > be easy because of VFS_GET, getfh and other stuff operating with inode > > > > > numbers. > > > > > > > > Well, it may be good enough, or not. Thats what I am trying to find > > > > out. Obviously there are problems, as you mentioned, which will not > > > > exist when I change the vop_vector of the vnode, but as I thought > > > > and you mentioned it as well, this is not very clean way. > > > Why don't you like stacked filesystem approach? It's designed to solve > > > the problem you are describing if I get it right. Although creating > > > pefs-like filesystem altering data and names is not so easy within > > > existing framework. > > > > > > > > > 2. Nullfs allows me to to overlay just one directory, but i want to > > > > > > include another directories and/or exclude subdirectories/files. > > > > > > 3. Nullfs just redirects vnode operations to lower layer, I need to > > > > > > catch that operation, do something (for example alter the arguments > > > > > > somehow etc..), pass the operation (with possibly altered arguments) > > > > > > to the lower layer, get the result and then return the result. > > > > > I'd suggest to take a look at pefs: http://github.com/glk/pefs > > > > > It's cryptographic stacked filesystem for FreeBSD. It changes file > > > > > names, hides directory entries, modifies data from lower layer > > > > > (encrypts or decrypts), supports mounting on same directory, etc. > > > > > > > > Thats great, thanks! I will look at it. > > > > > > > > > > > > > > > The best way to do that (I think) is to change vnode operations of > > > > > > particular vnodes to point to functions defined in that module. At > > > > > > this point, I can catch any operations with the vnode and this is > > > > > > the base of what i want. > > > > > > > > > > > > So my question is. I there any "clean" way to chande vnode > > > > > > operations ? If not, is there any "not so clean" way ? Anyway I will > > > > > > appreciate any good idea how to do what I have described. > > > > > Imho, stacked filesystem is the only right way to do it (see null, > > > > > unionfs, pefs). > > > > > > > > OK. Thanks for pointing me to the pefs, it is interesting and looks > > > > like a good start. But I would appreciate more comment on the side > > > > of the whole idea about changing vnode operations from the kernel > > > > module. It is a little hacky, but aside this I do not see any bigger > > > > problems, do you ? > > > Changing vop_vector is too hackish for me. Basically, changing vnode > > > operations is what stacked filesystems are about. Vnode operations are > > > the top of the problem, you would also have to deal with parent lookup, > > > namecache consistency and buffering, which is going to be complicated. > > > I.e. you'd have to partially reimplement part of VFS layer. > > > > > > nullfs and unionfs pass vnode vobject (buffering layer) from lower > > > layer, adding your own vobject to vnode would complicate filesystem > > > significantly. Besides you won't be able to assign 2 vobjects (original > > > and your own) to a single vnode if you decide to change operations > > > vector. > > > > This is exactly how I feel about it and I am glad that you actually > > confirm that, so thank you. Now I am convinced to use stacked > > filesystem. > > > > But I have one last question, though. It may be stupid, but when I > > am looking at your pefs I can not figure out how you manage to mount > > directory above itself. I am staring at the code and just do not see > > that. It seems to me, like the check is done before the > > {pefs|nullfs}_mount is even called. Can you point me out to the > > right direction ? > It's nullfs that forbids it. VFS is fine about mounting on top of the > same directory. As far as I remember lower vnode should be unlocked to > prevent locking against itself and pefs_lock and pefs_unlock had to be > adjusted to support it. Do not remember specifics, sorry. > > I do 'pefs mount /home/gleb /home/gleb' since October, it works for me. > I have already figured it out. Thanks again! -Lukas. --8323329-220880250-1272436083=:7101-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 11:04:52 2010 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 853E0106564A for ; Wed, 28 Apr 2010 11:04:52 +0000 (UTC) (envelope-from uzunchev.stanislav@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 156A18FC1C for ; Wed, 28 Apr 2010 11:04:51 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so2694112fge.13 for ; Wed, 28 Apr 2010 04:04:46 -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 :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=u2mnwkrivwy6j4iVOEJvTTZAsmz7zqhRG+4PdKVG6u0=; b=X+FAfXZac4HAg5eGMgGFKM3HojKUQtNm19c0sKHBfkA+n7Tw4Sq+EDmeQ8LOAhEN8x /yuWeaagJwLVVigIO/GRztqRjls+F7u1KB5ags3kOtJ3vQBoeQ4dEfCVMSJ3HyUnWkB0 R3YwkJ+FQEqdKAQ4HhTw3cqp/n6HlYoxYpCTk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=kFADZg9pVLMNrSxKV/AEpEkdq/caZek58nIE46khcjw0DBCMHXVGsuZO3h+nhG7UMR twIb/AMbo2GwpP3S1/LdtZKtDdoqLm997Nb81ubG5yeVbH9c6gkt/NTQ/lW5uXhictHK PTH8QFHVRlNHYHQOgngCZ6EW1oHFuDZDPoELo= Received: by 10.87.45.15 with SMTP id x15mr4071061fgj.42.1272452686217; Wed, 28 Apr 2010 04:04:46 -0700 (PDT) Received: from [192.168.2.101] ([95.87.248.136]) by mx.google.com with ESMTPS id l12sm4244589fgb.27.2010.04.28.04.04.44 (version=SSLv3 cipher=RC4-MD5); Wed, 28 Apr 2010 04:04:45 -0700 (PDT) Message-ID: <4BD85CA6.4040904@gmail.com> Date: Wed, 28 Apr 2010 14:04:54 -0200 From: Stanislav User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 28 Apr 2010 11:56:08 +0000 Subject: Hello! 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, 28 Apr 2010 11:04:52 -0000 Hello! I am accepted for the google summer of code. I just wanted to introduce myself to the community. I will be working on "BSNMP enhancement: A new module". I will be very thankful to anyone who have ideas to share. I am still newbie and have never coded for project such FreeBSD, but i hope that with some help i will cope with the project. I will post a link to the wiki page soon. Best regards, to all the people who help somehow to the FreeBSD idea. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 14:46:37 2010 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 8053D1065670 for ; Wed, 28 Apr 2010 14:46:37 +0000 (UTC) (envelope-from jamesbrandongooch@gmail.com) Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by mx1.freebsd.org (Postfix) with ESMTP id A0EF58FC1C for ; Wed, 28 Apr 2010 14:46:36 +0000 (UTC) Received: by iwn42 with SMTP id 42so9723787iwn.14 for ; Wed, 28 Apr 2010 07:46:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=MLsMzxBrdaUvvsDXRT3pp2k+Mh8vbEiY9c8JUMK66b8=; b=WnBPLwQ2EZ7RP82/s2t9jiT6dgsTT7T1C062O4LBPxfPuQ4QgORGJMiUMH7LRMbnRA 7NCuE181XPWy0uBfHktLKbmGBcSkN6qoCAYI9KJ4KYGTQIHSZuddlFuPKRbFTqkmJAns m8kY0omom9DUSwcv1yBMRv4yF0PAjQH5Rq4k0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rWWvidrR/HjZvrzSheOTdbr5QMr4tIcF+3sgDVRBoOY3tr3aAf29gDuCQPsrTzGe4u Tfhpo+ZsZIYFHBLA4HjONNLLdxLwVJww0xtKKaGxJPnuSjVXKeXu01W6PXBfSiPt/cUM eYq/1UICwcDOtSteba4lx2EFlEgueE0KVmJoE= MIME-Version: 1.0 Received: by 10.115.84.4 with SMTP id m4mr2106775wal.222.1272465982182; Wed, 28 Apr 2010 07:46:22 -0700 (PDT) Received: by 10.231.113.36 with HTTP; Wed, 28 Apr 2010 07:46:20 -0700 (PDT) In-Reply-To: <4BD85CA6.4040904@gmail.com> References: <4BD85CA6.4040904@gmail.com> Date: Wed, 28 Apr 2010 14:46:20 +0000 Message-ID: From: Brandon Gooch To: Stanislav Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Hello! 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, 28 Apr 2010 14:46:37 -0000 On Wed, Apr 28, 2010 at 4:04 PM, Stanislav wrote: > Hello! I am accepted for the google summer of code. I just wanted to > introduce myself to the community. I will be working on "BSNMP enhancement: > A new module". I will be very thankful to anyone who have ideas to share. I > am still newbie and have never coded for project such FreeBSD, but i hope > that with some help i will cope with the project. I will post a link to the > wiki page soon. > Best regards, to all the people who help somehow to the FreeBSD idea. Stanislav, congratulations on your acceptance in the GoC 2010! I, along with many others, am excited to see enhancements in the current state of SNMP on FreeBSD. Your work will undoubtedly be welcomed by many system administrators, and I look forward to sharing ideas and providing support and encouragement wherever possible. Good Luck, and Happy Coding! -Brandon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 15:29:59 2010 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 302C2106564A for ; Wed, 28 Apr 2010 15:29:59 +0000 (UTC) (envelope-from Hartmut.Brandt@dlr.de) Received: from smtp3.dlr.de (smtp3.dlr.de [129.247.252.33]) by mx1.freebsd.org (Postfix) with ESMTP id B64248FC1F for ; Wed, 28 Apr 2010 15:29:58 +0000 (UTC) Received: from beagle.kn.op.dlr.de ([129.247.178.136]) by smtp3.dlr.de over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 28 Apr 2010 17:29:56 +0200 Date: Wed, 28 Apr 2010 17:29:56 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt_h@beagle.kn.op.dlr.de To: Stanislav In-Reply-To: Message-ID: <20100428172806.H21128@beagle.kn.op.dlr.de> References: <4BD85CA6.4040904@gmail.com> X-OpenPGP-Key: harti@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-OriginalArrivalTime: 28 Apr 2010 15:29:56.0671 (UTC) FILETIME=[A82B14F0:01CAE6E7] Cc: freebsd-hackers@freebsd.org Subject: Re: Hello! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Harti Brandt List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 15:29:59 -0000 On Wed, 28 Apr 2010, Brandon Gooch wrote: On Wed, Apr 28, 2010 at 4:04 PM, Stanislav wrote: > Hello! I am accepted for the google summer of code. I just wanted to > introduce myself to the community. I will be working on "BSNMP enhancement: > A new module". I will be very thankful to anyone who have ideas to share. I > am still newbie and have never coded for project such FreeBSD, but i hope > that with some help i will cope with the project. I will post a link to the > wiki page soon. > Best regards, to all the people who help somehow to the FreeBSD idea. Congratulations. Nice to hear. Perhaps I finally need to put up the bsnmp repo somewhere. harti From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 17:11:37 2010 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 26F931065673 for ; Wed, 28 Apr 2010 17:11:37 +0000 (UTC) (envelope-from unixmania@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id AB64A8FC1C for ; Wed, 28 Apr 2010 17:11:36 +0000 (UTC) Received: by fxm15 with SMTP id 15so602730fxm.13 for ; Wed, 28 Apr 2010 10:11:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=S1fP5aa3NGvag9NNv6r2qS9pY1iGyu2vAC1j2GRIrtE=; b=DDlyKyQtJmiTcNO77ZkYCGxjdSvskzi0wXEUznwKKtXOYE3spYEtpHwImC1Lmgqrhc adWSX1fOiPAtLJ9NJgZp2dY0FpuGMYkbdfKwmH3Y+pUDYLexy63SNAQFFFFbQGB1WB/f vttd1BGCgn4Nrwl9dMKM325AWb5TY8KTrofLg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=UQ8SNzJ5iuWOD4yzKvxdbvbA4ofxiM2OKPpclsUKC7RJz+VqqyJxw8w2DPP9UVYIa5 +eaGsN08G0enFSVVY5vAvK1weVIOD+IuLsVnli/wAeDN+Xg40FrgPAkMTjsPHrSogj9e rIHY4LDyYpXYq2lmlsqX+62QpB8NgymBDNFos= MIME-Version: 1.0 Received: by 10.223.17.194 with SMTP id t2mr431762faa.101.1272474686325; Wed, 28 Apr 2010 10:11:26 -0700 (PDT) Received: by 10.223.113.77 with HTTP; Wed, 28 Apr 2010 10:11:26 -0700 (PDT) In-Reply-To: <4BD85CA6.4040904@gmail.com> References: <4BD85CA6.4040904@gmail.com> Date: Wed, 28 Apr 2010 14:11:26 -0300 Message-ID: From: "Carlos A. M. dos Santos" To: Stanislav Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: Hello! 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, 28 Apr 2010 17:11:37 -0000 On Wed, Apr 28, 2010 at 1:04 PM, Stanislav wrote: > Hello! I am accepted for the google summer of code. I just wanted to > introduce myself to the community. I will be working on "BSNMP enhancement: > A new module". I will be very thankful to anyone who have ideas to share. I > am still newbie and have never coded for project such FreeBSD, but i hope > that with some help i will cope with the project. I will post a link to the > wiki page soon. > Best regards, to all the people who help somehow to the FreeBSD idea. I have not only ideas, but lots of code to share. The company I work for is using bsnmp for embedded products and I'm in charge for contributing the modifications back to FreeBSD. Time has been very scarce, however, so any help in this direction will be very welcome. Please contact me @hp.com for more details. The email address is "casantos@...". -- Not so young, but still crying out Full of anger full of doubt From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 20:18:19 2010 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 45AE8106566B for ; Wed, 28 Apr 2010 20:18:19 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1AF318FC1B for ; Wed, 28 Apr 2010 20:18:19 +0000 (UTC) Received: from eagle.syrec.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id o3SKII4Q053412 for ; Wed, 28 Apr 2010 13:18:18 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4BD8980A.9000706@rawbw.com> Date: Wed, 28 Apr 2010 13:18:18 -0700 From: Yuri User-Agent: Thunderbird 2.0.0.24 (X11/20100331) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: How to troubleshoot why VirtualBox kernel module freezes the system? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 20:18:19 -0000 VirtualBox kernel module (port emulators/virtualbox-ose-kmod) began to cause system freezes from some kernel change around the end of January. Once the system freezes it has to be rebooted. Soundcard, if it was playing something, begins to cycle some very short piece. Nothing is logged into /var/log/messages. Is there any way to troubleshoot this, like enabling some kernel configuation options? What is normally done in such case? Should I run system under kernel debugger? But would it detect something if it's not a SEGV but the freeze? Yuri From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 20:37:22 2010 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 7F5C6106566B for ; Wed, 28 Apr 2010 20:37:22 +0000 (UTC) (envelope-from shuvaev@physik.uni-wuerzburg.de) Received: from mailrelay.rz.uni-wuerzburg.de (mailrelay.rz.uni-wuerzburg.de [132.187.3.28]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE458FC21 for ; Wed, 28 Apr 2010 20:37:21 +0000 (UTC) Received: from virusscan.mail (localhost [127.0.0.1]) by mailrelay.mail (Postfix) with ESMTP id 7791A5AE66; Wed, 28 Apr 2010 22:37:20 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by virusscan.mail (Postfix) with ESMTP id 74CDA5AE45; Wed, 28 Apr 2010 22:37:20 +0200 (CEST) X-Virus-Scanned: by amavisd-new at uni-wuerzburg.de Received: from mail.physik.uni-wuerzburg.de (wthp192.physik.uni-wuerzburg.de [132.187.40.192]) by mailmaster.uni-wuerzburg.de (Postfix) with ESMTP id 551F65D075; Wed, 28 Apr 2010 22:37:20 +0200 (CEST) Received: from wep4035 ([132.187.37.35]) by mail.physik.uni-wuerzburg.de (Lotus Domino Release 8.5.1FP2) with ESMTP id 2010042822371878-96736 ; Wed, 28 Apr 2010 22:37:18 +0200 Received: by wep4035 (sSMTP sendmail emulation); Wed, 28 Apr 2010 22:37:18 +0200 Date: Wed, 28 Apr 2010 22:37:18 +0200 From: Alexey Shuvaev To: Yuri Message-ID: <20100428203718.GB38859@wep4035.physik.uni-wuerzburg.de> References: <4BD8980A.9000706@rawbw.com> MIME-Version: 1.0 In-Reply-To: <4BD8980A.9000706@rawbw.com> Organization: Universitaet Wuerzburg User-Agent: Mutt/1.5.20 (2009-06-14) X-MIMETrack: Itemize by SMTP Server on domino1/uni-wuerzburg(Release 8.5.1FP2|March 17, 2010) at 04/28/2010 10:37:19 PM, Serialize by Router on domino1/uni-wuerzburg(Release 8.5.1FP2|March 17, 2010) at 04/28/2010 10:37:20 PM, Serialize complete at 04/28/2010 10:37:20 PM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Cc: freebsd-hackers@freebsd.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? 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, 28 Apr 2010 20:37:22 -0000 On Wed, Apr 28, 2010 at 01:18:18PM -0700, Yuri wrote: > VirtualBox kernel module (port emulators/virtualbox-ose-kmod) began > to cause system freezes from some kernel change around the end of > January. > Once the system freezes it has to be rebooted. Soundcard, if it was > playing something, begins to cycle some very short piece. > Nothing is logged into /var/log/messages. > > Is there any way to troubleshoot this, like enabling some kernel > configuation options? > What is normally done in such case? > Should I run system under kernel debugger? But would it detect > something if it's not a SEGV but the freeze? > Trivial suggestion: have you rebuilt virtualbox with new kernel sources? What are the versions of FreeBSD / virtualbox? As a record it is running fine here: ~> uname -a FreeBSD wep4035 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206758: Sat Apr 17 17:37:46 CEST 2010 root@wep4035:/usr/obj/usr/src/sys/GENERIC amd64 ~> ls /var/db/pkg/virtualbox-ose- virtualbox-ose-3.1.6_2/ virtualbox-ose-kmod-3.1.6/ HTH, Alexey. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 21:00:58 2010 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 3CF1F1065676 for ; Wed, 28 Apr 2010 21:00:58 +0000 (UTC) (envelope-from webmaster@kibab.com) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id A429A8FC14 for ; Wed, 28 Apr 2010 21:00:57 +0000 (UTC) Received: from localhost (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id D74198FC4E for ; Thu, 29 Apr 2010 01:00:54 +0400 (MSD) Date: Thu, 29 Apr 2010 01:01:24 +0400 From: Ilya Bakulin To: freebsd-hackers@freebsd.org Message-ID: <20100429010124.3496d7ef@kibab.com> Organization: Deglitch Networks X-Mailer: Claws Mail 3.7.2 (GTK+ 2.18.7; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/kayTty+Y13aej03uLxQRIZm"; protocol="application/pgp-signature" Subject: GSoC project: Make optional kernel subsystems register themselves via sysctl 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, 28 Apr 2010 21:00:58 -0000 --Sig_/kayTty+Y13aej03uLxQRIZm Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi list, I participate in GSoC this summer, so I want to announce my project. Proje= ct details may be found at FreeBSD wiki, [1]. Completing this project will make it easy to get current kernel feature set= from the userland, thus simplifying writing system administration scripts,= autoconfigurating Ports, jailed packages building jobs, etc. My experience with FreeBSD includes using it as the main OS for both server= s and work PCs. This includes solving problems with buggy ACPI, helping som= e FreeBSD developers to test their code on my hardware, tuning our company'= s FreeBSD servers. I maintain several ports in FreeBSD Ports Collection. Al= so I was working with FreeBSD/ARM for some time (this includes developing c= ustom firmware for the proprietary AT91RM9200-based device, done together w= ith Stanislav Sedov, and driver code for Marvell 88F5182 SATA controller --= work done for Semihalf. It was committed to FreeBSD-CURRENT last summer). =20 According to suggested timeline described at [1], now it's time to decide w= hat kernel subsystems need to be registered this way, and how this registra= tion may be overriden. The interesting question is: should modules register themselves under kern.= features tree? For example, USB support may be either compiled into kernel = or loaded as a module at runtime. In the first case it seems to be a good i= dea to register it under kern.features. The main goal is not to rely on "kl= dstat -v" to get compiled-in modules. Other need-to-be-registered things are ALTQ support, MAC support, INET/INET= 6,... I expect all such sysctls to be boolean: the feature X is either present, i= n this case "kern.features.X =3D 1", or not present -- simply no node at ke= rnel.features. But maybe it's not sufficient? =20 So I'll be glad to hear your opinion, and hope we all will be able to set "= kern.features.the_best_os_ever=3D1" in our kernel feature sets at the end o= f the summer :-) Good luck for all GSoC participants! [1] http://wiki.freebsd.org/SOC2010IlyaBakulin --=20 Regards, Ilya Bakulin http://kibab.com xmpp://kibab612@jabber.ru --Sig_/kayTty+Y13aej03uLxQRIZm Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (FreeBSD) iEYEARECAAYFAkvYoikACgkQo9vlj1oadwjAvQCg35HKMw7CnrfhNNyGH96+Sz66 kYcAn2RyRzu2W4hRL1IsDu1vqHCgM+tw =ITpq -----END PGP SIGNATURE----- --Sig_/kayTty+Y13aej03uLxQRIZm-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 22:10:40 2010 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 9B50F106566B for ; Wed, 28 Apr 2010 22:10:40 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 874898FC1D for ; Wed, 28 Apr 2010 22:10:40 +0000 (UTC) Received: from eagle.syrec.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id o3SMAdgB073987; Wed, 28 Apr 2010 15:10:40 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4BD8B25F.1000509@rawbw.com> Date: Wed, 28 Apr 2010 15:10:39 -0700 From: Yuri User-Agent: Thunderbird 2.0.0.24 (X11/20100331) MIME-Version: 1.0 To: Alexey Shuvaev References: <4BD8980A.9000706@rawbw.com> <20100428203718.GB38859@wep4035.physik.uni-wuerzburg.de> In-Reply-To: <20100428203718.GB38859@wep4035.physik.uni-wuerzburg.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Apr 2010 22:10:40 -0000 Alexey Shuvaev wrote: > Trivial suggestion: have you rebuilt virtualbox with new kernel sources? > What are the versions of FreeBSD / virtualbox? > Of course I rebuilt VirtualBox after kernel update. FreeBSD xxx.xxx.xxx 8.0-STABLE FreeBSD 8.0-STABLE #0: Mon Apr 26 19:32:12 PDT 2010 yuri@xxx.xxx.xxx:/usr/obj/usr/src/sys/GENERIC i386 virtualbox-ose-3.1.6_3, virtualbox-ose-kmod-3.1.6 > As a record it is running fine here: > ~> uname -a > FreeBSD wep4035 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206758: Sat Apr 17 17:37:46 CEST 2010 root@wep4035:/usr/obj/usr/src/sys/GENERIC amd64 > ~> ls /var/db/pkg/virtualbox-ose- > virtualbox-ose-3.1.6_2/ virtualbox-ose-kmod-3.1.6 Obviously there are two major differences: 9.0-CURRENT and amd64. I am not sure which one matters for the problem. Yuri From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 28 23:42:36 2010 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 83BF0106566C for ; Wed, 28 Apr 2010 23:42:36 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7674D8FC15 for ; Wed, 28 Apr 2010 23:42:36 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 389F41A3D86; Wed, 28 Apr 2010 16:42:35 -0700 (PDT) Date: Wed, 28 Apr 2010 16:42:35 -0700 From: Alfred Perlstein To: hackers@freebsd.org Message-ID: <20100428234235.GA36233@elvis.mu.org> References: <20100428171840.GS35381@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100428171840.GS35381@elvis.mu.org> User-Agent: Mutt/1.4.2.3i Cc: Subject: Re: fixes for enhanced coredump 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, 28 Apr 2010 23:42:36 -0000 Additionally I need to remove all traces of IO_NODELOCKED from kern_gzio.c as they leads to unlocked vnode access otherwise in the gzip coredump routine. A review would be much appreciated. thank you, -Alfred * Alfred Perlstein [100428 10:18] wrote: > I was recently working on the enhanced coredumps > internal to Juniper and realized that there were > some defects in the code I pushed (mostly due to > mismerge), can someone please review? > > 1) don't allocate hostname[] on the stack > 2) don't leak the temp buffer in imgact_elf_coredump. > > thank you, > -Alfred > > > Index: kern/kern_sig.c > =================================================================== > --- kern/kern_sig.c (revision 207329) > +++ kern/kern_sig.c (working copy) > @@ -3004,8 +3004,9 @@ > char *temp; > size_t i; > int indexpos; > - char hostname[MAXHOSTNAMELEN]; > + char *hostname; > > + hostname = NULL; > format = corefilename; > temp = malloc(MAXPATHLEN, M_TEMP, M_NOWAIT | M_ZERO); > if (temp == NULL) > @@ -3021,6 +3022,19 @@ > sbuf_putc(&sb, '%'); > break; > case 'H': /* hostname */ > + if (hostname == NULL) { > + hostname = malloc(MAXHOSTNAMELEN, > + M_TEMP, M_NOWAIT); > + if (hostname == NULL) { > + log(LOG_ERR, > + "pid %ld (%s), uid (%lu): " > + "unable to alloc memory " > + "for corefile hostname\n", > + (long)pid, name, > + (u_long)uid); > + goto nomem; > + } > + } > getcredhostname(td->td_ucred, hostname, > sizeof(hostname)); > sbuf_printf(&sb, "%s", hostname); > @@ -3054,9 +3068,10 @@ > } > #endif > if (sbuf_overflowed(&sb)) { > - sbuf_delete(&sb); > log(LOG_ERR, "pid %ld (%s), uid (%lu): corename is too " > "long\n", (long)pid, name, (u_long)uid); > +nomem: > + sbuf_delete(&sb); > free(temp, M_TEMP); > return (NULL); > } > Index: kern/imgact_elf.c > =================================================================== > --- kern/imgact_elf.c (revision 207329) > +++ kern/imgact_elf.c (working copy) > @@ -1088,8 +1088,10 @@ > hdrsize = 0; > __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); > > - if (hdrsize + seginfo.size >= limit) > - return (EFAULT); > + if (hdrsize + seginfo.size >= limit) { > + error = EFAULT; > + goto done; > + } > > /* > * Allocate memory for building the header, fill it up, > @@ -1097,7 +1099,8 @@ > */ > hdr = malloc(hdrsize, M_TEMP, M_WAITOK); > if (hdr == NULL) { > - return (EINVAL); > + error = EINVAL; > + goto done; > } > error = __elfN(corehdr)(td, vp, cred, seginfo.count, hdr, hdrsize, > gzfile); > @@ -1125,8 +1128,8 @@ > curproc->p_comm, error); > } > > +done: > #ifdef COMPRESS_USER_CORES > -done: > if (core_buf) > free(core_buf, M_TEMP); > if (gzfile) > -- > - Alfred Perlstein > .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 > .- FreeBSD committer -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 04:21:30 2010 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 B6CD7106566B for ; Thu, 29 Apr 2010 04:21:30 +0000 (UTC) (envelope-from gabrielquadros@hotmail.com) Received: from snt0-omc2-s17.snt0.hotmail.com (snt0-omc2-s17.snt0.hotmail.com [65.55.90.92]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6158FC17 for ; Thu, 29 Apr 2010 04:21:30 +0000 (UTC) Received: from SNT136-W65 ([65.55.90.72]) by snt0-omc2-s17.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 28 Apr 2010 21:09:29 -0700 Message-ID: X-Originating-IP: [189.105.53.45] From: Gabriel Quadros To: Date: Thu, 29 Apr 2010 01:09:29 -0300 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 29 Apr 2010 04:09:29.0993 (UTC) FILETIME=[C3FC2790:01CAE751] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: GSoC: 802.11 Fuzzing and Testing 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, 29 Apr 2010 04:21:30 -0000 Hi everybody! I got accepted on GSoC with the proposal "802.11 Fuzzing and Testing". The goal is to improve the reliability of wireless stack=2C discovering bug= s through fuzzing with frame injection. I'd like to hear your opinions and ideas about the project. Soon I'll update my Wiki page [1]. Regards=2C Gabriel [1] http://wiki.freebsd.org/SOC2010GabrielSilva =20 _________________________________________________________________ O Internet Explorer 8 quer te ajudar a navegar seguro. Entre aqui para ler = as dicas. http://www.microsoft.com/brasil/windows/internet-explorer/?WT.mc_id=3D1500= From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 05:49:11 2010 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 0F3801065670 for ; Thu, 29 Apr 2010 05:49:11 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 432C08FC14 for ; Thu, 29 Apr 2010 05:49:09 +0000 (UTC) Received: from porto.topspin.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA28099 for ; Thu, 29 Apr 2010 08:49:08 +0300 (EEST) (envelope-from avg@freebsd.org) Received: from localhost.topspin.kiev.ua ([127.0.0.1]) by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1O7McW-0008BQ-Ao for freebsd-hackers@FreeBSD.org; Thu, 29 Apr 2010 08:49:08 +0300 Message-ID: <4BD91DD3.90108@freebsd.org> Date: Thu, 29 Apr 2010 08:49:07 +0300 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.24 (X11/20100321) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Fwd: rc.d/root: handle filesystems with r/o support only] 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, 29 Apr 2010 05:49:11 -0000 There was no excitement over the proposed patch on rc@, perhaps more luck here :-) -------- Original Message -------- Subject: rc.d/root: handle filesystems with r/o support only Date: Sat, 17 Apr 2010 22:16:30 +0300 From: Andriy Gapon To: freebsd-rc@freebsd.org Could you please review the following patch? The idea is to not try to remount root R/W if root filesystem supports only R/O. For example, cd9660. This should make life easier for live CDs that use standard rc startup. Currently one has to either put a root fs entry into fstab (and thus guess root device name, e.g. cd0 vs acd0) or to specify root_rw_mount="NO" in rc.conf. This change attempts to guess that automatically. I think that things like ro_fs_list, in_list and is_readonly_fs could be shared with other rc scripts. E.g. see http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/116931 P.S. sorry if the code style and structure differs from conventions. --- a/etc/rc.d/root +++ b/etc/rc.d/root @@ -13,11 +13,54 @@ name="root" start_cmd="root_start" stop_cmd=":" +ro_fs_list="cd9660 udf" + +in_list() +{ + local _x _list _i + + _x=$1 + _list=$2 + for _i in ${_list}; do + [ "${_x}" = "${_i}" ] && return 0 + done + return 1 +} + +is_readonly_fs() +{ + local _arg _ret + + _arg="$1" ; shift + _ret=`mount -p | while read _dev _mp _type _rest; do + [ $_mp = "$_arg" ] || continue + echo $_type + break + done` + + if [ -z "${_ret}" ]; then + warn "root filesystem not found" + return 1 + fi + if in_list "${_ret}" "${ro_fs_list}"; then + info "read-only root filesystem type: ${_ret}" + return 0 + else + info "read-write root filesystem type: ${_ret}" + return 1 + fi +} + root_start() { # root normally must be read/write, but if this is a BOOTP NFS # diskless boot it does not have to be. # + + if is_readonly_fs '/' ; then + root_rw_mount="NO" + fi + case ${root_rw_mount} in [Nn][Oo] | '') ;; -- Andriy Gapon -- Andriy Gapon From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 06:41:04 2010 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 2F7BA1065670 for ; Thu, 29 Apr 2010 06:41:04 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id 0236D8FC08 for ; Thu, 29 Apr 2010 06:41:03 +0000 (UTC) Received: from eagle.syrec.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id o3T6f333050678; Wed, 28 Apr 2010 23:41:03 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4BD929FF.4070101@rawbw.com> Date: Wed, 28 Apr 2010 23:41:03 -0700 From: Yuri User-Agent: Thunderbird 2.0.0.24 (X11/20100331) MIME-Version: 1.0 To: Alexey Shuvaev References: <4BD8980A.9000706@rawbw.com> <20100428203718.GB38859@wep4035.physik.uni-wuerzburg.de> In-Reply-To: <20100428203718.GB38859@wep4035.physik.uni-wuerzburg.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 06:41:04 -0000 Alexey Shuvaev wrote: > As a record it is running fine here: > ~> uname -a > FreeBSD wep4035 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r206758: Sat Apr 17 > 17:37:46 CEST 2010 root@wep4035:/usr/obj/usr/src/sys/GENERIC amd64 > I tried to install 9.0-CURRENT (r206758). nvidia driver crashes the system there (it is of course was rebuilt with 90 sources). 90-CURENT is also much slower due to the debugging options turned on. This may prevent bug in VirtualBox kernel module from hanging the system too. Yuri From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 09:17:31 2010 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 711AE1065676 for ; Thu, 29 Apr 2010 09:17:31 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 166FF8FC08 for ; Thu, 29 Apr 2010 09:17:30 +0000 (UTC) Received: by wwb13 with SMTP id 13so317563wwb.13 for ; Thu, 29 Apr 2010 02:17:25 -0700 (PDT) Received: by 10.216.86.82 with SMTP id v60mr811697wee.180.1272532645130; Thu, 29 Apr 2010 02:17:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.12.1 with HTTP; Thu, 29 Apr 2010 02:17:03 -0700 (PDT) In-Reply-To: <4BD8980A.9000706@rawbw.com> References: <4BD8980A.9000706@rawbw.com> From: =?UTF-8?Q?Marius_N=C3=BCnnerich?= Date: Thu, 29 Apr 2010 11:17:03 +0200 Message-ID: To: yuri@rawbw.com Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? 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, 29 Apr 2010 09:17:31 -0000 On Wed, Apr 28, 2010 at 22:18, Yuri wrote: > VirtualBox kernel module (port emulators/virtualbox-ose-kmod) began to cause > system freezes from some kernel change around the end of January. > Once the system freezes it has to be rebooted. Soundcard, if it was playing > something, begins to cycle some very short piece. > Nothing is logged into /var/log/messages. > > Is there any way to troubleshoot this, like enabling some kernel > configuation options? > What is normally done in such case? > Should I run system under kernel debugger? But would it detect something if > it's not a SEGV but the freeze? It freezes for me too after a short while when I use the nvidia blob (8.0-RELEASE/amd64). Does your machine have firewire and do you have a second machine with firewire? I heard that it should be possible to read the ram contents of a frozen machine over firewire. I only have one firewire machine so I can't test. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 04:42:41 2010 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 5956F106564A for ; Thu, 29 Apr 2010 04:42:41 +0000 (UTC) (envelope-from gabor@kovesdan.org) Received: from server.mypc.hu (server.mypc.hu [87.229.73.95]) by mx1.freebsd.org (Postfix) with ESMTP id 1386F8FC15 for ; Thu, 29 Apr 2010 04:42:40 +0000 (UTC) Received: from server.mypc.hu (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 2D71914DAFE6 for ; Thu, 29 Apr 2010 06:42:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at server.mypc.hu Received: from server.mypc.hu ([127.0.0.1]) by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7ltTwc71yUVX for ; Thu, 29 Apr 2010 06:42:36 +0200 (CEST) Received: from webmail.kovesdan.org (localhost [127.0.0.1]) by server.mypc.hu (Postfix) with ESMTP id 07C4614DAE5A for ; Thu, 29 Apr 2010 06:42:36 +0200 (CEST) Received: from 113.199.139.242 (SquirrelMail authenticated user gabor) by webmail.kovesdan.org with HTTP; Thu, 29 Apr 2010 06:42:36 +0200 Message-ID: <0d1147ced58b57fc7364448ee4237db4.squirrel@webmail.kovesdan.org> Date: Thu, 29 Apr 2010 06:42:36 +0200 From: =?utf-8?B?IkfhYm9yIEv2dmVzZOFuIg==?= To: freebsd-hackers@freebsd.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Mailman-Approved-At: Thu, 29 Apr 2010 11:14:24 +0000 Subject: GSoC: Collective resource limits aka jobs 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, 29 Apr 2010 04:42:41 -0000 Hello All, My name is Gabor Kovesdan, I am a Master student of Computer Engineering at the Budapest University of Technology and Economics. I am 22 years old and I live in Budapest but will study one year in Porto, Portugal from September. I am already a FreeBSD committer and I have already participated in GSoC before. So far I have been wroking on port, doc (including Hungarian and Spanish translations), BSDL text processing tools, BSDL libiconv. Some of these projects is being integrated still. This time I wanted to improve my skills and that is why I chose a kernel project, which is adding IRIX-style jobs support to FreeBSD. You can read the whole proposal with details here: http://kovesdan.org/doc/en_US.ISO8859-1/soc2010-freebsd/soc2010-freebsd.html Until the end of May I have limited connection but if you have further questions, ideas, suggestions, etc. please feel free to contact me. Regards, Gabor From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 11:20:35 2010 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 E306C106566B for ; Thu, 29 Apr 2010 11:20:35 +0000 (UTC) (envelope-from decke@FreeBSD.org) Received: from mail.itac.at (mail.itac.at [91.205.172.9]) by mx1.freebsd.org (Postfix) with ESMTP id 639158FC19 for ; Thu, 29 Apr 2010 11:20:35 +0000 (UTC) Received: from [91.205.172.21] (helo=webmail.bluelife.at) by mail.itac.at with esmtpa (Exim 4.63) (envelope-from ) id 1O7RBX-0008KR-LC; Thu, 29 Apr 2010 12:41:35 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Date: Thu, 29 Apr 2010 12:41:36 +0200 From: Bernhard Froehlich To: In-Reply-To: <4BD8980A.9000706@rawbw.com> References: <4BD8980A.9000706@rawbw.com> Message-ID: <6ee1a3134e128d8a0836be552e0c9f09@bluelife.at> X-Sender: decke@FreeBSD.org User-Agent: RoundCube Webmail/0.4-beta X-Spam-Score: 4.0 (++++) X-Spam-Report: Spam detection software, running on the system "mail.itac.at", 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 Wed, 28 Apr 2010 13:18:18 -0700, Yuri wrote: > VirtualBox kernel module (port emulators/virtualbox-ose-kmod) began to > cause system freezes from some kernel change around the end of January. > Once the system freezes it has to be rebooted. Soundcard, if it was > playing something, begins to cycle some very short piece. > Nothing is logged into /var/log/messages. > > Is there any way to troubleshoot this, like enabling some kernel > configuation options? > What is normally done in such case? > Should I run system under kernel debugger? But would it detect something [...] Content analysis details: (4.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.4 ALL_TRUSTED Passed through trusted hosts only via SMTP 3.4 FH_DATE_PAST_20XX The date is grossly in the future. 2.4 DNS_FROM_OPENWHOIS RBL: Envelope sender listed in bl.open-whois.org. -0.3 AWL AWL: From: address is in the auto white-list Cc: freebsd-hackers@freebsd.org, vbox@FreeBSD.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? 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, 29 Apr 2010 11:20:36 -0000 On Wed, 28 Apr 2010 13:18:18 -0700, Yuri wrote: > VirtualBox kernel module (port emulators/virtualbox-ose-kmod) began to > cause system freezes from some kernel change around the end of January. > Once the system freezes it has to be rebooted. Soundcard, if it was > playing something, begins to cycle some very short piece. > Nothing is logged into /var/log/messages. > > Is there any way to troubleshoot this, like enabling some kernel > configuation options? > What is normally done in such case? > Should I run system under kernel debugger? But would it detect something > if it's not a SEGV but the freeze? Mario Lobo currently sees something similar and has already tracked it down to probably be a drm/Xorg issue. It does work fine for him if he uses the virtualbox-ose-devel ports and VNC so without running an xserver on that machine. To debug this it's probably the best to try it with a serial console and the descriptions in the developers handbook. http://www.freebsd.org/doc/en/books/handbook/serialconsole-setup.html http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/kerneldebug-online-gdb.html -- Bernhard Froehlich http://www.bluelife.at/ From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 11:34:45 2010 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 5442F1065670 for ; Thu, 29 Apr 2010 11:34:45 +0000 (UTC) (envelope-from iputsikau@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB578FC12 for ; Thu, 29 Apr 2010 11:34:44 +0000 (UTC) Received: by pvg11 with SMTP id 11so168564pvg.13 for ; Thu, 29 Apr 2010 04:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=XT61SVJ8fUMNktID8508yOjxj4ov7Zpsn0voAEN8Wvs=; b=tYOAbB7poWrywTJtAFM85MbtPiYE1AIzY8pLN0aX2KVCJHhrzLeySoIGlPCDkj40FJ c3Vc5ueDWjloJCONpswdvGdRD8g2oF2zQKqI5ShlyzNjFUV5ssKPWhMLKj2DfTXestcr tcJtEhy9WX3XeNCH6LVQPyxMtHn6q+Up63K+o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HDEHs5PVHrcF7JqEP8vWCBsj+7N4ZFoDheoJIjcHylV49qdkuYmL4SfT3xW1k+HLS8 vi4xwczcAKpmgKgVODIUvhNvNmGbNvEruup51xkHk1GE1hMNwjOxSoSTTXZYdv7OuHCs fcwTFW+DNcgnAb6WJBb+SnCJ/pPyM9te+paTY= MIME-Version: 1.0 Received: by 10.141.213.27 with SMTP id p27mr9274550rvq.155.1272539104282; Thu, 29 Apr 2010 04:05:04 -0700 (PDT) Received: by 10.141.42.14 with HTTP; Thu, 29 Apr 2010 04:05:04 -0700 (PDT) Date: Thu, 29 Apr 2010 14:05:04 +0300 Message-ID: From: Ilya Putsikau To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: GSoC: File system changes notification 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, 29 Apr 2010 11:34:45 -0000 Hi all, This summer I'll add file system notification mechanism that works around limitations of kevent. It has the same limitation as Linux' dnotify once had: file or directory should be opened to monitor changes, preventing file system unmounting. Most of the applications in FreeBSD currently use polling because of this limitation (gamin, kde). I'll reuse existing kevent framework by attaching kevent listeners to vnodes on creation, implementation is to be kernel level, have user level inotify API compatibility and can be used to implement inotify support in linuxulator. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 13:10:04 2010 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 68EFD106566B for ; Thu, 29 Apr 2010 13:10:04 +0000 (UTC) (envelope-from z0.0z.furukawa@gmail.com) Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by mx1.freebsd.org (Postfix) with ESMTP id 308A48FC26 for ; Thu, 29 Apr 2010 13:10:03 +0000 (UTC) Received: by iwn42 with SMTP id 42so11118858iwn.14 for ; Thu, 29 Apr 2010 06:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=eZOZ8NlrI+w+R64qGH5oxbz0ZYY7wCgXJ33r/B5xflg=; b=IuhRrKe/ZeSBqKKEo+t6z5yZvG/r0Whfc5QQIz6686w6cz1ZCm4x7nX1WQG4ELUihr 6NV+esSgF4dWYAa2ji5zv59iK5vAGthucFbrp3/ApXlwbdwZiTgX0KcTVy2xaR3t4IPq lRkqyP0ocQCWS/WyFMtPiyTOt9MYTipzTUFyA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kgqapf7jIc4aGFQKNOONUzWGqKxecfqFnNgmB+T7UHgg3j3ohK56oHSTy3TLXXvaaO 1T5YsrjLp/Hvor+iOeRp1IW0r5ooDq5Tzz+TSKKDyK6d5cmwCN6AZU2oaeY2RubRW4n/ 7V867Mw2otwSM0+8S1ohLP0Lrn3jOiLDqkYyA= MIME-Version: 1.0 Received: by 10.231.182.211 with SMTP id cd19mr1629823ibb.55.1272545078291; Thu, 29 Apr 2010 05:44:38 -0700 (PDT) Received: by 10.231.156.81 with HTTP; Thu, 29 Apr 2010 05:44:38 -0700 (PDT) Date: Thu, 29 Apr 2010 21:44:38 +0900 Message-ID: From: furukawa jun To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to change vnode operations ? 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, 29 Apr 2010 13:10:04 -0000 Hi, I know the way for changing vnode operations because I did that for my graduate thesis. In that thesis I made a LKM that hooks vn_write() function. To make that software I referenced a book and a website listed below. "Joseph Kong. Designing BSD Rootkits: An Introduction to Kernel Hacking. No Starch Press, 2007." "Stephanie Wehner. Fun and games with freebsd kernel modules, April 2001. http:/ /www.r4k.net/mod/fbsdfun.html" As a reference, I show here the part of the source code of my software. #include /* module */ #include /* module */ #include /* module */ #include /* size_t, copystr */ #include /* copystr */ #include /* struct thread */ #include /* vnops */ #include /* msdosfs_vnodeops */ int fo_write_hook(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td); typedef int (*fow_t)(struct file*, struct uio*, struct ucred*, int flags, struct thread*); fow_t old_fo_write; char mybuf[256+1]; /* fo_write hook */ int fo_write_hook(struct file *fp, struct uio *uio, struct ucred *active_cred, int flags, struct thread *td) { * /* You can add here a new functinality. */* return (old_fo_write(fp, uio, active_cred, flags, td)); } /* The function called at load/unload */ static int load(struct module *module, int cmd, void *arg) { int error = 0; /* The declaration of msdosfs_vnodeops */ /* from /usr/include/fs/msdosfs/msdosfs_vnops.c */ /* extern struct vop_vector msdosfs_vnodeops */ /* The initialization of msdosfs_vnodeops */ /* from /usr/src/sys/fs/msdosfs/msdosfs_vnops.c */ //struct vop_vector msdosfs_vnodeops = { // ... // .vop_read = msdosfs_read, // ... // .vop_write = msdosfs_write, // ... //}; switch (cmd) { case MOD_LOAD: uprintf("Module has loaded\n"); /* Replace fo_write with fo_write_hook. */ old_fo_write = (fow_t)(vnops.fo_write); vnops.fo_write = fo_write_hook; break; case MOD_UNLOAD: uprintf("Module has unloaded\n"); /* Change everyhting back to normal. */ vnops.fo_write = old_fo_write; break; default: error = EOPNOTSUPP; break; } return (error); } static moduledata_t fo_write_hook_mod = { "fo_write_hook", /* module name */ load, /* event handler */ NULL /* EXTRA DATA */ }; DECLARE_MODULE(fo_write_hook, fo_write_hook_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); Jun Furukawa From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 17:52:52 2010 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 42889106566C for ; Thu, 29 Apr 2010 17:52:52 +0000 (UTC) (envelope-from czerner.lukas@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 C3D448FC08 for ; Thu, 29 Apr 2010 17:52:51 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so3340265fge.13 for ; Thu, 29 Apr 2010 10:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:message-id:user-agent:mime-version:content-type; bh=JMlQigtUH1MgJZ4XiKM0Y24YCFW2cCQiRIv0l4G/nEg=; b=NIt3ecypjeARk6EE4ufmexGru/yeJdiwxUHFYsmwKQIa19Eh26ApSbYYzLfETEw5Q9 gt8caX6x+sL8UnqXK/qVUhyFZBBGw+8rAV8RsbHSlQkX0CufH3kKh8wzJK3CSPPoyJ5Y WV2eCjJ2AqVT/HrIwRWIz7aE0JEmhzwy/sCMA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:message-id:user-agent :mime-version:content-type; b=rsFtmmLR69ZuCZRtPZiZSEkgPw7pW8Q1YaJQvm1l3RAAbVFlEeh2reLNeBKtl26zrL oMZqPTeUZEtIOsRsGyRUb8rkmM0UyLlAxhXOQH32PeRuf5MnzcIVbvXj8QU4qz9XAXIJ dbA/uBI0H2hRKqVbvnvucI+34KxELJ0D28uQQ= Received: by 10.87.58.6 with SMTP id l6mr163333fgk.15.1272563563964; Thu, 29 Apr 2010 10:52:43 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id e11sm12748357fga.23.2010.04.29.10.52.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 10:52:42 -0700 (PDT) Date: Thu, 29 Apr 2010 19:52:45 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: freebsd-hackers@freebsd.org Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: czerner.lukas@gmail.com Subject: ioctl, copy string from user 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, 29 Apr 2010 17:52:52 -0000 Hi, I know that there are plenty of examples in the kernel code, but I just can not get it working, so maybe I am doing some stupid mistake I am not aware of. Please give me a hint if you can. What I want to do is simply call the ioctl from the userspace with (char *) argument. Then, in kernel ioctl handling function copy the string argument into the kernel space. I have tried it various ways, everything without any success. *** Userspace *** char name[MAXLEN]; strncpy(name, argv[1], MAXLEN); fprintf(stdout,"Name: %s\n",name); if (ioctl(fd, MYIOCTL, name)) { ... *** Kernel *** case MYIOCTL: { char buffer[MAXLEN]; /* Yes I can allocate it dynamically, byt just for simplicity */ retval = copyinstr(ap->a_data, buffer, MAXLEN - 1, NULL); uprintf("In kerne - name : %s\n", buffer) ... The output is still the same at userspace app it prints out the name properly (obviously), but in kernel space it just prints out nothing. So I want to ask what is the proper way to do this ?? And the second question. I have commented that I can allocate buffer dynamically, but I suppose that there will be some locks involved so I think I can not just use M_WAITOK, am I right ? Thanks! -Lukas. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 17:57:04 2010 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 4624B1065670 for ; Thu, 29 Apr 2010 17:57:04 +0000 (UTC) (envelope-from czerner.lukas@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by mx1.freebsd.org (Postfix) with ESMTP id C1EBA8FC19 for ; Thu, 29 Apr 2010 17:57:03 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so2003216fgb.13 for ; Thu, 29 Apr 2010 10:56:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=by1HgbHFA3vLCp8pDTiHkmGjbGXn6jFCGgBX84Mjisg=; b=x4JJ4/V8yvKTouItJksyLUa3kOEcMKlxZFwVRubTnvdwIC+jtwh0qmOH0FC+4VWrhN Bo8rj7cgmT2NXa2/dTZeJvigA2LTLi5E9rr6rvJS3o8zEMqyjZidYTNiT+sAF2nedDy5 TCi06ezhMmeIH8k1cltCOWR8gGIG197/bXkGI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=E8dIUL70DtKVRTCb2v4REedZTR+iwald5HYatbGACOkeDIYvm0CA+qdK1Qy1opgdHo Sb0CcqIbWhXjSkNCO+OJSv970o189dOVENQ+w1RLIHvz+pBYSVXa+X01+uTijXCqrEGT iiOGxRoa3juLAh5SE781W1ypDlrWkLow9aOJU= Received: by 10.87.15.35 with SMTP id s35mr2152274fgi.12.1272563814833; Thu, 29 Apr 2010 10:56:54 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id d8sm4097575fga.21.2010.04.29.10.56.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 10:56:53 -0700 (PDT) Date: Thu, 29 Apr 2010 19:56:56 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1016914840-1272563817=:30007" Cc: freebsd-hackers@freebsd.org Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 17:57:04 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1016914840-1272563817=:30007 Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, LukᨠCzerner wrote: > Date: Thu, 29 Apr 2010 19:52:45 +0200 (CEST) > From: LukᨠCzerner > To: freebsd-hackers@freebsd.org > Cc: czerner.lukas@gmail.com > Subject: ioctl, copy string from user > > Hi, > > I know that there are plenty of examples in the kernel code, but I > just can not get it working, so maybe I am doing some stupid mistake > I am not aware of. Please give me a hint if you can. > > What I want to do is simply call the ioctl from the userspace with > (char *) argument. Then, in kernel ioctl handling function copy the > string argument into the kernel space. I have tried it various ways, > everything without any success. > > *** Userspace *** > char name[MAXLEN]; > > strncpy(name, argv[1], MAXLEN); > fprintf(stdout,"Name: %s\n",name); > > if (ioctl(fd, MYIOCTL, name)) { > ... > > > *** Kernel *** > case MYIOCTL: { > char buffer[MAXLEN]; /* Yes I can allocate it dynamically, > byt just for simplicity */ > > retval = copyinstr(ap->a_data, buffer, MAXLEN - 1, NULL); > uprintf("In kerne - name : %s\n", buffer) > ... Oh and I should probably note that structure ap is : struct vop_ioctl_args *ap so I am doing that in filesystem code. > > The output is still the same at userspace app it prints out the name > properly (obviously), but in kernel space it just prints out > nothing. So I want to ask what is the proper way to do this ?? > > And the second question. I have commented that I can allocate buffer > dynamically, but I suppose that there will be some locks involved so > I think I can not just use M_WAITOK, am I right ? > > Thanks! > -Lukas. > --8323329-1016914840-1272563817=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 18:18:53 2010 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 3745C106566C for ; Thu, 29 Apr 2010 18:18:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0743B8FC19 for ; Thu, 29 Apr 2010 18:18:53 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AB8A446B03; Thu, 29 Apr 2010 14:18:52 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id B5D6B8A021; Thu, 29 Apr 2010 14:18:51 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 29 Apr 2010 14:18:09 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <201004291418.09768.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 29 Apr 2010 14:18:51 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: =?utf-8?q?Luk=C3=A1=C5=A1?= Czerner Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 18:18:53 -0000 On Thursday 29 April 2010 1:52:45 pm Luk=C3=A1=C5=A1 Czerner wrote: > Hi, >=20 > I know that there are plenty of examples in the kernel code, but I > just can not get it working, so maybe I am doing some stupid mistake > I am not aware of. Please give me a hint if you can. >=20 > What I want to do is simply call the ioctl from the userspace with > (char *) argument. Then, in kernel ioctl handling function copy the > string argument into the kernel space. I have tried it various ways, > everything without any success. >=20 > *** Userspace *** > char name[MAXLEN]; >=20 > strncpy(name, argv[1], MAXLEN); > fprintf(stdout,"Name: %s\n",name); >=20 > if (ioctl(fd, MYIOCTL, name)) { On BSD systems, ioctl() copies the data into the kernel for you ahead of ti= me. =20 What does the definition of MYIOCTL look like? > And the second question. I have commented that I can allocate buffer > dynamically, but I suppose that there will be some locks involved so > I think I can not just use M_WAITOK, am I right ? malloc() and free() acquire their own locks internally, you do not need to= =20 hold any locks to call them. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 19:21:01 2010 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 30393106567C for ; Thu, 29 Apr 2010 19:21:01 +0000 (UTC) (envelope-from czerner.lukas@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 ACF728FC20 for ; Thu, 29 Apr 2010 19:21:00 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so2035374fgb.13 for ; Thu, 29 Apr 2010 12:21:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=MOD0JkEpfjeIisdc0HkudzOk6eZFikY1T4OmCfb+Vyg=; b=DSM3cnJIvqvCR6jnJNz4JgZPmOsW2llf91hljpuk4YFlCDGOLTsvT26+aPzt2l4X0+ vu3+zzLsD8bEkQetQ1VxuUO62N2nxdKp0yLa3BnUmL9pN2AP3Y82LNbBWs9H8UImUidy Wvq6EVEhGG5XCc4a2AVi8iUFJwrJ9DzM43hnE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=wv4KxyOEhSDS7FngTZSCQyv3VssgRNDvV9Q9zwAEEkMVCSvXd+84ZfSMOZ5wJhs5+2 yfwzNxunH3i3p3KU/nsMtG11qh2Afm0pMdwbb7NZHAA07tPEhJzsJfrUPgbPeXfk4H3Z GcXZTL98emHtE5IQiunhS+miZ4wxkGleO1d/8= Received: by 10.86.6.37 with SMTP id 37mr2159859fgf.7.1272568858299; Thu, 29 Apr 2010 12:20:58 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id d4sm3074983fga.25.2010.04.29.12.20.57 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 12:20:57 -0700 (PDT) Date: Thu, 29 Apr 2010 21:21:00 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: John Baldwin In-Reply-To: <201004291418.09768.jhb@freebsd.org> Message-ID: References: <201004291418.09768.jhb@freebsd.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1225407102-1272568861=:30007" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 19:21:01 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1225407102-1272568861=:30007 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, John Baldwin wrote: > Date: Thu, 29 Apr 2010 14:18:09 -0400 > From: John Baldwin > To: freebsd-hackers@freebsd.org > Cc: Lukáš Czerner > Subject: Re: ioctl, copy string from user > > On Thursday 29 April 2010 1:52:45 pm Lukáš Czerner wrote: > > Hi, > > > > I know that there are plenty of examples in the kernel code, but I > > just can not get it working, so maybe I am doing some stupid mistake > > I am not aware of. Please give me a hint if you can. > > > > What I want to do is simply call the ioctl from the userspace with > > (char *) argument. Then, in kernel ioctl handling function copy the > > string argument into the kernel space. I have tried it various ways, > > everything without any success. > > > > *** Userspace *** > > char name[MAXLEN]; > > > > strncpy(name, argv[1], MAXLEN); > > fprintf(stdout,"Name: %s\n",name); > > > > if (ioctl(fd, MYIOCTL, name)) { > > On BSD systems, ioctl() copies the data into the kernel for you ahead of time. > What does the definition of MYIOCTL look like? #define MYIOCTL _IOW('M', 0, char *) > > > And the second question. I have commented that I can allocate buffer > > dynamically, but I suppose that there will be some locks involved so > > I think I can not just use M_WAITOK, am I right ? > > malloc() and free() acquire their own locks internally, you do not need to > hold any locks to call them. I probably does not express what I meant very clearly. My concern is that when I am calling malloc with M_WAITOK I can sleep (be rescheduled) and it may be bad thing if I am holding some lock, because I can block others, am I right ? --8323329-1225407102-1272568861=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 19:36:46 2010 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 278D01065673 for ; Thu, 29 Apr 2010 19:36:46 +0000 (UTC) (envelope-from tomtinn@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id B74788FC19 for ; Thu, 29 Apr 2010 19:36:45 +0000 (UTC) Received: by wyb36 with SMTP id 36so601765wyb.13 for ; Thu, 29 Apr 2010 12:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=n7qeP9o9dhv/znf6sJTWHKXfmGg6hHlWUwGsrD2o/xc=; b=g1fPN9Uj2qIW8WmcdFQp6Pj/P9tQii9Xr5bMBjPSKFYFaIK/M8y0nK/bbxi6NsU4vx xaePaQ1zXJ54dOm739AViov67Qe1KnAHPSSdHMcewANv7fIWLv08qUKZZT54Xnqw58L6 VoTKrw4uok8HGmZtRtOdAqurEgI+UZjzFqrfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ZiRvITkLnNpytf5dc8oeDy7WK3xzoHNJDzgbfl7MeNk7hwSITMoZDl79zrS+VM5YGW H/+6DA3XpxsB+DK+ORrDPxw2kTCJ7xqllccJHoKCxHIz47gRETc+qQtKO0kBnDmP1+gN rAqvvz2nHkn9O2d0yQxL1PMIUZtf/AjL8hkBo= MIME-Version: 1.0 Received: by 10.216.90.208 with SMTP id e58mr5011007wef.57.1272567977797; Thu, 29 Apr 2010 12:06:17 -0700 (PDT) Received: by 10.216.166.16 with HTTP; Thu, 29 Apr 2010 12:06:17 -0700 (PDT) Date: Thu, 29 Apr 2010 19:06:17 +0000 Message-ID: From: Gunnar Hinriksson To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Ptrace segfault 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, 29 Apr 2010 19:36:46 -0000 Hello Im having a little problem using ptrace on my system. If I use ptrace to attach to another process the child process segfaults once I detach. For example using this simple program. #include #include #include #include #include int main(int argc, char *argv[]) { int pid = atoi(argv[1]); ptrace(PT_ATTACH, pid, 0, 0); wait(NULL); ptrace(PT_DETACH, pid, 0, 0); return 0; } Am I using ptrace incorrectly or is there perhaps a bug in ptrace that causes the child to always segfault ? With Regards Gunnar FreeBSD knut 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #0: Tue Apr 27 04:36:16 UTC 2010 gunnar@knut:/usr/obj/usr/src/sys/GENERIC amd64 From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 20:06:59 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C0CB106566B for ; Thu, 29 Apr 2010 20:06:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 695038FC1B for ; Thu, 29 Apr 2010 20:06:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1098C46B0D; Thu, 29 Apr 2010 16:06:59 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 509DC8A01F; Thu, 29 Apr 2010 16:06:58 -0400 (EDT) From: John Baldwin To: "=?iso-8859-15?q?Luk=E1=A8?= Czerner" Date: Thu, 29 Apr 2010 16:06:35 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201004291418.09768.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201004291606.35899.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 29 Apr 2010 16:06:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 20:06:59 -0000 On Thursday 29 April 2010 3:21:00 pm Luk=E1=A8 Czerner wrote: > On Thu, 29 Apr 2010, John Baldwin wrote: >=20 > > Date: Thu, 29 Apr 2010 14:18:09 -0400 > > From: John Baldwin > > To: freebsd-hackers@freebsd.org > > Cc: Luk=E1=A8 Czerner > > Subject: Re: ioctl, copy string from user > >=20 > > On Thursday 29 April 2010 1:52:45 pm Luk=E1=A8 Czerner wrote: > > > Hi, > > >=20 > > > I know that there are plenty of examples in the kernel code, but I > > > just can not get it working, so maybe I am doing some stupid mistake > > > I am not aware of. Please give me a hint if you can. > > >=20 > > > What I want to do is simply call the ioctl from the userspace with > > > (char *) argument. Then, in kernel ioctl handling function copy the > > > string argument into the kernel space. I have tried it various ways, > > > everything without any success. > > >=20 > > > *** Userspace *** > > > char name[MAXLEN]; > > >=20 > > > strncpy(name, argv[1], MAXLEN); > > > fprintf(stdout,"Name: %s\n",name); > > >=20 > > > if (ioctl(fd, MYIOCTL, name)) { > >=20 > > On BSD systems, ioctl() copies the data into the kernel for you ahead o= f=20 time. =20 > > What does the definition of MYIOCTL look like? >=20 > #define MYIOCTL _IOW('M', 0, char *) Ok. In that case the argument to ioctl needs to be a pointer to a char *, not the raw char * itself. Try doing 'ioctl(fd, MYIOCTL, &name)' from=20 userland to see if that fixes it. > > > And the second question. I have commented that I can allocate buffer > > > dynamically, but I suppose that there will be some locks involved so > > > I think I can not just use M_WAITOK, am I right ? > >=20 > > malloc() and free() acquire their own locks internally, you do not need= to=20 > > hold any locks to call them. >=20 > I probably does not express what I meant very clearly. My concern is > that when I am calling malloc with M_WAITOK I can sleep (be > rescheduled) and it may be bad thing if I am holding some lock, > because I can block others, am I right ? Generally yes, but it depends on the lock. If it is the vn_lock lock then = it=20 is ok to do a blocking malloc(). As a general rule I do try to call malloc= () before acquiring locks (basically preallocating) whenever possible. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 20:28:38 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F05C106566C; Thu, 29 Apr 2010 20:28:38 +0000 (UTC) (envelope-from czerner.lukas@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 208C58FC19; Thu, 29 Apr 2010 20:28:36 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so2060614fgb.13 for ; Thu, 29 Apr 2010 13:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=uIWEFG9KgSyPlZnIMoXEd7lh5705fWYVF1e9a9V3kRg=; b=snb5C8YQzKdxylidq3xL89IWvoBmSTZINRhNFWPTWbHX5mAmJgoiBKlzuaCL8hY2hJ KyCG3aKmJVT5B73M3FWXAKAA8D8dGFndjZ/84Dnosx9lWreR3nYYPXMJfMUat3AcbUUI HSUmB+SmZ+7DwfQECrYfk778Ge/i5HJnmBnzc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=dnK0av7gmsnBZh75321Cgbx0y/Fte53XaWNvxJreOoSlubjeeKQHhEQxiG0vs0HOMc CCFAGUOb7RMjr5yXsgonqs7RdIlmrphImH0PR+VjbaNkXpJphqeB/ccc1/IbR9gRovr/ E/pzPWY6shMMI8b1tomw5TthmgUpR7VzvQcYg= Received: by 10.87.58.6 with SMTP id l6mr497928fgk.15.1272572908587; Thu, 29 Apr 2010 13:28:28 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id e3sm3172212fga.14.2010.04.29.13.28.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 13:28:27 -0700 (PDT) Date: Thu, 29 Apr 2010 22:28:31 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: John Baldwin In-Reply-To: <201004291606.35899.jhb@freebsd.org> Message-ID: References: <201004291418.09768.jhb@freebsd.org> <201004291606.35899.jhb@freebsd.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-226625673-1272572912=:30007" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 20:28:38 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-226625673-1272572912=:30007 Content-Type: TEXT/PLAIN; charset=iso-8859-15 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, John Baldwin wrote: > > > > > > On Thursday 29 April 2010 1:52:45 pm LukᨠCzerner wrote: > > > > Hi, > > > > > > > > I know that there are plenty of examples in the kernel code, but I > > > > just can not get it working, so maybe I am doing some stupid mistake > > > > I am not aware of. Please give me a hint if you can. > > > > > > > > What I want to do is simply call the ioctl from the userspace with > > > > (char *) argument. Then, in kernel ioctl handling function copy the > > > > string argument into the kernel space. I have tried it various ways, > > > > everything without any success. > > > > > > > > *** Userspace *** > > > > char name[MAXLEN]; > > > > > > > > strncpy(name, argv[1], MAXLEN); > > > > fprintf(stdout,"Name: %s\n",name); > > > > > > > > if (ioctl(fd, MYIOCTL, name)) { > > > > > > On BSD systems, ioctl() copies the data into the kernel for you ahead of > time. > > > What does the definition of MYIOCTL look like? > > > > #define MYIOCTL _IOW('M', 0, char *) > > Ok. In that case the argument to ioctl needs to be a pointer to a char *, > not the raw char * itself. Try doing 'ioctl(fd, MYIOCTL, &name)' from > userland to see if that fixes it. I have already tried that, but still without any success. The buffer remains unchanged (which is weird IMO). Just FYI I am using FreeBSD-8. > > > > > And the second question. I have commented that I can allocate buffer > > > > dynamically, but I suppose that there will be some locks involved so > > > > I think I can not just use M_WAITOK, am I right ? > > > > > > malloc() and free() acquire their own locks internally, you do not need to > > > hold any locks to call them. > > > > I probably does not express what I meant very clearly. My concern is > > that when I am calling malloc with M_WAITOK I can sleep (be > > rescheduled) and it may be bad thing if I am holding some lock, > > because I can block others, am I right ? > > Generally yes, but it depends on the lock. If it is the vn_lock lock then it > is ok to do a blocking malloc(). As a general rule I do try to call malloc() > before acquiring locks (basically preallocating) whenever possible. So I suppose M_NOWAIT will do the trick when there is no other way (preallocations etc..) ? Of course I should test if it does not return NULL then. Thanks. --8323329-226625673-1272572912=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 20:56:59 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 89A35106566C for ; Thu, 29 Apr 2010 20:56:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 593788FC14 for ; Thu, 29 Apr 2010 20:56:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id D847346B0C; Thu, 29 Apr 2010 16:56:58 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 2FF828A01F; Thu, 29 Apr 2010 16:56:58 -0400 (EDT) From: John Baldwin To: "=?iso-8859-15?q?Luk=E1=A8?= Czerner" Date: Thu, 29 Apr 2010 16:56:12 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: <201004291606.35899.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201004291656.12565.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 29 Apr 2010 16:56:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 20:56:59 -0000 On Thursday 29 April 2010 4:28:31 pm Luk=E1=A8 Czerner wrote: > On Thu, 29 Apr 2010, John Baldwin wrote: > > > >=20 > > > > On Thursday 29 April 2010 1:52:45 pm Luk=E1=A8 Czerner wrote: > > > > > Hi, > > > > >=20 > > > > > I know that there are plenty of examples in the kernel code, but I > > > > > just can not get it working, so maybe I am doing some stupid mist= ake > > > > > I am not aware of. Please give me a hint if you can. > > > > >=20 > > > > > What I want to do is simply call the ioctl from the userspace with > > > > > (char *) argument. Then, in kernel ioctl handling function copy t= he > > > > > string argument into the kernel space. I have tried it various wa= ys, > > > > > everything without any success. > > > > >=20 > > > > > *** Userspace *** > > > > > char name[MAXLEN]; > > > > >=20 > > > > > strncpy(name, argv[1], MAXLEN); > > > > > fprintf(stdout,"Name: %s\n",name); > > > > >=20 > > > > > if (ioctl(fd, MYIOCTL, name)) { > > > >=20 > > > > On BSD systems, ioctl() copies the data into the kernel for you ahe= ad of=20 > > time. =20 > > > > What does the definition of MYIOCTL look like? > > >=20 > > > #define MYIOCTL _IOW('M', 0, char *) > >=20 > > Ok. In that case the argument to ioctl needs to be a pointer to a char= *, > > not the raw char * itself. Try doing 'ioctl(fd, MYIOCTL, &name)' from= =20 > > userland to see if that fixes it. >=20 > I have already tried that, but still without any success. The buffer > remains unchanged (which is weird IMO). Can you print out the value of 'ap->a_data' from the kernel and the value of '&name' in userland? > > Generally yes, but it depends on the lock. If it is the vn_lock lock t= hen it=20 > > is ok to do a blocking malloc(). As a general rule I do try to call ma= lloc() > > before acquiring locks (basically preallocating) whenever possible. >=20 > So I suppose M_NOWAIT will do the trick when there is no other way > (preallocations etc..) ? Of course I should test if it does not > return NULL then. Yes, but in a VOP_IOCTL() handler it should be safe to M_WAITOK malloc() as long as you do it before you acquire any mutexes. =2D-=20 John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 20:58:03 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B142E1065673 for ; Thu, 29 Apr 2010 20:58:03 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from bunrab.catwhisker.org (adsl-63-193-123-122.dsl.snfc21.pacbell.net [63.193.123.122]) by mx1.freebsd.org (Postfix) with ESMTP id 609648FC21 for ; Thu, 29 Apr 2010 20:58:03 +0000 (UTC) Received: from bunrab.catwhisker.org (localhost [127.0.0.1]) by bunrab.catwhisker.org (8.13.3/8.13.3) with ESMTP id o3TKvq8L030576 for ; Thu, 29 Apr 2010 13:57:52 -0700 (PDT) (envelope-from david@bunrab.catwhisker.org) Received: (from david@localhost) by bunrab.catwhisker.org (8.13.3/8.13.3/Submit) id o3TKvq8g030575 for hackers@freebsd.org; Thu, 29 Apr 2010 13:57:52 -0700 (PDT) (envelope-from david) Date: Thu, 29 Apr 2010 13:57:52 -0700 From: David Wolfskill To: hackers@freebsd.org Message-ID: <20100429205752.GQ96847@bunrab.catwhisker.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vaHlF1o0eSLrKmNa" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Cc: Subject: Should I expect to be able to source upgrade stable/7 -> stable/8? 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, 29 Apr 2010 20:58:03 -0000 --vaHlF1o0eSLrKmNa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I'm in the process of setting up some "reference" machines at work; about the only "interesting" thing about them is that each is configured to be able to boot from any of the 4 MBR slices; I have a script for "cloning" one slice to another, at which point I can boot from the newly-populated slice and do a source upgrade -- and I can run tests (e.g., software builds) under each environment with fairly good confidence that -- save for external factors that aren't under my control -- I can compare results when booted from one slice vs. results when booted from a different slice. After getting the 7.x machine set up, I effectively cloned it to be the starting-point for the 8.x machine. I then booted from a recent stable/7, updated sources to stable/8, then: * cd /usr/src * make buildworld * make kernel # I'm using GENERIC for 8.x; I had used MAC for 7.x * reboot to single user Well, I tried to. I got some fairly ugly errors trying to mount root -- and the KVM system at work, combined with no PS/2 keyboard ports on these machines conspired to render the machine completely non-responsive at this point. (And the only facility for capturing the screen content was as a JPEG image; I'm not willing to sned a JPEG image to -hackers@, and I'm not quite desperate enough to transcribe it by hand. If the following experiment fails similarly, I'll put the image up on my Web server somewhere.) I'm in the process of repeating the experiment, starting with upgrading from stable-7 r205655 to stable/7 r207388 first. If I should update sources to an earlier point for 8.x, I'd appreciate a "heads up" sooner, vs. later. :-} [I note that /usr/src/UPDATING labeled "stable/8/UPDATING 206382 2010-04-07 19:04:36Z ume" doesn't literally address the above; rather, it claims to have instructions (at the end) "To upgrade in-place from 5.x-stable to current" -- it might be a Nice Touch to update that before 8.1-RELEASE, I suspect.] Thanks! Peace, david --=20 David H. Wolfskill david@catwhisker.org Depriving a girl or boy of an opportunity for education is evil. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --vaHlF1o0eSLrKmNa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iEYEARECAAYFAkvZ8tAACgkQmprOCmdXAD0StACdE7Hj18qnnNjHY29XEFzeIYT0 VWUAn3mxZbdeGMPDZuGOE2mcnTdHbYrx =LjOr -----END PGP SIGNATURE----- --vaHlF1o0eSLrKmNa-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 20:58:08 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E52451065670; Thu, 29 Apr 2010 20:58:08 +0000 (UTC) (envelope-from yuri@rawbw.com) Received: from shell0.rawbw.com (shell0.rawbw.com [198.144.192.45]) by mx1.freebsd.org (Postfix) with ESMTP id B612F8FC1C; Thu, 29 Apr 2010 20:58:08 +0000 (UTC) Received: from eagle.syrec.org (stunnel@localhost [127.0.0.1]) (authenticated bits=0) by shell0.rawbw.com (8.14.4/8.14.4) with ESMTP id o3TKw7rF020288; Thu, 29 Apr 2010 13:58:08 -0700 (PDT) (envelope-from yuri@rawbw.com) Message-ID: <4BD9F2DF.1090204@rawbw.com> Date: Thu, 29 Apr 2010 13:58:07 -0700 From: Yuri User-Agent: Thunderbird 2.0.0.24 (X11/20100331) MIME-Version: 1.0 To: Bernhard Froehlich References: <4BD8980A.9000706@rawbw.com> <6ee1a3134e128d8a0836be552e0c9f09@bluelife.at> In-Reply-To: <6ee1a3134e128d8a0836be552e0c9f09@bluelife.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, vbox@freebsd.org Subject: Re: How to troubleshoot why VirtualBox kernel module freezes the system? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: yuri@rawbw.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 20:58:09 -0000 Bernhard Froehlich wrote: > Mario Lobo currently sees something similar and has already tracked it > down to probably be a drm/Xorg issue. It does work fine for him if he uses > the virtualbox-ose-devel ports and VNC so without running an xserver on > that machine. > Looks like you are right. Now I am running VirtualBox from virtualbox-ose ports under vnc on the same machine where xserver is (with nvidia driver) without a problem. This appears to be a workaround. Thank you! Yuri From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 21:10:01 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 903891065674; Thu, 29 Apr 2010 21:10:01 +0000 (UTC) (envelope-from czerner.lukas@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 D9DD48FC19; Thu, 29 Apr 2010 21:10:00 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so3415394fge.13 for ; Thu, 29 Apr 2010 14:09:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=vGax1vB/lMcGNpB2aSm/sd4Srp1PbJSh0zkxXTZNtDM=; b=nrPGfLvVR0QrusBegYfzD2K7hxZgCCZdCyHguKNAJgFIAgR/tMZJvuFGYTMcL5RKRG QxotVJuZui+kuHIoFPV34bndPUNbfU9SS2/gbZgiNJZCej5vrqs73qBGKMP5AJ8FOPoo w+pkOSlBKDXejyIbUNrErIPb9vVQBztYbULFU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=ccHpG1grEkrdMI51pBYOPIrdEsKLhmKSdUXT7mquqRFzHEMCEDWNxU/ZqaJ5Exjf7w UBQq5ZKY/Zh4dKImOyIelnZGuSmvPRPBOMgKqgfeqUcHAGg98tTN1psJW/Lad60doX4U VBtPPw29u7KGF37RpCL5sSgyVTTiA8ycPFeyY= Received: by 10.86.22.31 with SMTP id 31mr2316442fgv.24.1272575389966; Thu, 29 Apr 2010 14:09:49 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id 4sm3196669fgg.27.2010.04.29.14.09.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 14:09:48 -0700 (PDT) Date: Thu, 29 Apr 2010 23:09:51 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= In-Reply-To: Message-ID: References: <201004291418.09768.jhb@freebsd.org> <201004291606.35899.jhb@freebsd.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1438505303-1272575392=:30007" Cc: freebsd-hackers@freebsd.org Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 21:10:01 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1438505303-1272575392=:30007 Content-Type: TEXT/PLAIN; charset=iso-8859-15 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, LukᨠCzerner wrote: > Date: Thu, 29 Apr 2010 22:28:31 +0200 (CEST) > From: LukᨠCzerner > To: John Baldwin > Cc: LukᨠCzerner , freebsd-hackers@freebsd.org > Subject: Re: ioctl, copy string from user > > On Thu, 29 Apr 2010, John Baldwin wrote: > > > > > > > > On Thursday 29 April 2010 1:52:45 pm LukᨠCzerner wrote: > > > > > Hi, > > > > > > > > > > I know that there are plenty of examples in the kernel code, but I > > > > > just can not get it working, so maybe I am doing some stupid mistake > > > > > I am not aware of. Please give me a hint if you can. > > > > > > > > > > What I want to do is simply call the ioctl from the userspace with > > > > > (char *) argument. Then, in kernel ioctl handling function copy the > > > > > string argument into the kernel space. I have tried it various ways, > > > > > everything without any success. > > > > > > > > > > *** Userspace *** > > > > > char name[MAXLEN]; > > > > > > > > > > strncpy(name, argv[1], MAXLEN); > > > > > fprintf(stdout,"Name: %s\n",name); > > > > > > > > > > if (ioctl(fd, MYIOCTL, name)) { > > > > > > > > On BSD systems, ioctl() copies the data into the kernel for you ahead of > > time. > > > > What does the definition of MYIOCTL look like? > > > > > > #define MYIOCTL _IOW('M', 0, char *) > > > > Ok. In that case the argument to ioctl needs to be a pointer to a char *, > > not the raw char * itself. Try doing 'ioctl(fd, MYIOCTL, &name)' from > > userland to see if that fixes it. > > I have already tried that, but still without any success. The buffer > remains unchanged (which is weird IMO). > > Just FYI I am using FreeBSD-8. > > > > > > > And the second question. I have commented that I can allocate buffer > > > > > dynamically, but I suppose that there will be some locks involved so > > > > > I think I can not just use M_WAITOK, am I right ? > > > > > > > > malloc() and free() acquire their own locks internally, you do not need to > > > > hold any locks to call them. > > > > > > I probably does not express what I meant very clearly. My concern is > > > that when I am calling malloc with M_WAITOK I can sleep (be > > > rescheduled) and it may be bad thing if I am holding some lock, > > > because I can block others, am I right ? > > > > Generally yes, but it depends on the lock. If it is the vn_lock lock then it > > is ok to do a blocking malloc(). As a general rule I do try to call malloc() > > before acquiring locks (basically preallocating) whenever possible. > > So I suppose M_NOWAIT will do the trick when there is no other way > (preallocations etc..) ? Of course I should test if it does not > return NULL then. > > Thanks. Ok, so I have manage to get it working, but I doubt this is the proper way of doing this: #define MYIOCTL _IOW('M', 0, char[MAXLEN]) ** Userspace ** ioctl(fd, MYIOCTL, &name) ** Kernel ** name = (char *)ap->a_data; uprintf("Name : %s\n", name); Apparently I need to tell ioctl how big is the variable I am providing to it ([MAXLEN]). The odd thing is, when I have a structure like this: struct lrfs_attach_info { char *name; int priority; }; and I pass the pointer to that structure to the ioctl, it just works. I can even use the 'name' string from the structure without any problems, apparently it translates the pointer properly, but I did not expect this... --8323329-1438505303-1272575392=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 21:19:48 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52510106566C for ; Thu, 29 Apr 2010 21:19:48 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f224.google.com (mail-ew0-f224.google.com [209.85.219.224]) by mx1.freebsd.org (Postfix) with ESMTP id D41958FC08 for ; Thu, 29 Apr 2010 21:19:47 +0000 (UTC) Received: by ewy24 with SMTP id 24so5078129ewy.33 for ; Thu, 29 Apr 2010 14:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=zUEmUd18xPrBtzaqmgOw/PBmoQcZfw0RAFZO7jrkCl4=; b=rrdiJ+cpKI8IO6Xray9vZNFKmh2Mz3wbmYRPrm81kjGYz/qcvZTC0iHDmQ01LtYvWB OCRqOy+1sfjDAigXC09y/xwEK1aBxpL5PnTvTAP1+4idgAd1WgZkqM5Y2BsH9m2mqN/I OGmyg6o3OxN+t/7s+hwdHnTVBBJfNNYfqI1Nk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=qbo9Jxxv0Ph3FKFipHupHIBsYGq7K1zu1VbX3HkEFkmzabjvE4xvKX3ln8HQmlXdli lXZigKyqv9PPf2mNkK7kwG3YQcdilUpQieu1KLSyiWZHZdGXdaDDN4B31AY9ob2pj4ed tdrA8zKPRCMiH1iwU7OBuc9uhRgbWEaNtm0RM= MIME-Version: 1.0 Received: by 10.213.110.135 with SMTP id n7mr3645955ebp.66.1272575981227; Thu, 29 Apr 2010 14:19:41 -0700 (PDT) Received: by 10.213.10.6 with HTTP; Thu, 29 Apr 2010 14:19:41 -0700 (PDT) In-Reply-To: References: <201004291418.09768.jhb@freebsd.org> <201004291606.35899.jhb@freebsd.org> Date: Thu, 29 Apr 2010 17:19:41 -0400 Message-ID: From: Ryan Stone To: =?ISO-8859-2?Q?Luk=E1=B9_Czerner?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 21:19:48 -0000 > Apparently I need to tell ioctl how big is the variable I am > providing to it ([MAXLEN]). The odd thing is, when I have a structure > like this: > > struct lrfs_attach_info { > =A0 =A0 =A0 =A0char *name; > =A0 =A0 =A0 =A0int priority; > }; > > and I pass the pointer to that structure to the ioctl, it just > works. I can even use the 'name' string from the structure without > any problems, apparently it translates the pointer properly, but I > did not expect this... I think that you'll find that what actually happens is that you're reading from the userspace pointer. That will work as long as the pointer is mapped, but you'll panic if what it points to gets swapped out or is invalid. From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 21:19:53 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8593D106564A; Thu, 29 Apr 2010 21:19:53 +0000 (UTC) (envelope-from czerner.lukas@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 C92B38FC13; Thu, 29 Apr 2010 21:19:52 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so3419024fge.13 for ; Thu, 29 Apr 2010 14:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=qqeXIzzYqEvJhVMBj67EbjBE6HF0/Z8UW1S7uV8oKvg=; b=In3zUWrC7NSxar3CCGnpnLs861i+rHJAMyHTFFJd2tHwaEr+dXrbV5ZqCQT8a9pG/D Mk+yCMgC8XFcWIAfv8r7/37EgN6lhSPEBjusQPrM1EMf2OLU7SWFZ/44Y/tiu4yeaVuM ZPeHALe8+Y0u19w92ffJ3BbCkw0+O/3XndeoY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=sGIrvzM2vcGKk3R5ZOu+9tEX40T1HmfMX6G5yzPud1nsILUSMEFbUCHhpvFAvuVZYD qhBsrkacoj2EwgqkWSidlZotjx4w+XneyM824ze4s4Eb/RsyGOrDexWM4SQFuBZtgpk1 XI32oJSmEfhlXB0LaEz6Y6nXjvaFLoWD0Fd4o= Received: by 10.87.53.28 with SMTP id f28mr2496657fgk.70.1272575991777; Thu, 29 Apr 2010 14:19:51 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id e3sm2797760fga.4.2010.04.29.14.19.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 14:19:51 -0700 (PDT) Date: Thu, 29 Apr 2010 23:19:54 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: John Baldwin In-Reply-To: <201004291656.12565.jhb@freebsd.org> Message-ID: References: <201004291606.35899.jhb@freebsd.org> <201004291656.12565.jhb@freebsd.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1067549723-1272575995=:30007" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 21:19:53 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1067549723-1272575995=:30007 Content-Type: TEXT/PLAIN; charset=iso-8859-15 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, John Baldwin wrote: > Date: Thu, 29 Apr 2010 16:56:12 -0400 > From: John Baldwin > To: LukᨠCzerner > Cc: freebsd-hackers@freebsd.org > Subject: Re: ioctl, copy string from user > > On Thursday 29 April 2010 4:28:31 pm LukᨠCzerner wrote: > > On Thu, 29 Apr 2010, John Baldwin wrote: > > > > > > > > > > On Thursday 29 April 2010 1:52:45 pm LukᨠCzerner wrote: > > > > > > Hi, > > > > > > > > > > > > I know that there are plenty of examples in the kernel code, but I > > > > > > just can not get it working, so maybe I am doing some stupid mistake > > > > > > I am not aware of. Please give me a hint if you can. > > > > > > > > > > > > What I want to do is simply call the ioctl from the userspace with > > > > > > (char *) argument. Then, in kernel ioctl handling function copy the > > > > > > string argument into the kernel space. I have tried it various ways, > > > > > > everything without any success. > > > > > > > > > > > > *** Userspace *** > > > > > > char name[MAXLEN]; > > > > > > > > > > > > strncpy(name, argv[1], MAXLEN); > > > > > > fprintf(stdout,"Name: %s\n",name); > > > > > > > > > > > > if (ioctl(fd, MYIOCTL, name)) { > > > > > > > > > > On BSD systems, ioctl() copies the data into the kernel for you ahead of > > > time. > > > > > What does the definition of MYIOCTL look like? > > > > > > > > #define MYIOCTL _IOW('M', 0, char *) > > > > > > Ok. In that case the argument to ioctl needs to be a pointer to a char *, > > > not the raw char * itself. Try doing 'ioctl(fd, MYIOCTL, &name)' from > > > userland to see if that fixes it. > > > > I have already tried that, but still without any success. The buffer > > remains unchanged (which is weird IMO). > > Can you print out the value of 'ap->a_data' from the kernel and the value of > '&name' in userland? fprintf(stdout,"Name: %s\n",name); Name: Dummyflt uprintf("Name: %s\n", name) Name: When I set the name variable before copyinstr() it remains unchanged. > > > > Generally yes, but it depends on the lock. If it is the vn_lock lock then it > > > is ok to do a blocking malloc(). As a general rule I do try to call malloc() > > > before acquiring locks (basically preallocating) whenever possible. > > > > So I suppose M_NOWAIT will do the trick when there is no other way > > (preallocations etc..) ? Of course I should test if it does not > > return NULL then. > > Yes, but in a VOP_IOCTL() handler it should be safe to M_WAITOK malloc() as > long as you do it before you acquire any mutexes. Good to know, thanks! -Lukas --8323329-1067549723-1272575995=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 21:23:40 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 644ED1065676 for ; Thu, 29 Apr 2010 21:23:40 +0000 (UTC) (envelope-from czerner.lukas@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id DAD428FC0C for ; Thu, 29 Apr 2010 21:23:39 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so2080763fgb.13 for ; Thu, 29 Apr 2010 14:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-x-sender:to:cc :subject:in-reply-to:message-id:references:user-agent:mime-version :content-type; bh=Kv21QVPdcYXfoYBXqUa4/A9XIfXebd6uIcwJ52FzDhs=; b=RfA2dhwdzje5UiVX8UcFghZMYdNl7iFwUacj0cc56d/ZSoynOY9xIHHSLWrT+XhR1H JlBTsz/i1kbmNzEINzOCSQPZztuyfR5GIUvuZ/T7uMS+HIO1yA4795fx1RNXERrmizEi rsiUYINtvDbMgP0iYGZPNaiEbR2QJvmrbQByk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-x-sender:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; b=svQ9cJKig4XjFugg1pawXzjts7i8I3DqjGmbk3izJwKhDwO8lN1iGb+3Dr/cUDqK5Q OuUiHNM9fWBc/Uo9KLpkaDPQMrTMWzpP9+5hJ43Y+jmFbdoqTJU2Ed74d8eXcjphNmdb +0fnfnOPN3ePWYv8JBkEf3uaUek99kY1cDf5c= Received: by 10.87.15.35 with SMTP id s35mr2576769fgi.12.1272576206350; Thu, 29 Apr 2010 14:23:26 -0700 (PDT) Received: from a04-0215a.kn.vutbr.cz (a04-0215a.kn.vutbr.cz [147.229.216.20]) by mx.google.com with ESMTPS id e20sm9746303fga.11.2010.04.29.14.23.25 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 29 Apr 2010 14:23:25 -0700 (PDT) Date: Thu, 29 Apr 2010 23:23:28 +0200 (CEST) From: "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" X-X-Sender: bratt@a04-0215a.kn.vutbr.cz To: Ryan Stone In-Reply-To: Message-ID: References: <201004291418.09768.jhb@freebsd.org> <201004291606.35899.jhb@freebsd.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-1321214282-1272576209=:30007" Cc: freebsd-hackers@freebsd.org, =?ISO-8859-15?Q?Luk=E1=A8_Czerner?= Subject: Re: ioctl, copy string from user 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, 29 Apr 2010 21:23:40 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1321214282-1272576209=:30007 Content-Type: TEXT/PLAIN; charset=ISO-8859-15 Content-Transfer-Encoding: 8BIT On Thu, 29 Apr 2010, Ryan Stone wrote: > Date: Thu, 29 Apr 2010 17:19:41 -0400 > From: Ryan Stone > To: LukᨠCzerner > Cc: freebsd-hackers@freebsd.org > Subject: Re: ioctl, copy string from user > > > Apparently I need to tell ioctl how big is the variable I am > > providing to it ([MAXLEN]). The odd thing is, when I have a structure > > like this: > > > > struct lrfs_attach_info { > >        char *name; > >        int priority; > > }; > > > > and I pass the pointer to that structure to the ioctl, it just > > works. I can even use the 'name' string from the structure without > > any problems, apparently it translates the pointer properly, but I > > did not expect this... > > I think that you'll find that what actually happens is that you're > reading from the userspace pointer. That will work as long as the > pointer is mapped, but you'll panic if what it points to gets swapped > out or is invalid. > Hmmm, I can prevent the pointer to be invalidated, but I doubt I can prevent to the pointer to been swapped out. Is there some better way ? Allocate it statically (char name[MAXLEN]), then it gets copied as whole to the kernel space, isn't it ? --8323329-1321214282-1272576209=:30007-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 21:37:39 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E465E106564A for ; Thu, 29 Apr 2010 21:37:39 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B87498FC19 for ; Thu, 29 Apr 2010 21:37:39 +0000 (UTC) Received: by pwi9 with SMTP id 9so11606429pwi.13 for ; Thu, 29 Apr 2010 14:37:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=S7NDWkTUGpSZE0mvo0YfD51nh6/CxcqI0glnam59J/U=; b=dcIK9rw/toqDgL4TbOOVAkNwh2HD2WCAu8nbnPEo6JKqTgMfA+DFkRhMpPQa9LxjS1 4GDBSpvM2rl4imzSGVSeGaEbbpIveVkzSW3aAITiLfmgfzJJzWNOFWRLzRx8QClJvoQv m0N3pSIkRfb42c0jXEDBzGCdN72Rj+0akPCPk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bJZTP5WjViaXLwc+00fZSk47+zu3TFzblyOW6xL64ZxztiPMVhK3FUrhdj+P6OaPcc XEz3DkfRGRNPJJEnHSqoT57KJXCRGZ2qSCyB7RvNXijwqtpO5SCh4+YonG1UsnvdW0uG nhkaHfIUA3bsln6iig1m5HqkUIM08m25XGpng= MIME-Version: 1.0 Received: by 10.142.1.29 with SMTP id 29mr5864730wfa.337.1272577056855; Thu, 29 Apr 2010 14:37:36 -0700 (PDT) Received: by 10.142.69.2 with HTTP; Thu, 29 Apr 2010 14:37:36 -0700 (PDT) In-Reply-To: References: Date: Thu, 29 Apr 2010 14:37:36 -0700 Message-ID: From: Garrett Cooper To: Gunnar Hinriksson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Ptrace segfault 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, 29 Apr 2010 21:37:40 -0000 On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson wro= te: > Hello > > Im having a little problem using ptrace on my system. > If I use ptrace to attach to another process the child process > segfaults once I detach. > For example using this simple program. > > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]) > { > =A0 =A0 =A0 =A0int pid =3D atoi(argv[1]); > =A0 =A0 =A0 =A0ptrace(PT_ATTACH, pid, 0, 0); > =A0 =A0 =A0 =A0wait(NULL); > =A0 =A0 =A0 =A0ptrace(PT_DETACH, pid, 0, 0); > =A0 =A0 =A0 =A0return 0; > } > > Am I using ptrace incorrectly or is there perhaps a bug in ptrace that > causes the child to always segfault ? Nope -- it's a bug in your code. From ptrace(2): PT_CONTINUE The traced process continues execution. The addr argume= nt is an address specifying the place where execution is to= be resumed (a new value for the program counter), or (caddr_t)1 to indicate that execution is to pick up wher= e it left off. The data argument provides a signal number= to be delivered to the traced process as it resumes executi= on, or 0 if no signal is to be sent. [...] PT_DETACH This request is like PT_CONTINUE, except that it does no= t allow specifying an alternate place to continue executio= n, and after it succeeds, the traced process is no longer traced and continues execution normally. Note very carefully the fact that PT_DETACH is like PT_CONTINUE, and that PT_CONTINUE says that addr references the memory where the execution is going to be resumed. HTH, -Garrett From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 22:23:05 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A9A7D1065670 for ; Thu, 29 Apr 2010 22:23:05 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 30F8B8FC12 for ; Thu, 29 Apr 2010 22:23:04 +0000 (UTC) Received: from gidgate.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id o3TMIXkP090722; Thu, 29 Apr 2010 23:18:33 +0100 (BST) (envelope-from rb@gid.co.uk) Received: from rbpbp.gid.co.uk ([194.32.164.6]) by gidgate.gid.co.uk (8.13.8/8.13.8) with ESMTP id o3TMIS4D069913; Thu, 29 Apr 2010 23:18:28 +0100 (BST) (envelope-from rb@gid.co.uk) Mime-Version: 1.0 (Apple Message framework v1078) Content-Type: text/plain; charset=us-ascii From: Bob Bishop In-Reply-To: Date: Thu, 29 Apr 2010 23:18:27 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <9EF83DA6-B2D3-456E-B0AF-0B4F5F458A1F@gid.co.uk> References: To: Garrett Cooper X-Mailer: Apple Mail (2.1078) Cc: freebsd-hackers@freebsd.org, Gunnar Hinriksson Subject: Re: Ptrace segfault 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, 29 Apr 2010 22:23:05 -0000 Hi, On 29 Apr 2010, at 22:37, Garrett Cooper wrote: > On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson = wrote: >> Hello >>=20 >> Im having a little problem using ptrace on my system. >> If I use ptrace to attach to another process the child process >> segfaults once I detach. >> For example using this simple program. >>=20 >> #include >> #include >> #include >> #include >> #include >>=20 >> int main(int argc, char *argv[]) >> { >> int pid =3D atoi(argv[1]); >> ptrace(PT_ATTACH, pid, 0, 0); >> wait(NULL); >> ptrace(PT_DETACH, pid, 0, 0); >> return 0; >> } >>=20 >> Am I using ptrace incorrectly or is there perhaps a bug in ptrace = that >> causes the child to always segfault ? >=20 > Nope -- it's a bug in your code. =46rom ptrace(2): >=20 > PT_CONTINUE The traced process continues execution. The addr = argument > is an address specifying the place where execution = is to be > resumed (a new value for the program counter), or > (caddr_t)1 to indicate that execution is to pick up = where > it left off. The data argument provides a signal = number to > be delivered to the traced process as it resumes = execution, > or 0 if no signal is to be sent. >=20 > [...] >=20 > PT_DETACH This request is like PT_CONTINUE, except that it = does not = ^^^^^^^^^^^ > allow specifying an alternate place to continue = execution, = ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > and after it succeeds, the traced process is no = longer > traced and continues execution normally. >=20 > Note very carefully the fact that PT_DETACH is like PT_CONTINUE, > and that PT_CONTINUE says that addr references the memory where the > execution is going to be resumed. Looks to me like a bug in ptrace(PT_DETACH,...) which to agree with = ptrace(2) ought either to (a) fail (EINVAL?) if addr !=3D (caddr_t)1, or (b) ignore addr entirely; it's not clear which. OP inferred (b) which is reasonable. > HTH, > -Garrett > _______________________________________________ > 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" >=20 >=20 -- Bob Bishop +44 (0)118 940 1243 rb@gid.co.uk fax +44 (0)118 940 1295 mobile +44 (0)783 626 4518 From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 23:00:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC584106566C for ; Thu, 29 Apr 2010 23:00:27 +0000 (UTC) (envelope-from tomtinn@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6DA038FC17 for ; Thu, 29 Apr 2010 23:00:27 +0000 (UTC) Received: by wyb36 with SMTP id 36so742447wyb.13 for ; Thu, 29 Apr 2010 16:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=jDDFRnDN8B3+baGo3AECXvvO33XFAv5bbjzjynkgl0k=; b=pjLIppFbmGD4m2Zm7rVWDu61tevVWcmdbJicrZYgWw5uXhYqkgnbLkTIWnyXZnPKsV DzPypqzao06+KTOi2FWX9ufPIfZFfqkR8ySRAXOUcceN3rDmtdA+Md1PIijzBwm+m7ir AFgEWhZCw42sLp3gRpNgz41TBVwoKpoultFMM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=TxZ3Y7cLTFs0CnlMwcYEtTBznZscipV8NYOqeYH/v+8TMSj7pHh1IrRBvGEeTIlzWm leZSSCXQSfmDGuDMKcaiQ8MLdFJw8YSPBelFyXZ7fA3tj9UX8CVlUy6qGUbRh2iB8VIU h3I8wO0JX3RoD7TF1Rq+Zy7bF7J7fPQMWK9dI= MIME-Version: 1.0 Received: by 10.216.186.10 with SMTP id v10mr2254294wem.111.1272582017461; Thu, 29 Apr 2010 16:00:17 -0700 (PDT) Received: by 10.216.166.16 with HTTP; Thu, 29 Apr 2010 16:00:16 -0700 (PDT) In-Reply-To: <9EF83DA6-B2D3-456E-B0AF-0B4F5F458A1F@gid.co.uk> References: <9EF83DA6-B2D3-456E-B0AF-0B4F5F458A1F@gid.co.uk> Date: Thu, 29 Apr 2010 23:00:16 +0000 Message-ID: From: Gunnar Hinriksson To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Ptrace segfault 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, 29 Apr 2010 23:00:27 -0000 2010/4/29 Bob Bishop : > Hi, > > On 29 Apr 2010, at 22:37, Garrett Cooper wrote: > >> On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson = wrote: >>> Hello >>> >>> Im having a little problem using ptrace on my system. >>> If I use ptrace to attach to another process the child process >>> segfaults once I detach. >>> For example using this simple program. >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> >>> int main(int argc, char *argv[]) >>> { >>> =A0 =A0 =A0 =A0int pid =3D atoi(argv[1]); >>> =A0 =A0 =A0 =A0ptrace(PT_ATTACH, pid, 0, 0); >>> =A0 =A0 =A0 =A0wait(NULL); >>> =A0 =A0 =A0 =A0ptrace(PT_DETACH, pid, 0, 0); >>> =A0 =A0 =A0 =A0return 0; >>> } >>> >>> Am I using ptrace incorrectly or is there perhaps a bug in ptrace that >>> causes the child to always segfault ? >> >> =A0 =A0Nope -- it's a bug in your code. From ptrace(2): >> >> =A0 =A0 PT_CONTINUE =A0 The traced process continues execution. =A0The a= ddr argument >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 is an address specifying the place w= here execution is to be >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 resumed (a new value for the program= counter), or >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (caddr_t)1 to indicate that executio= n is to pick up where >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 it left off. =A0The data argument pr= ovides a signal number to >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 be delivered to the traced process a= s it resumes execution, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 or 0 if no signal is to be sent. >> >> [...] >> >> =A0 =A0 PT_DETACH =A0 =A0 This request is like PT_CONTINUE, except that = it does not > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 allow specifying an alternate place = to continue execution, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 and after it succeeds, the traced pr= ocess is no longer >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 traced and continues execution norma= lly. >> >> =A0 =A0Note very carefully the fact that PT_DETACH is like PT_CONTINUE, >> and that PT_CONTINUE says that addr references the memory where the >> execution is going to be resumed. > > Looks to me like a bug in ptrace(PT_DETACH,...) which to agree with ptrac= e(2) ought either to > (a) fail (EINVAL?) if addr !=3D (caddr_t)1, or > (b) ignore addr entirely; it's not clear which. > > OP inferred (b) which is reasonable. > >> HTH, >> -Garrett >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.or= g" >> >> > > > -- > Bob Bishop =A0 =A0 =A0 =A0 =A0+44 (0)118 940 1243 > rb@gid.co.uk =A0 =A0fax +44 (0)118 940 1295 > =A0 =A0 =A0 =A0 =A0 =A0 mobile +44 (0)783 626 4518 > > > > > > Hello I didn't want to make the code to big so I omitted any tests. About wait(), you are supposed to use wait to check if the child process has stopped successfully. I guess the correct usage would be something like this if im understanding the documentation correctly. if ( wait(WIFSTOPPED(SIGSTOP)) =3D=3D pid ) Im not sure if there is any posix way of describing how ptrace should be implemented but I know linux ptrace ignores the addr on DETACH. So my vote would be that ptrace ignores addr on detach to make it compatible with code for linux. With Regards Gunnar From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 23:36:48 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78AF5106566C for ; Thu, 29 Apr 2010 23:36:48 +0000 (UTC) (envelope-from tomtinn@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2698FC14 for ; Thu, 29 Apr 2010 23:36:47 +0000 (UTC) Received: by wyb36 with SMTP id 36so759431wyb.13 for ; Thu, 29 Apr 2010 16:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=TBPZsKhOPSMnSXqd0NAqo/dQhSV4jPxquwa0RZcWFRo=; b=IUT+Pwt1v6afUevInXrL1sgdBuCecCaDl8vM4tDp4kGkZx83WaNV1Y6B9ap3eRkuPD vw9Oi+0G2dG9bWMSCGexgQWtf68GxXN9vDzP1pFA0c5weLCl0MjrVyOYH34geA8KfFvm DuPzHwWmty/E2jKSksFmQv9oA5YDaB56vC5es= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=AC2b84NeK3Cevgj3kqq1HoWpGV9NxfCsXfuSj92DcUKNIsOnRVMJ6FuNfEO2Fg7DOl NG9HdWCps+AEx0oxcX02wmsMzSgYBy/HcqWT+pQbmq6+R1AvLwpBwQMvr6LcgriAixhc YhBqQtuG1B5uixLkqgfqIgFmbR45X0KJmmC64= MIME-Version: 1.0 Received: by 10.216.87.16 with SMTP id x16mr1691635wee.27.1272584200958; Thu, 29 Apr 2010 16:36:40 -0700 (PDT) Received: by 10.216.166.16 with HTTP; Thu, 29 Apr 2010 16:36:40 -0700 (PDT) In-Reply-To: References: <9EF83DA6-B2D3-456E-B0AF-0B4F5F458A1F@gid.co.uk> Date: Thu, 29 Apr 2010 23:36:40 +0000 Message-ID: From: Gunnar Hinriksson To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Ptrace segfault 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, 29 Apr 2010 23:36:48 -0000 2010/4/29 Gunnar Hinriksson : > 2010/4/29 Bob Bishop : >> Hi, >> >> On 29 Apr 2010, at 22:37, Garrett Cooper wrote: >> >>> On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson = wrote: >>>> Hello >>>> >>>> Im having a little problem using ptrace on my system. >>>> If I use ptrace to attach to another process the child process >>>> segfaults once I detach. >>>> For example using this simple program. >>>> >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> >>>> int main(int argc, char *argv[]) >>>> { >>>> =A0 =A0 =A0 =A0int pid =3D atoi(argv[1]); >>>> =A0 =A0 =A0 =A0ptrace(PT_ATTACH, pid, 0, 0); >>>> =A0 =A0 =A0 =A0wait(NULL); >>>> =A0 =A0 =A0 =A0ptrace(PT_DETACH, pid, 0, 0); >>>> =A0 =A0 =A0 =A0return 0; >>>> } >>>> >>>> Am I using ptrace incorrectly or is there perhaps a bug in ptrace that >>>> causes the child to always segfault ? >>> >>> =A0 =A0Nope -- it's a bug in your code. From ptrace(2): >>> >>> =A0 =A0 PT_CONTINUE =A0 The traced process continues execution. =A0The = addr argument >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 is an address specifying the place = where execution is to be >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 resumed (a new value for the progra= m counter), or >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (caddr_t)1 to indicate that executi= on is to pick up where >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 it left off. =A0The data argument p= rovides a signal number to >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 be delivered to the traced process = as it resumes execution, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 or 0 if no signal is to be sent. >>> >>> [...] >>> >>> =A0 =A0 PT_DETACH =A0 =A0 This request is like PT_CONTINUE, except that= it does not >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^ >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 allow specifying an alternate place= to continue execution, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^ >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 and after it succeeds, the traced p= rocess is no longer >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 traced and continues execution norm= ally. >>> >>> =A0 =A0Note very carefully the fact that PT_DETACH is like PT_CONTINUE, >>> and that PT_CONTINUE says that addr references the memory where the >>> execution is going to be resumed. >> >> Looks to me like a bug in ptrace(PT_DETACH,...) which to agree with ptra= ce(2) ought either to >> (a) fail (EINVAL?) if addr !=3D (caddr_t)1, or >> (b) ignore addr entirely; it's not clear which. >> >> OP inferred (b) which is reasonable. >> >>> HTH, >>> -Garrett >>> _______________________________________________ >>> freebsd-hackers@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers >>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.o= rg" >>> >>> >> >> >> -- >> Bob Bishop =A0 =A0 =A0 =A0 =A0+44 (0)118 940 1243 >> rb@gid.co.uk =A0 =A0fax +44 (0)118 940 1295 >> =A0 =A0 =A0 =A0 =A0 =A0 mobile +44 (0)783 626 4518 >> >> >> >> >> >> > > Hello > > I didn't want to make the code to big so I omitted any tests. > About wait(), you are supposed to use wait to check if the child > process has stopped successfully. > I guess the correct usage would be something like this if im > understanding the documentation correctly. > if ( wait(WIFSTOPPED(SIGSTOP)) =3D=3D pid ) > Im not sure if there is any posix way of describing how ptrace should > be implemented but I know linux ptrace ignores the addr on DETACH. > So my vote would be that ptrace ignores addr on detach to make it > compatible with code for linux. > > With Regards > > Gunnar > Hello I started looking around in the kernel sources and I think i've found out how it is implemented. in /usr/src/sys/kern/sys_process.c line 744 the following code is found. if (addr !=3D (void *)1) { error =3D ptrace_set_pc(td2, (u_long)(uintfptr_t)ad= dr); if (error) break; } So it is changing the address if the addr is anything but 1. I tested my program by passing 1 as an argument in the addr field and the segfaults stopped. So the question is if this code should be removed so that PT_DETACH ignores addr or leave it be and perhaps update the documentation to reflect that it allows the addr to the changed. With Regards Gunnar From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 23:49:34 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40DF71065673 for ; Thu, 29 Apr 2010 23:49:34 +0000 (UTC) (envelope-from tomtinn@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 42A398FC0A for ; Thu, 29 Apr 2010 23:49:33 +0000 (UTC) Received: by wwb13 with SMTP id 13so971175wwb.13 for ; Thu, 29 Apr 2010 16:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=+ddJdL3mWG8BY0/es78ObjKflD/6syy21oxLj4XtdeI=; b=McXeeKITURjqVIxzcwXF1KV+qYbZsXfhAkzdyiXCPNjBbQCSi4v0tV4W6jRp9+7pHQ +1QlZgTOa22XTtXFZl71aINaYMd4SJo8u9wrIaYyyWQXIyL6zWgG2/GCgqCLCCeNj5Aa tnynSkl+FMrYyZtdQDGriFaWOwdjJWMvq5i2w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=suHuz4wlR+qPtJkE6gsF2jx10+TGk1mzm80mZ34YKENsWSRtmL512NJ9HWrghHutxk C0r9QcziNL92EZFjOytMw8p7HdtVcTN8YArsbjfZJmJhfDHZnp1sxjNvSYi6tSJTQju5 iLKzsGDkO2nmj1HgMcQIJH6DtI5bNlpujS6JQ= MIME-Version: 1.0 Received: by 10.216.90.69 with SMTP id d47mr742058wef.198.1272584966702; Thu, 29 Apr 2010 16:49:26 -0700 (PDT) Received: by 10.216.166.16 with HTTP; Thu, 29 Apr 2010 16:49:26 -0700 (PDT) In-Reply-To: References: <9EF83DA6-B2D3-456E-B0AF-0B4F5F458A1F@gid.co.uk> Date: Thu, 29 Apr 2010 23:49:26 +0000 Message-ID: From: Gunnar Hinriksson To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Ptrace segfault 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, 29 Apr 2010 23:49:34 -0000 2010/4/29 Gunnar Hinriksson : > 2010/4/29 Gunnar Hinriksson : >> 2010/4/29 Bob Bishop : >>> Hi, >>> >>> On 29 Apr 2010, at 22:37, Garrett Cooper wrote: >>> >>>> On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson wrote: >>>>> Hello >>>>> >>>>> Im having a little problem using ptrace on my system. >>>>> If I use ptrace to attach to another process the child process >>>>> segfaults once I detach. >>>>> For example using this simple program. >>>>> >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> >>>>> int main(int argc, char *argv[]) >>>>> { >>>>> =A0 =A0 =A0 =A0int pid =3D atoi(argv[1]); >>>>> =A0 =A0 =A0 =A0ptrace(PT_ATTACH, pid, 0, 0); >>>>> =A0 =A0 =A0 =A0wait(NULL); >>>>> =A0 =A0 =A0 =A0ptrace(PT_DETACH, pid, 0, 0); >>>>> =A0 =A0 =A0 =A0return 0; >>>>> } >>>>> >>>>> Am I using ptrace incorrectly or is there perhaps a bug in ptrace tha= t >>>>> causes the child to always segfault ? >>>> >>>> =A0 =A0Nope -- it's a bug in your code. From ptrace(2): >>>> >>>> =A0 =A0 PT_CONTINUE =A0 The traced process continues execution. =A0The= addr argument >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 is an address specifying the place= where execution is to be >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 resumed (a new value for the progr= am counter), or >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (caddr_t)1 to indicate that execut= ion is to pick up where >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 it left off. =A0The data argument = provides a signal number to >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 be delivered to the traced process= as it resumes execution, >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 or 0 if no signal is to be sent. >>>> >>>> [...] >>>> >>>> =A0 =A0 PT_DETACH =A0 =A0 This request is like PT_CONTINUE, except tha= t it does not >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^ >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 allow specifying an alternate plac= e to continue execution, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^ >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 and after it succeeds, the traced = process is no longer >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 traced and continues execution nor= mally. >>>> >>>> =A0 =A0Note very carefully the fact that PT_DETACH is like PT_CONTINUE= , >>>> and that PT_CONTINUE says that addr references the memory where the >>>> execution is going to be resumed. >>> >>> Looks to me like a bug in ptrace(PT_DETACH,...) which to agree with ptr= ace(2) ought either to >>> (a) fail (EINVAL?) if addr !=3D (caddr_t)1, or >>> (b) ignore addr entirely; it's not clear which. >>> >>> OP inferred (b) which is reasonable. >>> >>>> HTH, >>>> -Garrett >>>> _______________________________________________ >>>> 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" >>>> >>>> >>> >>> >>> -- >>> Bob Bishop =A0 =A0 =A0 =A0 =A0+44 (0)118 940 1243 >>> rb@gid.co.uk =A0 =A0fax +44 (0)118 940 1295 >>> =A0 =A0 =A0 =A0 =A0 =A0 mobile +44 (0)783 626 4518 >>> >>> >>> >>> >>> >>> >> >> Hello >> >> I didn't want to make the code to big so I omitted any tests. >> About wait(), you are supposed to use wait to check if the child >> process has stopped successfully. >> I guess the correct usage would be something like this if im >> understanding the documentation correctly. >> if ( wait(WIFSTOPPED(SIGSTOP)) =3D=3D pid ) >> Im not sure if there is any posix way of describing how ptrace should >> be implemented but I know linux ptrace ignores the addr on DETACH. >> So my vote would be that ptrace ignores addr on detach to make it >> compatible with code for linux. >> >> With Regards >> >> Gunnar >> > > Hello > > I started looking around in the kernel sources and I think i've found > out how it is implemented. > in /usr/src/sys/kern/sys_process.c line 744 the following code is found. > > if (addr !=3D (void *)1) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0error =3D ptrace_set_pc(td= 2, (u_long)(uintfptr_t)addr); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (error) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0} > > So it is changing the address if the addr is anything but 1. > I tested my program by passing 1 as an argument in the addr field and > the segfaults stopped. > > So the question is if this code should be removed so that PT_DETACH > ignores addr or leave it be and perhaps update the documentation to > reflect that it allows the addr to the changed. > > With Regards > > Gunnar > After reading the code more carefully the correct way would be to modify it like this. --- case PT_CONTINUE: { if (addr !=3D (void *)1) { error =3D ptrace_set_pc(td2, (u_long)(uintfptr_t)ad= dr); } } if (error) break; --- Note that im just learning programming so this might not be the correct way to do it. With Regards Gunnar From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 30 08:52:39 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1EAB71065670 for ; Fri, 30 Apr 2010 08:52:39 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 972228FC15 for ; Fri, 30 Apr 2010 08:52:38 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so309fgb.13 for ; Fri, 30 Apr 2010 01:52:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=tSebT9U9NRFtBC0PlptiwNiyJMXlrr5hUDBZK9kvCF0=; b=Zy+Xgj0Vuk66kEs3RJ1PrWXKP1LxVxW+HH41NxoVf8qo11aKnzcrgRox8H9P19I5cZ AfAMw7VVGWtoF8gxuIQbYGHK6Vy94JgdmjkJbmqL5uIxuo9B2bRGFbsxForpzQPZSMip v/9saMFBtfeWwWzI8eyw7f8ON0zeUr2FAq918= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=L1K3l0P+ASO2orUncYkhRoO/RoN3BFxtN0gIEbJH54DEPXbcPgh40rlWC8QxZI3sP/ /ti5LCe8hqfgbav+v+UcUkZF3xAyCao5KznzrALyMun/jCKzcUfZQ0zYV/dZduszbiMT RhgoAzydXykkCt6qUHTZ5X6f+l3FL/EqM03gs= Received: by 10.87.2.15 with SMTP id e15mr3502191fgi.23.1272617551879; Fri, 30 Apr 2010 01:52:31 -0700 (PDT) Received: from ernst.jennejohn.org (p57AE0288.dip0.t-ipconnect.de [87.174.2.136]) by mx.google.com with ESMTPS id 2sm2473769fks.42.2010.04.30.01.52.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Apr 2010 01:52:30 -0700 (PDT) Date: Fri, 30 Apr 2010 10:52:29 +0200 From: Gary Jennejohn To: "=?ISO-8859-15?Q?Luk=E1=A8?= Czerner" Message-ID: <20100430105229.57dec4f2@ernst.jennejohn.org> In-Reply-To: References: <201004291418.09768.jhb@freebsd.org> <201004291606.35899.jhb@freebsd.org> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Ryan Stone Subject: Re: ioctl, copy string from user X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2010 08:52:39 -0000 On Thu, 29 Apr 2010 23:23:28 +0200 (CEST) "Lukas Czerner" wrote: > On Thu, 29 Apr 2010, Ryan Stone wrote: > > > Date: Thu, 29 Apr 2010 17:19:41 -0400 > > From: Ryan Stone > > To: Lukas Czerner > > Cc: freebsd-hackers@freebsd.org > > Subject: Re: ioctl, copy string from user > > > > > Apparently I need to tell ioctl how big is the variable I am > > > providing to it ([MAXLEN]). The odd thing is, when I have a structure > > > like this: > > > > > > struct lrfs_attach_info { > > > char *name; > > > int priority; > > > }; > > > > > > and I pass the pointer to that structure to the ioctl, it just > > > works. I can even use the 'name' string from the structure without > > > any problems, apparently it translates the pointer properly, but I > > > did not expect this... > > > > I think that you'll find that what actually happens is that you're > > reading from the userspace pointer. That will work as long as the > > pointer is mapped, but you'll panic if what it points to gets swapped > > out or is invalid. > > > > Hmmm, I can prevent the pointer to be invalidated, but I doubt I can > prevent to the pointer to been swapped out. Is there some better way > ? Allocate it statically (char name[MAXLEN]), then it gets copied > as whole to the kernel space, isn't it ? Look at the definition of _IOW() in /sys/sys/ioccom.h. It should become obvious what's going on. -- Gary Jennejohn From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 30 07:25:17 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 83B761065670 for ; Fri, 30 Apr 2010 07:25:17 +0000 (UTC) (envelope-from gnehzuil@gmail.com) Received: from mail-px0-f182.google.com (mail-px0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 58C568FC16 for ; Fri, 30 Apr 2010 07:25:17 +0000 (UTC) Received: by pxi17 with SMTP id 17so3979663pxi.13 for ; Fri, 30 Apr 2010 00:25:12 -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 :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=HK4olaz3qr8UhbBX1unq0UN3JtdL9pm7NIePwRQF8GM=; b=byOkDW/B5BWPRoTAPS81zghO3NuO+uOiDNG3dzTRrfY7T5AreyysW/lvKcwHD4JZcM wOzQlro/GXHbakEOT1XGars4mj7sO0xwX3rAYchW7TqIVYcU+2qfSC8NZa5kNiqNHGXP +hseZAeCMBL1yqMUcoXaXuYd1PxSb4Dy0Y2Xk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=T43Gs3MmsLbNIhgrolPuNJo+RY94/C0g9U5gjRbPQRBwsFPG3MiTcWqvHELROn/Vec 3Os3zaCn+B8Yfm/0DR8riW5s1lljfreWGu3GSDI7NPw/4byhyVfVA9+nH4vQiaWZdVXj vcaH3Axh3tuLfsfLFkkNBtO4OTXQMQlrtbfO0= Received: by 10.114.237.16 with SMTP id k16mr7421716wah.26.1272610966691; Fri, 30 Apr 2010 00:02:46 -0700 (PDT) Received: from [192.168.1.247] ([166.111.68.197]) by mx.google.com with ESMTPS id g30sm7626582wag.4.2010.04.30.00.02.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 30 Apr 2010 00:02:46 -0700 (PDT) Message-ID: <4BDA8090.4040306@gmail.com> Date: Fri, 30 Apr 2010 15:02:40 +0800 From: gnehzuil User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 30 Apr 2010 11:51:54 +0000 Subject: About My SoC 2010 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: Fri, 30 Apr 2010 07:25:17 -0000 Hello everyone, I am Zheng Liu. I participate in FreeBSD SoC this year. My project is about ext2fs. I will update ext2fs project to support preallocation and read ext4 file system. About my project, please view my wiki page ''http://wiki.freebsd.org/SOC2010ZhengLiu". Best regards, lz From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 30 14:11:17 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0051106566C for ; Fri, 30 Apr 2010 14:11:17 +0000 (UTC) (envelope-from gpf.kira@gmail.com) Received: from mail-ww0-f54.google.com (mail-ww0-f54.google.com [74.125.82.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC3D8FC19 for ; Fri, 30 Apr 2010 14:11:16 +0000 (UTC) Received: by wwb13 with SMTP id 13so200737wwb.13 for ; Fri, 30 Apr 2010 07:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=Be0IEBXQmW/pgJVdvHYIRPzEePWejLw1VjemjKBRCi8=; b=jg4XCYethZQlFqaDdwr1Zg7ggPFM+WZiZy8+mpaqCXyje7SdA6Kewau/i8D7Lfw2a5 3I8DlziXEVYCZhZT+0RSN+m7KJ+spcjGu83AQGgXgo+2SR53BElda/20gZX7c4+YSNen jXeritMrBc1QSH9AFYFj1Szv1bBGHvgkrBS/M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=t9oJm1x1YkXs8xoKynyYY38nWfUIttjSGClNq7N1xsqS8Ez9hfwxZBQgmeHiPU3zq2 9tRj03YsyKvQBpeaRXyUiL52NkiKDNI26+QKq9MAv0Ep5AYgF8FigVIvMC90nEH9NDZd +mvnxt+EMihLhPYBnNVjKwaXVlWVYMRLfYAXo= MIME-Version: 1.0 Received: by 10.216.86.212 with SMTP id w62mr1925094wee.131.1272635339267; Fri, 30 Apr 2010 06:48:59 -0700 (PDT) Received: by 10.216.53.6 with HTTP; Fri, 30 Apr 2010 06:48:59 -0700 (PDT) Date: Fri, 30 Apr 2010 16:48:59 +0300 Message-ID: From: Efstratios Karatzas To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Subject: GSoC: Audit Kernel Events 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, 30 Apr 2010 14:11:17 -0000 Hello! My name is Efstratios Karatzas and I will be participating in this year's gsoc with the FreeBSD project. My project is about providing audit support for NFS RPCs and extending the kernel audit framework so it can keep track of multiple simultaneous audit records per kernel thread. I will be using this mailing list in the coming weeks to get some feedback for a KPI that I will be designing. It will have to acquire 'a' working path of a file from its vnode, without use of the name cache; let's not start the flame just yet. You can find more about me and my project via the following link! http://wiki.freebsd.org/SOC2010EfstratiosKaratzas Regards, -- Efstratios "GPF" Karatzas From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 30 14:44:13 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 76317106566B; Fri, 30 Apr 2010 14:44:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 37ACF8FC17; Fri, 30 Apr 2010 14:44:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id AE62646B35; Fri, 30 Apr 2010 10:44:12 -0400 (EDT) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 5C71B8A025; Fri, 30 Apr 2010 10:44:00 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Fri, 30 Apr 2010 08:51:56 -0400 User-Agent: KMail/1.12.1 (FreeBSD/7.3-CBSD-20100217; KDE/4.3.1; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201004300851.56399.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 30 Apr 2010 10:44:00 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Gunnar Hinriksson , bde@freebsd.org Subject: Re: Ptrace segfault 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, 30 Apr 2010 14:44:13 -0000 On Thursday 29 April 2010 7:49:26 pm Gunnar Hinriksson wrote: > 2010/4/29 Gunnar Hinriksson : > > 2010/4/29 Gunnar Hinriksson : > >> 2010/4/29 Bob Bishop : > >>> Hi, > >>> > >>> On 29 Apr 2010, at 22:37, Garrett Cooper wrote: > >>> > >>>> On Thu, Apr 29, 2010 at 12:06 PM, Gunnar Hinriksson wrote: > >>>>> Hello > >>>>> > >>>>> Im having a little problem using ptrace on my system. > >>>>> If I use ptrace to attach to another process the child process > >>>>> segfaults once I detach. > >>>>> For example using this simple program. > >>>>> > >>>>> #include > >>>>> #include > >>>>> #include > >>>>> #include > >>>>> #include > >>>>> > >>>>> int main(int argc, char *argv[]) > >>>>> { > >>>>> int pid = atoi(argv[1]); > >>>>> ptrace(PT_ATTACH, pid, 0, 0); > >>>>> wait(NULL); > >>>>> ptrace(PT_DETACH, pid, 0, 0); > >>>>> return 0; > >>>>> } > >>>>> > >>>>> Am I using ptrace incorrectly or is there perhaps a bug in ptrace that > >>>>> causes the child to always segfault ? > >>>> > >>>> Nope -- it's a bug in your code. From ptrace(2): > >>>> > >>>> PT_CONTINUE The traced process continues execution. The addr argument > >>>> is an address specifying the place where execution is to be > >>>> resumed (a new value for the program counter), or > >>>> (caddr_t)1 to indicate that execution is to pick up where > >>>> it left off. The data argument provides a signal number to > >>>> be delivered to the traced process as it resumes execution, > >>>> or 0 if no signal is to be sent. > >>>> > >>>> [...] > >>>> > >>>> PT_DETACH This request is like PT_CONTINUE, except that it does not > >>> ^^^^^^^^^^^ > >>>> allow specifying an alternate place to continue execution, > >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >>>> and after it succeeds, the traced process is no longer > >>>> traced and continues execution normally. > >>>> > >>>> Note very carefully the fact that PT_DETACH is like PT_CONTINUE, > >>>> and that PT_CONTINUE says that addr references the memory where the > >>>> execution is going to be resumed. > >>> > >>> Looks to me like a bug in ptrace(PT_DETACH,...) which to agree with ptrace(2) ought either to > >>> (a) fail (EINVAL?) if addr != (caddr_t)1, or > >>> (b) ignore addr entirely; it's not clear which. > >>> > >>> OP inferred (b) which is reasonable. > >>> > >>>> HTH, > >>>> -Garrett > >>>> _______________________________________________ > >>>> 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" > >>>> > >>>> > >>> > >>> > >>> -- > >>> Bob Bishop +44 (0)118 940 1243 > >>> rb@gid.co.uk fax +44 (0)118 940 1295 > >>> mobile +44 (0)783 626 4518 > >>> > >>> > >>> > >>> > >>> > >>> > >> > >> Hello > >> > >> I didn't want to make the code to big so I omitted any tests. > >> About wait(), you are supposed to use wait to check if the child > >> process has stopped successfully. > >> I guess the correct usage would be something like this if im > >> understanding the documentation correctly. > >> if ( wait(WIFSTOPPED(SIGSTOP)) == pid ) > >> Im not sure if there is any posix way of describing how ptrace should > >> be implemented but I know linux ptrace ignores the addr on DETACH. > >> So my vote would be that ptrace ignores addr on detach to make it > >> compatible with code for linux. > >> > >> With Regards > >> > >> Gunnar > >> > > > > Hello > > > > I started looking around in the kernel sources and I think i've found > > out how it is implemented. > > in /usr/src/sys/kern/sys_process.c line 744 the following code is found. > > > > if (addr != (void *)1) { > > error = ptrace_set_pc(td2, (u_long) (uintfptr_t)addr); > > if (error) > > break; > > } > > > > So it is changing the address if the addr is anything but 1. > > I tested my program by passing 1 as an argument in the addr field and > > the segfaults stopped. > > > > So the question is if this code should be removed so that PT_DETACH > > ignores addr or leave it be and perhaps update the documentation to > > reflect that it allows the addr to the changed. > > > > With Regards > > > > Gunnar > > > > After reading the code more carefully the correct way would be to > modify it like this. > --- > case PT_CONTINUE: > { > if (addr != (void *)1) { > error = ptrace_set_pc(td2, (u_long) (uintfptr_t)addr); > } > } > if (error) > break; > --- > Note that im just learning programming so this might not be the > correct way to do it. I think this might be the cleanest. None of the other commands here need to adjust the pc (PT_STEP requires that addr be '1' in the manpage for example), so this change cleans up the logic some by only trying to set the pc for PT_CONTINUE. It also moves some PT_DETACH logic up into the switch as a PT_DETACH case as well. Index: sys_process.c =================================================================== --- sys_process.c (revision 207329) +++ sys_process.c (working copy) @@ -899,6 +899,14 @@ if (error) goto out; break; + case PT_CONTINUE: + if (addr != (void *)1) { + error = ptrace_set_pc(td2, + (u_long)(uintfptr_t)addr); + if (error) + goto out; + } + break; case PT_TO_SCE: p->p_stops |= S_PT_SCE; break; @@ -908,15 +916,7 @@ case PT_SYSCALL: p->p_stops |= S_PT_SCE | S_PT_SCX; break; - } - - if (addr != (void *)1) { - error = ptrace_set_pc(td2, (u_long)(uintfptr_t)addr); - if (error) - break; - } - - if (req == PT_DETACH) { + case PT_DETACH: /* reset process parent */ if (p->p_oppid != p->p_pptr->p_pid) { struct proc *pp; @@ -941,6 +941,7 @@ /* should we send SIGCHLD? */ /* childproc_continued(p); */ + break; } sendsig: -- John Baldwin From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 30 18:01:24 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 936551065670 for ; Fri, 30 Apr 2010 18:01:24 +0000 (UTC) (envelope-from jceel@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id 414568FC08 for ; Fri, 30 Apr 2010 18:01:24 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 37E4DC42DC for ; Fri, 30 Apr 2010 19:48:49 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id GSim1pvj-HXq for ; Fri, 30 Apr 2010 19:48:48 +0200 (CEST) Received: from [10.10.1.3] (remotehell.sc.czest.pl [83.19.65.138]) by smtp.semihalf.com (Postfix) with ESMTPSA id A1686C42D9 for ; Fri, 30 Apr 2010 19:48:48 +0200 (CEST) From: Jakub Klama Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 30 Apr 2010 19:44:45 +0200 Message-Id: <61BCAC8D-B468-41BD-9537-6DC6E5AFB834@semihalf.com> To: freebsd-hackers@freebsd.org Mime-Version: 1.0 (Apple Message framework v1077) X-Mailer: Apple Mail (2.1077) Subject: GSoC: Generic DMA engine framework 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, 30 Apr 2010 18:01:24 -0000 Hi all, I'm a student accepted with proposal "Generic DMA engine framework for FreeBSD". I'm on second year computer science studies at Jagiellonian University in Poland. This summer I'll add generic mechanism for using general purpose DMA engines found in embedded system-on-chip devices. This will make possible to schedule transfers from kernel and userspace and will allow to use DMA in other devices using systemwide DMA engine. My earlier experience with kernel development was writing FreeBSD/arm port to TI DaVinci Digital-media system-on-chip - more details here: [1]. Development of this project will be done also on DaVinci - I'll provide implementation of its DMA engine as well as example DMA-enabled device driver - DaVinci's SD/MMC controller (current implementation uses only PIO transfers). You can read more details here: http://wiki.freebsd.org/SOC2010JakubKlama I will appreciate your comments and suggestions about this project. [1] - http://42.pl/u/2gfn_FreeBSDarm-port-for-TI-DaVinci Best regards, -- Jakub Klama. From owner-freebsd-hackers@FreeBSD.ORG Sat May 1 11:04:52 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F09931065673; Sat, 1 May 2010 11:04:52 +0000 (UTC) (envelope-from hinokind@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by mx1.freebsd.org (Postfix) with ESMTP id 5681C8FC15; Sat, 1 May 2010 11:04:51 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id l26so331039fgb.13 for ; Sat, 01 May 2010 04:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:to:subject:date :cc:mime-version:content-transfer-encoding:from:message-id :user-agent; bh=dRrAOnP8YuKEIV7w8+hc0vYMeseP4CTCjzF+g0ovXnU=; b=Pt56GKIDy7iTgewRKKjJEMm9jRWhVDkqbEdp8BNwvxdq6MwDzAnZc267QEEs/9cXAd wa3Jg5MvBgxqgt8wB5rQ1dS5jIJwX7G/BXThX/kVH4JFiwxAjzm8EuquXvaja5Lvou2W 1FwJO1heLU0ATLK8gM63RpRGVVN8rHaWcBe9I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:to:subject:date:cc:mime-version :content-transfer-encoding:from:message-id:user-agent; b=YYZj3O1774eRAMG9B+3OREuh9bGEN1rCgD9WKQWgUog5QfbbglfqBkyisT7sSkwXgR 4kmNkYEI2oDrgJ8L4Nx9NB5XA2LMMQtxj0jzexribfRhy/0oSiz11IBLbby/BDhTJTrH pegn/HmS6Cgb/eyNc/hMmCBlblBG0B3YFYu38= Received: by 10.87.47.6 with SMTP id z6mr5878412fgj.13.1272711880830; Sat, 01 May 2010 04:04:40 -0700 (PDT) Received: from klevas (hst-17-80.splius.lt [77.79.17.80]) by mx.google.com with ESMTPS id 12sm1785848fgg.29.2010.05.01.04.04.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 01 May 2010 04:04:40 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-hackers@freebsd.org Date: Sat, 01 May 2010 14:04:38 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: =?utf-8?B?QW5kcml1cyBNb3JrxatuYXM=?= Message-ID: User-Agent: Opera Mail/10.10 (FreeBSD) Cc: freebsd-ports@freebsd.org Subject: GSoC: Making ports work with clang 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, 01 May 2010 11:04:53 -0000 Hi, I'm Andrius Mork=C5=ABnas from Lithuania. My Summer of Code proposal was= accepted this year and be working on my project, which is to make clang and ports= to be friendly with each other. My main goals are: * Create an easy way to set ports compiler to either clang or gcc (and n= o, CC=3Dclang is not a good way to do that). * Write a tool to detect common problems with individual ports not respe= cting environment variables like CC/CXX or doing other horrible things that= break compilation with clang. * Make Gnome, KDE, Xorg and other widely used things to work with clang.= I've been patching ports to work with clang since last October, so I kno= w my way around the ports tree by now. What's different in GSoC project, comp= ared to what I usually do is that I have specific goals to achieve now, rathe= r than fixing random things when I feel like it. More information will be available on FreeBSD wiki[1] later (some is alr= eady there). I've seen a lot of people interested in building ports with clang, espec= ially now, that rdivacky@ has finally announced ClangBSD testing[2]. However, ClangBSD and ports compiled with clang are two completely different thin= gs, so I don't recommend trying to use clang for ports just yet. I've even p= osted a mail to freebsd-current@ recently, asking people not to do it[3]. However I intend to write a howto in FreeBSD wiki sometime soon explaini= ng how to build ports with clang more safely, what to expect and what not t= o expect. It will also include some information for those who want to help= us with clang and/or ports, explaining what help we do or don't want. At so= me point during summer I'll probably ask people to start testing stuff, and= report problems, so stay tuned. If you have any questions, suggestions, or some other feedback, feel fre= e to mail me on or off list. [1] http://wiki.freebsd.org/SOC2010AndriusMorkunas [2] http://lists.freebsd.org/pipermail/freebsd-current/2010-April/016648= .html [3] http://lists.freebsd.org/pipermail/freebsd-current/2010-April/016990= .html -- = Andrius From owner-freebsd-hackers@FreeBSD.ORG Sat May 1 17:22:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 782F2106564A for ; Sat, 1 May 2010 17:22:27 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79]) by mx1.freebsd.org (Postfix) with ESMTP id 393A18FC0A for ; Sat, 1 May 2010 17:22:26 +0000 (UTC) Received: from mobileKamikaze.norad (HSI-KBW-078-042-098-160.hsi3.kabel-badenwuerttemberg.de [78.42.98.160]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bsdforen.de (Postfix) with ESMTP id 846CF8A1C1D; Sat, 1 May 2010 19:22:13 +0200 (CEST) Message-ID: <4BDC6344.8090408@bsdforen.de> Date: Sat, 01 May 2010 19:22:12 +0200 From: Dominic Fandrey User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-GB; rv:1.9.1.9) Gecko/20100331 Thunderbird/3.0.4 MIME-Version: 1.0 To: =?UTF-8?B?QW5kcml1cyBNb3JrxatuYXM=?= References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-hackers@freebsd.org Subject: Re: GSoC: Making ports work with clang 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, 01 May 2010 17:22:27 -0000 Hello, On 01/05/2010 13:04, Andrius MorkÅ«nas wrote: > I'm Andrius MorkÅ«nas from Lithuania. My Summer of Code proposal was > accepted > this year and be working on my project, which is to make clang and ports to > be friendly with each other. I'm the maintainer of games/ioquake3 and games/ioquake3-devel. I'm currently working on getting ioquake3 clang compatible. It already compiles (the modding tools, which I intended to add to the port are still broken), but there are some rendering issues that are my top priority to solve at the moment. Any way, if you need feedback, consider me an interested party. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? From owner-freebsd-hackers@FreeBSD.ORG Sat May 1 20:02:15 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C659D1065670; Sat, 1 May 2010 20:02:15 +0000 (UTC) (envelope-from dforsythe@gmail.com) Received: from mail-iw0-f204.google.com (mail-iw0-f204.google.com [209.85.223.204]) by mx1.freebsd.org (Postfix) with ESMTP id 824F28FC0C; Sat, 1 May 2010 20:02:15 +0000 (UTC) Received: by iwn42 with SMTP id 42so1615320iwn.14 for ; Sat, 01 May 2010 13:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=YS/p89TsCQfinHXgmQo/W3RPmW+UdTlbDIsDhprUFSs=; b=ol4yQyo0GsFAnB9/P4KycD0q8+kAoLo226zle6yUC+rxY5IwwaTRrIiX1PzDMQLTAC j6H/4hWQHWjhi3n0nIuWhyH7qzVbJuRnsWj3rIB0+QbzR9xRzwpQoZI61tHTJlWUdx7D v1YhtM8ubHzhGnSlTDbb26ZJTxv3H4pd5VyLE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=EhY5hW/t7rp0smS03JxiMh/e7E2zlL563YbzPEwxScPXI0eRu5wg0xe9VI7jg/tStf ysXZq75e07QcswXLlzTHpU/FSMl8YmrBAv1hbYGQ6YrWrvO/z0GxntzAsj50wjD2cMHD 3we0Uya3Q5TfezCb4vuSfLMOvtQux5fW2BkNs= MIME-Version: 1.0 Received: by 10.231.168.9 with SMTP id s9mr4008864iby.7.1272742373154; Sat, 01 May 2010 12:32:53 -0700 (PDT) Sender: dforsythe@gmail.com Received: by 10.231.171.130 with HTTP; Sat, 1 May 2010 12:32:53 -0700 (PDT) Date: Sat, 1 May 2010 15:32:53 -0400 X-Google-Sender-Auth: q2lpnsScKgqUWxGuOJ93uTnXHLY Message-ID: From: David Forsythe To: freebsd-hackers@freebsd.org, freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: GSoC: Libpkg, package 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: Sat, 01 May 2010 20:02:15 -0000 Hi all, I'm David Forsythe, and I'll be working on completing libpkg (started during Summer of Code 2009) and putting together some production ready package tools. My mentor will be Tim Kientzle. I started work on the library during last years SoC with Tim as my mentor. I've been doing work on the library as time permits, and I feel that I should be able to complete most important features early on in the summer. I'll also be doing my best to keep in step with Garrett Cooper and Julian Laffaye, and hopefully I'll be able to push some of their work into the library by the end of the summer. Please take a look at the project wiki page[1] if you want to keep track of what needs to be completed in the library, and take a look at the code[2] if you want to make comments. Also, if you have interest bdb and sqlite package database implementations, plist format changes, package archive format changes, or any of that good stuff that can start a flamewar almost instantly, take a look at the code and see if you might be interested in writing something that plugs into the library (the API isn't finalized, so let me know if you actually think about doing something like this). You can email me on or off list is you have any questions, comments, or suggestions. Or if you just want to say hi. David Forsythe [1] http://wiki.freebsd.org/SOC2010DavidForsythe [2] http://www.github.com/dforsyth/libpkg From owner-freebsd-hackers@FreeBSD.ORG Sat May 1 22:35:34 2010 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4140106564A for ; Sat, 1 May 2010 22:35:34 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id D80B48FC0C for ; Sat, 1 May 2010 22:35:34 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 8B2FC1A3F00; Sat, 1 May 2010 15:35:24 -0700 (PDT) Date: Sat, 1 May 2010 15:35:24 -0700 From: Alfred Perlstein To: hackers@freebsd.org Message-ID: <20100501223524.GU36233@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Cc: Subject: Coverity warning: strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); 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, 01 May 2010 22:35:35 -0000 I notice this code sprinkled through the sources: strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); This trips up coverity because it does not know for sure that the string returned by cam_sim_name() is going to be DEV_IDLEN-1 characters long. Should we switch these calls to strlcpy? Is there a smarter thing to do to code more defensively? thank you, -- - Alfred Perlstein .- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10 .- FreeBSD committer