Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 59836 - RFE: re-add zlib speedups
RFE: re-add zlib speedups
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2002-02-13 14:23 EST by Enrico Scholz
Modified: 2008-05-01 11:38 EDT (History)
0 users

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

Attachments (Terms of Use)

  None (edit)
Description Enrico Scholz 2002-02-13 15:12:53 EST
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 15:42:47 EST
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 17:31:15 EST
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 14:08:15 EDT
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.