Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Richard Black <rjb@dcs.gla.ac.uk>
To: axp-list@redhat.com,
	Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	bugs@redhat.com
Cc: rjb@dcs.gla.ac.uk
Subject: Another bug in strace-3.1
Date: Wed, 23 Sep 98 18:48:19 +0100	[thread overview]
Message-ID: <9809231748.AA00702@bathurst> (raw)
In-Reply-To: Your message of "Tue, 22 Sep 98 01:35:31 +0200."             <19980922013531.28943@alpha.franken.de>


> 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. 

Many thanks to Thomas for his patches, though I have looked on ftp.redhat.com 
and can only find strace-3.1-5.

Here is another problem -- the fstat (and related) calls appear to report 
something wrong i.e. neither the contents of the stat buffer before the call, 
nor the contents after the call.  This happens on *both* intel and alpha.

Here is the program:

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

int main(int argc, char **argv)
{
    int fd = open("/etc/passwd", O_RDONLY);
    struct stat s;
    char buf[1024];		/* just to de-cloud strace log */

    s.st_mode = 42;
    s.st_size = 12345678;
    if (fstat(fd, &s) < 0)
	perror("stat:");
    sprintf(buf, "st_mode=%d, st_size=%ld\n",
	    s.st_mode, s.st_size);
    write(1, buf, strlen(buf));
    return 0;
}

and here is the output on intel:

open("/etc/passwd", O_RDONLY)           = 5
fstat(5, {st_mode=0, st_size=0, ...})   = 0
write(1, "st_mode=33188, st_size=585\n", 27st_mode=33188, st_size=585
) = 27
_exit(0)                                = ?

and here is the output on alpha:

open("/etc/passwd", O_RDONLY)           = 3
fstat(3, {st_mode=01, st_size=906571131, ...}) = 0
write(1, "st_mode=33188, st_size=585\n", 27st_mode=33188, st_size=585
) = 27
exit(0)                                 = ?

You can see that the information reported in the braces is completely wrong.


Richard.

PS: Curiosity -- why do the alpha systems start at fd 5 and the intel ones at fd 3?



  reply	other threads:[~1998-09-23 23:45 UTC|newest]

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