Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Black <rjb@dcs.gla.ac.uk>
To: redhat-bugs@redhat.com, axp-list@redhat.com
Cc: rjb@dcs.gla.ac.uk
Subject: at least two bugs in strace-3.1-5
Date: Mon, 21 Sep 98 15:41:07 +0100	[thread overview]
Message-ID: <9809211441.AA14164@bathurst> (raw)


Summary:

I discovered a bug in strace (on alpha), and on investigating discovered that 
the source RPM appears not to compile on either alpha or intel (multiple 
problems)

Details:

1)

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.

#include <unistd.h>
#include <sys/mman.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>

int main(int argc, char **argv)
{
    int fd = open("/etc/passwd", O_RDONLY);

    if (mmap(NULL, 8192, PROT_READ, MAP_PRIVATE, fd, 0) == 0)
	perror("mmap:");
    return 0;
}

gives:

open("/etc/passwd", O_RDONLY)           = 3
mmap(0, 0, 0x1ffff480, 0 /* MAP_??? */, 2, 0) = 0x1555556a000
exit(0)                                 = ?

on alpha, but the correct

open("/etc/passwd", O_RDONLY)           = 5
mmap(0, 8192, PROT_READ, MAP_PRIVATE, 5, 0) = 0x400b5000
_exit(0)                                = ?

on intel.



2)

- Also the strace source rpm (even with the supplied patches) does not compile 
on either alpha or intel because of a missing kernel include file.  
strace-3.1/process.c includes <sys/prctl.h> which in turn includes 
<linux/prctl.h>, but that header file does not exist.

- On intel, the file syscall.c does not compile because of the errors:

syscall.c: In function `trace_syscall':
syscall.c:513: `ORIG_EAX' undeclared (first use this function)
syscall.c:513: (Each undeclared identifier is reported only once
syscall.c:513: for each function it appears in.)
syscall.c:613: `EAX' undeclared (first use this function)
make: *** [syscall.o] Error 1

- On alpha even if config.h is modified to say
#undef HAVE_PRCTL
the build still fails in 

sock.c: In function `sock_ioctl':
sock.c:60: warning: implicit declaration of function `_IOW'
sock.c:60: parse error before `int'
sock.c:76: warning: unreachable code at beginning of switch statement

It is necessary to also include sys/ioctl.h to get the (buggy) binary shipped 
in the binary rpm file.

Richard



             reply	other threads:[~1998-09-21 14:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-21 14:41 Richard Black [this message]
1998-09-21 23:35 ` at least two bugs in strace-3.1-5 Thomas Bogendoerfer
1998-09-23 17:48   ` Another bug in strace-3.1 Richard Black
1998-09-24 19:10     ` Thomas Bogendoerfer
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox