github / codeql

CodeQL: the libraries and queries that power security researchers around the world, as well as code scanning in GitHub Advanced Security
https://codeql.github.com
MIT License
7.57k stars 1.52k forks source link

[C++] CLI doesn't work while VS Code Extention works fine #16083

Closed iiins0mn1a closed 5 months ago

iiins0mn1a commented 6 months ago

I've updated my toolchain to codeql-cli-v2.16.6 (ql-lib on tag v2.16.6 too). While a same query works fine with VS Code extension (with same cli binary), it reports a lot of ERRORs when I use CLI directly in command line.

These ERRORs seem to be internel errors, related log:

[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to FlowState, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:408,46-55)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to FlowState, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:414,47-56)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to FlowState, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:426,19-28)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to FlowState, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:426,49-58)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to isAdditionalFlowStep, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:442,7-27)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to isAdditionalFlowStep, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:443,7-27)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to isAdditionalFlowStep, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:444,7-27)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to isAdditionalFlowStep, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:445,7-27)
[2024-03-29 02:10:20] [ERROR] execute queries> ERROR: Predicate signature default may not refer to DataFlowCall, which is another member of the module signature. (<Path-Omitted-by-insomnia>/ql/shared/dataflow/codeql/dataflow/DataFlow.qll:80,47-59)

Hope to be replied. Thanks.

adityasharad commented 6 months ago

Thanks for the report. Could I please see the exact CLI invocation you are running when you see these errors?

iiins0mn1a commented 6 months ago

Hi @adityasharad . Thanks for your replying.

Sure, here is my command:

$CLI_PATH database analyze \
    --rerun \
    --format=sarifv2.1.0 \
    --output=$OUTPUT_PATH \
    --max-paths=8 \
    --ram=81920 \
    --evaluator-log=$EVA_PATH \
    --tuple-counting \
    --debug \
    --threads=24 \
    -- $DATABASE_PATH path:$QUERY_PATH
mbg commented 5 months ago

Hi @iiins0mn1a,

It looks like there may be a version mismatch going on somewhere. The fact that this worked fine before the update and also works in VSCode suggests that you may have different versions of the CLI / libraries somewhere.

Are you letting the VSCode extension manage its own CodeQL CLI independent of the one you are using from the command line?

iiins0mn1a commented 5 months ago

Hi @mbg , thanks for your reply. I checked the detailed configuration and found that it's really my carelessness to blame. Sorry for your troubling you. And I think I shall close this issue. Thanks again.

mbg commented 5 months ago

No problem at all! Good to hear that you have been able to resolve the problem.