Project

General

Profile

Actions

Bug #18277

closed

buffer error (Zlib::BufError) in Zlib::Deflate#deflate when using MJIT

Added by Eregon (Benoit Daloze) about 3 years ago. Updated almost 2 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 3.1.0dev (2021-10-23T04:38:40Z master cda8bc3657) +JIT [x86_64-linux]
[ruby-core:105872]

Description

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].


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18058: 3.1.0-dev with MJIT enabled Zlib::BufError during `gem install`Closedk0kubun (Takashi Kokubun)Actions

Updated by Eregon (Benoit Daloze) about 3 years ago

I also tried with latest master as of today:
ruby 3.1.0dev (2021-10-30T10:24:41Z master a46c220320) +JIT [x86_64-linux].
It also crashes:

$ 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/.rubies/ruby-latest/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/.rubies/ruby-latest/lib/ruby/gems/3.1.0/gems/hexapdf-0.16.0/lib/hexapdf/filter/flate_decode.rb:94:in `block in encoder'
Actions #2

Updated by byroot (Jean Boussier) about 3 years ago

  • Related to Bug #18058: 3.1.0-dev with MJIT enabled Zlib::BufError during `gem install` added

Updated by byroot (Jean Boussier) about 3 years ago

I believe it's a duplicate of [Bug #18058]

Updated by Eregon (Benoit Daloze) about 3 years ago

Indeed, it looks related, thanks.
I did a quick google search before but didn't find it.
The advantage of this repro is it happens every time.

Updated by k0kubun (Takashi Kokubun) almost 3 years ago

  • Assignee set to k0kubun (Takashi Kokubun)

Updated by k0kubun (Takashi Kokubun) almost 2 years ago

  • Status changed from Open to Closed

Closing as we replaced the implementation in [Feature #19420] and I believe this doesn't happen anymore.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0