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

IllegalArgumentException when running 9.2.9.0 in RubyMine Debugger #5954

Closed
mohamedhafez opened this issue Nov 4, 2019 · 23 comments
Closed
Milestone

Comments

@mohamedhafez
Copy link
Contributor

Environment

When I try to run my rails console in debug mode in RubyMine, which it looks like uses the gem ruby-debug-ide 0.7.0.beta7, I get the output below. I'm using RubyMine version 2019.2 on MacOS Catalina 10.15.1

/bin/bash -c "/Users/mohamed/.rvm/bin/rvm jruby-9.2.9.0 do /Users/mohamed/.rvm/rubies/jruby-9.2.9.0/bin/jruby -X+O -J-Djruby.compile.mode=OFF -J-Djruby.debug.fullTrace=true /Users/mohamed/.rvm/gems/jruby-9.2.9.0/gems/ruby-debug-ide-0.7.0.beta7/bin/rdebug-ide --key-value --disable-int-handler --evaluation-timeout 10 --evaluation-control --time-limit 100 --memory-limit 0 --rubymine-protocol-extensions --port 50665 --host 0.0.0.0 --dispatcher-port 50666 -- /Users/mohamed/rubyprojects/myproject/bin/rails console -- --simple-prompt"
Evaluation memory limit is ineffective in JRuby and MRI < 2.0
Unhandled Java exception: java.lang.IllegalArgumentException: unknown event type: c_call
java.lang.IllegalArgumentException: unknown event type: c_call
      typeForEvent at org/jruby/debug/Util.java:131
      eventHandler at org/jruby/debug/DebugEventHook.java:97
             event at org/jruby/runtime/EventHook.java:32
    callEventHooks at org/jruby/Ruby.java:3195
             trace at org/jruby/runtime/ThreadContext.java:745
             trace at org/jruby/runtime/ThreadContext.java:741
         callTrace at org/jruby/internal/runtime/methods/JavaMethod.java:189
              call at org/jruby/RubyHash$INVOKER$i$1$0$op_aref_DBG.gen:-1
      cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:375
              call at org/jruby/runtime/callsite/CachingCallSite.java:174
       processCall at org/jruby/ir/interpreter/InterpreterEngine.java:316
         interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:72
         interpret at org/jruby/ir/interpreter/InterpreterEngine.java:80
  INTERPRET_METHOD at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:123
              call at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:110
      cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:354
              call at org/jruby/runtime/callsite/CachingCallSite.java:143
       processCall at org/jruby/ir/interpreter/InterpreterEngine.java:345
         interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:72
  INTERPRET_METHOD at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:87
              call at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:66
      cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:332
              call at org/jruby/runtime/callsite/CachingCallSite.java:86
         interpret at org/jruby/ir/instructions/CallBase.java:540
       processCall at org/jruby/ir/interpreter/InterpreterEngine.java:361
         interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:72
         interpret at org/jruby/ir/interpreter/InterpreterEngine.java:86
  INTERPRET_METHOD at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:159
              call at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:146
      cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:375
              call at org/jruby/runtime/callsite/CachingCallSite.java:174
       processCall at org/jruby/ir/interpreter/InterpreterEngine.java:316
         interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:72
         interpret at org/jruby/ir/interpreter/InterpreterEngine.java:86
  INTERPRET_METHOD at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:159
              call at org/jruby/internal/runtime/methods/InterpretedIRMethod.java:146
      cacheAndCall at org/jruby/runtime/callsite/CachingCallSite.java:375
              call at org/jruby/runtime/callsite/CachingCallSite.java:174
       processCall at org/jruby/ir/interpreter/InterpreterEngine.java:316
         interpret at org/jruby/ir/interpreter/StartupInterpreterEngine.java:72
    INTERPRET_ROOT at org/jruby/ir/interpreter/Interpreter.java:96
           execute at org/jruby/ir/interpreter/Interpreter.java:81
           execute at org/jruby/ir/interpreter/Interpreter.java:30
           execute at org/jruby/ir/IRTranslator.java:42
    runInterpreter at org/jruby/Ruby.java:892
    runInterpreter at org/jruby/Ruby.java:896
       runNormally at org/jruby/Ruby.java:785
       runNormally at org/jruby/Ruby.java:798
       runFromMain at org/jruby/Ruby.java:610
     doRunFromMain at org/jruby/Main.java:412
       internalRun at org/jruby/Main.java:304
               run at org/jruby/Main.java:234
              main at org/jruby/Main.java:206


Process finished with exit code 1
@mohamedhafez mohamedhafez changed the title java.lang.IllegalArgumentException when running 9.2.9.0 in RubyMine Debugger IllegalArgumentException when running 9.2.9.0 in RubyMine Debugger Nov 4, 2019
@headius
Copy link
Member

headius commented Nov 4, 2019

Shouldn't be too hard to reproduce with the command line given. I suspect this is due to work on #5859.

@enebo
Copy link
Member

enebo commented Nov 4, 2019

Can someone help me find what gem those org.jruby.debug.* files are from? Part of the fixes in #5859 was changing c_call to c-call since that is what they are called in C Ruby. I am trying to track to ruby-debug-base but the only java file is not using org.jruby.debug.* as their Java equivs.

@enebo
Copy link
Member

enebo commented Nov 4, 2019

@headius
Copy link
Member

headius commented Nov 4, 2019

@enebo I believe it is from here...these are the JRuby-specific bits for the ruby-debug tool stack: https://github.com/jruby/jruby-debug/blob/master/src/org/jruby/debug/Util.java.

At least this may mean we can fix it and somehow force RubyMine to use the updated library.

@enebo
Copy link
Member

enebo commented Nov 4, 2019

yeah c_call is not a real even name so we have had a bunch of typos in our code base for years we did not notice because we would only emit line up until #5859. So I guess we update jruby-debug and then tell people they need to update. Should be reasonably simple to update at least (s/_/-/ more or less :) ).

@enebo
Copy link
Member

enebo commented Nov 4, 2019

I should take that back...we did emit some and some of those were using the _ name. But most events were not being emitted.

@enebo
Copy link
Member

enebo commented Nov 4, 2019

hahah or a few things need to be changed since this is pre-maven and effectively has not been changed in 7 years. I think we can assume 9.x codebase and probably get rid of reflection hacks.

@denofevil
Copy link

@ViugiNick please, take a look and update the base gem

@enebo
Copy link
Member

enebo commented Nov 4, 2019

@ViugiNick @denofevil ruby-debug/ruby-debug#30 ... This seems to be the place?

@amiracam
Copy link

I can confirm that I have the same issue, and on 9.2.8.0 I also have a debugger issue but not on the same spot, any work arounds ? hard to fly without a working debugger , thanks

@headius
Copy link
Member

headius commented Dec 16, 2019

@amiracam I believe this is being fixed and should be released once we figure out who can do such releases...hopefully soon!

@amiracam
Copy link

amiracam commented Dec 16, 2019 via email

@headius
Copy link
Member

headius commented Jan 7, 2020

According to this it seems the releases were out a couple weeks ago: ruby-debug/ruby-debug#30 (comment)

I'm not sure about next steps because I'm not familiar with how the IDEA (and probably Eclipse) plugins integrate this gem. Will they require new releases? Can users upgrade in place? @ViugiNick are you the right person to ask about this?

@amiracam
Copy link

amiracam commented Jan 7, 2020

well what works is to include that release in the Gemfile

gem 'ruby-debug-base', '0.11.0',

which in the case of IDEA will override what it thinks is the "appropriate" current release
usually there's a IDE specific gem that accompanies these, but again to debug in IDEA one does not usually need to add these debug gems into the Gemfile since IDEA is aware

Anyhow I can confirm that the specific issue is addressed by the release of the aforementioned gem.

I do still have edge issues debugging Jruby code from IDEA but I'll create another ticket for it if there's not one already.

@enebo
Copy link
Member

enebo commented Jan 7, 2020

@amiracam Also note that 9.2.9.0 not only corrected those incorrect event names but also started properly emitting them (most events were not emitted before 9.2.9.0). So you may notice more stuff happening within IDEA which did not prior to 9.2.9.0.

@headius
Copy link
Member

headius commented Jan 7, 2020

@amiracam I think we can call this fixed since ruby-debug-base is released and resolves the issue. Summarizing what I found about your new issue:

  • You are having troubles getting a debug breakpoint to fire.
  • I looked into the code and it appears to simply be a search through breakpoints for every LINE event.
  • LINE events are pretty heavily tested in our various suites, so if you go ahead with an issue I think it should start at ruby-debug.

@enebo Maybe you have a different opinion about where to file future issues. I'll mark this one fixed though.

@headius headius closed this as completed Jan 7, 2020
@headius headius added this to the Non-Release milestone Jan 7, 2020
@enebo
Copy link
Member

enebo commented Jan 7, 2020

I would guess it should be filed with us unless it is apparent something is wrong with the debug related gems.

@amiracam
Copy link

amiracam commented Jan 8, 2020

@enebo to be clear I also bumped into this issue on 9.2.9.0 which is what my project is currently on.
including the 11.0 version in the Gemfile again gets me past the immediate issue
@headius I'll do some more experimentation and test with a MRI release , if it works with MRI, I think proper to submit a bug here, also , its not as simple as not getting a breakpoint to fire , they will under "simpler" conditions, but debugging my vertx project is crippled, I thought I bumped into an issue getting past a forwardable delegation but its all inconclusive at this point , I will try to recreate the issue in an isolated demo that mimics my project

@enebo
Copy link
Member

enebo commented Jan 8, 2020

@amiracam yeah we both have the same understanding then.

@ViugiNick
Copy link

@headius New gem will be bundled in one of the first 2020 releases

@slonopotamus
Copy link

@ViugiNick if IDEA/RubyMine didn't bundle a gem but instead installed from RubyGems, users would not need to suffer and wait until new release happens.

@ViugiNick
Copy link

@slonopotamus You can install the needed version from RubyGems and use it

@slonopotamus
Copy link

Yes, I can. I can also use different IDE, use different programming language, work on a different job, etc. There are workarounds for the fact that IDEA/RubyMine bundles fixed version of ruby-debug-base. But my point is that if things were done in a different way, there would be no need to workaround it.

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

7 participants