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 109659 - classic debugger - session cannot be not correctly finished when working with threads
Summary: classic debugger - session cannot be not correctly finished when working with...
Status: VERIFIED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2007-07-13 16:15 UTC by Tomas Danek
Modified: 2007-08-13 16:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2007-07-13 16:15:31 UTC
20070713
------------
-Have a code:

Thread.start(){ puts "hello from new thread"}
puts "main thread"

- put BP on line with Thread.start
- run classic jruby debugger
- debugger stops at BP, push f8
- finish session (shift-f5) -> process is not finished. P2 for sure, since it may reveal other important thread problems
in debugger. If not, feel free to downgrade to P3.
Comment 1 Martin Krauskopf 2007-07-13 16:21:06 UTC
Yup, there might be more threads-related problem in all debuggers. Thanks for testing this area.
Comment 2 Tomas Danek 2007-07-13 16:36:54 UTC
the problem can be that if i run whole the program step by step (pushing f8 after breakpoint) , there's no output from
the newly created thread?! the program ends, but process is still hanging...and after some timeout, i get 

org.rubyforge.debugcommons.RubyDebuggerException: Unable to read information in the specified timeout [10s]
	at org.rubyforge.debugcommons.ReadersSupport.readInfo(ReadersSupport.java:131)
	at org.rubyforge.debugcommons.ReadersSupport.readFrames(ReadersSupport.java:146)
	at org.rubyforge.debugcommons.RubyDebuggerProxy.readFrames(RubyDebuggerProxy.java:276)
	at org.rubyforge.debugcommons.model.RubyThread.getFrames(RubyThread.java:29)
	at org.rubyforge.debugcommons.model.RubyThread.getTopFrame(RubyThread.java:51)
	at org.netbeans.modules.ruby.debugger.RubySession.getTopFrame(RubySession.java:172)
	at org.netbeans.modules.ruby.debugger.RubySession.switchThread(RubySession.java:233)
	at org.netbeans.modules.ruby.debugger.RubyDebuggerActionProvider.stopHere(RubyDebuggerActionProvider.java:162)
	at org.netbeans.modules.ruby.debugger.RubyDebuggerActionProvider.onDebugEvent(RubyDebuggerActionProvider.java:138)
	at org.rubyforge.debugcommons.RubyDebuggerProxy.fireDebugEvent(RubyDebuggerProxy.java:113)
	at org.rubyforge.debugcommons.model.RubyThread.suspend(RubyThread.java:102)
	at org.rubyforge.debugcommons.model.RubyDebugTarget.suspensionOccurred(RubyDebugTarget.java:78)
[catch] at org.rubyforge.debugcommons.RubyDebuggerProxy$RubyLoop$1.run(RubyDebuggerProxy.java:422)


 If i disable the breakpoint and run debugger, the output is ok, and after program finishes, process ends. Hope that helps.
Comment 3 Martin Krauskopf 2007-07-13 17:03:46 UTC
Honestly I've not tried to reproduce yet. I'll take a look at this hopefully next week. Working on backends now.
Comment 4 Martin Krauskopf 2007-07-18 15:46:21 UTC
Should be fixed. In JRuby it still might be tuned since it might happen that it waits at max. 10s, but then correctly
finishes.

debug-commons-java/manifest.mf;
new revision: 1.4; previous revision: 1.3
debugger/nbproject/project.xml;
new revision: 1.5; previous revision: 1.4
debugger/src/org/netbeans/modules/ruby/debugger/RubySession.java;
new revision: 1.3; previous revision: 1.2
debugger/src/org/netbeans/modules/ruby/debugger/Util.java;
new revision: 1.2; previous revision: 1.1
external/debug-commons-0.9.4.tar.gz;
new revision: 1.4; previous revision: 1.3
external/debug-commons-java-0.7.3.jar;
new revision: 1.4; previous revision: 1.3
projects/src/org/netbeans/modules/ruby/rubyproject/execution/OutputForwarder.java;
new revision: 1.2; previous revision: 1.1
Comment 5 Martin Krauskopf 2007-07-18 15:46:27 UTC
Should be fixed. In JRuby it still might be tuned since it might happen that it waits at max. 10s, but then correctly
finishes.

debug-commons-java/manifest.mf;
new revision: 1.4; previous revision: 1.3
debugger/nbproject/project.xml;
new revision: 1.5; previous revision: 1.4
debugger/src/org/netbeans/modules/ruby/debugger/RubySession.java;
new revision: 1.3; previous revision: 1.2
debugger/src/org/netbeans/modules/ruby/debugger/Util.java;
new revision: 1.2; previous revision: 1.1
external/debug-commons-0.9.4.tar.gz;
new revision: 1.4; previous revision: 1.3
external/debug-commons-java-0.7.3.jar;
new revision: 1.4; previous revision: 1.3
projects/src/org/netbeans/modules/ruby/rubyproject/execution/OutputForwarder.java;
new revision: 1.2; previous revision: 1.1
Comment 6 Tomas Danek 2007-07-19 15:36:21 UTC
have to reopen - still reproducible:(
Comment 7 Martin Krauskopf 2007-07-19 15:52:14 UTC
I think it is a little different. The session together with process is really finished. There are no running process (ps
ax), or session and its threads hanging on (views). Problem is only that the OutputWindow does not react to the finished
process. Will try to fix it soon (so rather another P3 bug I think).
Comment 8 Tomas Danek 2007-08-01 11:49:29 UTC
Ack. process is finished, problem is only in UI.
Comment 9 Martin Krauskopf 2007-08-07 08:23:54 UTC
Wrong synchronization in the frontend in the end. 0+ threads kept hanging around after program was finished. Good catch,
thanks.

debugger/src/org/netbeans/modules/ruby/debugger/RubyDebuggerActionProvider.java;
new revision: 1.7; previous revision: 1.6
debugger/test/unit/src/org/netbeans/modules/ruby/debugger/RubyDebuggerTest.java;
new revision: 1.7; previous revision: 1.6
Comment 10 Tomas Danek 2007-08-13 16:46:24 UTC
thanks, verified in 20070813