NetBSD Problem Report #48014
From martin@aprisoft.de Thu Jul 4 16:40:24 2013
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id A67D371874
for <gnats-bugs@gnats.NetBSD.org>; Thu, 4 Jul 2013 16:40:24 +0000 (UTC)
Message-Id: <20130704164016.9019DED0E4D@emmas.aprisoft.de>
Date: Thu, 4 Jul 2013 18:40:16 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: libarchive zip reading fails on all xps files created by windows 7
X-Send-Pr-Version: 3.95
>Number: 48014
>Category: lib
>Synopsis: libarchive zip reading fails on all xps files created by windows 7
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: lib-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jul 04 16:45:00 +0000 2013
>Last-Modified: Thu Jul 18 17:00:00 +0000 2013
>Originator: Martin Husemann
>Release: NetBSD 6.99.23
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 6.99.23 NetBSD 6.99.23 (WHOEVER) #76: Sun Jun 30 18:12:09 CEST 2013 martin@emmas.aprisoft.de:/usr/src/sys/arch/sparc64/compile/WHOEVER sparc64
Architecture: sparc64
Machine: sparc64
>Description:
I tried to convert xps files to pdf and failed. Testing the input files with
unzip -t showed strange errors. I tried all xps files I found, and they
all failed the same.
The pkgsrc unzip is happy with the files.
[/tmp/pdf] martin@whoever-brings-the-night > /usr/bin/unzip -t gaga.xps
Archive: gaga.xps
testing: Metadata/Job_PT.xml OK
testing: Metadata/MXDC_Empty_PT.xml OK
testing: Documents/1/Metadata/Page1_Thumbnail.JPG ZIP compressed data is wrong size
unzip: Bad ZIP file
[/tmp/pdf] martin@whoever-brings-the-night > /usr/pkg/bin/unzip -t gaga.xps
Archive: gaga.xps
testing: Metadata/Job_PT.xml OK
testing: Metadata/MXDC_Empty_PT.xml OK
testing: Documents/1/Metadata/Page1_Thumbnail.JPG OK
testing: Documents/1/Resources/Images/1.JPG OK
testing: Documents/1/Resources/Images/2.JPG OK
testing: Documents/1/Pages/_rels/1.fpage.rels OK
testing: Documents/1/Pages/1.fpage OK
testing: Documents/1/_rels/FixedDocument.fdoc.rels OK
testing: Documents/1/FixedDocument.fdoc OK
testing: _rels/FixedDocumentSequence.fdseq.rels OK
testing: FixedDocumentSequence.fdseq OK
testing: _rels/.rels OK
testing: [Content_Types].xml OK
No errors detected in compressed data of gaga.xps.
[/tmp/pdf] martin@whoever-brings-the-night > ldd /usr/bin/unzip
/usr/bin/unzip:
-larchive.3 => /usr/lib/libarchive.so.3
-lbz2.1 => /usr/lib/libbz2.so.1
-lc.12 => /usr/lib/libc.so.12
-llzma.1 => /usr/lib/liblzma.so.1
-lz.1 => /usr/lib/libz.so.1
[/tmp/pdf] martin@whoever-brings-the-night > ldd /usr/pkg/bin/xpstopdf
/usr/pkg/bin/xpstopdf:
-lgxps.2 => /usr/pkg/lib/libgxps.so.2
-lgio-2.0.0 => /usr/pkg/lib/libgio-2.0.so.0
-lgobject-2.0.0 => /usr/pkg/lib/libgobject-2.0.so.0
-lglib-2.0.0 => /usr/pkg/lib/libglib-2.0.so.0
-lpcre.1 => /usr/pkg/lib/libpcre.so.1
-lc.12 => /usr/lib/libc.so.12
-lintl.1 => /usr/lib/libintl.so.1
-lpthread.1 => /usr/lib/libpthread.so.1
-lffi.6 => /usr/pkg/lib/libffi.so.6
-lgmodule-2.0.0 => /usr/pkg/lib/libgmodule-2.0.so.0
-lz.1 => /usr/lib/libz.so.1
-lcairo.2 => /usr/pkg/lib/libcairo.so.2
-lpixman-1.2 => /usr/X11R7/lib/libpixman-1.so.2
-lm.0 => /usr/lib/libm.so.0
-lfontconfig.2 => /usr/X11R7/lib/libfontconfig.so.2
-lexpat.2 => /usr/lib/libexpat.so.2
-lfreetype.7 => /usr/X11R7/lib/libfreetype.so.7
-lbz2.1 => /usr/lib/libbz2.so.1
-lpng16.16 => /usr/pkg/lib/libpng16.so.16
-lxcb-shm.0 => /usr/X11R7/lib/libxcb-shm.so.0
-lxcb.1 => /usr/X11R7/lib/libxcb.so.1
-lXau.7 => /usr/X11R7/lib/libXau.so.7
-lXdmcp.7 => /usr/X11R7/lib/libXdmcp.so.7
-lxcb-render.0 => /usr/X11R7/lib/libxcb-render.so.0
-lXrender.2 => /usr/X11R7/lib/libXrender.so.2
-lXext.7 => /usr/X11R7/lib/libXext.so.7
-lX11.7 => /usr/X11R7/lib/libX11.so.7
-lrt.1 => /usr/lib/librt.so.1
-larchive.3 => /usr/lib/libarchive.so.3
-llzma.1 => /usr/lib/liblzma.so.1
-llcms2.2 => /usr/pkg/lib/liblcms2.so.2
-ltiff.5 => /usr/pkg/lib/libtiff.so.5
-ljpeg.9 => /usr/pkg/lib/libjpeg.so.9
[/tmp/pdf] martin@whoever-brings-the-night >
>How-To-Repeat:
Just try unzip -t on an arbitray xps file created by the windows 7 xps
printer.
>Fix:
n/a
>Audit-Trail:
From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48014: libarchive zip reading fails on all xps files created
by windows 7
Date: Thu, 4 Jul 2013 21:45:23 +0200
On Thu, Jul 04, 2013 at 04:45:00PM +0000, martin@NetBSD.org wrote:
> [/tmp/pdf] martin@whoever-brings-the-night > /usr/pkg/bin/unzip -t gaga.xps
> Archive: gaga.xps
> testing: Metadata/Job_PT.xml OK
> testing: Metadata/MXDC_Empty_PT.xml OK
> testing: Documents/1/Metadata/Page1_Thumbnail.JPG OK
I think the problem is caused by the combination of a stored (vs.
deflated) file with general purpose bit 3 set, i.e. the actual crc,
compressed and uncompressed size following after the data.
I don't understand how the code is supposed to work well enough, but
it might be that if zip->entry_compressed_bytes_read isn't updated
correctly when reading uncompressed data -- at least I saw '0' once.
Thomas
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48014: libarchive zip reading fails on all xps files created by windows 7
Date: Thu, 18 Jul 2013 17:21:24 +0200
This seems to already have been fixed upstream, libarchive-3.1.2 works for
my test .xps.
Martin
From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48014: libarchive zip reading fails on all xps files created
by windows 7
Date: Thu, 18 Jul 2013 18:55:14 +0200
On Thu, Jul 18, 2013 at 03:25:01PM +0000, Martin Husemann wrote:
> This seems to already have been fixed upstream, libarchive-3.1.2 works for
> my test .xps.
Perhaps this changelog entry (post-2.8.4):
Nov 24, 2011: Improve streaming Zip reader's support for uncompressed entries
Thomas
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.