From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5886 invoked from network); 21 Sep 1998 23:41:22 -0000 Received: from mail.redhat.com (199.183.24.239) by mail2.redhat.com with SMTP; 21 Sep 1998 23:41:22 -0000 Received: from rachael.franken.de (rachael.franken.de [193.175.24.38]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id TAA19671 for ; Mon, 21 Sep 1998 19:40:53 -0400 Received: from hub-fue by rachael.franken.de via rmail with uucp id for redhat.com!axp-list; Tue, 22 Sep 1998 01:40:15 +0200 (MET DST) (Smail-3.2 1996-Jul-4 #4 built DST-Sep-8) Received: by hub-fue.franken.de (Smail3.1.29.1 #35) id m0zLFXI-002PLqC; Tue, 22 Sep 98 01:38 MET DST Received: (from tsbogend@localhost) by alpha.franken.de (8.8.7/8.8.5) id BAA06783; Tue, 22 Sep 1998 01:35:31 +0200 Message-ID: <19980922013531.28943@alpha.franken.de> Date: Tue, 22 Sep 1998 01:35:31 +0200 From: Thomas Bogendoerfer To: axp-list@redhat.com Subject: Re: at least two bugs in strace-3.1-5 References: <9809211441.AA14164@bathurst> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85 In-Reply-To: <9809211441.AA14164@bathurst>; from Richard Black on Mon, Sep 21, 1998 at 03:41:07PM +0100 On Mon, Sep 21, 1998 at 03:41:07PM +0100, Richard Black wrote: > The following program, when run under strace on alpha linux shows that strace > on alpha linux does not record the mmap call correctly. It is recorded > correctly on intel linux. below is my current patchset for strace. It fixes the mmap bug and some other oddities. > - Also the strace source rpm (even with the supplied patches) does not > compile strace-3.1-7 (RedHat 5.1) compiled at least on my Alpha. The patch is on top of it. Thomas. diff -ru strace-3.1-orig/defs.h strace-3.1/defs.h --- strace-3.1-orig/defs.h Tue Sep 22 01:22:02 1998 +++ strace-3.1/defs.h Sun Jun 29 15:06:34 1997 @@ -113,6 +113,7 @@ short flags; /* See below for TCB_ values */ int pid; /* Process Id of this entry */ long scno; /* System call number */ + long oscno; /* old System call for handling signals */ int u_nargs; /* System call arguments */ long u_arg[MAX_ARGS]; /* System call arguments */ int u_error; /* Error code */ diff -ru strace-3.1-orig/file.c strace-3.1/file.c --- strace-3.1-orig/file.c Tue Sep 22 01:22:03 1998 +++ strace-3.1/file.c Sun Jun 29 14:38:46 1997 @@ -297,7 +297,7 @@ static void printstat(tcp, addr) struct tcb *tcp; -int addr; +long addr; { struct stat statbuf; @@ -306,7 +306,7 @@ return; } if (syserror(tcp) || !verbose(tcp)) { - tprintf("%#x", addr); + tprintf("%#lx", addr); return; } if (umove(tcp, addr, &statbuf) < 0) { diff -ru strace-3.1-orig/linux/alpha/syscallent.h strace-3.1/linux/alpha/syscallent.h --- strace-3.1-orig/linux/alpha/syscallent.h Fri May 17 04:38:46 1996 +++ strace-3.1/linux/alpha/syscallent.h Tue Sep 22 01:06:09 1998 @@ -99,7 +99,7 @@ { 2, TF, sys_lstat, "lstat" }, /* 68 */ { 5, 0, printargs, "SYS_69" }, /* 69 */ { 5, 0, printargs, "SYS_70" }, /* 70 */ - { 1, 0, sys_mmap, "mmap" }, /* 71 */ + { 6, 0, sys_mmap, "mmap" }, /* 71 */ { 5, 0, printargs, "SYS_72" }, /* 72 */ { 2, 0, sys_munmap, "munmap" }, /* 73 */ { 3, 0, sys_mprotect, "mprotect" }, /* 74 */ diff -ru strace-3.1-orig/process.c strace-3.1/process.c --- strace-3.1-orig/process.c Tue Sep 22 01:22:03 1998 +++ strace-3.1/process.c Sun May 19 08:40:36 1996 @@ -1143,6 +1143,11 @@ tprintf("release=\"%s\", version=\"%s\", ", uname.release, uname.version); tprintf("machine=\"%s\"", uname.machine); +#ifdef LINUX +#ifndef ALPHA + tprintf(", domainname=\"%s\"", uname.domainname); +#endif /* ALPHA */ +#endif /* LINUX */ tprintf("}"); } else diff -ru strace-3.1-orig/strace.c strace-3.1/strace.c --- strace-3.1-orig/strace.c Sun May 19 08:40:37 1996 +++ strace-3.1/strace.c Sun Jun 29 15:08:17 1997 @@ -1311,6 +1311,7 @@ break; case PR_SIGNALLED: if (!cflag && (qual_flags[what] & QUAL_SIGNAL)) { + tcp->oscno = tcp->scno; printleader(tcp); tprintf("--- %s (%s) ---", signalent[what], strsignal(what)); diff -ru strace-3.1-orig/syscall.c strace-3.1/syscall.c --- strace-3.1-orig/syscall.c Tue Sep 22 01:22:03 1998 +++ strace-3.1/syscall.c Tue Sep 22 01:05:07 1998 @@ -720,6 +720,7 @@ } if (tcp->flags & TCB_REPRINT) { + tcp->scno = tcp->oscno; printleader(tcp); tprintf("<... "); if (tcp->scno >= nsyscalls) @@ -848,7 +849,10 @@ #ifdef ALPHA { int i; - tcp->u_nargs = sysent[tcp->scno].nargs; + if (scno < 400) + tcp->u_nargs = sysent[tcp->scno].nargs; + else + tcp->u_nargs = 5; for (i = 0; i < tcp->u_nargs; i++) { if (upeek(pid, REG_A0+i, &tcp->u_arg[i]) < 0) return -1; -- See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too ;-) [Linus Torvalds in <4rikft$7g5@linux.cs.Helsinki.FI>]