Bug 1092759 - gzseek calls can incorrectly position the file.
Summary: gzseek calls can incorrectly position the file.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw-zlib
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-29 23:09 UTC by tsteven4
Modified: 2015-01-19 12:28 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-01-19 12:28:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
zlib gzseek test case (1.02 KB, application/x-zip-compressed)
2014-04-29 23:09 UTC, tsteven4
no flags Details

Description tsteven4 2014-04-29 23:09:49 UTC
Created attachment 890969 [details]
zlib gzseek test case

Description of problem:  gzseek can incorrectly hit EOF, causing subsequent gzread calls to fail.


Version-Release number of selected component (if applicable):
mingw32-zlib-1.2.7-2.fc19.noarch

How reproducible:
100%

Steps to Reproduce:
1. unzip test case zlib_test2.zip provided.
2. run test2 script to compile the test case.
3. execute test case by running testz2.exe under windows.  testz2.exe, zlib1.dll and test.data all need to be in the directory testz2.exe is executed from.

Actual results:
Got 0

Expected results:
Got 4

Additional info:
A possible patch with zlib 1.2.8 is listed below, although this might be a configuration problem.  offset, which is of type z_off64_t, ends up being 32 bits as configured.
--- gzlib.c	2013-03-24 23:47:59.000000000 -0600
+++ gzlib.patch.c	2014-04-27 15:34:38.496808069 -0600
@@ -393,7 +393,7 @@
     /* if within raw area while reading, just go there */
     if (state->mode == GZ_READ && state->how == COPY &&
             state->x.pos + offset >= 0) {
-        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
+        ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
         if (ret == -1)
             return -1;
         state->x.have = 0;

I have reported this to zlib but haven't received any response yet.

Comment 1 Richard W.M. Jones 2014-04-30 09:08:33 UTC
If this is an upstream bug with zlib, then we need to wait for them
to accept the patch and/or issue an updated package, which can
then be added to the zlib & mingw-zlib packages in Fedora.

Comment 2 tsteven4 2014-05-04 23:03:27 UTC
The native executable does not show the problem because of conditional compilation and support for large files.  It is only seen with the mingw* built executables which don't get created with large file support.  If we could build mingw-zlib with large file support that would alleviate the issue.

rhel 6 mingw32 works with the test case because it is built with a version of zlib before large file support was added to zlib.

Comment 3 Richard W.M. Jones 2014-05-06 08:14:53 UTC
I'm still no closer to understanding what the action item is on
this bug.  There is no flag to enable large file support in
./configure --help.

Comment 4 Fedora End Of Life 2015-01-09 21:20:17 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.


Note You need to log in before you can comment on or make changes to this bug.