From owner-freebsd-current@FreeBSD.ORG Mon Dec 15 04:35:34 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 852EC16A4CE; Mon, 15 Dec 2003 04:35:34 -0800 (PST) Received: from relay.macomnet.ru (relay.macomnet.ru [195.128.64.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AD4A43D1F; Mon, 15 Dec 2003 04:35:33 -0800 (PST) (envelope-from maxim@macomnet.ru) Received: from news1.macomnet.ru (1v4hx2pz@news1.macomnet.ru [195.128.64.14]) by relay.macomnet.ru (8.12.10/8.12.10) with ESMTP id hBFCZVkQ27744224; Mon, 15 Dec 2003 15:35:31 +0300 (MSK) Date: Mon, 15 Dec 2003 15:35:31 +0300 (MSK) From: Maxim Konovalov To: Alexander Nedotsukov In-Reply-To: <3EEDD6E2.6040505@mail.ru> Message-ID: <20031215151613.E7304@news1.macomnet.ru> References: <3EEDD6E2.6040505@mail.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cracauer@freebsd.org cc: current@freebsd.org Subject: Re: truss issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Dec 2003 12:35:34 -0000 Hello, On Mon, 16 Jun 2003, 23:40+0900, Alexander Nedotsukov wrote: > All, > > I found current truss behaviour a bit strange. It coredumps always if > trussed process do without any significant reason for my understanding. > I also confused with comment for commit originally introduced this > functionality > http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.bin/truss/main.c.diff?r1=1.9&r2=1.10. > I propose patch attached to make truss always return result of trussed > process and do not kill() itself. What do you think about it? As a matter of fact, bin/58970 is a backout of rev.1.10 truss/main.c: ---------------------------- revision 1.10 date: 1998/08/24 10:17:20; author: cracauer; state: Exp; lines: +9 -1 When exiting on SIGINT, exit with signal status ============================================================================= But a code does not match the comment and does something funny: @@ -216,6 +217,7 @@ break; case S_SIG: fprintf(outfile, "SIGNAL %lu\n", pfs.val); + sigexit = pfs.val; break; case S_EXIT: fprintf (outfile, "process exit, rval = %lu\n", pfs.val); @@ -232,5 +234,11 @@ if (ioctl(Procfd, PIOCCONT, val) == -1) warn("PIOCCONT"); } while (pfs.why != S_EXIT); + if (sigexit) { + if (sigexit == SIGQUIT) + exit(sigexit); + (void) signal(sigexit, SIG_DFL); + (void) kill(getpid(), sigexit); + } return 0; } Gentlemen, does anobody know what is going on there? -- Maxim Konovalov, maxim@macomnet.ru, maxim@FreeBSD.org