Issue #18277 has been updated by k0kubun (Takashi Kokubun).

Assignee set to k0kubun (Takashi Kokubun)

----------------------------------------
Bug #18277: buffer error (Zlib::BufError) in Zlib::Deflate#deflate when using MJIT
https://bugs.ruby-lang.org/issues/18277#change-95802

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Assignee: k0kubun (Takashi Kokubun)
* ruby -v: ruby 3.1.0dev (2021-10-23T04:38:40Z master cda8bc3657) +JIT [x86_64-linux]
* Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
To repro:
```
$ git clone https://github.com/Shopify/yjit-bench.git
$ cd yjit-bench
$ ruby --jit -I./harness benchmarks/hexapdf/benchmark.rb
...
Bundle complete! 1 Gemfile dependency, 4 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
/home/eregon/prefix/ruby-master/lib/ruby/gems/3.1.0/gems/hexapdf-0.16.0/lib/hexapdf/filter/flate_decode.rb:94:in `deflate': buffer error (Zlib::BufError)
	from /home/eregon/prefix/ruby-master/lib/ruby/gems/3.1.0/gems/hexapdf-0.16.0/lib/hexapdf/filter/flate_decode.rb:94:in `block in encoder'
```

This fails every time with MJIT, and it does not fail without MJIT or with YJIT (on ruby master @ cda8bc3657).

It fails on master MJIT: `ruby 3.1.0dev (2021-10-23T04:38:40Z master cda8bc3657) +JIT [x86_64-linux]`

It works with 3.0.2 MJIT: `ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) +JIT [x86_64-linux]`.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>