[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with recent tar on NetBSD/sparc-1.5
From: |
Paul Eggert |
Subject: |
Re: Problem with recent tar on NetBSD/sparc-1.5 |
Date: |
Wed, 12 Sep 2001 11:34:22 -0700 (PDT) |
> Date: Sun, 9 Sep 2001 17:25:28 +0200 (CEST)
> From: Adrian Bunk <address@hidden>
>
> Yes, I called ktrace with the "-d" option.
Odd. I thought that meant that ktrace would trace all descendants of
tar, including gzip. But never mind, I think we're on the track of
the trouble now.
> http://www.fs.tum.de/~bunk/tar-out.bz2
Here's the key part of that trace:
1488 tar CALL utimes(0x46080,0xeffff360)
1488 tar NAMI "ImageMagick-5.3.8/PerlMagick/t/zlib/write.t"
1488 tar RET utimes 0
At this point, 'tar' should go on to drain the pipe (file descriptor
3), but instead it immediately closes it:
1488 tar CALL close(0x3)
1488 tar RET close 0
The relevant function in the tar source code is buffer.c's
'close_archive'. It contains the following code:
if (access_mode == ACCESS_READ
&& ! _isrmt (archive)
&& S_ISFIFO (archive_stat.st_mode))
while (rmtread (archive, record_start->buffer, record_size) > 0)
continue;
Can you please see why that while loop is not being executed? You can
do this either with a debugger or by inserting printf statements.
It seems to me that access_mode must be ACCESS_READ, and also _isrmt
(archive) must be zero, so the likely problem is
S_ISFIFO (archive_stat.st_mode). So I would focus on the value of the
S_ISFIFO expression. POSIX 1003.1-200x d7 says that S_ISFIFO must
yield nonzero on a pipe, but perhaps it doesn't work that way on your
host.
Also, does config.h define STAT_MACROS_BROKEN on your host?
And does <sys/stat.h> define S_ISFIFO in your compilation environment?