New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bizarre Problem in Archive::Tar (auto-vivification problem?) #1167
Comments
From gustav@morpheus.demon.co.ukCreated by gustav@morpheus.demon.co.ukThe basic problem is that Archive::Tar 0.21 fails test 5 with Perl 5.5.650 under Now, in order to try to diagnose the problem, I added some print statements. The The peculiar thing is that if I uncomment print #1, the test succeeds! I suspect the issue here is something to do with auto-vivification -- that's the But the whole thing is very strange. ------ Tar.pm patch ------ Inline Patch--- Tar.pm.orig Tue Feb 02 16:37:13 1999
+++ Tar.pm Thu Feb 10 22:23:58 2000
@@ -232,11 +232,13 @@
$fh = Compress::Zlib::gzopen ($_[0], $mode)
or goto &_drat;
+ # (print #3) print STDERR "ZLIB: fh=$fh\n";
}
else {
$fh = bless *{$_[0]}{IO}, "Archive::Tar::_io";
binmode $fh
or goto &_drat;
+ # (print #4) print STDERR "IO: fh=$fh\n";
}
return $fh;
@@ -616,6 +618,7 @@
$handle = gensym;
open $handle, ref ($file) ? ">&". fileno ($file) : ">" . $file
or goto &_drat;
+ binmode $handle;
_write_tar (_get_handle ($handle, int ($compress)),
map {_add_file ($_)} @_);
@@ -629,6 +632,7 @@
$handle = gensym;
open $handle, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $handle;
my $data = _read_tar (_get_handle ($handle), 1);
@@ -647,6 +651,7 @@
$handle = gensym;
open $handle, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $handle;
_read_tar (_get_handle ($handle), 0, 1);
}
@@ -681,6 +686,7 @@
$self->{_handle} = gensym;
open $self->{_handle}, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $self->{_handle};
$self->{_data} = _read_tar (_get_handle ($self->{_handle}),
sysseek $self->{_handle}, 0, 1);
@@ -697,6 +703,7 @@
my $handle = gensym;
open $handle, ref ($file) ? ">&". fileno ($file) : ">" . $file
or goto &_drat;
+ binmode $handle;
if ($compress && !$compression) {
$error = "Compression not available.\n";
@@ -782,6 +789,8 @@
unless $entry->{offset};
my $handle = _get_handle ($self->{_handle});
+# (print #1) print STDERR "HANDLE IS $self->{_handle}\n";
+# (print #2) print STDERR "HANDLE IS $handle\n";
$handle->gzseek ($entry->{offset}, 0)
or goto &_drat; Perl Info
|
From [Unknown Contact. See original ticket]Created by gustav@morpheus.demon.co.ukThe basic problem is that Archive::Tar 0.21 fails test 5 with Perl 5.5.650 Now, in order to try to diagnose the problem, I added some print statements. The peculiar thing is that if I uncomment print #1, the test succeeds! I suspect the issue here is something to do with auto-vivification -- that's But the whole thing is very strange. ------ Tar.pm patch ------ Inline Patch--- Tar.pm.orig Tue Feb 02 16:37:13 1999
+++ Tar.pm Thu Feb 10 22:23:58 2000
@@ -232,11 +232,13 @@
$fh = Compress::Zlib::gzopen ($_[0], $mode)
or goto &_drat;
+ # (print #3) print STDERR "ZLIB: fh=$fh\n";
}
else {
$fh = bless *{$_[0]}{IO}, "Archive::Tar::_io";
binmode $fh
or goto &_drat;
+ # (print #4) print STDERR "IO: fh=$fh\n";
}
return $fh;
@@ -616,6 +618,7 @@
$handle = gensym;
open $handle, ref ($file) ? ">&". fileno ($file) : ">" . $file
or goto &_drat;
+ binmode $handle;
_write_tar (_get_handle ($handle, int ($compress)),
map {_add_file ($_)} @_);
@@ -629,6 +632,7 @@
$handle = gensym;
open $handle, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $handle;
my $data = _read_tar (_get_handle ($handle), 1);
@@ -647,6 +651,7 @@
$handle = gensym;
open $handle, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $handle;
_read_tar (_get_handle ($handle), 0, 1);
}
@@ -681,6 +686,7 @@
$self->{_handle} = gensym;
open $self->{_handle}, ref ($file) ? "<&". fileno ($file) : "<" . $file
or goto &_drat;
+ binmode $self->{_handle};
$self->{_data} = _read_tar (_get_handle ($self->{_handle}),
sysseek $self->{_handle}, 0, 1);
@@ -697,6 +703,7 @@
my $handle = gensym;
open $handle, ref ($file) ? ">&". fileno ($file) : ">" . $file
or goto &_drat;
+ binmode $handle;
if ($compress && !$compression) {
$error = "Compression not available.\n";
@@ -782,6 +789,8 @@
unless $entry->{offset};
my $handle = _get_handle ($self->{_handle});
+# (print #1) print STDERR "HANDLE IS $self->{_handle}\n";
+# (print #2) print STDERR "HANDLE IS $handle\n";
$handle->gzseek ($entry->{offset}, 0)
or goto &_drat; Perl Info
|
From @floatingatollHi :) This bug seems to be regarding a non-core module that's your - R. [1] http://rt.perl.org/rt2/Ticket/Display.html/id=2135 |
From kane@dwim.orgOn Nov 23, 2003, at 4:52 AM, crystalflame (via RT) wrote:
since all the internals are /completely/ rewritten, i'd say: 'probably' p.s. note the age of this ticket, i hardly think it's current any -- Jos Boumans "If superman is so smart, why does he wear underpants over his CPANPLUS http://cpanplus.sf.net [2] http://search.cpan.org/~kane/Archive-Tar-1.07/lib/Archive/Tar.pm |
@petdance - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#2135 (status was 'resolved')
Searchable as RT2135$
The text was updated successfully, but these errors were encountered: