Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2006 14:14:13 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Oleg Dambaev <perl@ipchains.ru>
Cc:        stable@freebsd.org, Nikos Vassiliadis <nvass@teledomenet.gr>
Subject:   Re: trussing a non existing file causes misbehavior
Message-ID:  <20061116121413.GA1841@deviant.kiev.zoral.com.ua>
In-Reply-To: <455C2EC8.7030107@ipchains.ru>
References:  <200611161109.02430.nvass@teledomenet.gr> <455C2EC8.7030107@ipchains.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061116121413.GA1841>