Giter Site home page Giter Site logo

Comments (27)

conradwt avatar conradwt commented on August 10, 2024

@legal90 I removed all the debug related gems from my gem file. In Rubymine 6.0.3, clicked the debugger icon and was prompted to install required debug gems for Rubymine. After the installation, things are working as expected. Thus, it appears that Rubymine 6 doesn't require one to add debug gems explicitly to the Gemfile because the documentation has the following:

http://www.jetbrains.com/ruby/webhelp/debugging.html

Note

Debugging in RubyMine does not require any additional gems. However, if there is debugger gem in your Gemfile, RubyMine checks whether debugger-xml gem is also present. If this gem is missing, RubyMine will suggest to included it to the Gemfile, to avoid conflict between the debugger gem, and the debugging gems used by RubyMine by default.

If you must install a debug gem to your Gemfile, then I would only add the following to your development block:

gem 'debugger'

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@conradwt Thank you, but I don't have any debug related gems in the Gemfile. Here is it:
https://github.com/mitchellh/vagrant/blob/master/Gemfile
https://github.com/mitchellh/vagrant/blob/master/vagrant.gemspec

P.s. My gem list has been collected after the first 'Debug' action in the Rubymine, e.q. all debug related gems was installed by Rubymine, as you have described above.

Exception still exists :(

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

I've created ticket about the problem in RubyMine's tracker (http://youtrack.jetbrains.com/issue/RUBY-14880)
I've seen this and will try to fix it.

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

Unfortunately, I'm unable to reproduce the problem now :(
@legal90 Is the problem still reproducible for you?
If so could you please run debugger in verbose mode (Settings|Debugger|Ruby) and provide both log of the ruby debugger and RubyMine's logs (Help|Show Log in ...)
It would be better if you'd provide them in the RubyMine's ticket I've created (I'm not sure how well github handles attachements).

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673, I've attached logs to the RubyMine's ticket

from ruby-debug-ide.

oleingemann avatar oleingemann commented on August 10, 2024

Have you managed to fix this yet? I am getting the same error-message, even after removing all debugging gems from my gemfile. thx

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

@olekjormo try sub-proc-init-race branch

from ruby-debug-ide.

oleingemann avatar oleingemann commented on August 10, 2024

Added this to GEMFILE

gem 'ruby-debug-ide', :git => 'git://github.com/ruby-debug/ruby-debug-ide.git', :branch => 'sub-proc-init-race'

but I still get this:

Fast Debugger (ruby-debug-ide 0.4.22, debase 0.0.9) listens on 127.0.0.1:52660
| 49640: Exception in DebugThread loop: closed stream
| Backtrace:
| /Users/myUserName/.rvm/gems/ruby-2.0.0-head/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/interface.rb:44:in close' 18:10:43 iver.1 | from: /Users/myUserName/.rvm/gems/ruby-2.0.0-head/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/interface.rb:44:inclose'

Any idea?

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

@olekjormo bother :( Could you please run ruby debugger in verbose mode (--debug in command line or Settings|Debugger|Ruby|verbose in RubyMine)?

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673, It is not working in my case too.
I've added to Gemfile

gem 'ruby-debug-ide', :git => 'git://github.com/ruby-debug/ruby-debug-ide.git', :branch => 'sub-proc-init-race'

And there is verbose debug output:

/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/bin/rdebug-ide --debug --disable-int-handler --port 51375 --dispatcher-port 51376 -- /Users/legal/Documents/vagrant/bin/vagrant help
Fast Debugger (ruby-debug-ide 0.4.22, debase 0.0.9) listens on 127.0.0.1:51375
Connected from 127.0.0.1
2214: Starting control thread
2214: Processing in control: start
2214: Starting: running program script
2214: Exception in DebugThread loop: closed stream
Backtrace:
/Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/interface.rb:44:in `close'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/interface.rb:44:in `close'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/ide_processor.rb:103:in `ensure in process_commands'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide/ide_processor.rb:103:in `process_commands'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/lib/ruby-debug-ide.rb:124:in `block in start_control'

Process finished with exit code 1

Would you like me to send an 'idea.log' to you?

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

@legal90 and what do you see in the RM's log?

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673, I see only these (there are 3 entries per each debug run)

2014-02-06 11:19:20,310 [ 546363]   INFO - s.ruby.ruby.run.AbstractRunner - Executing [/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/bin/rdebug-ide --debug --disable-int-handler --port 51938 --dispatcher-port 51939 -- /Users/legal/Documents/vagrant/bin/vagrant help], working dir =[/Users/legal/Documents/vagrant]

2014-02-06 11:19:31,035 [ 557088]   INFO - s.ruby.ruby.run.AbstractRunner - Executing [/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/bin/rdebug-ide --debug --disable-int-handler --port 51941 --dispatcher-port 51942 -- /Users/legal/Documents/vagrant/bin/vagrant help], working dir =[/Users/legal/Documents/vagrant]

2014-02-06 11:19:43,246 [ 569299]   INFO - s.ruby.ruby.run.AbstractRunner - Executing [/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-84f79c4a74cb/bin/rdebug-ide --debug --disable-int-handler --port 51945 --dispatcher-port 51946 -- /Users/legal/Documents/vagrant/bin/vagrant help], working dir =[/Users/legal/Documents/vagrant]

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

Hmm, it looks like I've fixed another problem which looked similar to yours :( Will look at this today or tomorrow.

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673 So, is this issue still closed?
http://youtrack.jetbrains.com/issue/RUBY-14880

Debugging is one of the most important feature in Rubymine and It is so sad that it still not working with Ruby 2.x.

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

the ticket is closed because it loks like the cause of the problem is in the gem.
I'm working on this but no results yet :(

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

Ok, thank you very much!

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

@legal90 I've added more debug output (to the branch), could you please try to reproduce the problem with it and provide debugger's log

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673 Sure, that it is. But it seems that nothing has changed in the output:(

/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/bin/rdebug-ide --debug --disable-int-handler --port 53099 --dispatcher-port 53100 -- /Users/legal/Documents/vagrant/bin/vagrant help
Fast Debugger (ruby-debug-ide 0.4.22, debase 0.0.9) listens on 127.0.0.1:53099
Connected from 127.0.0.1
5105: Starting control thread
5105: Processing in control: start
5105: Starting: running program script
5105: Exception in DebugThread loop: closed stream
Backtrace:
/Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/lib/ruby-debug-ide/interface.rb:44:in `close'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/lib/ruby-debug-ide/interface.rb:44:in `close'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/lib/ruby-debug-ide/ide_processor.rb:105:in `ensure in process_commands'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/lib/ruby-debug-ide/ide_processor.rb:105:in `process_commands'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-83d75a9cc2ca/lib/ruby-debug-ide.rb:124:in `block in start_control'

Process finished with exit code 1

P.s. You can try to reproduce it by yourself. Just checkout this repo: https://github.com/mitchellh/vagrant
and try to debug ./bin/vagrant --help command via Rubymine

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

I was able to reproduce the exception but I'm not sure if this is the same problem as you see.
So I've added more debug output. Could you please try again.

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673 now 'medvedko' is printing sometimes :-)
https://gist.github.com/legal90/0358cb6e75310b115600

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

Ok, it looks like we just missed the expected exception.
But it is verfy strange in RemoteInterface.close() we resue Exception and it doesn't catch IOError, but rescue IOError helps.
So, I've updated the branch. Please try it and let me know if it helps or not.

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

Sorry, but it still not working. But now there is Bad file descriptor exception:

/Users/legal/.rbenv/versions/2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/bin/rdebug-ide --debug --disable-int-handler --port 53145 --dispatcher-port 53146 -- /Users/legal/Documents/vagrant/bin/vagrant help
Fast Debugger (ruby-debug-ide 0.4.22, debase 0.0.9) listens on 127.0.0.1:53145
Connected from 127.0.0.1
2843: Starting control thread
2843: Processing in control: start
2843: Starting: running program script
2843: Exception in DebugThread loop: Bad file descriptor
Backtrace:
/Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/interface.rb:8:in `select'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/interface.rb:8:in `block in non_blocking_gets'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/interface.rb:7:in `loop'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/interface.rb:7:in `non_blocking_gets'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/interface.rb:33:in `read_command'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide/ide_processor.rb:84:in `process_commands'
  from: /Users/legal/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/bundler/gems/ruby-debug-ide-7c7d5865c0d8/lib/ruby-debug-ide.rb:124:in `block in start_control'

Process finished with exit code 1

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

Added one more check. Try it now :)

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

Now it is working better, but error still occurs:
4781: Exception in DebugThread loop: Bad file descriptor(Errno::EBADF)
Full examples: https://gist.github.com/legal90/fb030145409a0a3e214e

Statistics: I have only 1 of 5 debugging attempts failed.

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

Ok, I think I've got the cause of the problem. Our code just not ready for situation when the socket will be closed on another thread. To catch all Errno::XXX we need to catch SystemCallError.
I've updated the branch.

from ruby-debug-ide.

legal90 avatar legal90 commented on August 10, 2024

@os97673, great! Now it is working fine for me, thank you! I don't get errors anymore.
I hope your PR #39 will be merged soon.

from ruby-debug-ide.

os97673 avatar os97673 commented on August 10, 2024

@legal90

I hope your PR #39 will be merged soon.

I hope too :) Will ping the maintainer today.

from ruby-debug-ide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.