bin/58970: truss coredumps for the no significant reason
Alexander Nedotsukov
bland at FreeBSD.org
Wed Nov 5 07:50:26 PST 2003
>Number: 58970
>Category: bin
>Synopsis: truss coredumps for the no significant reason
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 05 07:50:23 PST 2003
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:
More information about the freebsd-bugs
mailing list