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 168139 - debugger lock up
Summary: debugger lock up
Status: CLOSED WORKSFORME
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-05 12:58 UTC by kirillkh
Modified: 2010-05-19 09:29 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot (505.40 KB, image/png)
2009-07-05 13:04 UTC, kirillkh
Details
thread dump (43.95 KB, text/plain)
2009-07-05 13:05 UTC, kirillkh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kirillkh 2009-07-05 12:58:45 UTC
I'm frequently experiencing debugger lock ups, when performing any of step actions (step over, step in, step out, run to
cursor). It is random, so there's no reproducible test case. May happen at one point and next time at another. The cure
is to restart the debugger. I used to think this was related to conditional breakpoints, as the last time it happened
(several days ago) removing the breakpoints seemed to cure it for a while. But now it's happening again, and there are
no enabled breakpoints at all. I'm attaching a thread dump and a screenshot. The screenshot was taken after performing
"run to cursor"; the highlighted (green) line is the line, where I pressed F4, so apparently it locks up after getting
to the destination.
Comment 1 kirillkh 2009-07-05 13:04:15 UTC
Created attachment 84378 [details]
screenshot
Comment 2 kirillkh 2009-07-05 13:05:02 UTC
Created attachment 84379 [details]
thread dump
Comment 3 kirillkh 2009-07-05 13:05:37 UTC
Product Version: NetBeans IDE 6.7 (Build 200906241340)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02
System: Linux version 2.6.28-13-generic running on amd64; UTF-8; en_US (nb)
Comment 4 Martin Entlicher 2009-07-07 10:15:12 UTC
This is one of the worst lock up - target VM does not respond and we do not know why.

One of the possible cause (which I'm dealing with these days) might be a global Pause action. Can you please let me know
if this might be involved in your case? Did you use Pause prior this lock up?
Comment 5 kirillkh 2009-07-07 10:42:18 UTC
I'm pretty confident that most of the times I reproduced without ever using pause. It seems related to the watch
expressions. That's what the thread dumps say, and I was able to somehow get rid of this problem for now by removing
some of the watches. I'm not sure, which, though.
Comment 6 kirillkh 2009-07-07 10:45:37 UTC
It is possible that I did use pause on a single thread in the Debugging window every time it happened. I'm not sure, if
it was the case, but can't confirm otherwise, either. In the attached screenshot the other thread is paused.
Comment 7 Martin Entlicher 2009-07-07 10:51:51 UTC
Do you know if the paused "Thread-0" might hold some lock that would prevent from evaluation that is running in "main"
thread to finish? In such case, resume of "Thread-0" should resolve the lock up.
Comment 8 kirillkh 2009-07-07 10:59:48 UTC
That thread doesn't hold any locks. It's completely unsynchronized. Here's the full source code:

        new Thread() {
            { setDaemon(true); }

            public void run() {
                while(true) {
                    try {
                        sleep(500);
                        printSolution();
                        stat();
                    } catch(InterruptedException ie) {
                        return;
                    }
                }
            }
        }.start();
Comment 9 kirillkh 2009-07-07 11:11:50 UTC
To clarify, the only possible hazard from the other thread is that it prints to System.out. There was at least one watch
expression that called a function that printed something to stdout, as well. Could this be the reason for the lock up? I
can see why it could happen, if NB allowed the paused thread to run for a brief period (even though it shouldn't). Then
the thread might get suspended again in the middle of I/O, possibly while holding an I/O lock in the native code. Is
this kind of scenario possible?
Comment 10 Martin Entlicher 2009-07-07 16:08:55 UTC
This is possible. When one thread is suspended while it's printing something out, no other thread can print in parallel.
But according to the screenshot, "Thread-0" is suspended at Thread.sleep, which should not interfere with other calls.

It would be best if you could provide some sample project on which we could reproduce the problem (at least once per
several attempts).
Comment 11 kirillkh 2009-07-07 17:53:47 UTC
I can confirm seeing this without pausing anything. Happens straight away after it starts on a breakpoint. Several step
overs, and it's stuck. Tried waiting for several seconds after each step, doesn't help.
Comment 12 kirillkh 2009-07-07 18:06:13 UTC
I've been able to reproduce the issue after removing the watch expression that printed to stdout, but only once. I can't
reproduce it without that watch expression anymore, and I am still able to reproduce it with the watch expression.

I can send you the source code, but it should not be made accessible to a 3rd party.
Comment 13 Martin Entlicher 2009-07-23 17:06:49 UTC
I've got a testcase from kirillkh, working on identification of the problem...
Comment 14 Filip Zamboj 2009-10-07 17:54:35 UTC
As vsiegler asked me I tried to reproduce the problem on x64 Linux 

i did not reproduce on any of these two builds:

Product Version: NetBeans IDE 6.8 Beta (Build 200910020947)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

Product Version: NetBeans IDE 6.7 (Build 200906241340)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

i even tried to hold F8 button a while and IDE never got locked/frozen
Comment 15 Vojtech Sigler 2009-10-16 14:37:15 UTC
Tried to reproduce on the following (jdk the same as kirillkh used):

Product Version: NetBeans IDE 6.7 (Build 200906241340)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02
System: Linux version 2.6.31-11-generic running on amd64; UTF-8; en_US (nb)

Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02
System: Linux version 2.6.31-11-generic running on amd64; UTF-8; en_US (nb)

Product Version: NetBeans IDE Dev (Build 200910160201)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02
System: Linux version 2.6.31-11-generic running on amd64; UTF-8; en_US (nb)

The same also with:
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

I am unable to reproduce this no matter how hard I try - stepping into, over, out, adding various watches.
Comment 16 Martin Entlicher 2009-10-16 14:45:38 UTC
Thanks a lot Filipe and Vojto.

Kirill, unfortunately I have to close this as works-for-me, since we're not able to reproduce this issue, even with the
code that you've provided.

Please try the 6.8 M2 or the upcoming beta.
Comment 17 Marian Mirilovic 2010-05-19 09:29:57 UTC
verified in NB 6.9 - closing