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 268748 - NB hangs while debugging
Summary: NB hangs while debugging
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: Dev
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Martin Entlicher
Depends on:
Reported: 2016-10-30 15:45 UTC by NukemBy
Modified: 2017-01-25 06:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

hanged-jvm.txt (22.53 KB, text/plain)
2016-10-30 15:45 UTC, NukemBy

Note You need to log in before you can comment on or make changes to this bug.
Description NukemBy 2016-10-30 15:45:38 UTC
Created attachment 162691 [details]

Unfortunately it is a commons case for me when NetBeans just freezes while debugging.

Typical use-case is
- first symptom - NB stops evaluating variables in Watch window - I see endless messages "Evaluating..."  instead of variable values
- after some time - NB completely freezes - UI is not updated

After I kill target process (the one being debugged), NB starts working normally. This way debugging becomes a nightmare - to resolve the problem i have to restart application many times hoping that NB will not freeze at most needed place :(. Problem most frequently reproduces when debugging one instance of NetBeans from another instance of NetBeans.

I've generated thread dump for the last occurrence of that problem. I see nothing special except thread "AWT-EventQueue-0" is always waiting in the same place. Full dump is attached.

Taking into consideration that after killing target process debugger-NB goes back to life - I think that something in 'debugger' functionality somehow blocks UI events and after breaking the debugger channel this block is automatically removed.

"AWT-EventQueue-0" #22 prio=6 os_prio=0 tid=0x5cede800 nid=0x1d78 waiting on condition [0x5f0cd000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x06507480> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(
Comment 1 Martin Entlicher 2016-11-10 14:15:16 UTC
Can you please provide the NetBeans build number that you're using?
There was issue #262424 which could cause similar symptoms, but it's fixed in 8.2.

In the attachment it does not look like a deadlock, AWT is waiting for events.
It has just opened a breakpoint customizer. Please check whether the customizer dialog is not mistakenly opened behind the NetBeans window - in this case NetBeans window would not be accepting events and would look like frozen.
Comment 2 NukemBy 2016-11-14 08:29:51 UTC
I'm using NB 8.2 to debug NB built from local sources. 

Yes - there is no 'classic' deadlock logged in thread dump, but it may be a deadlock across two processes - i.e. AWT thread in debugger is blocked by something that waits for some in target debuggee process, what in turn waits for something else back in debugger process. I think I need to generated thread dump for both processes next time it occurs.

Regarding mentioned "issue #262424" - I have another similar common buggy case - targed debugged partially stops during debugging, i.e. stepping through code does work but it seems like not all threads in target process are resumed - some of the typical observations - after I click "Continue (F5)" WEB request to target server still hangs until I completely detach debugger. (target process in my case is Karaf/OSGI with plenty of modules and with around 300 threads)
Comment 3 gilibuzaglo 2017-01-25 06:04:36 UTC
It also happens to me when I debug web apps with tomcat 8.0.27.
When I kill tomcat , debugging stop and NB stops freezing