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 229657 - Line breakpoint ignored in the first debugging session upon IDE startup
Summary: Line breakpoint ignored in the first debugging session upon IDE startup
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.4
Hardware: PC Linux
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2013-05-13 13:09 UTC by Jiri Kovalsky
Modified: 2013-06-28 02:17 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of IDE with ignored line breakpoint. (125.52 KB, image/png)
2013-05-13 13:09 UTC, Jiri Kovalsky
Details
Another missed breakpoint. (208.48 KB, image/png)
2013-05-29 12:06 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2013-05-13 13:09:58 UTC
Created attachment 134366 [details]
Screenshot of IDE with ignored line breakpoint.

Product Version: NetBeans IDE Dev (Build 201304282301)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

Description:
============
It seems like submission of line breakpoints is too fast when starting the first debugging session right after start of the NetBeans IDE. As a result such breakpoints are ignored and never hit until restart of the debugger or sequence of "Pause" and "Continue" actions.

See failing lineBreakpointTest() test case in AntSanityTest.java test suite [1].

[1] http://hudson4qe.cz.oracle.com/job/jpda.debugger.ui/jdk=JDK%207,label=Windows7-slave2/13/

Steps to reproduce:
===================
1. Start NetBeans IDE with an empty userdir.
2. Open MemoryView project.
3. Toggle line 98 breakpoint in MemoryView.java i.e. on this line:

98      int taken = (int) (total - free);

4. Press Ctrl+F5 to start debugging.
5. You will see two threads (AWT-XAWT and main) running but no UI started hence no breakpoint hit - see attached screenshot.
Comment 1 Martin Entlicher 2013-05-14 12:03:39 UTC
Reproduced under the debugger, where I can pause individual threads.
It's possible that the continue action is called before the breakpoint is about to be submitted:

"JPDA Debugger"
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointImpl.<init>(BreakpointImpl.java:139)
org.netbeans.modules.debugger.jpda.breakpoints.ClassBasedBreakpoint.<init>(ClassBasedBreakpoint.java:132)
org.netbeans.modules.debugger.jpda.breakpoints.LineBreakpointImpl.<init>(LineBreakpointImpl.java:142)
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.createBreakpointImpl(BreakpointsEngineListener.java:325)
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener.access$100(BreakpointsEngineListener.java:93)
org.netbeans.modules.debugger.jpda.breakpoints.BreakpointsEngineListener$1.run(BreakpointsEngineListener.java:182)
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2042)

It's because the breakpoint is submitted to the debuggee asynchronously.
Comment 2 Martin Entlicher 2013-05-16 11:57:24 UTC
Fixed by changeset:   253689:6b1378a67a31 A mechanism which synchronize debugger actions was introduced. I hope that the timeout in the test is no longer necessary.
http://hg.netbeans.org/core-main/rev/6b1378a67a31
Comment 3 Quality Engineering 2013-05-17 09:54:02 UTC
Integrated into 'main-golden', will be available in build *201305170640* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/6b1378a67a31
User: mentlicher@netbeans.org
Log: #229657: An ActionsSynchronizer is introduced, which takes care about debugger actions synchronization.
Comment 4 Jiri Kovalsky 2013-05-29 12:06:40 UTC
Created attachment 135067 [details]
Another missed breakpoint.

Product Version: NetBeans IDE Dev (Build 201305262300)
Updates: Updates available
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

I am sorry but the fix didn't help. I just followed the steps to reproduce. Reopening.
Comment 5 Jiri Kovalsky 2013-05-29 12:56:32 UTC
I have also faced another symptom of this problem in 7.3.1. Clear userdir. MemoryView project opened, MemoryView.java selected. F7. Debugger stops on 1st line of main() method. F8 acts like F5. :(

Product Version: NetBeans IDE 7.3.1 (Build 201305282201)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Linux version 3.0.0-12-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/7.3.1
Cache directory: /home/cesilko/.cache/netbeans/7.3.1

I know the fix is in trunk. Added here just in case it could help find the cause.
Comment 6 Jiri Kovalsky 2013-06-05 16:34:41 UTC
Any progress on this Martine?
Comment 7 Martin Entlicher 2013-06-26 16:53:00 UTC
Apparently, the main thread is suspended on the breakpoint, but IDE does not know about it and considers the main thread as running.
Exploring what's wrong...
Comment 8 Martin Entlicher 2013-06-27 12:56:44 UTC
I've found a place where the breakpoint event was ignored. It's fixed by changeset: 257615:470498d9334b
http://hg.netbeans.org/core-main/rev/470498d9334b
Comment 9 Quality Engineering 2013-06-28 02:17:29 UTC
Integrated into 'main-silver', will be available in build *201306272300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/470498d9334b
User: mentlicher@netbeans.org
Log: #229657: Handle parallel events even when there are no ignored threads.