truss doesn't work on 3.0/ -master
truss on master stalls on 'exec1' or enters a loop of::
truss: PIOCWAIT top of loop: Inappropriate ioctl for device
truss: PIOCCONT: Inappropriate ioctl for device
when tracing /bin/ls, among other programs.
#1 Updated by nthery over 3 years ago
I've observed both behaviors too.
The hang is a deadlock between the father process (truss) and the child
being exec'ed (e.g. ls). The father waits for the child to stop in
procfs_ioctl (PIOCWAIT). The child waits in PSTALL() in
exec_new_vmspace() for the father to PRELE() its reference to the
This deadlocks because of pfs_find() which PHOLD()'s the child at the
beginning of procfs_ioctl() and keeps the reference while sleeping.
One possible fix would be to keep track of the number of
procfs_ioctl(PIOCWAIT) sleepers and adjust the expected lock count
passed to PSTALL (there is already such an adjustment for the vfork()
case). This requires adding a new field to struct proc though. I'm
in the process of trying this.
As an aside the tests for P_INEXEC in procfs_open() and procfs_ioctl()
are suspicious. The flag could be set just after being tested.
On 25 February 2012 17:24, Venkatesh Srinivas via Redmine
> Issue #2313 has been reported by Venkatesh Srinivas.
> Bug #2313: truss doesn't work on 3.0/ -master
> Author: Venkatesh Srinivas
> Status: New
> Priority: Normal
> Target version:
> truss on master stalls on 'exec1' or enters a loop of::
> truss: PIOCWAIT top of loop: Inappropriate ioctl for device
> truss: PIOCCONT: Inappropriate ioctl for device
> when tracing /bin/ls, among other programs.
> You have received this notification because you have either subscribed to it, or are involved in it.
> To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account