Date: Sun, 10 Nov 2002 18:08:32 +0100 (CET) From: Pawel Worach <sajd@telia.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/45193: [PATCH] truss can't truss itself Message-ID: <200211101708.gAAH8WVX002184@darkstar.sajd.net>
next in thread | raw e-mail | index | archive | help
>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 <sajd@telia.com> >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 <next pid> >How-To-Repeat: Figure out the next pid number (using top for example) then run truss -p <pid> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211101708.gAAH8WVX002184>