Debian Bug report logs - #435656
Change in behaviour of gzreadline() caused debmirror to delete my whole mirror

version graph

Package: libcompress-zlib-perl; Maintainer for libcompress-zlib-perl is Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>;

Reported by: Peter Baumann <waste.manager@gmx.de>

Date: Thu, 2 Aug 2007 11:57:02 UTC

Severity: grave

Found in version libcompress-zlib-perl/2.005-1

Fixed in version libcompress-zlib-perl/2.005-2

Done: Damyan Ivanov <dmn@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://rt.cpan.org/Public/Bug/Display.html?id=28663

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>:
Bug#435656; Package libcompress-zlib-perl. Full text and rfc822 format available.

Acknowledgement sent to Peter Baumann <waste.manager@gmx.de>:
New Bug report received and forwarded. Copy sent to Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Peter Baumann <waste.manager@gmx.de>
To: submit@bugs.debian.org
Subject: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Date: Thu, 2 Aug 2007 13:55:03 +0200
Package: libcompress-zlib-perl
Version: 2.005-1
Severity: serious

--- Please enter the report below this line. ---

After the upgrade to version 2.005-1 debmirror decided to delete my
whole debian mirror. And as i didn't pay attention during debmirror
updates this is really annoying.

The corresponding debmirror code is here:

 851     my $gunzf = gzopen($file, "rb") or die "$file: $!";
 852     my $line;
 853     my $res;
 854     my $loop = 1;
 855     while ($loop) {
 856       my $buf = "";
 857       while(($res = $gunzf->gzreadline($line) > 0)
 858             && !($line =~ /^$/)) {
 859         $buf = $buf . $line;
 860       }
 861       if ($res <= 0) { # <--------  THIS IS ALWAYS TRUE AFTER THE UPGRADE
 862         $loop = 0;
 863         next;
 864       }

I debuged it with print statements and found out the the above marked if
statement is alwasy true after the upgrade and thats why the code further down
the while statement is never reached.

I'm not sure if this is actually a problem in debmirror or in libcompress-zlib-perl,
but as it worked before the upgrade it seems naturally to report the bug here.

Downgrading the packet fixed my problem. But now to downloading the mirror :-(

-Peter

--- System information. ---
Architecture: i386
Kernel:       Linux 2.6.18-4-k7

Debian Release: lenny/sid
  990 unstable        www.debian-multimedia.org 
  990 unstable        ftp.debian.org 
  990 unstable        ftp.de.debian.org 
  500 stable          ftp.de.debian.org 

--- Package information. ---
Depends                (Version) | Installed
================================-+-===============
perl              (>= 5.8.8-6.1) | 5.8.8-7
perlapi-5.8.8                    | 
libc6               (>= 2.3.6-6) | 2.6-5
zlib1g              (>= 1:1.2.1) | 1:1.2.3.3.dfsg-5




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>:
Bug#435656; Package libcompress-zlib-perl. Full text and rfc822 format available.

Acknowledgement sent to Damyan Ivanov <dam@modsoftsys.com>:
Extra info received and forwarded to list. Copy sent to Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #10 received at 435656@bugs.debian.org (full text, mbox):

From: Damyan Ivanov <dam@modsoftsys.com>
To: Peter Baumann <waste.manager@gmx.de>
Cc: 435656@bugs.debian.org
Subject: Re: Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Date: Fri, 03 Aug 2007 08:23:10 +0300
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- -=| Peter Baumann,  2.08.2007 14:55 |=-
> 
> After the upgrade to version 2.005-1 debmirror decided to delete my
> whole debian mirror. And as i didn't pay attention during debmirror
> updates this is really annoying.
> 
> The corresponding debmirror code is here:
> 
>  851     my $gunzf = gzopen($file, "rb") or die "$file: $!";
>  852     my $line;
>  853     my $res;
>  854     my $loop = 1;
>  855     while ($loop) {
>  856       my $buf = "";
>  857       while(($res = $gunzf->gzreadline($line) > 0)
>  858             && !($line =~ /^$/)) {
>  859         $buf = $buf . $line;
>  860       }
>  861       if ($res <= 0) { # <--------  THIS IS ALWAYS TRUE AFTER THE UPGRADE
>  862         $loop = 0;
>  863         next;
>  864       }

I have a couple of guesses that you may help with:

The code above reads until either an empty $line appears, or $res is not
positive. Could it be possible that the file in question does no contain
empty lines and thus the inner while reads until EOF?

Or, perhaps $line needs a chomp in order to match /^$/ ?
(yes, that would mean a behaviour change)
- --
Damyan Ivanov            JabberID: dam@jabber.minus273.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsru+Hqjlqpcl9jsRAp/IAKCw8lc3W+k2Lya5+qvjOPzYaS+6MQCfWKHV
Wy7RdEGhIQ7ezm+JCLq1jn4=
=XtPN
-----END PGP SIGNATURE-----



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>:
Bug#435656; Package libcompress-zlib-perl. Full text and rfc822 format available.

Acknowledgement sent to Peter Baumann <waste.manager@gmx.de>:
Extra info received and forwarded to list. Copy sent to Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #15 received at 435656@bugs.debian.org (full text, mbox):

From: Peter Baumann <waste.manager@gmx.de>
To: Damyan Ivanov <dam@modsoftsys.com>
Cc: 435656@bugs.debian.org
Subject: Re: Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Date: Fri, 3 Aug 2007 15:46:08 +0200
On Fri, Aug 03, 2007 at 08:23:10AM +0300, Damyan Ivanov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> - -=| Peter Baumann,  2.08.2007 14:55 |=-
> > 
> > After the upgrade to version 2.005-1 debmirror decided to delete my
> > whole debian mirror. And as i didn't pay attention during debmirror
> > updates this is really annoying.
> > 
> > The corresponding debmirror code is here:
> > 
> >  851     my $gunzf = gzopen($file, "rb") or die "$file: $!";
> >  852     my $line;
> >  853     my $res;
> >  854     my $loop = 1;
> >  855     while ($loop) {
> >  856       my $buf = "";
> >  857       while(($res = $gunzf->gzreadline($line) > 0)
> >  858             && !($line =~ /^$/)) {
> >  859         $buf = $buf . $line;
> >  860       }
> >  861       if ($res <= 0) { # <--------  THIS IS ALWAYS TRUE AFTER THE UPGRADE
> >  862         $loop = 0;
> >  863         next;
> >  864       }
> 
> I have a couple of guesses that you may help with:
> 
> The code above reads until either an empty $line appears, or $res is not
> positive. Could it be possible that the file in question does no contain
> empty lines and thus the inner while reads until EOF?
> 
> Or, perhaps $line needs a chomp in order to match /^$/ ?
> (yes, that would mean a behaviour change)

No. The file is fine (it is e.g dists/lenny/main/binary-i386/Packages.gz).
But this gave me the right direction. Here is the output of the slighly
changed code segment (output enclosed by '-' markers)

    my $gunzf = gzopen($file, "rb") or die "$file: $!";
    my $line;
    my $res;
    my $loop = 1;
    while ($loop) {
      my $buf = "";
      while(($res = $gunzf->gzreadline($line) > 0)
           && !($line =~ /^$/)) {
        printf "%u:%s", length($line), $line;
        exit;
        $buf = $buf . $line;
      }



previous version (1.42-2):
-
16:Package: 2vcard
-


new version (2.005-1)
-
791:Package: 2vcard
Priority: optional
Section: utils
Installed-Size: 108
Maintainer: Martin Albisetti <argentina@gmail.com>
Architecture: i386
Version: 0.5-1
Filename: pool/main/2/2vcard/2vcard_0.5-1_i386.deb
Size: 14090
MD5sum: 074de92c99657c98dff1ed42d580f84b
SHA1: ceea35694c35437ad3f8a1e06ab7d3e698efee56
SHA256: 814b27ae828b9947d63a1ce628c85e5fb36f95075f3ccdbd23c9c908e067fb6c
Description: A little perl script to convert an addressbook to VCARD file format
 2vcard is a little perl script that you can use to convert the popular vcard
 file format. Currently 2vcard can only convert adressbooks and alias files from
 the following formats: abook,eudora,juno,ldif,mutt,mh and pine.
 .
 The VCARD format is used by gnomecard, for example, which is turn is used by
 the balsa email client.

-

So it is definitly a change in behaviour of gzreadline()

Greetings,
Peter Baumann



Information forwarded to debian-bugs-dist@lists.debian.org, Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>:
Bug#435656; Package libcompress-zlib-perl. Full text and rfc822 format available.

Acknowledgement sent to Damyan Ivanov <dam@modsoftsys.com>:
Extra info received and forwarded to list. Copy sent to Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #20 received at 435656@bugs.debian.org (full text, mbox):

From: Damyan Ivanov <dam@modsoftsys.com>
To: Peter Baumann <waste.manager@gmx.de>
Cc: 435656@bugs.debian.org
Subject: Re: Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Date: Fri, 03 Aug 2007 17:22:46 +0300
[Message part 1 (text/plain, inline)]
severity 435656 grave
thanks

Rationale: breaks unrelated software

-=| Peter Baumann,  3.08.2007 16:46 |=-
> On Fri, Aug 03, 2007 at 08:23:10AM +0300, Damyan Ivanov wrote:
>> The code above reads until either an empty $line appears, or $res is not
>> positive. Could it be possible that the file in question does no contain
>> empty lines and thus the inner while reads until EOF?
>>
>> Or, perhaps $line needs a chomp in order to match /^$/ ?
>> (yes, that would mean a behaviour change)
> 
> No. The file is fine (it is e.g dists/lenny/main/binary-i386/Packages.gz).
> But this gave me the right direction. Here is the output of the slighly
> changed code segment (output enclosed by '-' markers)
> 
>     my $gunzf = gzopen($file, "rb") or die "$file: $!";
>     my $line;
>     my $res;
>     my $loop = 1;
>     while ($loop) {
>       my $buf = "";
>       while(($res = $gunzf->gzreadline($line) > 0)
>            && !($line =~ /^$/)) {
>         printf "%u:%s", length($line), $line;
>         exit;
>         $buf = $buf . $line;
>       }
> 
> 
> 
> previous version (1.42-2):
> -
> 16:Package: 2vcard
> -
> 
> 
> new version (2.005-1)
> -
> 791:Package: 2vcard
> Priority: optional
> Section: utils
> Installed-Size: 108
> Maintainer: Martin Albisetti <argentina@gmail.com>
> Architecture: i386
> Version: 0.5-1
> Filename: pool/main/2/2vcard/2vcard_0.5-1_i386.deb
> Size: 14090
> MD5sum: 074de92c99657c98dff1ed42d580f84b
> SHA1: ceea35694c35437ad3f8a1e06ab7d3e698efee56
> SHA256: 814b27ae828b9947d63a1ce628c85e5fb36f95075f3ccdbd23c9c908e067fb6c
> Description: A little perl script to convert an addressbook to VCARD file format
>  2vcard is a little perl script that you can use to convert the popular vcard
>  file format. Currently 2vcard can only convert adressbooks and alias files from
>  the following formats: abook,eudora,juno,ldif,mutt,mh and pine.
>  .
>  The VCARD format is used by gnomecard, for example, which is turn is used by
>  the balsa email client.
> 
> -

Ouch! It seems only double \n's are detected?

Can you also print length($/) around there? Is it zero?

If it is, this could be the source of the problem - it seems
IO::Compress::Base (which actually implements the gzreadline function)
supports several modes, $/ == '' provoking the "paragraph mode".

I guess Compress::Zlib's gzreadline() should add "local $/ = ''" before
passing the call further to preserve the previous interface.

If you confirm that $/ is indeed empty and setting it to '\n' solves the
problem, I'll prepare a fix.
-- 
dam            JabberID: dam@jabber.minus273.org

[signature.asc (application/pgp-signature, attachment)]

Severity set to `grave' from `serious' Request was from Damyan Ivanov <dam@modsoftsys.com> to control@bugs.debian.org. (Fri, 03 Aug 2007 14:24:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>:
Bug#435656; Package libcompress-zlib-perl. Full text and rfc822 format available.

Acknowledgement sent to Peter Baumann <waste.manager@gmx.de>:
Extra info received and forwarded to list. Copy sent to Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>. Full text and rfc822 format available.

Message #27 received at 435656@bugs.debian.org (full text, mbox):

From: Peter Baumann <waste.manager@gmx.de>
To: Damyan Ivanov <dam@modsoftsys.com>
Cc: 435656@bugs.debian.org
Subject: Re: Bug#435656: Change in behaviour of gzreadline() caused debmirror to delete my whole mirror
Date: Fri, 3 Aug 2007 19:37:13 +0200
On Fri, Aug 03, 2007 at 05:22:46PM +0300, Damyan Ivanov wrote:
> severity 435656 grave
> thanks
> 
> Rationale: breaks unrelated software
> 
> -=| Peter Baumann,  3.08.2007 16:46 |=-
> > On Fri, Aug 03, 2007 at 08:23:10AM +0300, Damyan Ivanov wrote:
> >> The code above reads until either an empty $line appears, or $res is not
> >> positive. Could it be possible that the file in question does no contain
> >> empty lines and thus the inner while reads until EOF?
> >>
> >> Or, perhaps $line needs a chomp in order to match /^$/ ?
> >> (yes, that would mean a behaviour change)
> > 
> > No. The file is fine (it is e.g dists/lenny/main/binary-i386/Packages.gz).
> > But this gave me the right direction. Here is the output of the slighly
> > changed code segment (output enclosed by '-' markers)
> > 
> >     my $gunzf = gzopen($file, "rb") or die "$file: $!";
> >     my $line;
> >     my $res;
> >     my $loop = 1;
> >     while ($loop) {
> >       my $buf = "";
> >       while(($res = $gunzf->gzreadline($line) > 0)
> >            && !($line =~ /^$/)) {
> >         printf "%u:%s", length($line), $line;
> >         exit;
> >         $buf = $buf . $line;
> >       }
> > 
> > 
> > 
> > previous version (1.42-2):
> > -
> > 16:Package: 2vcard
> > -
> > 
> > 
> > new version (2.005-1)
> > -
> > 791:Package: 2vcard
> > Priority: optional
> > Section: utils
> > Installed-Size: 108
> > Maintainer: Martin Albisetti <argentina@gmail.com>
> > Architecture: i386
> > Version: 0.5-1
> > Filename: pool/main/2/2vcard/2vcard_0.5-1_i386.deb
> > Size: 14090
> > MD5sum: 074de92c99657c98dff1ed42d580f84b
> > SHA1: ceea35694c35437ad3f8a1e06ab7d3e698efee56
> > SHA256: 814b27ae828b9947d63a1ce628c85e5fb36f95075f3ccdbd23c9c908e067fb6c
> > Description: A little perl script to convert an addressbook to VCARD file format
> >  2vcard is a little perl script that you can use to convert the popular vcard
> >  file format. Currently 2vcard can only convert adressbooks and alias files from
> >  the following formats: abook,eudora,juno,ldif,mutt,mh and pine.
> >  .
> >  The VCARD format is used by gnomecard, for example, which is turn is used by
> >  the balsa email client.
> > 
> > -
> 
> Ouch! It seems only double \n's are detected?
> 
> Can you also print length($/) around there? Is it zero?
> 

No, it is 2 and set to "\n\n"

> If it is, this could be the source of the problem - it seems
> IO::Compress::Base (which actually implements the gzreadline function)
> supports several modes, $/ == '' provoking the "paragraph mode".
> 
> I guess Compress::Zlib's gzreadline() should add "local $/ = ''"
> before
> passing the call further to preserve the previous interface.
> 
> If you confirm that $/ is indeed empty and setting it to '\n' solves
> the
> problem, I'll prepare a fix.

Yes, setting it to $/="\n" fixes my problem and I get only one line from
gzreadline() as result.

-Peter



Noted your statement that Bug has been forwarded to http://rt.cpan.org/Public/Bug/Display.html?id=28663. Request was from Damyan Ivanov <dmn@debian.org> to control@bugs.debian.org. (Sat, 04 Aug 2007 05:06:01 GMT) Full text and rfc822 format available.

Reply sent to Damyan Ivanov <dmn@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to Peter Baumann <waste.manager@gmx.de>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #34 received at 435656-close@bugs.debian.org (full text, mbox):

From: Damyan Ivanov <dmn@debian.org>
To: 435656-close@bugs.debian.org
Subject: Bug#435656: fixed in libcompress-zlib-perl 2.005-2
Date: Sat, 04 Aug 2007 05:32:02 +0000
Source: libcompress-zlib-perl
Source-Version: 2.005-2

We believe that the bug you reported is fixed in the latest version of
libcompress-zlib-perl, which is due to be installed in the Debian FTP archive:

libcompress-zlib-perl_2.005-2.diff.gz
  to pool/main/libc/libcompress-zlib-perl/libcompress-zlib-perl_2.005-2.diff.gz
libcompress-zlib-perl_2.005-2.dsc
  to pool/main/libc/libcompress-zlib-perl/libcompress-zlib-perl_2.005-2.dsc
libcompress-zlib-perl_2.005-2_all.deb
  to pool/main/libc/libcompress-zlib-perl/libcompress-zlib-perl_2.005-2_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 435656@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Damyan Ivanov <dmn@debian.org> (supplier of updated libcompress-zlib-perl package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


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

Format: 1.7
Date: Sat, 04 Aug 2007 08:13:39 +0300
Source: libcompress-zlib-perl
Binary: libcompress-zlib-perl
Architecture: source all
Version: 2.005-2
Distribution: unstable
Urgency: low
Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
Changed-By: Damyan Ivanov <dmn@debian.org>
Description: 
 libcompress-zlib-perl - Perl module for creation and manipulation of gzip files
Closes: 435656
Changes: 
 libcompress-zlib-perl (2.005-2) unstable; urgency=low
 .
   * Added 02_restore-gzreadline-record-separator-behaviour.patch, which
     hard-codes "\n" as record separator before calling $gz->getline for the
     actual read. Closes: #435656
   * This package is now pure Perl. Set Architecture: to "all" and adjust
     debian/control and debian/rules accordingly.
Files: 
 e700cea8dac1f00088de726d00f37aba 1040 perl optional libcompress-zlib-perl_2.005-2.dsc
 464d56078826c3c21ad33e497e2969a6 3866 perl optional libcompress-zlib-perl_2.005-2.diff.gz
 c922ddfa9ce420d77ce194c4ef13d71c 34510 perl optional libcompress-zlib-perl_2.005-2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGtA1IHqjlqpcl9jsRAsYHAKCg+0zIFBW5JOV3Ig2+0h68ItY4GACeOHW9
EG31f51ssU6WsYA0zBTpPqo=
=geru
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 02 Sep 2007 07:28:08 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 23:42:57 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.