From dds@icarian.dmst.aueb.gr Wed Feb 4 17:02:31 2009 Return-Path: Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 944701065670 for ; Wed, 4 Feb 2009 17:02:31 +0000 (UTC) (envelope-from dds@icarian.dmst.aueb.gr) Received: from icarian.dmst.aueb.gr (icarian.dmst.aueb.gr [195.251.251.20]) by mx1.freebsd.org (Postfix) with ESMTP id 1F4318FC27 for ; Wed, 4 Feb 2009 17:02:30 +0000 (UTC) (envelope-from dds@icarian.dmst.aueb.gr) Received: from icarian.dmst.aueb.gr (localhost [127.0.0.1]) by icarian.dmst.aueb.gr (8.14.3/8.14.2) with ESMTP id n14Gp2A4001268 for ; Wed, 4 Feb 2009 18:51:02 +0200 (EET) (envelope-from dds@icarian.dmst.aueb.gr) Received: (from dds@localhost) by icarian.dmst.aueb.gr (8.14.3/8.14.2/Submit) id n14Gp2TG001267; Wed, 4 Feb 2009 18:51:02 +0200 (EET) (envelope-from dds) Message-Id: <200902041651.n14Gp2TG001267@icarian.dmst.aueb.gr> Date: Wed, 4 Feb 2009 18:51:02 +0200 (EET) From: Diomidis Spinellis Reply-To: Diomidis Spinellis To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: truss -f fails to attach to child processes X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 131369 >Category: bin >Synopsis: truss(1): truss -f fails to attach to child processes >Confidential: no >Severity: serious >Priority: medium >Responsible: delphij >State: analyzed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Feb 04 17:10:01 UTC 2009 >Closed-Date: >Last-Modified: Tue May 12 13:43:53 UTC 2009 >Originator: Diomidis Spinellis >Release: FreeBSD 8.0-CURRENT i386 >Organization: AUEB >Environment: System: FreeBSD icarian.dmst.aueb.gr 8.0-CURRENT FreeBSD 8.0-CURRENT #4 r188112M: Wed Feb 4 10:58:38 EET 2009 dds@icarian.dmst.aueb.gr:/usr/obj/usr/home/dds/src/fbsd-svn/base/head/sys/ICARIAN i386 >Description: The truss(1) command provides a -f flag to trace child processes of the process being traced. This doesn't work: the child process isn't traced and a child of truss(1) is left spinning in the background. If the command is short-lived, then no child truss is left behind, and truss reports: truss: can not attach to target process: No such process >How-To-Repeat: truss -f sh -c 'jot 100000 >foo' truss -f sh -c /bin/echo hi >Fix: In r168569 when truss(1) started using ptrace(2) instead of procfs it no longer set PF_FORK. We need to reintroduce a way to set PF_FORK, via a ptrace SETOPTIONS argument. >Release-Note: >Audit-Trail: State-Changed-From-To: open->analyzed State-Changed-By: dds State-Changed-When: Fri Mar 27 07:00:28 UTC 2009 State-Changed-Why: Problem analyzed and fix proposed. Responsible-Changed-From-To: freebsd-bugs->dds Responsible-Changed-By: dds Responsible-Changed-When: Fri Mar 27 07:00:28 UTC 2009 Responsible-Changed-Why: Problem analyzed and fix proposed. http://www.freebsd.org/cgi/query-pr.cgi?pr=131369 Responsible-Changed-From-To: dds->delphij Responsible-Changed-By: dds Responsible-Changed-When: Tue May 12 13:40:04 UTC 2009 Responsible-Changed-Why: Turned over to delphij as the problem is associated with kernel changes he performed and dds's proposed fix (reinstating the ioctl functionality through ptrace) didn't work. http://www.freebsd.org/cgi/query-pr.cgi?pr=131369 >Unformatted: