github / github/codeql

CatastrophicError does not include context information

Open
#9,000 0 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

### Version
CodeQL CLI v2.9.0

### Description
When a `CatastrophicError` occurs during `codeql query compile` no context information, such as the currently compiled query file, is printed to console. This makes troubleshooting cumbersome when running multi-threaded compilation.

An example for this can be seen in [this workflow log](https://github.com/Marcono1234/codeql-java-queries/runs/6248450591?check_suite_focus=true#step:8:326):
```
Compiling query plan for /home/runner/work/codeql-java-queries/codeql-java-queries/codeql-custom-queries-java/queries/likely-bugs/null-check-on-this.ql.
Done [154/385 comp 3s] /home/runner/work/codeql-java-queries/codeql-java-queries/codeql-custom-queries-java/queries/likely-bugs/null-check-on-this.ql.
Compiling query plan for /home/runner/work/codeql-java-queries/codeql-java-queries/codeql-custom-queries-java/queries/likely-bugs/nullness-annotation-on-primitive.ql.
Done [155/385 comp 3.1s] /home/runner/work/codeql-java-queries/codeql-java-queries/codeql-custom-queries-java/queries/likely-bugs/nullness-annotation-on-primitive.ql.
Compiling query plan for /home/runner/work/codeql-java-queries/codeql-java-queries/codeql-custom-queries-java/queries/likely-bugs/nullness-check-on-primitive.ql.
Oops! A fatal internal error occurred.
com.semmle.util.exception.CatastrophicError: Primitive directionalBind has more than one unbound field: [DataFlowImpl::TNodeEx#17aa0c36 this, DataFlowImpl::TNodeEx#17aa0c36 result]
at com.semmle.inmemory.planner.translate.TermTranslator$Result.applyPrimitiveAsKnownColumnOp(TermTranslator.java:625)
...
```

Since the compilation of multiple queries was ongoing at this point, it is not clear for which of them the compilation failed. In this specific case none of the queries shown in the snippet above failed, but instead a query shown a few lines above.

(The `CatastrophicError` itself is described in #8999)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.