Community
Participate
Working Groups
Version: 3.8.0 Build id: I20110823-0925 Trying to debug a dead-lock bug I turned on "Show Monitors" in the debug view and suspended the target I was interested in. As I began to drill down into a suspended thread to see what locks it held I got the following exception: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(Unknown Source) at org.eclipse.jdt.internal.debug.core.model.JDIReferenceType.getTypeName(JDIReferenceType.java:264) at org.eclipse.jdt.internal.debug.core.model.JDIReferenceType.getGenericName(JDIReferenceType.java:235) at org.eclipse.jdt.internal.debug.core.model.JDIObjectValue.getReferenceTypeName(JDIObjectValue.java:341) at org.eclipse.jdt.internal.debug.ui.JDIModelPresentation.getValueText(JDIModelPresentation.java:436) at org.eclipse.jdt.internal.debug.ui.JDIModelPresentation.getJavaContendedMonitorText(JDIModelPresentation.java:291) at org.eclipse.jdt.internal.debug.ui.JDIModelPresentation.getText(JDIModelPresentation.java:234) at org.eclipse.debug.internal.ui.LazyModelPresentation.getText(LazyModelPresentation.java:185) at org.eclipse.debug.internal.ui.DelegatingModelPresentation.getText(DelegatingModelPresentation.java:158) at org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider.getLabel(DebugElementLabelProvider.java:35) at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider.getLabel(ElementLabelProvider.java:312) at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider.retrieveLabel(ElementLabelProvider.java:215) at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider$LabelUpdater.run(ElementLabelProvider.java:160) at org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider$LabelJob.run(ElementLabelProvider.java:74) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
The problem is two-fold: 1. I had manually suspended the debug target, meaning object information is not available 2. this causes the value of '<unknown>' to be passed around as native object names, which is what is causing the SIOOBE because we think it is a generic signature.
Created attachment 203441 [details] fix
Pushed changes to master.
This fix is not good. I now get "null null" displayed as value in the 'Variables' view. Test case: 1. paste: public static void main(String[] args) { Object a= null; System.out.println(a); } 2. set breakpoint on second line in body 3. Debug
pushed updated fix + regression tests to master. Please verify Curtis.
>JDT / Platform Debug would also like to contribute to a re-build. We are tagged >and ready to go. Did that not work? I still see the bug in I20111011-1046. Works in N20111011-2000.
(In reply to comment #6) > >JDT / Platform Debug would also like to contribute to a re-build. We are tagged > >and ready to go. > Did that not work? I still see the bug in I20111011-1046. Works in > N20111011-2000. Chatting with Kim, apparently my email did not make it to her prior to the build starting, so the fix is *not* in the I-build.
verified in I20111027-1800 As a note, a good test case to verify the fix is to follow the steps from bug 345298, and once the deadlock occurs - in your target workspace - suspend the VM in your host.