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::Inflate - Getting Zlib::BufError inflating a string #4449

Open
x4d3 opened this issue Jan 20, 2017 · 5 comments
Open

Zlib::Inflate - Getting Zlib::BufError inflating a string #4449

x4d3 opened this issue Jan 20, 2017 · 5 comments

Comments

@x4d3
Copy link

x4d3 commented Jan 20, 2017

Environment

  • jruby-9.1.6.0
  • JRUBY_OPTS: -J-Xmx2048m -Xcext.enabled=true
  • Linux 80-Ubuntu x86_64 x86_64 x86_64 GNU/Linux

Scenario

  • Call this script with ruby ruby script.rb

script.rb

require "zlib"
require "base64"
input = "fVNNT+MwEL3zK5DvbZKGUGo1Qd2i1VaC3ajNcuCCHGcC0cYf63Fo+fc4H6UtQvUl0vObN++NJ3NkotZ00dhXuYb/DaC9uHRnJ2qJtLuMSWMkVQwrpJIJQGo53Swe7ulk7FNtlFVc1eRL2fkqhgjGVkr2Zau7mDww19swqaY8j8qbIgqmZV7CdTi9YlEZ+kUZRvw6n8xmYR7cTCazvvQRDDqdmDjZQQyxgZVEy6R1sB9MR34wCmaZH9KrgEbhU89LB+c/KllU8uW84bwnIf2VZeko/bPJepHFPshSSWwEmA2Yt4rD3/V9TF6t1Ug9r4C38daBXEnLuMUxV8IT+lnsI3uI6pn3CreCmX9gdc04xJ8MknTt5u1oaZfQJEzrURDp97l3jB54mv52OVZ3qaor/t7h7fmpjGBuMuQTWdS12i4NMAsxsaYBkvSapwon0sOyQNGtjktvYWcvl0poZipsHwR2Luvg++D9mL6s3R6soUzOrgqnvOU5OHWfrTJF+3LAXe/MjQa1MnYYwbfivWvvjO3kYn99/B8kHw=="
zstream = Zlib::Inflate.new(-Zlib::MAX_WBITS)
result = zstream.inflate(Base64.decode64(input))
zstream.finish
zstream.close
p result

Expected Behavior

No errors, printing the string (something like <samlp:AuthnRequest\n xmlns:samlp=\"urn:oasis:n ...

Actual Behavior

Getting an error:

Zlib::BufError: buffer error
  finish at org/jruby/ext/zlib/ZStream.java:134
  <main> at script.rb:6
@olleolleolle
Copy link
Member

olleolleolle commented Jan 20, 2017

@headius
Copy link
Member

headius commented Jan 24, 2017

Could be a bug in our logic or a bug in the jzlib library we implement zlib with. I'll try updating jzlib first.

@headius
Copy link
Member

headius commented Jan 24, 2017

Ok, unfortunately we're already on the latest jzlib and I can reproduce the issue with JRuby master locally (OS X).

@ymnk I have confirmed that the error is coming out of jzlib and it is a buffer error, but I'm unsure if it's something we're doing wrong or jzlib is doing wrong. If I remember right, you helped us implement this logic (and we have been very happy with jzlib!) Any thoughts on the error reported here?

@headius headius added this to the JRuby 9.1.8.0 milestone Jan 24, 2017
@headius headius modified the milestones: JRuby 9.2.0.0, JRuby 9.1.8.0 Mar 3, 2017
@headius
Copy link
Member

headius commented Mar 3, 2017

Without some work on jzlib I don't think we can fix this. Certainly will not make it for 9.1.8.0.

@headius
Copy link
Member

headius commented May 16, 2018

Uncertain when this might make it, since it requires work on jzlib. @ymnk may not be maintaining it anymore.

@headius headius removed this from the JRuby 9.2.0.0 milestone May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants