truss and procfs strange problem.

Proniewski Patrick patrick.proniewski at
Thu Jan 26 09:53:24 PST 2006


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  
truss usage, and if I repeat the truss command very fast, I got the  
second error (PIOCWAIT: Input/output error). Slowing down the process  
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  
puzzles me even more.


Administrateur Système - SENTIER - Université Lumière Lyon 2

More information about the freebsd-questions mailing list