From owner-freebsd-stable@FreeBSD.ORG Thu Nov 16 12:14:24 2006 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E8DC16A412 for ; Thu, 16 Nov 2006 12:14:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from fw.zoral.com.ua (fw.zoral.com.ua [213.186.206.134]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ABAE43D46 for ; Thu, 16 Nov 2006 12:14:20 +0000 (GMT) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id kAGCEE3I045297 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Nov 2006 14:14:14 +0200 (EET) (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.13.8/8.13.8) with ESMTP id kAGCEEaE027455; Thu, 16 Nov 2006 14:14:14 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8/Submit) id kAGCEDwY027454; Thu, 16 Nov 2006 14:14:13 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 16 Nov 2006 14:14:13 +0200 From: Kostik Belousov To: Oleg Dambaev Message-ID: <20061116121413.GA1841@deviant.kiev.zoral.com.ua> References: <200611161109.02430.nvass@teledomenet.gr> <455C2EC8.7030107@ipchains.ru> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbJkn9YxBvnuCH5J" Content-Disposition: inline In-Reply-To: <455C2EC8.7030107@ipchains.ru> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.4, clamav-milter version 0.88.4 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL, UNPARSEABLE_RELAY autolearn=no version=3.1.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on fw.zoral.com.ua Cc: stable@freebsd.org, Nikos Vassiliadis Subject: Re: trussing a non existing file causes misbehavior X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Nov 2006 12:14:24 -0000 --VbJkn9YxBvnuCH5J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 16, 2006 at 12:26:32PM +0300, Oleg Dambaev wrote: > Nikos Vassiliadis wrote: > >Hello, > > > >In my 6.2-PRERELEASE(one month old approximately) truss gets stuck exiti= ng > >when trying to truss a non existing file. I think the problem is not in= =20 > >truss itself. > >But I have not the skills to find it. So, will a build with updated=20 > >sources help? > >Is there anybody else with the same problem? > > > >nik:0:~$ truss /nothing > >truss: execvp /nothing: No such file or directory > >load: 1.04 cmd: truss 70662 [exithold] 0.00u 0.00s 0% 700k > > > >Thanks in advance, Nikos > > =20 > Never seen any dumbest thing. > Re-read truss(1) man page and find out what truss must do. I think that rude response is always wrong. There, Nikos reported real, although cosmetic problem since the parent truss process sleeps interruptible. The following change shall take care: Index: fs/procfs/procfs_ioctl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/arch/ncvs/src/sys/fs/procfs/procfs_ioctl.c,v retrieving revision 1.14 diff -u -r1.14 procfs_ioctl.c --- fs/procfs/procfs_ioctl.c 6 Nov 2006 13:41:57 -0000 1.14 +++ fs/procfs/procfs_ioctl.c 16 Nov 2006 12:13:45 -0000 @@ -124,7 +124,7 @@ *(unsigned int *)data =3D p->p_pfsflags; break; case PIOCWAIT: - while (p->p_step =3D=3D 0) { + while (p->p_step =3D=3D 0 && (p->p_flag & P_WEXIT) =3D=3D 0) { /* sleep until p stops */ error =3D msleep(&p->p_stype, &p->p_mtx, PWAIT|PCATCH, "pioctl", 0); @@ -142,7 +142,7 @@ break; #ifdef COMPAT_IA32 case PIOCWAIT32: - while (p->p_step =3D=3D 0) { + while (p->p_step =3D=3D 0 && (p->p_flag & P_WEXIT) =3D=3D 0) { /* sleep until p stops */ error =3D msleep(&p->p_stype, &p->p_mtx, PWAIT|PCATCH, "pioctl", 0); --VbJkn9YxBvnuCH5J Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFXFYVC3+MBN1Mb4gRAiJqAKDozohTbi+PsXVeVj0EbrMc57RqcACg8oNe DztL19nPLe6DICI9YkioNTk= =rUw+ -----END PGP SIGNATURE----- --VbJkn9YxBvnuCH5J--