github / github/codeql

TypeScript extraction hangs

未關閉
#17,827 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
question
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

We have an issue with CodeQL analysis where it would hang while extracting the files from the PR.

I've found which part was causing this and made a separate reproducible code snippet.
Here's a minimal reproducible example:

```
class Test {
static methodA>() {}
static methodB>() {}
}
```

Output logs

```
➜ temp-codeql-bug codeql version
CodeQL command-line toolchain release 2.19.2.
Copyright (C) 2019-2024 GitHub, Inc.
Unpacked in: /home/dubenko/codeql
Analysis results depend critically on separately distributed query and
extractor modules. To list modules that are visible to the toolchain,
use 'codeql resolve packs' and 'codeql resolve languages'.
➜ temp-codeql-bug codeql database create test --language=javascript --verbosity="progress+++" --overwrite
Writing logs to /home/dubenko/temp-codeql-bug/test/log/database-create-20241023.152003.392.log.
Initializing database at /home/dubenko/temp-codeql-bug/test.
Scanning for [codeql-extractor.yml] from /home/dubenko/codeql/.codeqlmanifest.json
Parsing /home/dubenko/codeql/csv/codeql-extractor.yml.
Parsing /home/dubenko/codeql/swift/codeql-extractor.yml.
Parsing /home/dubenko/codeql/cpp/codeql-extractor.yml.
Parsing /home/dubenko/codeql/properties/codeql-extractor.yml.
Parsing /home/dubenko/codeql/java/codeql-extractor.yml.
Parsing /home/dubenko/codeql/go/codeql-extractor.yml.
Parsing /home/dubenko/codeql/javascript/codeql-extractor.yml.
Parsing /home/dubenko/codeql/xml/codeql-extractor.yml.
Parsing /home/dubenko/codeql/yaml/codeql-extractor.yml.
Parsing /home/dubenko/codeql/html/codeql-extractor.yml.
Parsing /home/dubenko/codeql/ruby/codeql-extractor.yml.
Parsing /home/dubenko/codeql/python/codeql-extractor.yml.
Parsing /home/dubenko/codeql/csharp/codeql-extractor.yml.
Calculating baseline information in /home/dubenko/temp-codeql-bug
Ignoring the following directories when processing baseline information: .git, .hg, .svn.
Running command in /home/dubenko/temp-codeql-bug: /home/dubenko/codeql/tools/linux64/scc --by-file --exclude-dir .git,.hg,.svn --format json --no-large --no-min .
Running command in /home/dubenko/temp-codeql-bug: [/home/dubenko/codeql/javascript/tools/configure-baseline.sh]
Ignored an additional 92 files when processing baseline information for TypeScript Typings due to paths and paths-ignore configuration.
Ignored an additional 7 files when processing baseline information for JavaScript due to paths and paths-ignore configuration.
Found 2 baseline files for javascript.
Calculated baseline information for languages: javascript (69ms).
Resolving extractor javascript.
Found candidate extractor root for javascript: /home/dubenko/codeql/javascript.
Successfully loaded extractor JavaScript/TypeScript (javascript) from /home/dubenko/codeql/javascript.
Created skeleton CodeQL database at /home/dubenko/temp-codeql-bug/test. This in-progress database is ready to be populated by an extractor.
Running build command: []
Running command in /home/dubenko/temp-codeql-bug: [/home/dubenko/codeql/javascript/tools/autobuild.sh]
[2024-10-23 15:20:04] [build-stdout] Single-threaded extraction.
[2024-10-23 15:20:04] [build-stdout] package.json: Main file set to src/index.ts
[2024-10-23 15:20:04] [build-stdout] Found Node.js at: node
[2024-10-23 15:20:04] [build-stdout] Found Node.js version: v22.1.0
[2024-10-23 15:20:04] [build-stdout] Opening project /home/dubenko/temp-codeql-bug/tsconfig.json
[2024-10-23 15:20:04] [build-stdout] Memory for TypeScript process: 2000 MB, and 400 MB reserve
[2024-10-23 15:20:04] [build-stdout] Done opening project /home/dubenko/temp-codeql-bug/tsconfig.json (433 ms)
[2024-10-23 15:20:04] [build-stdout] Extracting /home/dubenko/temp-codeql-bug/src/index.ts
```

Codeql only hangs if there are two methods, if you remove one of them it works.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。