Bug #2313

truss doesn't work on 3.0/ -master

Added by vsrinivas about 2 years ago. Updated over 1 year ago.

Status:ClosedStart date:02/25/2012
Priority:NormalDue date:
Assignee:nthery% Done:

0%

Category:-
Target version:-

Description

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.

History

#1 Updated by nthery about 2 years ago

Hello,

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

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.

Cheers,
Nicolas

On 25 February 2012 17:24, Venkatesh Srinivas via Redmine
<> wrote:
>
> Issue #2313 has been reported by Venkatesh Srinivas.
>
> ----------------------------------------
> Bug #2313: truss doesn't work on 3.0/ -master
> http://bugs.dragonflybsd.org/issues/2313
>
> Author: Venkatesh Srinivas
> Status: New
> Priority: Normal
> Assignee:
> Category:
> 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

#2 Updated by nthery about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to nthery

#3 Updated by vsrinivas about 2 years ago

Nicolas -- were you working on this? Or just commenting where the problems were?

Thanks!

#4 Updated by vsrinivas about 2 years ago

Nicolas -- Happen to have an update wrt truss? How's it going?

#5 Updated by dillon over 1 year ago

  • Status changed from In Progress to Closed

The truss issue should be fixed in master now, though it still complains on some of the EAGAIN return values processes. Processes should no longer be getting stuck.

Also available in: Atom PDF