janlelis / irbtools

Improvements for Ruby's IRB console 💎︎
MIT License
921 stars 27 forks source link

irbtools doesn't work with jirb_swing #22

Closed walkeriniraq closed 9 years ago

walkeriniraq commented 11 years ago

In trying to find a workaround for https://jira.codehaus.org/browse/JRUBY-6996 (irb tab completion doesn't work in windows), I had installed irbtools and liked it.

The developer working on the bug suggested jirb_swing, which I tried, and immediately gave a stack overflow. The SO goes away if I remove irbtools from the .irbrc. It pitches a SO if I require irbtools from the irb interface. All of this works perfectly fine from the command line.

Running jRuby 1.7.1 on Java 7u9. Will try other versions to see if I have the same problem.

The stack trace seems to indicate that the problem is in fancy_irb:

        at rubyjit.Module$$write_stream_C7FD5C26BC3BA6EF54CD12386C73B82068D9BA102003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb.rb:122)
        at rubyjit.Module$$write_stream_C7FD5C26BC3BA6EF54CD12386C73B82068D9BA102003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb.rb)
        at org.jruby.ast.executable.AbstractScript.__file__(AbstractScript.java:50)
        at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:261)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:236)
        at rubyjit.IO$$write_9F2E0273DC5A5852E79D2E953ACA9CCD2D838E1F2003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb/irb_ext.rb:144)
        at rubyjit.IO$$write_9F2E0273DC5A5852E79D2E953ACA9CCD2D838E1F2003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb/irb_ext.rb)
        at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
        at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:191)
        at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
        at rubyjit.Module$$write_stream_C7FD5C26BC3BA6EF54CD12386C73B82068D9BA102003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb.rb:122)
        at rubyjit.Module$$write_stream_C7FD5C26BC3BA6EF54CD12386C73B82068D9BA102003839.__file__(c:/jruby-1.7.1/lib/ruby/gems/shared/gems/fancy_irb-0.7.3/lib/fancy_irb.rb)

However I can require fancy_irb by itself and it works fine. Also, if I configure irbtools to remove the fancy_irb library then irbtools loads fine. Seems to be some interaction between jirb_swing, irbtools, and fancy_irb.

Since irbtools + jirb_swing is incredibly ugly, I doubt that this would be high priority (nobody would run the combo), but since it was a SO I felt the need to share.

janlelis commented 11 years ago

Hi walkeriniraq,

thanks for pointing me to this bug and jirb_swing in general, looks promising. I can reproduce that something is not working correctly by requiring only fancy_irb and calling FancyIrb.start. How can I access the stacktrace?

walkeriniraq commented 11 years ago

jruby -w -S jirb_swing

janlelis commented 9 years ago

Closing. I quickly tried to reproduce it with the current version of JRuby and Irbtools and couldn't. Please re-open if this is still a problem for you.