★ wanayoo — archive 1999 https://github.com/microsoft/vscode-java-debug/issues/782Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conditional breakpoint fails if String condition is set/used #782

Closed
blassmegod opened this issue Mar 20, 2020 · 3 comments
Closed

conditional breakpoint fails if String condition is set/used #782

blassmegod opened this issue Mar 20, 2020 · 3 comments
Labels
bug
Milestone

Comments

@blassmegod
Copy link

@blassmegod blassmegod commented Mar 20, 2020

[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
  1. [step 1]
    Set a conditional breakpoint with string condition
  2. [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.

Additional Informations
@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Mar 23, 2020

Cannot reproduce it. Could you share the whole context and the conditional expression you used?

@blassmegod
Copy link
Author

@blassmegod blassmegod commented Mar 25, 2020 •

Hi @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")
image

@no-response no-response bot removed the needs more info label Mar 25, 2020
@testforstephen
Copy link
Contributor

@testforstephen testforstephen commented Mar 26, 2020

@blassmegod, thank you for the details. i can reproduce it with your sample project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.