Repository navigation
Description
[provide a description of the issue]
Environment
- Operating System: Windows 10 x64
- JDK version:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.242-b08, mixed mode) - Visual Studio Code version:
Version: 1.43.1 (system setup)
Commit: fe22a9645b44368865c0ba92e2fb881ff1afce94
Date: 2020-03-18T07:01:20.184Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.17763 - Java extension version: 0.58.0 (March 5th, 2020)
- Java Debugger extension version: 0.25.1 - 2020-03-06
Steps To Reproduce
- [step 1]
Set a conditional breakpoint with string condition - [step 2]
Debug and wait to stop at breakpoint
[attach a sample project reproducing the error]
attach logs
[Warn - 10:32:00] 20-Mar-2020 10:32:00 Failed to destory launch files, will retry again.
[Error - 10:32:11] 20-Mar-2020 10:32:11 [ConditionalBreakpoint]:
org.eclipse.debug.core.DebugException:
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:829)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:3641)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
at java.util.Stack.pop(Stack.java:84)
at org.eclipse.jdt.internal.debug.eval.ast.engine.Interpreter.pop(Interpreter.java:165)
at org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction.pop(Instruction.java:108)
at org.eclipse.jdt.internal.debug.eval.ast.instructions.SendMessage.execute(SendMessage.java:52)
at org.eclipse.jdt.internal.debug.eval.ast.engine.Interpreter.execute(Interpreter.java:69)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable$1EvaluationRunnable.run(ASTEvaluationEngine.java:751)
at org.eclipse.jdt.internal.debug.core.model.JDIThread.runEvaluation(JDIThread.java:849)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:804)
... 2 more
[Error - 10:32:11] 20-Mar-2020 10:32:11 [ConditionalBreakpoint]:
org.eclipse.debug.core.DebugException:
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:829)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:3641)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException
at org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction.setLastValue(Instruction.java:48)
at org.eclipse.jdt.internal.debug.eval.ast.instructions.SendMessage.execute(SendMessage.java:71)
at org.eclipse.jdt.internal.debug.eval.ast.engine.Interpreter.execute(Interpreter.java:69)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable$1EvaluationRunnable.run(ASTEvaluationEngine.java:751)
at org.eclipse.jdt.internal.debug.core.model.JDIThread.runEvaluation(JDIThread.java:849)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:804)
... 2 more
[Error - 10:32:11] 20-Mar-2020 10:32:11 [ConditionalBreakpoint]:
org.eclipse.debug.core.DebugException:
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:829)
at org.eclipse.jdt.internal.debug.core.model.JDIThread$ThreadJob.run(JDIThread.java:3641)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException
at org.eclipse.jdt.internal.debug.eval.ast.instructions.Instruction.setLastValue(Instruction.java:48)
at org.eclipse.jdt.internal.debug.eval.ast.instructions.SendMessage.execute(SendMessage.java:71)
at org.eclipse.jdt.internal.debug.eval.ast.engine.Interpreter.execute(Interpreter.java:69)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable$1EvaluationRunnable.run(ASTEvaluationEngine.java:751)
at org.eclipse.jdt.internal.debug.core.model.JDIThread.runEvaluation(JDIThread.java:849)
at org.eclipse.jdt.internal.debug.eval.ast.engine.ASTEvaluationEngine$EvalRunnable.run(ASTEvaluationEngine.java:804)
... 2 more
Current Result
Result of breakpoint condition '"something".equals(xRole)' is not a boolean, please correct your expression.
Expected Result
That the condition inside the conditional breakpoint is evaluated correctly.
Activity
testforstephen commentedon Mar 23, 2020
Cannot reproduce it. Could you share the whole context and the conditional expression you used?
blassmegod commentedon Mar 25, 2020
Hi Jinbo Wang (@testforstephen), just found out when this happens, it happens only when the conditional breakpoint is used in a part of code that runs in parallel, so when the breakpoint needs to be evaluated on more parallel threads. For example, in this case, all threads that run that code stop on the conditional breakpoint, vscode messages that the breakpoint is not a valid boolean, but if I continue all other suspended threads but one, then the breakpoint can be evaluated on that point.
So it looks like it's happening only on parallel threads.
I have created a test:

vscode_debug_test.zip
breakpoint has condition: "s".equals("threex22")
testforstephen commentedon Mar 26, 2020
blassmegod, thank you for the details. i can reproduce it with your sample project.