Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2006 18:53:46 +0100
From:      Proniewski Patrick <patrick.proniewski@univ-lyon2.fr>
To:        freebsd-questions@freebsd.org
Cc:        Dan Nelson <dnelson@allantgroup.com>
Subject:   Re: truss and procfs strange problem.
Message-ID:  <CCF767A3-2C7B-4988-8F9E-6EF2DABEDF76@univ-lyon2.fr>
In-Reply-To: <20060126171333.GB52542@dan.emsphone.com>
References:  <6F2F4E06-712A-4E3D-9124-7AC7E1B964BD@univ-lyon2.fr> <20060126171333.GB52542@dan.emsphone.com>

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

On 26 janv. 06, at 18:13, Dan Nelson wrote:

>> 	$ truss ls
>> 	truss: cannot open /proc/4509/mem: No such file or directory
>> 	$ truss ls
>> 	truss: PIOCWAIT: Input/output error
>
> The child process probably hasn't been fully started by the time the
> parent tries to attach to it.  Adding a sleep(1) inside
> setup_and_wait() in setup.c just before it tries to open /proc/%d/mem
> is a quick hack that works.  A better solution would be to retry the
> open and ioctl calls if they fail, after a short wait (but only doing
> so for a couple seconds in case there was a problem starting the child
> process).

hmmm I see. In fact, I have the "cannot open" error for a normal =20
truss usage, and if I repeat the truss command very fast, I got the =20
second error (PIOCWAIT: Input/output error). Slowing down the process =20=

is an interesting workaround :

truss ls -> fails 100% of the time
ktrace truss ls -> fail most of the time
truss `which ls` -> works great.


> I have no idea why the PIOCWAIT ioctl would fail like that

neither have I... In fact, the 128 items limitation of my procfs =20
puzzles me even more.

thanks

Patrick PRONIEWSKI
--=20
Administrateur Syst=E8me - SENTIER - Universit=E9 Lumi=E8re Lyon 2




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CCF767A3-2C7B-4988-8F9E-6EF2DABEDF76>