Debugging failing in RM6.3 on Linux

I'm running RubyMine 6.3 on Ubuntu 14.04, and when I set a breakpoint, RM doesn't stop on the breakpoint. I've instrumented an alert that pops up after the breakpoint (and written in the .coffee I expect to call back), so I know that the breakpoint is being completely ignored.

If I can help with more information, I'll gladly do so, but I'm not sure what else may be relevant. What follows is the gem environment. I should note that I tried also tried the combination of debugger/debugger-xml, and then also byebug with ruby-debugger-ide. 'debugger' resulted in the seg fault described here: https://bugs.ruby-lang.org/issues/9594. And byebug tries to use the console as a terminal, which obviously doesn't work (and I didn't really expect it to).

Attached is the log file from the process that started rubymine. I'll note that it shows some null pointer exceptions (java) and a couple of other exceptions that seem to relate to the failures I report above based on where they appear.

RUBYGEMS VERSION: 2.2.2
RUBY VERSION: 2.1.1 (2014-02-24 patchlevel 76) [x86_64-linux]
INSTALLATION DIRECTORY: ~/.rvm/gems/ruby-2.1.1
RUBY EXECUTABLE: ~/.rvm/rubies/ruby-2.1.1/bin/ruby
EXECUTABLE DIRECTORY: ~/.rvm/gems/ruby-2.1.1/bin
SPEC CACHE DIRECTORY: ~/.gem/specs
RUBYGEMS PLATFORMS:
  ruby
  x86_64-linux
GEM PATHS:
   ~/.rvm/gems/ruby-2.1.1
   ~/.rvm/gems/ruby-2.1.1@global
GEM CONFIGURATION:
   :update_sources => true
   :verbose => true
   :backtrace => false
   :bulk_threshold => 1000
REMOTE SOURCES:
   https://rubygems.org/
SHELL PATH:
   ~/.rvm/rubies/ruby-2.1.1/bin
   ~/.rvm/gems/ruby-2.1.1/bin
   ~/.rvm/gems/ruby-2.1.1@global/bin
   ~/.rvm/bin
   /usr/local/sbin
   /usr/local/bin
   /usr/sbin
   /usr/bin
   /sbin
   /bin
   /usr/games
   /usr/local/games
   ~/.rvm/bin
----------------------
IDE: RubyMine 6.3, build #RM-135.692
OS: Linux 3.13.0-24-generic[amd64]
Java: 1.8.0_05-b13
RubyMine SDK Environment:
Sdk: RVM: ruby-2.1.1
Sdk Version: ver.2.1.1p76 ( revision 45161) p76
Ruby Interpreter: /home/rev-dr-d3/.rvm/rubies/ruby-2.1.1/bin/ruby
RVM Sdk: yes, gemset:[default]
RVM Home: ~/.rvm
Sdk Language Level: 2.1
Sdk Load Path:
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby/2.1.0/x86_64-linux
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/site_ruby
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby/2.1.0/x86_64-linux
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/vendor_ruby
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0
     ~/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/x86_64-linux
     ~/INSTALLS/RubyMine-6.3/rubystubs21
Sdk Gem paths:
     ~/.rvm/gems/ruby-2.1.1/bundler/gems
     ~/.rvm/gems/ruby-2.1.1/gems
     ~/.rvm/gems/ruby-2.1.1@global/gems
Gems used for 'foo':
     builder (3.2.2)
         ~/.rvm/gems/ruby-2.1.1/gems/builder-3.2.2
     rdoc (4.1.1)
         ~/.rvm/gems/ruby-2.1.1/gems/rdoc-4.1.1
     tzinfo (1.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/tzinfo-1.1.0
     polyglot (0.3.4)
         ~/.rvm/gems/ruby-2.1.1/gems/polyglot-0.3.4
     sass (3.2.19)
         ~/.rvm/gems/ruby-2.1.1/gems/sass-3.2.19
     rails (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/rails-4.1.0
     turbolinks (2.2.2)
         ~/.rvm/gems/ruby-2.1.1/gems/turbolinks-2.2.2
     actionmailer (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/actionmailer-4.1.0
     erubis (2.7.0)
         ~/.rvm/gems/ruby-2.1.1/gems/erubis-2.7.0
     thor (0.19.1)
         ~/.rvm/gems/ruby-2.1.1/gems/thor-0.19.1
     mime-types (1.25.1)
         ~/.rvm/gems/ruby-2.1.1/gems/mime-types-1.25.1
     arel (5.0.1.20140414130214)
         ~/.rvm/gems/ruby-2.1.1/gems/arel-5.0.1.20140414130214
     ruby-debug-ide (0.4.23.beta1)
         ~/.rvm/gems/ruby-2.1.1/gems/ruby-debug-ide-0.4.23.beta1
     debase (0.0.9)
         ~/.rvm/gems/ruby-2.1.1/gems/debase-0.0.9
     i18n (0.6.9)
         ~/.rvm/gems/ruby-2.1.1/gems/i18n-0.6.9
     multi_json (1.9.3)
         ~/.rvm/gems/ruby-2.1.1/gems/multi_json-1.9.3
     sass-rails (4.0.3)
         ~/.rvm/gems/ruby-2.1.1/gems/sass-rails-4.0.3
     railties (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/railties-4.1.0
     thread_safe (0.3.3)
         ~/.rvm/gems/ruby-2.1.1/gems/thread_safe-0.3.3
     activesupport (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0
     jquery-rails (3.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/jquery-rails-3.1.0
     rack (1.5.2)
         ~/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2
     uglifier (2.5.0)
         ~/.rvm/gems/ruby-2.1.1/gems/uglifier-2.5.0
     coffee-rails (4.0.1)
         ~/.rvm/gems/ruby-2.1.1/gems/coffee-rails-4.0.1
     jbuilder (1.5.3)
         ~/.rvm/gems/ruby-2.1.1/gems/jbuilder-1.5.3
     rake (10.3.1)
         ~/.rvm/gems/ruby-2.1.1/gems/rake-10.3.1
     activerecord (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/activerecord-4.1.0
     actionview (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/actionview-4.1.0
     execjs (2.0.2)
         ~/.rvm/gems/ruby-2.1.1/gems/execjs-2.0.2
     treetop (1.4.15)
         ~/.rvm/gems/ruby-2.1.1/gems/treetop-1.4.15
     actionpack (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.0
     mail (2.5.4)
         ~/.rvm/gems/ruby-2.1.1/gems/mail-2.5.4
     coffee-script (2.2.0)
         ~/.rvm/gems/ruby-2.1.1/gems/coffee-script-2.2.0
     coffee-script-source (1.7.0)
         ~/.rvm/gems/ruby-2.1.1/gems/coffee-script-source-1.7.0
     sprockets (2.11.0)
         ~/.rvm/gems/ruby-2.1.1/gems/sprockets-2.11.0
     activemodel (4.1.0)
         ~/.rvm/gems/ruby-2.1.1/gems/activemodel-4.1.0
     sprockets-rails (2.1.3)
         ~/.rvm/gems/ruby-2.1.1/gems/sprockets-rails-2.1.3
     minitest (5.3.3)
         ~/.rvm/gems/ruby-2.1.1/gems/minitest-5.3.3
     bundler (1.6.2)
         ~/.rvm/gems/ruby-2.1.1@global/gems/bundler-1.6.2
     debugger-ruby_core_source (1.3.2)
         ~/.rvm/gems/ruby-2.1.1/gems/debugger-ruby_core_source-1.3.2
     hike (1.2.3)
         ~/.rvm/gems/ruby-2.1.1/gems/hike-1.2.3
     rack-test (0.6.2)
         ~/.rvm/gems/ruby-2.1.1/gems/rack-test-0.6.2
     tilt (1.4.1)
         ~/.rvm/gems/ruby-2.1.1/gems/tilt-1.4.1
     sdoc (0.4.0)
         ~/.rvm/gems/ruby-2.1.1/gems/sdoc-0.4.0
     sqlite3 (1.3.9)
         ~/.rvm/gems/ruby-2.1.1/gems/sqlite3-1.3.9

12 comments

Hi,

it looks like you have added ruby-debug-ide into your Gemfile.  Am I right?
You are not supposed to do so.  I'd suggest to remove it (and all other gems if you have them).
Also I'd uninstall all these gems and restart RubyMine to let it install them back.

Hope this helps, but if it is not please let me know.

Regards, Oleg.

0

To make sure I understand correctly, I should list no debugging gems in my gemfile?

0

I ask because I get the message, "The gem 'debase' is required by the debugger. Shall I install it?"

I assume the correct answer is yes.

Then, at startup of a debugging session, the following is printed to the console:

"/home/rev-dr-d3/.rvm/rubies/ruby-2.1.1/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide --debug --disable-int-handler --port 40603 --dispatcher-port 36181 -- /home/rev-dr-d3/RubymineProjects/foo/bin/rails server -b 0.0.0.0 -p 3000 -e development
Fast Debugger (ruby-debug-ide 0.4.23.beta1, debase 0.0.9) listens on 127.0.0.1:40603
Connected from 127.0.0.1"

So, I don't list these in my gemfile, but they're picked up anyway?

0

In any case, the anticipated behavior (stopping at breakpoints in the controller) is not observed.

As before, if there's any additional information I can provide, I'll gladly do so.

0

Hi Derrell,

if RubyMine uses ruby-debug-ide then you are not supposed to add any of debugger-related gems to your Gemfile (RubyMine will install them in sdk and use for its own purpose).
If you decide to use debugger+debugger-xml then they should be added to Gemfile.

Hope I was able to clarify the situation for you ;)

Regards, Oleg.

0

Oleg--

Thanks for your response. While your statement is clear, I apparently haven't been clear enough. When I follow what appear to be the instructions, I am not stopping at a breakpoint set in Ruby code in my Rails app (which has a little coffeescript mixed in).

The following is from restarting (run 'bundler clean --force', resulting in attached gem environment, restart RubyMine, delete the existing elements of the database, and begin a debugging session of my very simple app), I get:

1) a pop-up dialog with the message, "The gem debase required by the debugger is not currently installed. Would you like to install it?" I choose 'yes', since it fails if I don't accept it. This is the console output:

/home/rev-dr-d3/.rvm/rubies/ruby-2.1.1/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/ruby-debug-ide-0.4.23.beta1/bin/rdebug-ide --debug --disable-int-handler --port 47921 --dispatcher-port 38379 -- /home/rev-dr-d3/RubymineProjects/foo/bin/rails server -b 0.0.0.0 -p 3000 -e development
Fast Debugger (ruby-debug-ide 0.4.23.beta1, debase 0.0.9) listens on 127.0.0.1:47921
Connected from 127.0.0.1
9593: Starting control thread
9593: Processing in control: b /home/rev-dr-d3/RubymineProjects/foo/app/controllers/todo_items_controller.rb:7
9593: <breakpointAdded no="1" location="/home/rev-dr-d3/RubymineProjects/foo/app/controllers/todo_items_controller.rb:7"/>
9593: Processing in control: b /home/rev-dr-d3/RubymineProjects/foo/app/controllers/todo_items_controller.rb:9
9593: <breakpointAdded no="2" location="/home/rev-dr-d3/RubymineProjects/foo/app/controllers/todo_items_controller.rb:9"/>
9593: Processing in control: start
9593: Starting: running program script
=> Booting WEBrick
=> Rails 4.1.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2014-05-06 15:15:19] INFO  WEBrick 1.3.1
[2014-05-06 15:15:19] INFO  ruby 2.1.1 (2014-02-24) [x86_64-linux]
[2014-05-06 15:15:19] INFO  WEBrick::HTTPServer#start: pid=9593 port=3000


2) The external log currently has a warning from startup: "Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0", but nothing else.

3) I then refresh the page for the app. The console reads:

Started GET "/todo_items" for 127.0.0.1 at 2014-05-06 15:23:51 -0600

  ActiveRecord::SchemaMigration Load (0.3ms)  SELECT "schema_migrations".* FROM "schema_migrations"

Processing by TodoItemsController#index as HTML

  TodoItem Load (0.6ms)  SELECT "todo_items".* FROM "todo_items"

  Rendered todo_items/index.html.erb within layouts/application (43.1ms)

Completed 200 OK in 241ms (Views: 200.7ms | ActiveRecord: 4.9ms)

Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/todo_items.css?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/turbolinks.js?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/todo_items.js?body=1" for 127.0.0.1 at 2014-05-06 15:23:52 -0600

Started GET "/assets/bg.png" for 127.0.0.1 at 2014-05-06 15:23:53 -0600


4) I have a breakpoint in the 'create' controller for the todoitem model. This is the code:
  def create
    @todo_item = TodoItem.create!(todo_items_params)
    puts 'missed breakpoint! params: '+todo_items_params.to_s
    noop
  end

There is a breakpoint is at the create!(), and a breakpoint at the line that says 'noop' (no operation -- it's an empty function). I have the print statement that follows it, and an alert in the coffee script that is called after this controller.


5) I enter a new item in the todo list on the page.

Started POST "/todo_items" for 127.0.0.1 at 2014-05-06 15:43:48 -0600

Processing by TodoItemsController#create as JS

  Parameters: {"utf8"=>"✓", "todo_item"=>{"title"=>"foo"}}

   (0.2ms)  begin transaction

   (0.2ms)  rollback transaction

Completed 422 Unprocessable Entity in 62ms


ActiveRecord::RecordInvalid (Validation failed: Title can't be blank):

  app/controllers/todo_items_controller.rb:7:in `create'



  Rendered /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/middleware/templates/rescues/_source.erb (1.8ms)

  Rendered /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/middleware/templates/rescues/_trace.text.erb (1.9ms)

  Rendered /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb (2.4ms)

  Rendered /home/rev-dr-d3/.rvm/gems/ruby-2.1.1/gems/actionpack-4.1.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb (23.0ms)

I did not hit the breakpoint (at line 6 in todo_items_controller.rb).

6) I then remove the ! from the create call in the controller:
  def create
    @todo_item = TodoItem.create(todo_items_params)
    puts 'missed breakpoint! params: '+todo_items_params.to_s
    noop
  end



7) And create a new entry in the todo list. This is the console (note the 'puts' statement):
Started POST "/todo_items" for 127.0.0.1 at 2014-05-06 15:48:19 -0600
Processing by TodoItemsController#create as JS
  Parameters: {"utf8"=>"✓", "todo_item"=>{"title"=>"foo"}}
   (0.2ms)  begin transaction
   (0.2ms)  rollback transaction
missed breakpoint! params: {"title"=>"foo"}
  Rendered todo_items/_todo_item.html.erb (1.2ms)
  Rendered todo_items/create.coffee (485.9ms)
Completed 200 OK in 530ms (Views: 497.5ms | ActiveRecord: 1.5ms)



Attached is a screenshot of the browser window showing the alert, and the debug breakpoint wasn't hit. There was no further output to the "external log" beyond that reproduced in 2) above.


As I said, if I can provide any information, I'm glad to do so.




Attachment(s):
Screenshot from 2014-05-06 15:49:21.png
rmine-gem-env.txt.zip
0

Hi Derrell,

Is it possible share the app so I could play with it?
If it is not then please provide output of ruby debugger (whole content of debugger's console).

Regards, Oleg.

0

Oleg--

I have published the code to GItHub here.

Otherwise, I shared the virtually the entire console output in the text of my previous entry in this thread. I've attached the entire console output, in case I've missed something relevant.

Thanks for your help.



Attachment(s):
rm-debug-console.out.zip
0

I've discovered (out of frustration) that if I set a breakpoint in the code I didn't write (in this case, the create method in persistence.rb), I get the desired behavior (the debugger works as expected). I can then step back up the stack and see the frame as it was in my code (todo_item_controller.rb).

More interestingly (and I hope helpful for your analysis of the problem ), when I choose the frame for todo_item_controller, it doesn't open the tab in which that file already exists, but opens a new tab.

I use a bit of misdirection in my home directory, pointing RubyMine to a link that points to an external drive. Is it possible this is a source of the problem?

0

Hi,

symlinks could cause such problems for RubyMine, we just do not know what path we should use to specify a breakpoint and thus we use "resolved" version :(  

Oleg.

0

OK. That makes sense. We had the same problem writing in Java, so I understand where that comes from.

One possibility, then, is to store the resolved version of the path as the source location. At least that way users wouldn't have to delete a project to get around this.

Thanks for your help.

Derrell     

0

Hi Derrell,

could you pleas file a ticket in our tracker so we check what we could do with this for debugger.

Regards, Oleg.

0

Please sign in to leave a comment.