Bug 59836 - RFE: re-add zlib speedups
Summary: RFE: re-add zlib speedups
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
(Show other bugs)
Version: 7.3
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-13 19:23 UTC by Enrico Scholz
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-02-13 22:31:20 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Enrico Scholz 2002-02-13 20:12:53 UTC
Seems to be a not handled case in get_byte():

1. get_byte() will be entered with 's->stream.avail_in == 0'
2. gz_refill_buf(s) will be called
3. gz_refill_buf(s) can return with '0' _and_ 's->stream.avail_in == 0'
4. execution continues in get_byte() and decrements s->stream.avail_in 
   --> contains (uint)(-1) now  !!CONFLICT!!

Probably, zlib/gzio.c:346

|                if (ferror(s->file)) {
|                        s->z_err = Z_ERRNO;
|                        return 1;
|                }

should be

|                if (ferror(s->file)) s->z_err = Z_ERRNO;
|                return 1;

which make step 3. impossible.

Comment 1 Enrico Scholz 2002-02-13 20:42:47 UTC
Last suggestion is not complete; line 337 should be modified also:

            if (s->mmap_pos > s->mmap_end)
                s->stream.avail_in = s->mmap_end - s->mmap_pos + z_bufsize;
            for (n=0; n<s->stream.avail_in; n+=4096)
                ((volatile char *)s->inbuf)[n];
-           return 0;
+           return s->stream.avail_in==0;
        }

Probably, the case 's->mmap_pos <= s->mmap_end' must be handled also, since
's->stream.avail_in' will be 'z_bufsize' then.

Comment 2 Jeff Johnson 2002-02-13 22:31:15 UTC
The analysis sounds convincing, will try the patch soon.

FWIW, I'm very interested in finding packages that don't "work",
as rpm-4.0.4 has some very aggresive patches in it's internal
zlib. Please find some more.

Comment 3 Jeff Johnson 2002-07-01 18:08:15 UTC
Deferred until I get a chance to re-add Ben LaHaises's
mmap(2) patch.


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