Adding a file to a zoo archive returns a fatal error on amd64

Bug #892788 reported by zapman
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
zoo (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Under Ubuntu 10.04.3 LTS trying to add a file to an existing zoo archive results in a fatal error. The bug is very easy to reproduce, just create a zoo archive and then try to add a file to it:
zapman@ubuntu:~/zoo$ zoo -add archive.zoo test.txt
Zoo: test.txt -- (28%) added
zapman@ubuntu:~/zoo$ zoo -add archive.zoo ../zoo_2.10-23_amd64.deb
Zoo: FATAL: Archive header failed consistency check.

The zoo package version was 2.10-21 but the same also happened with 2.10-23 which I grabbed from Launchpad. I also burnt a 32bit CD of 10.04.3 to test the package and everything worked fine, so this problem seems specific to the amd64 architecture. IIRC no other archiver has a generations feature like zoo, and this bug prevents me from using it.

Interestingly, a similar - if not identical - bug was filed on Debian years ago, a patch was provided and the issue was marked as fixed; but after burning debian-live-6.0.3-amd64-rescue.iso on a CD and installing zoo it seems that the problem still exists. The same test with debian-live-6.0.3-i386-standard.iso worked fine, the amd64 architecture seems to be the prime suspect again. The Debian bug in question is Bug 335114 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=335114>.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: zoo 2.10-21
ProcVersionSignature: Ubuntu 2.6.32-35.78-generic 2.6.32.46+drm33.20
Uname: Linux 2.6.32-35-generic x86_64
Architecture: amd64
CheckboxSubmission: 3b8b1e94677feb8b107502acb9f14c2c
CheckboxSystem: 4ed15c40009aa6f7770f606350a390a2
Date: Sun Nov 20 16:22:34 2011
ProcEnviron:
 LANGUAGE=en_AU:en_GB:en
 LANG=en_AU.utf8
 SHELL=/bin/bash
SourcePackage: zoo

Revision history for this message
zapman (zapman) wrote :
Revision history for this message
zapman (zapman) wrote :

I sent a message to Carl Johnson who had provided the patch for Debian and he kindly replied with the solution. Should you need to contact him you can find the e-mail I used to contact him on the Debian bug report. His message follows:

"I finally think I found the problem. Could you please foreward some or
all of this to Ubuntu since I don't use it? Ubuntu should in turn send
this upstream to Debian. I haven't used zoo in years, so that is why I
hadn't already stumbled upon this.

It appears that Debian reformatted the patches and introduced a typo in
one part of my patch. The relevant part of the patch to _misc.c_ is
below:

+#ifdef LONG64
+ if ((int)(header->zoo_start = header->zoo_minus) != 0)
+#else
    if ((header->zoo_start + header->zoo_minus) != 0L)
+#endif

Notice the '=' in the ifdef case and '+' in the else case? If the '='
is changed to '+' in the first part it will then work. The other files
are all patched correctly, so this is the only change.

It appears that my original patch can be simplified somewhat, if anybody
wants to go to the trouble. I used '#ifdef LONG64', but cpp has a
built-in define of '__LP64__' (or '_LP64') that already specifies that
information. If that can be used, then the 'LONG64' define and
therefore the 'linux64' makefile target can be removed. I don't have a
32 bit machine to test this on, so I am not certain that there won't be
any problems. I just submitted a patch using this to FreeBSD at
http://www.freebsd.org/cgi/query-pr.cgi?pr=162804. That patch will
probably not be directly usable, since other patches probably change the
line numbers.

I hope this helps."

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in zoo (Ubuntu):
status: New → Confirmed
Revision history for this message
Jari Aalto (jari-aalto) wrote :
Revision history for this message
zapman (zapman) wrote :

I tested version 2.10-27 on both Lucid (10.04) amd64 and Precise (12.04) amd64 and indeed, this bug seems to be fixed. Additionally, as there are no dependency problems those using older distros can manually install 2.10-27.

Interestingly, on amd64 with zoo 2.10-24 which is included in Precise repositories, extracting an archive works fine but there's an error message which gets displayed. An example follows:
zapman@ubuntu:~/zootest$ zoo x test.zoo
Zoo: WARNING: Archive header failed consistency check.
Zoo: dummyfile.txt -- extracted

Version 2.10-27 also fixes that. Thanks Jari.

Changed in zoo (Ubuntu):
status: Confirmed → Fix Committed
zapman (zapman)
Changed in zoo (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.