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 188507 - Debugger used to work and now freezes and does not show local variables or watches
Summary: Debugger used to work and now freezes and does not show local variables or wa...
Status: RESOLVED INCOMPLETE
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 normal (vote)
Assignee: issues@debugger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-08 20:26 UTC by netbeansuzr
Modified: 2010-07-09 13:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
The log file from netbeans when the error happened (88.37 KB, application/octet-stream)
2010-07-08 20:26 UTC, netbeansuzr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description netbeansuzr 2010-07-08 20:26:36 UTC
Created attachment 100710 [details]
The log file from netbeans when the error happened

I have been using Netbeans 6.1 for a long time and my debugger has always been flawless. Somehow recently (within the last two weeks or so) my debugger stops at breakpoints but it either freezes most of the time or i can't find out the value of any variable, my local variables wont expand and my watches will sometimes show all nulls even for this.hashCode() or not even update at all and freeze.

When this happens i see the following netbeans exceptions

com.sun.jdi.InternalException: Unexpected JDWP Error: 502 at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47) at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379) at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164) at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844) at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.invokeMethod(AbstractObjectVariable.java:417) at org.netbeans.modules.debugger.jpda.ui.models.JavaVariablesFilter.getChildren(JavaVariablesFilter.java:133) at org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter.getChildren(VariablesTreeModelFilter.java:193) at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:628) at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:2819) at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.evaluateLazily(TreeModelNode.java:701) at org.netbeans.modules.viewmodel.TreeModelNode$LazyEvaluator.run(TreeModelNode.java:1124) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

com.sun.jdi.InternalException: Unexpected JDWP Error: 502 at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47) at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379) at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164) at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844) at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:315) at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:285) at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getLimitedToString(VariablesNodeModel.java:316) at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getShortDescriptionSynch(VariablesNodeModel.java:275) at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel$1.run(VariablesNodeModel.java:233) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

Does anybody know how to fix or workaround this problem? I have googled this exception but can't find anything of value. The only thing i found is about running two different JVMs, one to debug and one to run the application (but this is not the case for me, both JVMs are the exact same version "1.4.2_03"). I am running into this issue at work so upgrading Java or my IDE is not an option, though it this was fixed in a newer version of the IDE i would still like to know that but most importantly I really need a fix or workaround for this. I have also not changed any settings in my project or NetBeans that i am aware of from the time my debugger was working to now.

Thanks

append:  I also got the following error

A com.sun.jdi.InternalException exception has occurred.
Please report this at http://www.netbeans.org/community/issues.html,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your C:\Documents and Settings\default\.netbeans\6.1\var\log folder.
Comment 1 Martin Entlicher 2010-07-09 12:10:10 UTC
Unexpected JDWP Error: 502 means ALREADY_INVOKING - Previous invoke not complete.

That means that there is an attempt to invoke a method (like this.hashCode() for instance), but there is some ongoing method invocation already running. Since debugger forbids to invoke a method from within a method invocation, it throws this error.

The only solution IMHO is to restart both NetBeans and the application you're debugging.

Without exact steps how to reproduce such situation we can not fix this, since it's not apparent which method invocation is running. It may be a bug in NetBeans as well as in the debugger backend in JVM.

If you're running often into this problem (even after restart of both the debugger and your application), please submit steps how can we reproduce it. Until then, resolving as incomplete.
Comment 2 netbeansuzr 2010-07-09 13:16:20 UTC
I am indeed running into this consistently but at random times.  I have been using NetBeans for a long time and the debugger has always been solid for me.  For some reason in the last week or two it's consistently failing now (after a few debugging runs through the same breakpoints) at random times.  I can't give you code to reproduce it however because it's on our app at work which is quite large.  What i see is this:

-debugger stops on breakpoints correctly
-sometimes i can hover my mouse over a variable and i will get the value
 other times it gives me nothing, at which point if i try to expand the variable in the local variable list, it freezes the debugger (usually has the hourglass  icon while expanding and never finishes
-sometimes the debugger fails by giving me a value of null for my watches (this includes this.hashCode() which is impossible for it to be null)

things i have tried:
-i have restarted NetBeans, did a clean and recompile throuh the IDE, verified that the netbeans project uses the same version of java as the application while running
-i also tried with a different project (that i haven't used for a while) to see if it's corruption but i got the same problem

I am also attaching the debugger after the application starts if this matters (but this is how i've always done it and it always worked)

Any chance this is fixed in a new version of NetBeans and is NetBeans 6.9 backwards compatible with 6.1's project settings?  Also can i develop on 6.9 (for form files expecially) while my colegues use 6.1 concurrently?

Also is there any chance that something in NetBeans of the JDK got corrupted somehow?

Please suggest some workarounds if you can.  The debugger is extremely useful to me in my day to day development

Thanks!
Comment 3 netbeansuzr 2010-07-09 13:27:46 UTC
Is there anything i should check when i run into this problem?

Also , thanks for the description of the error code, but could you please clarify the following point:

"That means that there is an attempt to invoke a method (like this.hashCode()
for instance), but there is some ongoing method invocation already running.".

Do you mean that the debugger is trying to invoke this.hashCode() for example, while the debugger is trying to get the value of another method call?  Ie. who invoked this other ongoing method invocation that's already running?