<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/zlib, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Merge zlib-3.2.3</title>
<updated>2026-03-09T15:19:27+00:00</updated>
<author>
<name>Hiroshi SHIBATA</name>
<email>hsbt@ruby-lang.org</email>
</author>
<published>2026-03-09T09:04:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=636523d0a5172337436e73f66e00c3b5178ce4b7'/>
<id>636523d0a5172337436e73f66e00c3b5178ce4b7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Load the same loaded zlib</title>
<updated>2025-10-08T14:53:00+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-10-08T14:28:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a0c6efdea46584b816afc47cbbe938668ed14476'/>
<id>a0c6efdea46584b816afc47cbbe938668ed14476</id>
<content type='text'>
Zlib is used by also rubygems, the built extension cannot be loaded
after the default gem is loaded.

https://github.com/ruby/zlib/commit/02a29dc7ea
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Zlib is used by also rubygems, the built extension cannot be loaded
after the default gem is loaded.

https://github.com/ruby/zlib/commit/02a29dc7ea
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Don't call `rb_str_set_len` while released the GVL.</title>
<updated>2024-11-20T21:02:16+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2024-11-20T21:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=b143fd5bd8527da3ddd176a3d6a362d0ab3bc6c7'/>
<id>b143fd5bd8527da3ddd176a3d6a362d0ab3bc6c7</id>
<content type='text'>
(https://github.com/ruby/zlib/pull/88)

* Only release the GVL where necessary.

- Several string manipulation methods were invoked while the GVL was
  released. This is unsafe.
- The mutex protecting multi-threaded access was not covering buffer state
  manipulation, leading to data corruption and out-of-bounds writes.
- Using `rb_str_locktmp` prevents changes to buffer while it's in use.

[Bug #20863]

https://github.com/ruby/zlib/commit/e445cf3c80
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/zlib/pull/88)

* Only release the GVL where necessary.

- Several string manipulation methods were invoked while the GVL was
  released. This is unsafe.
- The mutex protecting multi-threaded access was not covering buffer state
  manipulation, leading to data corruption and out-of-bounds writes.
- Using `rb_str_locktmp` prevents changes to buffer while it's in use.

[Bug #20863]

https://github.com/ruby/zlib/commit/e445cf3c80
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Avoid allocating intermediary strings when read/readpartial are passed an outbuf</title>
<updated>2024-05-14T21:44:34+00:00</updated>
<author>
<name>Samuel Giddins</name>
<email>segiddins@segiddins.me</email>
</author>
<published>2023-12-21T02:30:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e33336cb37b47834c0448921c6c4942e3fa63996'/>
<id>e33336cb37b47834c0448921c6c4942e3fa63996</id>
<content type='text'>
This accounts for a significant number of string allocations when reading rubygems, but we can avoid that in many places by only copying into the outbuf when present

https://github.com/ruby/zlib/commit/d25ef406c1
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This accounts for a significant number of string allocations when reading rubygems, but we can avoid that in many places by only copying into the outbuf when present

https://github.com/ruby/zlib/commit/d25ef406c1
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Clear temporary directory</title>
<updated>2024-04-20T10:53:41+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-04-20T10:45:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2b11bcb84ec0e9326ce03a2ec8f0ed2ee349d3c1'/>
<id>2b11bcb84ec0e9326ce03a2ec8f0ed2ee349d3c1</id>
<content type='text'>
https://github.com/ruby/zlib/commit/1bed54dcf7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/zlib/commit/1bed54dcf7
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] In Zlib::GzipReader#eof? check if we're actually at eof</title>
<updated>2024-02-22T06:42:06+00:00</updated>
<author>
<name>Martin Emde</name>
<email>martin.emde@gmail.com</email>
</author>
<published>2023-12-21T22:11:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=9f8f32bf9f3758ba67dd2afe7e07d9eccb68bbc7'/>
<id>9f8f32bf9f3758ba67dd2afe7e07d9eccb68bbc7</id>
<content type='text'>
Only consider it eof if we read ahead and something fills the buf.
If not, we may only have empty blocks and the footer.

Fixes https://github.com/ruby/zlib/pull/56

https://github.com/ruby/zlib/commit/437bea8003
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only consider it eof if we read ahead and something fills the buf.
If not, we may only have empty blocks and the footer.

Fixes https://github.com/ruby/zlib/pull/56

https://github.com/ruby/zlib/commit/437bea8003
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Revert "Workaround: Fix test failures on Ubuntu jammy s390x."</title>
<updated>2023-09-29T16:14:29+00:00</updated>
<author>
<name>Jun Aruga</name>
<email>jaruga@redhat.com</email>
</author>
<published>2023-09-29T09:29:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7278747d08a97e4b8e6470793d39b6107f69b0f3'/>
<id>7278747d08a97e4b8e6470793d39b6107f69b0f3</id>
<content type='text'>
This reverts commit https://github.com/ruby/zlib/commit/9f3b9c470c05 because we will
fix the issue on alternative way.

https://github.com/ruby/zlib/commit/3dfe3f9110
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit https://github.com/ruby/zlib/commit/9f3b9c470c05 because we will
fix the issue on alternative way.

https://github.com/ruby/zlib/commit/3dfe3f9110
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Workaround: Fix test failures on Ubuntu jammy s390x.</title>
<updated>2023-09-25T17:59:04+00:00</updated>
<author>
<name>Jun Aruga</name>
<email>jaruga@ruby-lang.org</email>
</author>
<published>2023-09-25T15:55:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=295862e22ad88b3c7204df18b9b6a8560a1896f9'/>
<id>295862e22ad88b3c7204df18b9b6a8560a1896f9</id>
<content type='text'>
This commit fixes the test failures on the zlib in Ubuntu jammy s390x.

According to the &lt;https://packages.ubuntu.com/jammy-updates/zlib1g&gt; -
`zlib_1.2.11.dfsg-2ubuntu9.2.debian.tar.xz`,
the zlib deb package is applying the patch 410.patch (madler/zlib#410), and
configured by `./configure --dfltcc` on Ubuntu jammy s390x. The `--dfltcc`
is to enable the deflate algorithm in hardware.

It produces a different (but still valid) compressed byte stream, and causes
the test failures in ruby/zlib. As a workaround, set the environment variable
`DFLTCC=0` disabling the implementation in zlib on s390x to the failing tests.

Note we need to test in a child Ruby process with `assert_separately` to test
on the `DFLTCC=0` set by the parent Ruby process.

https://github.com/ruby/zlib/commit/9f3b9c470c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes the test failures on the zlib in Ubuntu jammy s390x.

According to the &lt;https://packages.ubuntu.com/jammy-updates/zlib1g&gt; -
`zlib_1.2.11.dfsg-2ubuntu9.2.debian.tar.xz`,
the zlib deb package is applying the patch 410.patch (madler/zlib#410), and
configured by `./configure --dfltcc` on Ubuntu jammy s390x. The `--dfltcc`
is to enable the deflate algorithm in hardware.

It produces a different (but still valid) compressed byte stream, and causes
the test failures in ruby/zlib. As a workaround, set the environment variable
`DFLTCC=0` disabling the implementation in zlib on s390x to the failing tests.

Note we need to test in a child Ruby process with `assert_separately` to test
on the `DFLTCC=0` set by the parent Ruby process.

https://github.com/ruby/zlib/commit/9f3b9c470c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Add truffleruby-head in CI</title>
<updated>2023-09-22T07:29:22+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2023-09-21T17:55:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=50e3b27db7ebf3bceffaaa2852e00a3c27e494c7'/>
<id>50e3b27db7ebf3bceffaaa2852e00a3c27e494c7</id>
<content type='text'>
* The latest release does not have this fix:
  https://github.com/oracle/truffleruby/commit/c77f8bb35db084c99d1f5b14748267866004222e

https://github.com/ruby/zlib/commit/8abc80b994
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* The latest release does not have this fix:
  https://github.com/oracle/truffleruby/commit/c77f8bb35db084c99d1f5b14748267866004222e

https://github.com/ruby/zlib/commit/8abc80b994
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/zlib] Zlib.gunzip should not fail with utf-8 strings</title>
<updated>2023-08-10T20:12:21+00:00</updated>
<author>
<name>Sorah Fukumori</name>
<email>sorah@cookpad.com</email>
</author>
<published>2023-08-10T20:12:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=d2864ca330f7cc7f879e737a817e1161bead65c3'/>
<id>d2864ca330f7cc7f879e737a817e1161bead65c3</id>
<content type='text'>
(https://github.com/ruby/zlib/pull/55)

zstream_discard_input was encoding and character-aware when given input is user-provided, so this discards `len` chars instead of `len` bytes.

Also Zlib.gunzip explains in its rdoc that it is equivalent with the following code, but this doesn't fail for UTF-8 String.

```ruby
string = %w[1f8b0800c28000000003cb48cdc9c9070086a6103605000000].pack("H*").force_encoding('UTF-8')
sio = StringIO.new(string)
p gz.read #=&gt; "hello"
gz&amp;.close
p Zlib.gunzip(string) #=&gt; Zlib::DataError
```

Reported and discovered by eagletmt at https://twitter.com/eagletmt/status/1689692467929694209

https://github.com/ruby/zlib/commit/c5e58bc62a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/zlib/pull/55)

zstream_discard_input was encoding and character-aware when given input is user-provided, so this discards `len` chars instead of `len` bytes.

Also Zlib.gunzip explains in its rdoc that it is equivalent with the following code, but this doesn't fail for UTF-8 String.

```ruby
string = %w[1f8b0800c28000000003cb48cdc9c9070086a6103605000000].pack("H*").force_encoding('UTF-8')
sio = StringIO.new(string)
p gz.read #=&gt; "hello"
gz&amp;.close
p Zlib.gunzip(string) #=&gt; Zlib::DataError
```

Reported and discovered by eagletmt at https://twitter.com/eagletmt/status/1689692467929694209

https://github.com/ruby/zlib/commit/c5e58bc62a
</pre>
</div>
</content>
</entry>
</feed>
