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 202867 - Debugger occasionally blocks after visual debugging
Summary: Debugger occasionally blocks after visual debugging
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.1
Hardware: PC All
: P2 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-30 08:40 UTC by Martin Entlicher
Modified: 2011-10-05 14:12 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 Martin Entlicher 2011-09-30 08:40:09 UTC
1) Start debugging of some application with a GUI
2) Take the GUI snapshot of the application and select some components in the screenshot to have the component properties loaded in the Properties window.
3) Close the debugger session and start it again.
4) Repeat until the application stucks in displaying it's GUI.
   The Debugging view shows "AWT-EventQueue-0 evaluating method..." and
   both debugger and application is not responding.
5) The solution is to close the debugger session and restart NetBeans.
Comment 1 Martin Entlicher 2011-09-30 08:44:19 UTC
Thread dump shows that the application is stuck in loading of the visual debugger agent:
"AWT-EventQueue-0" prio=10 tid=0x717ea800 nid=0x2555 at breakpoint[0x714ad000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
	at java.lang.Class.getConstructor0(Class.java:2714)
	at java.lang.Class.newInstance0(Class.java:343)
	at java.lang.Class.newInstance(Class.java:325)
	at java.awt.EventQueue.getNextEvent(EventQueue.java:507)

gdb shows us that the native method interferes with the JVMTI debugging methods:
Thread 2 (Thread 0x71699b70 (LWP 9904)):
#0  0xb7850424 in __kernel_vsyscall ()
#1  0xb782b48c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i386-linux-gnu/libpthread.so.0
#2  0xb7074ae1 in os::PlatformEvent::park() () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#3  0xb704b652 in Monitor::IWait(Thread*, long long) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#4  0xb704be40 in Monitor::wait(bool, long, bool) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#5  0xb7177002 in JavaThread::java_suspend_self() () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#6  0xb6f7fe07 in JvmtiRawMonitor::raw_wait(long long, bool, Thread*) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
---Type <return> to continue, or q <return> to quit---
#7  0xb6f5b966 in JvmtiEnv::RawMonitorWait(JvmtiRawMonitor*, long long) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#8  0xb6f1cf72 in jvmti_RawMonitorWait () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#9  0xb6a27aa6 in debugMonitorWait () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#10 0xb6a15c2e in enqueueCommand () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#11 0xb6a16897 in eventHelper_reportEvents () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#12 0xb6a11e00 in reportEvents () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#13 0xb6a122a6 in event_callback () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#14 0xb6a12ebe in cbClassPrepare () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/libjdwp.so
#15 0xb6f7152c in JvmtiExport::post_class_prepare(JavaThread*, klassOopDesc*) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#16 0xb6e9448c in instanceKlass::link_class_impl(instanceKlassHandle, bool, Thread*) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#17 0xb6e94721 in instanceKlass::link_class(Thread*) () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so
#18 0xb6f116c2 in JVM_GetClassDeclaredConstructors () from /opt/java/jdk1.7.0-b147_FINAL/jre/lib/i386/server/libjvm.so

A class prepare event is trying to be delivered into the debugger while a method is being invoked.
Comment 2 Martin Entlicher 2011-09-30 12:00:30 UTC
There was a problem with proliferation of method breakpoints used by visual debugger and their propagation to new debugger sessions.
Fixed by changeset:   203274:71cd18dd95d4
http://hg.netbeans.org/main/rev/71cd18dd95d4

The underlying problem was an inability to handle class prepare events during a method invocation. I'll file a separate issue for that.
Comment 3 Quality Engineering 2011-10-05 14:12:23 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/71cd18dd95d4
User: mentlicher@netbeans.org
Log: #202867 Prevent from proliferation of MethodBreakpoints that are used to evaluate methods on demand.