teragrep / pth_03

Data Processing Language (DPL) parser
GNU Affero General Public License v3.0
0 stars 4 forks source link

Invalid eval query causes NullPointerException #37

Closed StrongestNumber9 closed 1 month ago

StrongestNumber9 commented 1 month ago

Describe the bug

| eval a=eval bc]

->

java.lang.NullPointerException
    at com.teragrep.pth_07.DPLExecutor$2.syntaxError(DPLExecutor.java:161)
    at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.ProxyErrorListener.syntaxError(ProxyErrorListener.java:41)
    at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.Parser.notifyErrorListeners(Parser.java:544)
    at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.DefaultErrorStrategy.reportUnwantedToken(DefaultErrorStrategy.java:377)
    at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.DefaultErrorStrategy.singleTokenDeletion(DefaultErrorStrategy.java:548)
    at com.teragrep.pth_03.shaded.org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:266)
    at com.teragrep.pth_03.antlr.DPLParser.evalStatement(DPLParser.java:15504)
    at com.teragrep.pth_03.antlr.DPLParser.t_eval_evalParameter(DPLParser.java:35135)
    at com.teragrep.pth_03.antlr.DPLParser.evalTransformation(DPLParser.java:35067)
    at com.teragrep.pth_03.antlr.DPLParser.transformStatement(DPLParser.java:7342)
    at com.teragrep.pth_03.antlr.DPLParser.transformStatement(DPLParser.java:8073)
    at com.teragrep.pth_03.antlr.DPLParser.root(DPLParser.java:3128)
    at com.teragrep.pth_07.DPLExecutor.interpret(DPLExecutor.java:170)
    at com.teragrep.pth_07.DPLInterpreter.internalInterpret(DPLInterpreter.java:159)

Expected behavior

Prints syntax error

How to reproduce

Use query | eval a=eval bc]

Software version

pth_03 version: 5.11.0

StrongestNumber9 commented 1 month ago

Please close and create a ticket if wrong repo

grafour commented 1 month ago

how do you reproduce this? just | eval a=eval bc] in the CLI?

51-code commented 1 month ago

It seems like the syntax error doesn't always have a message, so when PTH-07 tries to log it, it throws an NPE. I'll move this issue to PTH-07.

51-code commented 1 month ago

New issue created here: PTH-07 #13.