Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zlib produces different output to MRI #4244

Open
pointlessone opened this issue Oct 23, 2016 · 2 comments
Open

Zlib produces different output to MRI #4244

pointlessone opened this issue Oct 23, 2016 · 2 comments
Labels

Comments

@pointlessone
Copy link

Environment

Provide at least:

  • JRuby 9.1.5.0
  • macOS 10.12.1 developer beta

Expected Behavior

Zlib should produce the same output as MRI given the same input.

I need to consistently generate same binary data in both MRI and JRuby.

Actual Behavior

In most cases Zlib actually generates the same output but in one case it does not. I don't know what is different. The output seem to be valid but I need consistency between implementations, too. I tried both compact syntax and a more explicit one.

 Zlib::Deflate.deflate(data)
z = Zlib::Deflate.new(
  Zlib::DEFAULT_COMPRESSION,
  Zlib::MAX_WBITS,
  Zlib::DEF_MEM_LEVEL,
  Zlib::HUFFMAN_ONLY
)
compressed_data = z.deflate(data, Zlib::FINISH)
z.close

They both produce output different to MRI.

Here's example data: data.bin.zip. The file is zipped because GH doesn't allow random files to be uploaded.

@kares
Copy link
Member

kares commented Sep 27, 2018

same on 9.2 ... output is different

@kares kares added the stdlib label Sep 27, 2018
@headius
Copy link
Member

headius commented Oct 9, 2018

This would not seem to be a bug in JRuby as much as a bug in jzlib, but I have no clues beyond that. Maybe @ymnk has an idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants