Community
Participate
Working Groups
We've found a race condition in debug events handling in 3.8.2, but the same code is in 4.7 head. In our code we rely on JavaThreadEventHandler.indexOf(IStackFrame) returning the proper index to select the right stack element in the Debug view on the "suspended" event. In some cases this method does not work properly - namely, if there is an evaluation running at same time as the "suspended" event is sent to clients. In this case, IThread.getStackFrames() returns empty array (expected and documented) and indexOf() returns -1 (not expected because not documented), the debug view can't select the right frame and the "suspend/resume" buttons shows the wrong state. In our code we created a workaround and let indexOf() detect the running evaluation and simply wait some time, but I'm not sure if this can be accepted as a general solution. Anyway, I plan to push a test case and a possible patch soon.
New Gerrit change created: https://git.eclipse.org/r/96043
Gerrit change https://git.eclipse.org/r/96043 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=2d76f25b443d60c75ffb3888e3977480934325e8
http://download.eclipse.org/eclipse/downloads/drops4/I20170521-0800/testresults/html/org.eclipse.jdt.debug.tests_ep47I-unit-mac64_macosx.cocoa.x86_64_8.0.html testComputeFrameIndexDuringEvaluation Failure expected:<0> but was:<-1> junit.framework.AssertionFailedError: expected:<0> but was:<-1> at org.eclipse.jdt.debug.tests.breakpoints.JavaThreadEventHandlerTests$1.performChecks(JavaThreadEventHandlerTests.java:157) at org.eclipse.jdt.debug.tests.breakpoints.JavaThreadEventHandlerTests.doEvalAndRunInParallel(JavaThreadEventHandlerTests.java:211) at org.eclipse.jdt.debug.tests.breakpoints.JavaThreadEventHandlerTests.testComputeFrameIndexDuringEvaluation(JavaThreadEventHandlerTests.java:164) at org.eclipse.jdt.debug.tests.AbstractDebugTest.runBare(AbstractDebugTest.java:2528) at org.eclipse.jdt.debug.tests.DebugSuite$1.run(DebugSuite.java:57) at java.lang.Thread.run(Thread.java:745)
(In reply to Sarika Sinha from comment #3) > http://download.eclipse.org/eclipse/downloads/drops4/I20170521-0800/ > testresults/html/org.eclipse.jdt.debug.tests_ep47I-unit-mac64_macosx.cocoa. > x86_64_8.0.html > > testComputeFrameIndexDuringEvaluation Failure expected:<0> but was:<-1> I've created bug 517071.