This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 149884 - cannot debug with fast debugger using native ruby and Mac OSX
Summary: cannot debug with fast debugger using native ruby and Mac OSX
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: Macintosh Mac OS X
: P1 blocker (vote)
Assignee: issues@ruby
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-12 10:57 UTC by gu6526
Modified: 2011-09-19 21:10 UTC (History)
2 users (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
ide log for the first case (rspec not running) (34.55 KB, text/plain)
2008-10-12 11:04 UTC, gu6526
Details
ide log for the second problem (mongrel will not start under debugger) (31.83 KB, text/plain)
2008-10-12 11:08 UTC, gu6526
Details
messages log for the previous post (33.51 KB, text/plain)
2008-10-16 16:29 UTC, gu6526
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gu6526 2008-10-12 10:57:21 UTC
Debugging does not work under Mac OS X in the latest NB with the fast debugger.

There are actually two problems:  
- my spec tests don't run under debugger at all
- mongrel will not start

So long I used 6.5M1 with ruby-debug-ide-0.1.10 because I could never get
the newer versions running with the fast debugger.  Now I'm forced to use
the newer releases, due to a rake problem (missing do_option) with my old setup.

log files will follow
Comment 1 gu6526 2008-10-12 11:04:17 UTC
Created attachment 71619 [details]
ide log for the first case (rspec not running)
Comment 2 gu6526 2008-10-12 11:08:09 UTC
Created attachment 71620 [details]
ide log for the second problem (mongrel will not start under debugger)
Comment 3 Martin Krauskopf 2008-10-13 14:31:12 UTC
Hi. So you might:

- debug 'normal' Ruby scripts
- debug non-Rails project
- run Mongrel
- run tests

But you *cannot*:

- debug Rails project under Mongrel
- debug tests

Can you confirm? Just to narrow the problem as much as possible. What about e.g. debugging Rails project using Webrick?
Comment 4 gu6526 2008-10-15 10:46:21 UTC
I cannot debug at all! with this setup.  No tests, no non-rails, no Mongrel, No Webrick.
Comment 5 Martin Krauskopf 2008-10-15 11:29:32 UTC
That pretty bad -> increasing priority.

So firstly, could you try to get the latest build:

  http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds

and reproduce the issue with the simple (non-Rails) project with "Hello World" script and attach the log here. Thanks.
Comment 6 Martin Schovanek 2008-10-15 15:29:20 UTC
Cannot reproduce on the latest #200810150101 build. Can you please check if you are able to start Mongrel or run the
tests outside Nb?
Comment 7 gu6526 2008-10-16 16:24:41 UTC
Ok, I downloaded netbeans-hudson-trunk-4077-ruby.zip
even with a simple puts "hello world" the app will not run under the debugger:

Waiting for connection on ':50136'
Fast Debugger (ruby-debug-ide 0.3.1) listens on :50136
Starting command read loop
Processing: b /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4
<breakpointAdded no="1" location="/Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4"/>
Processing: start
Starting: running program script

without the debugger, everything runs fine
Comment 8 gu6526 2008-10-16 16:29:26 UTC
Created attachment 72010 [details]
messages log for the previous post
Comment 9 Martin Krauskopf 2008-10-16 17:13:44 UTC
Weird. The logs seems ok. Could you try to run from one terminal:

  cd /Users/gernot/NetBeansProjects/RubyApplication1/lib
  /usr/bin/ruby -I/Users/gernot/NetBeansProjects/RubyApplication1/lib /Library/Ruby/Gems/1.8/bin/rdebug-ide _0.3.1_ -p
50136 -d -- /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb

this should start up debugger backend, then from second terminal:

  telnet localhost 50136

and type in the telnet session.

  b /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4<Enter>
  start<Enter>

What does happen. Debugger should emit stopping on breakpoint message. Thanks.
Comment 10 gu6526 2008-10-16 18:42:40 UTC
first terminal session:
noname:lib gernot$ /usr/bin/ruby -I/Users/gernot/NetBeansProjects/RubyApplication1/lib
/Library/Ruby/Gems/1.8/bin/rdebug-ide _0.3.1_ -p 50136 -d -- /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb
Waiting for connection on ':50136'
Fast Debugger (ruby-debug-ide 0.3.1) listens on :50136
Starting command read loop
Processing: b /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4
<breakpointAdded no="1" location="/Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4"/>
Processing: start
Starting: running program script
noname:lib gernot$ 

second terminal session:
Last login: Thu Oct 16 19:37:52 on ttys011
noname:~ gernot$ telnet localhost 50136
Trying ::1...
Connected to localhost.
Escape character is '^]'.
b /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4
<breakpointAdded no="1" location="/Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb:4"/>start
Connection closed by foreign host.
noname:~ gernot$ 

Comment 11 Martin Krauskopf 2008-10-16 19:11:47 UTC
I suppose that content of main.rb was not changed, so it is:

  $ cat /Users/gernot/NetBeansProjects/RubyApplication1/lib/main.rb
  # To change this template, choose Tools | Templates
  # and open the template in the editor.

  puts "Hello World"

So it is not bug in NetBeans, it is bug in the debug-commons backend, I've filed:

  http://rubyforge.org/tracker/index.php?func=detail&aid=22453&group_id=3085&atid=11903

But let's keep the discussion here. I'll try to provide more logging in the backends, since on machines I've tried and
some of my colleges it works.

To try to narrow the culprit, there are other thinks which might be tried:

- try to upgrade your Ruby to more recent one than 1.8.6-p114, which is a bit outdated
(http://www.ruby-lang.org/en/downloads/) - does it help?

- try to debug the main.rb with CLI debugger - does it work?:

    $ gem install ruby-debug -v 0.10.2
    $ echo -e "puts 1\nputs 2\nputs 3" > /tmp/test.rb
    $ cat /tmp/test.rb 
    puts 1
    puts 2
    puts 3
    $ rdebug /tmp/test.rb 
    [-4, 5] in /tmp/test.rb
    => 1  puts 1
      2  puts 2
      3  puts 3
    /tmp/test.rb:1
    puts 1
    (rdb:1) b 3
    Breakpoint 1 file /tmp/test.rb, line 3
    (rdb:1) c
    1
    2
    Breakpoint 1 at test.rb:3
    [-2, 7] in /tmp/test.rb
      1  puts 1
      2  puts 2
    => 3  puts 3
    /tmp/test.rb:3
    puts 3
    (rdb:1) c
    3

This could help to narrow the culprit.
Comment 12 gu6526 2008-10-16 20:06:57 UTC
The latter worked.  Now I'm trying to install a newer ruby version which caused some other problems.  If that's stable I
will come back again.
Comment 13 gu6526 2008-10-16 23:42:45 UTC
good news!
I upgraded my ruby and now everything looks fine!  Thank you for your support.
RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.0
  - RUBY VERSION: 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.5.0]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-9
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.8
     - /Users/gernot/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
Comment 14 Martin Krauskopf 2008-10-16 23:59:58 UTC
Yes, that's really good to know! :)
Bad, that Ruby 1.8.6-p114 ended so silently - there were known segmentation fault cases, but the segmentation fault
itself was shown immediately in the NetBeans popup dialog, so it was clear immediately. This one was pretty hard to
track. I'll try to simulate this on the Mac machine in the office and try to peek a little bit more to prevent this next
time. Changing to TASK to not forgot it.

Thanks for the great feedback.