From: Eric Wong Date: 2014-08-30T23:57:03+00:00 Subject: [ruby-core:64679] Re: [ruby-trunk - Bug #10101] Zlib::GzipReader produce different outputs for different methods applied nagachika00@gmail.com wrote: > I don't have time to investigate this right now. > And zlib has no maintainer according to > https://bugs.ruby-lang.org/projects/ruby/wiki/MaintainersStdlib > Are there anyone who can handle this? Hi, r47327 should fix this: ------------------------------------------------------------------------ r47327 | normal | 2014-08-30 23:53:28 +0000 (Sat, 30 Aug 2014) | 18 lines zlib: GzipReader#rewind preserves ZSTREAM_FLAG_GZFILE * ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE [Bug #10101] * test/zlib/test_zlib.rb (test_rewind): test each_byte We must preserve the ZSTREAM_FLAG_GZFILE flag to prevent zstream_detach_buffer from: a) returning Qnil and breaking out of the `each_byte' loop b) yielding a large string to each_byte Note: the test case in bug report takes a long time. I found this bug because I noticed the massive time descrepancy between `each_byte' and `readbyte' loop before this patch. With this patch, `each_byte' and `readbyte' both take very long. ------------------------------------------------------------------------ I should be able to help out on zlib in the future (and many bugs reproducible without graphical or proprietary dependency).