From owner-freebsd-bugs Sun Nov 10 9:10: 4 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FDFF37B401 for ; Sun, 10 Nov 2002 09:10:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A0E243E4A for ; Sun, 10 Nov 2002 09:10:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gAAHA1x3021266 for ; Sun, 10 Nov 2002 09:10:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gAAHA1J0021265; Sun, 10 Nov 2002 09:10:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CEACD37B401 for ; Sun, 10 Nov 2002 09:08:36 -0800 (PST) Received: from h14n2fls34o809.telia.com (h14n2fls34o809.telia.com [217.208.95.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7270043E42 for ; Sun, 10 Nov 2002 09:08:35 -0800 (PST) (envelope-from sajd@telia.com) Received: from darkstar.sajd.net (darkstar.sajd.net [192.168.1.11]) by h14n2fls34o809.telia.com (8.11.6+Sun/8.11.6) with ESMTP id gAAH8Xg29537 for ; Sun, 10 Nov 2002 18:08:33 +0100 (MET) Received: from darkstar.sajd.net (localhost [127.0.0.1]) by darkstar.sajd.net (8.12.6/8.12.5) with ESMTP id gAAH8X4N002185 for ; Sun, 10 Nov 2002 18:08:33 +0100 (CET) (envelope-from root@darkstar.sajd.net) Received: (from root@localhost) by darkstar.sajd.net (8.12.6/8.12.6/Submit) id gAAH8WVX002184; Sun, 10 Nov 2002 18:08:32 +0100 (CET) Message-Id: <200211101708.gAAH8WVX002184@darkstar.sajd.net> Date: Sun, 10 Nov 2002 18:08:32 +0100 (CET) From: Pawel Worach Reply-To: Pawel Worach To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/45193: [PATCH] truss can't truss itself Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 45193 >Category: bin >Synopsis: [PATCH] truss can't truss itself >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Nov 10 09:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Pawel Worach >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: FreeBSD darkstar 4.7-STABLE FreeBSD 4.7-STABLE #0: Sat Nov 9 17:10:55 CET 2002 root@darkstar:/usr/obj/usr/src/sys/DARKSTAR i386 >Description: If you try to truss the truss process with itself it will deadlock like truss -p >How-To-Repeat: Figure out the next pid number (using top for example) then run truss -p that will make truss trace itself without any result. >Fix: Patch for $FreeBSD: src/usr.bin/truss/main.c,v 1.15.2.3 2002/05/16 23:41:23 peter Exp $ (this is what it does on SunOS) --- main.c.orig Fri May 17 01:41:23 2002 +++ main.c Sun Nov 10 16:44:40 2002 @@ -144,6 +144,10 @@ switch (c) { case 'p': /* specified pid */ pid = atoi(optarg); + if(pid == getpid()) { /* make sure i don't trace me */ + fprintf(stderr, "truss: attempt to grab self: %d\n", pid); + exit(2); + } break; case 'o': /* Specified output file */ fname = optarg; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message