Debian Bug report logs - #299658
"par2 create" dumps core with -q or -qq, but non-quiet mode works fine

version graph

Package: par2; Maintainer for par2 is Jeroen Ploemen <jcfp@debian.org>; Source for par2 is src:par2cmdline (PTS, buildd, popcon).

Reported by: Reid Priedhorsky <reid@reidster.net>

Date: Tue, 15 Mar 2005 18:48:47 UTC

Severity: normal

Tags: patch

Found in version 0.4-2

Fixed in version par2cmdline/0.4-6

Done: wjl@icecavern.net (Wesley J. Landaker)

Bug is archived. No further changes may be made.

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Andres Salomon <dilinger@voxel.net>:
Bug#299658; Package par2. (full text, mbox, link).


Acknowledgement sent to Reid Priedhorsky <reid@reidster.net>:
New Bug report received and forwarded. Copy sent to Andres Salomon <dilinger@voxel.net>. (full text, mbox, link).


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

From: Reid Priedhorsky <reid@reidster.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: "par2 create" dumps core with -q or -qq, but non-quiet mode works fine
Date: Tue, 15 Mar 2005 12:43:45 -0600
Package: par2
Version: 0.4-2
Severity: normal


Dear DDs,

On a certain pair of files, "par2 create -q" and "par2create -qq" dump core.
However, "par2 create" in non-quiet mode, i.e. without -q or -qq, works fine
on the same input with otherwise identical options.

To reproduce:

1. Create an empty directory and change to it.

2. Create two files containing random data:

     mirror-root_20050315-0507.super.tar.gz, size 12486682 bytes
     mirror-usr_20050315-0442.super.tar.gz, size 899718239 bytes

   (Below is a script which builds these files.)

3. Execute one of the following commands:

   $ par2 create -qq -s2097152 -r25 redundancy.par2 *
   $ par2 create -q -s2097152 -r25 redundancy.par2 *

Either will cause a core dump with the following message:

  par2: verificationpacket.cpp:63: void VerificationPacket::SetBlockHashAndCRC(unsigned int, const MD5Hash&, unsigned int): Assertion `blocknumber < blockcount' failed.
  Aborted (core dumped)

On the other hand,

   $ par2 create -s2097152 -r25 redundancy.par2 *

works fine.

Thanks for all your hard work, and please feel free to contact me for more
information.

Reid


---- par2-bug-createfiles.bash ----

#!/bin/bash

MEG=$((128 * 1024))

function create_random_file () {
  SIZE=$1
  FILE=$2
  echo "size = $SIZE, file = $FILE"
  dd bs=128k count=$(($SIZE/$MEG)) if=/dev/urandom of=$FILE
  dd bs=1 count=$(($SIZE-$MEG*($SIZE/$MEG))) seek=$(($MEG*($SIZE/$MEG))) if=/dev/urandom of=$FILE
}

create_random_file 12486682 mirror-root_20050315-0507.super.tar.gz
create_random_file 899718239 mirror-usr_20050315-0442.super.tar.gz

---- end par2-bug-createfiles.bash ----

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.29
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages par2 depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared libraries an
ii  libgcc1                     1:3.4.3-6    GCC support library
ii  libstdc++5                  1:3.3.5-8    The GNU Standard C++ Library v3

-- no debconf information



Information forwarded to debian-bugs-dist@lists.debian.org, wjl@icecavern.net (Wesley J. Landaker):
Bug#299658; Package par2. (full text, mbox, link).


Acknowledgement sent to Stelios Bounanos <sb-bugs@enotty.net>:
Extra info received and forwarded to list. Copy sent to wjl@icecavern.net (Wesley J. Landaker). (full text, mbox, link).


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

From: Stelios Bounanos <sb-bugs@enotty.net>
To: 299658@bugs.debian.org, control@bugs.debian.org
Subject: Adding patch
Date: Thu, 29 Sep 2005 03:14:55 +0100
tags 299658 + patch
thanks

This bug is caused by failing to increment an offset variable (used to
detect EOF) in quiet and silent mode.  Further, whether the affected
code is run depends on block size, redundancy level, memory limit and
input file size, so the bug is not always triggered.  File sizes above a
few hundred megs typically crash the program but small files don't.

This has also been reported upstream:
http://sourceforge.net/tracker/index.php?func=detail&aid=1085638&group_id=30568&atid=399698

I'm submitting the following trivial fix here as upstream seems to be
inactive at the moment.

Cheers,
Stelios Bounanos <sb()enotty()net>


diff -Nuar par2cmdline-0.4.orig/par2creatorsourcefile.cpp par2cmdline-0.4/par2creatorsourcefile.cpp
--- par2cmdline-0.4.orig/par2creatorsourcefile.cpp	2004-04-15 14:45:23.000000000 +0100
+++ par2cmdline-0.4/par2creatorsourcefile.cpp	2005-09-29 02:27:43.000000000 +0100
@@ -213,11 +213,12 @@
         }
       }
 
+      offset += want;
+
       if (noiselevel > CommandLine::nlQuiet)
       {
         // Display progress
         u32 oldfraction = (u32)(1000 * offset / filesize);
-        offset += want;
         u32 newfraction = (u32)(1000 * offset / filesize);
         if (oldfraction != newfraction)
         {



Tags added: patch Request was from Stelios Bounanos <sb-bugs@enotty.net> to control@bugs.debian.org. (full text, mbox, link).


Reply sent to wjl@icecavern.net (Wesley J. Landaker):
You have taken responsibility. (full text, mbox, link).


Notification sent to Reid Priedhorsky <reid@reidster.net>:
Bug acknowledged by developer. (full text, mbox, link).


Message #17 received at 299658-close@bugs.debian.org (full text, mbox, reply):

From: wjl@icecavern.net (Wesley J. Landaker)
To: 299658-close@bugs.debian.org
Subject: Bug#299658: fixed in par2cmdline 0.4-6
Date: Thu, 29 Sep 2005 08:32:17 -0700
Source: par2cmdline
Source-Version: 0.4-6

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

par2_0.4-6_i386.deb
  to pool/main/p/par2cmdline/par2_0.4-6_i386.deb
par2cmdline_0.4-6.diff.gz
  to pool/main/p/par2cmdline/par2cmdline_0.4-6.diff.gz
par2cmdline_0.4-6.dsc
  to pool/main/p/par2cmdline/par2cmdline_0.4-6.dsc



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 299658@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Wesley J. Landaker <wjl@icecavern.net> (supplier of updated par2cmdline 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: Thu, 29 Sep 2005 07:51:05 -0600
Source: par2cmdline
Binary: par2
Architecture: source i386
Version: 0.4-6
Distribution: unstable
Urgency: low
Maintainer: Wesley J. Landaker <wjl@icecavern.net>
Changed-By: Wesley J. Landaker <wjl@icecavern.net>
Description: 
 par2       - Parity Archive Volume Set, for checking and repair of files
Closes: 299658
Changes: 
 par2cmdline (0.4-6) unstable; urgency=low
 .
   * Applied patch to fix crash in quiet modes (closes: #299658)
     - (Thanks to Stelios Bounanos <sb-bugs@enotty.net>)
   * Added a few more relevant files to debian/docs
   * Added debian/watch to scan for upstream versions
Files: 
 b36f3d898a7783104753677c41a80d6c 605 utils extra par2cmdline_0.4-6.dsc
 c15e90bca560327688020ca561d25e3f 9873 utils extra par2cmdline_0.4-6.diff.gz
 56c479ed4af6e32c1136a6c3d3ca4618 122646 utils extra par2_0.4-6_i386.deb

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

iD8DBQFDPAUN8KmKTEzW49IRAiOnAJ9UGrgIL4jIJ4Pu9c/QyPvoZbF84wCfWvv/
L3B7TT3ob+WSWtFLyzgUtdk=
=+kd3
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 26 Jun 2007 00:43:24 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Jul 15 14:20:04 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.