bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] [GNU tar 1.20] testsuite: 2 7 8 13 14 16 17 22 28 29 44 45


From: Eric Blake
Subject: Re: [Bug-tar] [GNU tar 1.20] testsuite: 2 7 8 13 14 16 17 22 28 29 44 45 46 48 51 52 61 63 64 65 67 68 69 70 71 72 73 74 failed
Date: Wed, 21 May 2008 06:36:18 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[adding bug-gnulib]

According to H.Merijn Brand on 5/21/2008 2:06 AM:

[on HP-UX 10.20...]

|
| So, all these files have a leading two NULL bytes, but only when there
| is a size (any size).
|
| d3:/pro/3gl/GNU/tar-1.20/tests 124 > genfile --length 0 --file
directory/file2
| d3:/pro/3gl/GNU/tar-1.20/tests 125 > dump directory/file2
        [DUMP 0.5.05 UX]
|
| 00000000
|
| In order to track the source, I added a debug print with a ftell ()
| call in fill () to test the file offset before the write:
|
| So the problem lies before that, in generate_simple_file ()
| --8<---
|   fprintf (stderr, "File opened 0x%x, off: %d\n", fp, ftell (fp));
|   if (fseeko (fp, seek_offset, 0))
|     error (EXIT_FAILURE, errno, "%s", _("cannot seek"));
|   fprintf (stderr, "File seeked, off: %d\n", ftell (fp));
|
|   fill (fp, file_length, pattern);
| -->8---
|
|
| So obviously fseeko () (and.or fseek ()) are severely borked when
| called as first call after fopen (), even if seek_offset == 0.

Are you using the gnulib replacement for fseek/fseeko, or the native one?
~ If this is a bug in the gnulib replacement, it might be nice to figure
out why the seek is borking the file position.

|
| An extra guard to prevent this unwanted call:
| --8<---
|   if (seek_offset && fseek (fp, (long)seek_offset, 0))
|     error (EXIT_FAILURE, errno, "%s", _("cannot seek"));
| -->8---

This shouldn't be necessary with a compliant fseek (or working gnulib
fseek replacement).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkg0F0IACgkQ84KuGfSFAYAyHgCguh3cjXFpK1duaFtAouMkCAUx
i2wAn0whU1a+lwf/OtOhc/uPKKZ2wYC/
=PcSu
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]