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

LocalJumpError when creating enumerator inside block #4443

manu-crealytics opened this issue Jan 16, 2017 · 3 comments


Copy link


  • JRuby version:
    • jruby -v: jruby (2.3.1) 2017-01-11 68056ae Java HotSpot(TM) 64-Bit Server VM 25.73-b02 on 1.8.0_73-b02 +jit [linux-x86_64]
    • No flags or JRUBY_OPTS
  • Operating system and platform
    • uname -a: Linux manu-dm 4.4.0-45-generic Proc interface regression #66~14.04.1-Ubuntu SMP Wed Oct 19 15:05:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Expected Behavior

Creating enumerators inside GZipReader blocks should not crash. The simple example below works fine (doesn't crash) on MRI 2.3.0:

# /tmp/local_jump_error.rb
require 'zlib'

# echo | gzip > /tmp/somefile.gz'/tmp/somefile.gz') do |f|
    e = f.each_line
    # ...

Actual Behavior

Instead, a LocalJumpError exception is raised:

LocalJumpError: yield called out of block
                          each at org/jruby/ext/zlib/
                     each_line at org/jruby/ext/zlib/
  block in local_jump_error.rb at local_jump_error.rb:6
                          open at org/jruby/ext/zlib/
                        <main> at local_jump_error.rb:5

Note that using instead of does not raise any error.

Copy link

headius commented Jan 17, 2017

Confirmed! This is simply GzipReader#each not returning an enum when you don't pass a block.

Copy link

headius commented Jan 17, 2017

This is fixed but we should have tests for the enumerator-producing methods in GzipReader. @manu-crealytics perhaps you could add some to

Copy link
Contributor Author

@headius Sure, I'll look into that this week. Thanks for the quick fix :)

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

No branches or pull requests

2 participants