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 156408 - com.sun.jdi.IncompatibleThreadStateException at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames
Summary: com.sun.jdi.IncompatibleThreadStateException at com.sun.tools.jdi.ThreadRefer...
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
: 157274 160878 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-01-07 11:17 UTC by Jiri Prox
Modified: 2010-04-29 09:46 UTC (History)
16 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 144940


Attachments
stacktrace (695 bytes, text/plain)
2009-01-07 11:17 UTC, Jiri Prox
Details
stacktrace (695 bytes, text/plain)
2009-01-13 12:39 UTC, Filip Zamboj
Details
stacktrace (695 bytes, text/plain)
2009-01-16 21:19 UTC, Peter Pis
Details
stacktrace (695 bytes, text/plain)
2009-01-30 16:52 UTC, sreimers
Details
stacktrace (695 bytes, text/plain)
2009-02-09 19:29 UTC, Exceptions Reporter
Details
stacktrace (695 bytes, text/plain)
2009-03-23 14:43 UTC, rajivderas
Details
stacktrace (695 bytes, text/plain)
2009-03-23 17:20 UTC, Filip Zamboj
Details
stacktrace (695 bytes, text/plain)
2009-04-03 14:30 UTC, big_al
Details
stacktrace (695 bytes, text/plain)
2009-04-10 17:09 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Prox 2009-01-07 11:17:49 UTC
Build: NetBeans IDE Dev (Build 20090107054509)
VM: Java HotSpot(TM) Client VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Linux, 2.6.24-22-generic, i386

User Comments:
jiriprox: ITSE occured when using Step over while debugging Netbeans.



Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:419)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:298)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:326)
Comment 1 Jiri Prox 2009-01-07 11:17:59 UTC
Created attachment 75532 [details]
stacktrace
Comment 2 Filip Zamboj 2009-01-13 12:39:14 UTC
Build: NetBeans IDE Dev (Build 200901121401)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-9-generic, i386

User Comments: 
this one has been thrown when stepping over expression (F8) 

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:392)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:311)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:419)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:298)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:326)
Comment 3 Filip Zamboj 2009-01-13 12:39:17 UTC
Created attachment 75747 [details]
stacktrace
Comment 4 Peter Pis 2009-01-16 21:19:45 UTC
Build: NetBeans IDE Dev (Build 200901160201)
VM: Java HotSpot(TM) Client VM, 1.5.0_16-133, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_16-b06-284
OS: Mac OS X, 10.5.5, i386

User Comments: 
Stepping over leads to exception (jFrame)

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:364)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:276)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:433)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:307)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:327)
Comment 5 Peter Pis 2009-01-16 21:19:54 UTC
Created attachment 75923 [details]
stacktrace
Comment 6 Martin Entlicher 2009-01-22 08:47:19 UTC
There's likely missing synchronization somewhere. Concrete steps to reproduce appreciated.
Comment 7 Exceptions Reporter 2009-01-22 08:53:19 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=144940
Comment 8 sreimers 2009-01-30 16:52:19 UTC
Build: NetBeans IDE Dev (Build 20090129031330)
VM: Java HotSpot(TM) Server VM, 11.0-b16, Java(TM) SE Runtime Environment, 1.6.0_11-b03
OS: Windows XP, 5.1, x86

User Comments: 
step over in debugger

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:433)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:307)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:327)
Comment 9 sreimers 2009-01-30 16:52:23 UTC
Created attachment 76393 [details]
stacktrace
Comment 10 Exceptions Reporter 2009-02-09 19:29:48 UTC
Build: NetBeans IDE Dev (Build 200902050256)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-11-generic, i386

User Comments: 
debugging starting up of a Tomcat Web Project that has a long startup time

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:392)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:311)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:433)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:307)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:327)
Comment 11 Exceptions Reporter 2009-02-09 19:29:59 UTC
Created attachment 76750 [details]
stacktrace
Comment 12 Martin Entlicher 2009-02-25 14:10:34 UTC
There are similar stack traces in issue #157274:
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.JPDAStepImpl.shouldNotStopHere(JPDAStepImpl.java:493)
        at org.netbeans.modules.debugger.jpda.JPDAStepImpl.exec(JPDAStepImpl.java:423)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:265)
        at java.lang.Thread.run(Thread.java:619)

and issue #158750:
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.exec(StepActionProvider.java:334)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:327)
        at java.lang.Thread.run(Thread.java:619)
Comment 13 Martin Entlicher 2009-02-25 14:10:49 UTC
*** Issue 157274 has been marked as a duplicate of this issue. ***
Comment 14 Martin Entlicher 2009-02-25 14:11:08 UTC
*** Issue 158750 has been marked as a duplicate of this issue. ***
Comment 15 Martin Entlicher 2009-02-25 16:51:41 UTC
Should be fixed by changeset:   118361:5c61cf2a4656
http://hg.netbeans.org/main/rev/5c61cf2a4656
Comment 16 Quality Engineering 2009-02-27 10:30:55 UTC
Integrated into 'main-golden', will be available in build *200902270313* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/5c61cf2a4656
User: mentlicher@netbeans.org
Log: #156408 - Assure that when an event is received, other threads can not change the event thread's state before all event executors are processed. Otherwise executors could get a resumed thread.
Comment 17 rajivderas 2009-03-23 14:43:01 UTC
Build: NetBeans IDE Dev (Build 20090321211250)
VM: OpenJDK Client VM, 14.0-b10, Java(TM) SE Runtime Environment, 1.6.0_14-ea-b01
OS: Windows XP, 5.1, x86

User Comments: 
happened while debugging a ejb bean and hit the  apply code changes button and started to debug again

using glass fish v2
ejb 3.0 stateful

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:438)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:311)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:338)
Comment 18 rajivderas 2009-03-23 14:43:11 UTC
Created attachment 78644 [details]
stacktrace
Comment 19 Martin Entlicher 2009-03-23 15:44:51 UTC
Unfortunately, the exception still occurs - see issue #160878.
Reopening...
Comment 20 Martin Entlicher 2009-03-23 15:45:10 UTC
*** Issue 160878 has been marked as a duplicate of this issue. ***
Comment 21 Filip Zamboj 2009-03-23 17:20:13 UTC
Build: NetBeans IDE Dev (Build 200903230201)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b02
OS: Linux, 2.6.27-11-generic, amd64

User Comments: 
I was stepping over a java class (no jdk source). It's AWT application

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:438)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:311)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:338)
Comment 22 Filip Zamboj 2009-03-23 17:20:23 UTC
Created attachment 78665 [details]
stacktrace
Comment 23 big_al 2009-04-03 14:30:00 UTC
Build: NetBeans IDE Dev (Build 200904011705)
VM: Java HotSpot(TM) 64-Bit Server VM, 1.6.0_07-b06-57, Java(TM) SE Runtime Environment, 1.6.0_07-b06-153
OS: Mac OS X, 10.5.6, x86_64

User Comments: 
Stepping through (debugging) enterprise application

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:118)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:438)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:311)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:338)
Comment 24 big_al 2009-04-03 14:30:10 UTC
Created attachment 79392 [details]
stacktrace
Comment 25 Marian Mirilovic 2009-04-10 17:09:19 UTC
Build: NetBeans IDE Dev (Build 200904100201)
VM: Java HotSpot(TM) 64-Bit Server VM, 11.3-b02, Java(TM) SE Runtime Environment, 1.6.0_13-b03
OS: Linux, 2.6.27-11-generic, amd64

User Comments: 
debugging web application

Stacktrace: 
com.sun.jdi.IncompatibleThreadStateException
        at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
        at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
        at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:131)
        at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.setLastOperation(StepActionProvider.java:438)
        at org.netbeans.modules.debugger.jpda.actions.StepIntoNextMethod.exec(StepIntoNextMethod.java:311)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:338)
Comment 26 Marian Mirilovic 2009-04-10 17:09:30 UTC
Created attachment 79912 [details]
stacktrace
Comment 27 Marian Mirilovic 2009-04-10 17:11:27 UTC
45 duplicates so far ... all for NB 6.7 
Comment 28 fmcorp 2009-04-13 21:25:14 UTC
FYI,  after submitting the error log, I cannot continue debugging the project.  The only debugging buttons available are
the 'Finish debugging session' and the 'Pause' button.  If hit F7 or F8, I get just a beep.  I must restart the
debugging session to continue.  This is pretty critical to the IDE's health IMHO.
Comment 29 Martin Entlicher 2009-04-14 13:12:47 UTC
It looks like something is resuming the thread, it is not suspended right after the step event, which cause the exception.
Comment 30 Martin Entlicher 2009-04-14 20:23:22 UTC
Hopefully finally fixed in changeset:   126779:17e33bdcc6cf
http://hg.netbeans.org/main/rev/17e33bdcc6cf

I'm not able to reproduce the exception after this change. Please verify.
Comment 31 Quality Engineering 2009-04-15 07:44:48 UTC
Integrated into 'main-golden', will be available in build *200904150201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/17e33bdcc6cf
User: mentlicher@netbeans.org
Log: #156408 - Assure that the thread is not resumed twice from the step action.
Comment 32 Martin Entlicher 2009-04-16 16:18:36 UTC
The fix had to be a little corrected in changeset:   127391:247eaacc8708
http://hg.netbeans.org/main/rev/247eaacc8708
Comment 33 Quality Engineering 2009-04-17 08:39:09 UTC
Integrated into 'main-golden', will be available in build *200904170201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/247eaacc8708
User: mentlicher@netbeans.org
Log: #156408 - Correction of the fix - the step action have to resume the stepping thread by default.
Comment 34 Filip Zamboj 2009-04-21 14:28:07 UTC
didn't reproduce on 
Product Version: NetBeans IDE 6.7 Beta (Build 200904192254)
Java: 1.6.0_13; Java HotSpot(TM) 64-Bit Server VM 11.3-b02

verified 
Comment 35 licvidator 2009-08-07 15:38:05 UTC
Not fixed.

com.sun.jdi.IncompatibleThreadStateException
	at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
	at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
	at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:132)
	at org.netbeans.modules.debugger.jpda.actions.StepActionProvider.exec(StepActionProvider.java:360)
	at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:352)
[catch] at java.lang.Thread.run(Thread.java:619)

It happens when I try to STEP OVER [F8] beyond breakpoint.

Checked on sipmlest code:

-----
package javaapplication1;

public class Main {
    public static void main(String[] args) {
        System.out.println("1"); // breakpoint here, try to step over
        System.out.println("2");
        System.out.println("3");
        System.out.println("4");
        System.out.println("5");
    }
}
-----
Info:
Product Version: NetBeans IDE 6.7.1 (Build 200907230233)
Java: 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02
System: Linux version 2.6.26-2-686 running on i386; UTF-8; en_US (nb)
Comment 36 Martin Entlicher 2009-08-10 16:20:45 UTC
Unfortunately, I was not able to reproduce this issue by following the above steps - stepping through this simple
program works fine for me in 6.7.1.

Since this is a random issue, it's hard to be sure that it's fixed. However, it looks like after fix of issue #167578
the probability of getting this exception at least significantly decreased. I was not able to reproduce this in a
stress-test of hundreds invocations of Step Over and Step Into.
So hopefully this will work fine in 6.8. If someone have some steps from scratch, that leads to this exception, they are
highly welcomed.
Comment 37 soupdragon 2009-09-28 16:13:30 UTC
I've just posted logs etc. on what may be an manifestation of the same issue to:

http://www.netbeans.org/issues/show_bug.cgi?id=168800

For us, this occurs every time we try to step the debugger with either step over or step into.

And we're completely up to date on 6.7.1
Comment 38 tdefeo23 2010-01-19 13:03:17 UTC
 When debugging an application (Netbeans 6.8), if the debugger options are set to:
"New breakpoints suspend all threads" and "Steps resume all threads"

Anytime you single step after hitting a breakpoint, the application continues as if continue were hit instead of single stepping.

This is reproducible even with a very simple hellp world application.

There appears to be an existing bug on this, # 156408, but apperantly they couldn't reproduce it. I believe the abocve debugger settings ("New breakpoints suspend all threads" and "Steps resume all threads") are the key to being able to reproduce this.

The following exception also appears in the IDE log:

com.sun.jdi.IncompatibleThreadStateException
at com.sun.tools.jdi.ThreadReferenceImpl.privateFrames(ThreadReferenceImpl.java:365)
at com.sun.tools.jdi.ThreadReferenceImpl.frame(ThreadReferenceImpl.java:277)
at org.netbeans.modules.debugger.jpda.jdi.ThreadReferenceWrapper.frame(ThreadReferenceWrapper.java:132)
at org.netbeans.modules
Comment 39 Martin Entlicher 2010-02-10 15:55:06 UTC
Thanks for these steps! I've reproduced the problem. :-)
Comment 40 Martin Entlicher 2010-02-11 06:41:21 UTC
Should be fixed by changeset:   159887:eda9ba0c105e
http://hg.netbeans.org/main/rev/eda9ba0c105e
There was set bad suspend policy and the threads were left running.
Comment 41 Quality Engineering 2010-02-11 21:24:14 UTC
Integrated into 'main-golden', will be available in build *201002120200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/eda9ba0c105e
User: mentlicher@netbeans.org
Log: #156408 - Set correct suspend policy.
Comment 42 Quality Engineering 2010-04-29 09:46:27 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.