From bland@mail.ru  Wed Nov  5 07:45:13 2003
Return-Path: <bland@mail.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id AB7BA16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Nov 2003 07:45:13 -0800 (PST)
Received: from bbnest.net (t116213.ap.plala.or.jp [220.220.116.213])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5F74143FE0
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  5 Nov 2003 07:45:12 -0800 (PST)
	(envelope-from bland@mail.ru)
Received: from bbnest.net (bland@localhost [127.0.0.1])
	by bbnest.net (8.12.10/8.12.10) with ESMTP id hA5FjBGj001377
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 6 Nov 2003 00:45:11 +0900 (JST)
	(envelope-from bland@mail.ru)
Received: (from bland@localhost)
	by bbnest.net (8.12.10/8.12.10/Submit) id hA5FjAgb001376;
	Thu, 6 Nov 2003 00:45:10 +0900 (JST)
	(envelope-from bland)
Message-Id: <200311051545.hA5FjAgb001376@bbnest.net>
Date: Thu, 6 Nov 2003 00:45:10 +0900 (JST)
From: Alexander Nedotsukov <bland@freebsd.org>
Reply-To: Alexander Nedotsukov <bland@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: truss coredumps for the no significant reason
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58970
>Category:       bin
>Synopsis:       truss(1) coredumps for the no significant reason
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 05 07:50:23 PST 2003
>Closed-Date:    Tue Mar 01 10:14:46 EST 2011
>Last-Modified:  Tue Mar 01 10:14:46 EST 2011
>Originator:     Alexander Nedotsukov
>Release:        FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD bbnest.net 5.1-CURRENT FreeBSD 5.1-CURRENT #4: Mon Nov 3 16:13:21 JST 2003 bland@bbnest.net:/usr/obj/usr/src/sys/BBNEST i386


	
>Description:
truss contains some suicide code wich provokes it coredump for
no reason for my understanding.
	
>How-To-Repeat:
turss some coredumper like int main() {return *((char*)0) = 0;} and you
get two .core files. On of them will be truss.core.
	
>Fix:
Apply the path attached.
	

--- truss.patch begins here ---
--- usr.bin/truss/main.c.orig	Mon Jun 16 23:00:35 2003
+++ usr.bin/truss/main.c	Mon Jun 16 23:05:03 2003
@@ -144,7 +144,7 @@
   struct ex_types *funcs;
   int in_exec = 0;
   char *fname = NULL;
-  int sigexit = 0;
+  int rval = 0;
   struct trussinfo *trussinfo;
 
   /* Initialize the trussinfo struct */
@@ -283,10 +283,10 @@
 	break;
       case S_SIG:
 	fprintf(trussinfo->outfile, "SIGNAL %lu\n", pfs.val);
-	sigexit = pfs.val;
 	break;
       case S_EXIT:
 	fprintf (trussinfo->outfile, "process exit, rval = %lu\n", pfs.val);
+	rval = pfs.val;
 	break;
       case S_EXEC:
 	funcs = set_etype(trussinfo);
@@ -305,11 +305,5 @@
     }
   } while (pfs.why != S_EXIT);
   fflush(trussinfo->outfile);
-  if (sigexit) {
-    if (sigexit == SIGQUIT)
-      exit(sigexit);
-    (void) signal(sigexit, SIG_DFL);
-    (void) kill(getpid(), sigexit);
-  }
-  return 0;
+  return rval;
 }
--- truss.patch ends here ---


>Release-Note:
>Audit-Trail:

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/58970: commit references a PR
Date: Tue, 26 Jun 2007 22:42:46 +0000 (UTC)

 delphij     2007-06-26 22:42:38 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/truss        amd64-fbsd.c i386-fbsd.c i386-linux.c 
                          ia64-fbsd.c main.c powerpc-fbsd.c setup.c 
                          sparc64-fbsd.c 
   Log:
   MFp4: Bugfixes for truss(1):
   
    - Fix logic handling execve().  We will not be able to
      obtain information otherwise.
    - truss coredump [1].
    - truss does not work against itself [2].
   
   PR:             bin/58970 [1], bin/45193 [2]
   Submitted by:   Howard Su
   Approved by:    re (kensmith)
   
   Revision  Changes    Path
   1.8       +8 -9      src/usr.bin/truss/amd64-fbsd.c
   1.28      +7 -9      src/usr.bin/truss/i386-fbsd.c
   1.27      +10 -11    src/usr.bin/truss/i386-linux.c
   1.11      +6 -10     src/usr.bin/truss/ia64-fbsd.c
   1.45      +6 -11     src/usr.bin/truss/main.c
   1.3       +9 -10     src/usr.bin/truss/powerpc-fbsd.c
   1.24      +6 -1      src/usr.bin/truss/setup.c
   1.11      +6 -10     src/usr.bin/truss/sparc64-fbsd.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: gavin 
State-Changed-When: Thu Feb 28 12:12:59 UTC 2008 
State-Changed-Why:  
Patched in -HEAD and RELENG_7 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58970 
State-Changed-From-To: patched->closed 
State-Changed-By: eadler 
State-Changed-When: Tue Mar 1 10:14:46 EST 2011 
State-Changed-Why:  
This PR is fixed in head, 8.x and 7.x, but will not be merged to 6.x now 
that that branch is unsupported, sorry 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58970 
>Unformatted:
