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

Crash when CodeQL evaluator log summary is too large #2787

Open
dbartol opened this issue Sep 6, 2023 · 2 comments
Open

Crash when CodeQL evaluator log summary is too large #2787

dbartol opened this issue Sep 6, 2023 · 2 comments
Assignees
Labels
bug Something isn't working VSCode

Comments

@dbartol
Copy link
Contributor

dbartol commented Sep 6, 2023

Reported by several internal users:

[2023-09-06 14:13:16] Evaluation of .../code/ql/java/ql/src/Security/CWE/CWE-022/TaintedPath.ql produced BQRS results.
Error running query: Cannot create a string longer than 0x1fffffe8 characters (codeQL.quickEvalContextEditor)
Error: Error running query: Cannot create a string longer than 0x1fffffe8 characters
    at Object.slice (node:buffer:599:37)
    at Buffer.toString (node:buffer:819:14)
    at readFileHandle (node:internal/fs/promises:427:36)
    at generateSummarySymbols (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:144496:19)
    at generateSummarySymbolsFile (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:144492:19)
    at generateEvalLogSummaries (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:144889:7)
    at LocalQueryRun.summarizeEvalLog (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:145690:26)
    at LocalQueryRun.complete (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:145668:26)
    at LocalQueries.compileAndRunQueryInternal (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:146085:9)
    at LocalQueries.compileAndRunQuery (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:146025:5)
    at withProgress.title (~/.vscode/extensions/github.vscode-codeql-1.8.10/out/extension.js:145904:9)

The suspicion is that the log summary is too large to load as a single string, so we need to stream it.

@dbartol dbartol added the bug Something isn't working label Sep 6, 2023
@dbartol dbartol self-assigned this Sep 6, 2023
@github-actions github-actions bot added the VSCode label Sep 6, 2023
@aeisenberg
Copy link
Contributor

When this happens, is this indicative of a malformed query? If so, rather than actually trying to stream the JSON parsing into the file, we can just pop up a warning and say we're not even going to try to write the evaluator log. Instead we can suggest that the user reformulates their query so the log is shorter.

@aschackmull
Copy link

When this happens, is this indicative of a malformed query?

No. Long-tailed recursions generate a lot of log output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working VSCode
Projects
None yet
Development

No branches or pull requests

4 participants