Skip to content

LocalJumpError not caught by IRB #1134

@Xanthus

Description

@Xanthus

JRuby's IRB sessions seem to not handle LocalJumpError exceptions in the main thread properly. In an MRI IRB session, the following happens:

while true
  return 1
end

#LocalJumpError: unexpected return
#       from (irb):2
#       from /usr/local/rvm/rubies/ruby-2.0.0-p0/bin/irb:16:in `<main>'
#2.0.0-p0 :004 >

In JRuby's IRB session, JRuby either exits (Centos 6) or blocks indefinitely (Windows 7 x64). However, this works in JRuby IRB:

q = Thread.new do
  while true
    return 1
  end
end
q.join

#LocalJumpError: unexpected return
# jruby-1.7.4 :004 >

So I'd imagine IRB isn't catching the LocalJumpError in the main thread as it should?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions