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 117386 - com.sun.jdi.IncompatibleThreadStateException
Summary: com.sun.jdi.IncompatibleThreadStateException
Status: CLOSED DUPLICATE of bug 137461
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Entlicher
URL: http://statistics.netbeans.org/except...
Keywords:
: 118353 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-10-01 22:40 UTC by _ gtzabari
Modified: 2010-04-29 09:35 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 1011


Attachments
stacktrace (912 bytes, text/plain)
2007-10-01 22:40 UTC, _ gtzabari
Details
stacktrace (912 bytes, text/plain)
2007-10-05 01:21 UTC, emiddio
Details
stacktrace (912 bytes, text/plain)
2007-10-11 10:29 UTC, vtec
Details
stacktrace (912 bytes, text/plain)
2008-02-05 02:44 UTC, _ gtzabari
Details
stacktrace (912 bytes, text/plain)
2008-03-06 14:47 UTC, pribyl
Details
ide log (1.66 MB, text/plain)
2008-03-06 15:59 UTC, unr303
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2007-10-01 22:40:30 UTC
Build: NetBeans IDE Dev (Build 200709150000)
VM: Java HotSpot(TM) Client VM, 11.0-b06
OS: Windows XP, 5.1, x86

User Comments:
Comment 1 _ gtzabari 2007-10-01 22:40:38 UTC
Created attachment 49943 [details]
stacktrace
Comment 2 Martin Entlicher 2007-10-02 17:00:38 UTC
Something had to resume the thread in the mean time.
Likely a synchronization issue.
Comment 3 emiddio 2007-10-05 01:20:57 UTC
Build: NetBeans IDE 6.0 Beta 1 (Build 200709141330)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
Comment 4 emiddio 2007-10-05 01:21:04 UTC
Created attachment 50235 [details]
stacktrace
Comment 5 Martin Entlicher 2007-10-10 18:23:17 UTC
*** Issue 118353 has been marked as a duplicate of this issue. ***
Comment 6 vtec 2007-10-11 10:29:31 UTC
Build: NetBeans IDE Dev (Build 200710071200)
VM: Java HotSpot(TM) Client VM, 1.6.0_05-ea-b04
OS: Windows XP, 5.1, x86

User Comments: 
I was debugging UI test - had the test thread stopped then EDT got stopped and I wanted to make the EDT running again without getting the main test thread moving. There does not seeems to be a way how to do it directly the CONTINUE button makes all threads running.
So I clicked the 'suspend' checkbox in threads view trying to make all treads running apart from the main thread. Endless chain of error popup dialogs followed - REALLY DISSASTER - please increase the PRIORITY!
Comment 7 vtec 2007-10-11 10:29:43 UTC
Created attachment 50671 [details]
stacktrace
Comment 8 Martin Entlicher 2007-10-12 18:21:47 UTC
I've managed to reproduce this problem.
The result is really critical, I had to kill the IDE. I was flooded with a mix of
com.sun.jdi.IncompatibleThreadStateException and com.sun.jdi.InternalException: Unexpected JDWP Error: 13, finally also
java.lang.StackOverflowError because of too many opened dialogs.
Comment 9 Martin Entlicher 2007-10-12 19:25:49 UTC
Logger is now used instead of ErrorManager, so that we are not flooded with the strange dialogs.
But the original problem is still there.

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/JPDAThreadImpl.java,v  <-- 
JPDAThreadImpl.java
new revision: 1.38; previous revision: 1.37
Comment 10 Martin Entlicher 2007-10-15 14:53:15 UTC
This does not occur for me during suspend, but after continue.
I've managed to assemble s set of steps that reliably lead to this exception:

- Start debugging of Anagram game
- Put line breakpoint at the first line of "guessedWordActionPerformed" method.
- Write some text into "Your Guess" field and press Enter
- Breakpoint is hit
- Do Continue
- Do Pause
- In Threads view resume AWT-EventQueue-0 and AWT-XAWT threads
- Write some text into "Your Guess" field and press Enter
- After the breakpoint is hit, do Continue
- An indefinite row of exceptions will follow.

I hope that this will help me to find the problem and fix this soon.
Comment 11 Martin Entlicher 2007-10-16 10:17:42 UTC
The problem should be fixed now in trunk:

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v  <-- 
JPDADebuggerImpl.java
new revision: 1.130; previous revision: 1.129

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/JPDAThreadImpl.java,v  <-- 
JPDAThreadImpl.java
new revision: 1.39; previous revision: 1.38

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/ObjectTranslation.java,v  <-- 
ObjectTranslation.java
new revision: 1.11; previous revision: 1.10

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java,v  <--  Operator.java
new revision: 1.50; previous revision: 1.49
Comment 12 unr303 2008-01-21 14:55:48 UTC
I still get this exception in 6.0. Last record in log dated by Oct 16 2007. Does this mean that bug (or one of) is still
there??

Started to debug application and these exceptions start to flow one by one.

There are like 3mb of text like that in log file.

WARNING [org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl]: Thread 'Signal Dispatcher': status = 1, is suspended
= false, suspend count = 0, is at breakpoint = false, internal suspend status = true
com.sun.jdi.IncompatibleThreadStateException
	at com.sun.tools.jdi.ThreadReferenceImpl.ownedMonitors(ThreadReferenceImpl.java:398)
[catch] at org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl.getOwnedMonitors(JPDAThreadImpl.java:731)
	at org.netbeans.modules.debugger.jpda.ui.models.MonitorModel.getChildren(MonitorModel.java:136)
	at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:618)
	at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:2799)
	at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.evaluateLazily(TreeModelNode.java:701)
	at org.netbeans.modules.viewmodel.TreeModelNode$LazyEvaluator.run(TreeModelNode.java:1118)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
WARNING [org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl]: Thread 'Attach Listener': status = 1, is suspended =
false, suspend count = 0, is at breakpoint = false, internal suspend status = true
com.sun.jdi.InternalException: Unexpected JDWP Error: 13
	at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
	at com.sun.tools.jdi.ThreadReferenceImpl.currentContendedMonitor(ThreadReferenceImpl.java:433)
[catch] at org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl.getContendedMonitor(JPDAThreadImpl.java:677)
	at org.netbeans.modules.debugger.jpda.ui.models.MonitorModel.getChildren(MonitorModel.java:136)
	at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:618)
	at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:2799)
	at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.evaluateLazily(TreeModelNode.java:701)
	at org.netbeans.modules.viewmodel.TreeModelNode$LazyEvaluator.run(TreeModelNode.java:1118)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)


  Product Version         = NetBeans IDE 6.0 (Build 200711261600)
  Operating System        = Windows XP version 5.1 running on x86
Comment 13 kirsten 2008-01-28 10:58:00 UTC
i was told to upgrade to netbeans 6.0, but i did that a while ago (Product Version: NetBeans IDE 6.0 (Build
200711261600)) and am still experiencing this problem

Comment 14 _ gtzabari 2008-02-05 02:44:13 UTC
Build: NetBeans IDE Dev (Build 200802021203)
VM: Java HotSpot(TM) Client VM, 11.0-b11
OS: Windows Vista, 6.0, x86

User Comments: 
Comment 15 _ gtzabari 2008-02-05 02:44:16 UTC
Created attachment 56028 [details]
stacktrace
Comment 16 Exceptions Reporter 2008-02-11 17:00:30 UTC
THIS ISSUE HAS ALREADY 50 DUPLICATES
Comment 17 Martin Entlicher 2008-02-13 08:41:11 UTC
This occasionally happens to me, but I have no reliable steps to reproduce yet... :-(
Comment 18 pribyl 2008-03-06 14:47:38 UTC
Build: NetBeans IDE Dev (Build 200803050006)
VM: Java HotSpot(TM) Client VM, 10.0-b19
OS: SunOS, 5.11, x86

User Comments: 
Comment 19 pribyl 2008-03-06 14:47:41 UTC
Created attachment 57881 [details]
stacktrace
Comment 20 unr303 2008-03-06 15:59:35 UTC
Created attachment 57895 [details]
ide log
Comment 21 unr303 2008-03-06 16:05:18 UTC
Ignore last attachment please. It was for another issue. Sorry.
Comment 22 Martin Entlicher 2008-03-28 12:14:03 UTC
This exception can be reproduced by running ClassBreakpointTest.
So far it looks like the problem happens when JDI sends an event set with more then one event. Our event processing
resume the thread somewhere while the first event is processed and thus when the second event is being processed, the
thread is unexpectedly already resumed.
Comment 23 Martin Entlicher 2008-03-28 14:03:38 UTC
Well, it looks like the test reproduces a slightly different problem, is does not explain the problem with loading
monitors. But definitely it shows a way how to get the debugger into an inconsistent state.
The test resumes the thread itself at ClassBreakpointTest.java:86 as a response to the first event, which notifies about
debugger being suspended.
Comment 24 Martin Entlicher 2008-03-28 20:29:44 UTC
The inconsistency that could occur between event processing should be eliminated now.
It looks like it has also fixed the problem with thread monitors. Can you please verify that?
http://hg.netbeans.org/main/rev/bad4285727fc
Thanks.
Comment 25 Michel Graciano 2008-05-21 19:02:09 UTC
I am facing this for 6.1 FCS...
Comment 26 Martin Entlicher 2008-05-26 15:14:08 UTC
hmichel, can you please attach a fresh exception stack trace from 6.1 FCS so that we can see where the problem remains?
Thanks.
Comment 27 Daniel Prusa 2008-06-19 16:35:10 UTC
Closing this as duplicate of issue 137461 since a reproducible test case is there.

*** This issue has been marked as a duplicate of 137461 ***
Comment 28 Quality Engineering 2010-04-29 09:35:39 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.