pkg 二进制在大中型 Java 项目上因 Node 18.5.0 V8 bug 崩溃
@AntJiuFo is already working on this.
Since Jul 17, 2026.
Assessment
This issue has not been assessed yet.
Description
环境信息
- YASA 版本:
v0.3.1(最新 release 二进制) - 操作系统:Ubuntu 22.04 LTS
- 项目规模:100+ Java 文件(Spring Boot 应用)
复现步骤
./yasa-engine-linux-x64 \
--sourcePath /path/to/100-plus-java-files-project \
--language java \
--checkerIds taint_flow_java_input \
--ruleConfigFile resource/example-rule-config/rule_config_java.json \
--maindirPrefix /path/to/100-plus-java-files-project
崩溃发生在 startAnalyze 阶段(parseCode 正常完成后)。
崩溃日志
#
# Fatal error in , line 0
# Fatal JavaScript invalid size error 169220804
#
#
#
#FailureMessage Object: 0x7fffd67a31f0
1: 0xa73bd1 [./yasa-engine-linux-x64]
2: 0xebf5e9 V8_Fatal(char const*, ...) [./yasa-engine-linux-x64]
3: 0x137cba8 [./yasa-engine-linux-x64]
4: 0x153d7cf [./yasa-engine-linux-x64]
5: 0x154283a [./yasa-engine-linux-x64]
6: 0x1762f14 v8::internal::Runtime_GrowArrayElements(int, unsigned long*, v8::internal::Isolate*) [./yasa-engine-linux-x64]
7: 0x1bb6239 [./yasa-engine-linux-x64]
Trace/breakpoint trap
根因分析
Release 二进制内嵌的 Node 版本为 18.5.0(2022 年 7 月发布),已通过以下命令确认:
$ strings ./yasa-engine-linux-x64 | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | head -5
v18.5.0
Node 18.5.0 搭载的 V8 引擎(v10.2)存在一个数组扩容 bug(Runtime_GrowArrayElements)。在大中型 Java 项目中,YASA 的 TypeResolver 构建类型层次或 Call Graph 遍历时,会触发异常的数组扩容请求(尝试分配约 1.69 亿个元素),直接导致 V8 崩溃。
同份代码用 Node 22 运行正常
node --max-old-space-size=13312 dist/main.js \
--sourcePath /path/to/100-plus-java-files-project \
--language java \
--checkerIds taint_flow_java_input \
--ruleConfigFile resource/example-rule-config/rule_config_java.json \
--maindirPrefix /path/to/100-plus-java-files-project
# 输出:
# [YASA] Execution completed
# Total-findings: N
同一份 dist/ 代码,用 Node 22 直接运行完全正常,说明问题出在 pkg 内嵌的 Node 版本,而非 YASA 引擎代码。
建议
- 文档说明:在 README 或 Release 页面增加提示:
大中型项目推荐直接用 Node ≥ 20 运行,避免 pkg 内嵌 Node 18 的 V8 崩溃问题:
node --max-old-space-size=8192 dist/main.js --sourcePath ...
用户侧临时解决方案
在修复前,用 Node ≥ 20 直接运行:
node --max-old-space-size=13312 dist/main.js \
--sourcePath /path/to/project \
--language java \
--checkerIds taint_flow_java_input \
--ruleConfigFile resource/example-rule-config/rule_config_java.json \
--maindirPrefix /path/to/project
- Dominant language
- TypeScript
- Stars
- 339
- Forks
- 40
- Avg merge
- 2h 1m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from antgroup/YASA-Engine
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
antgroup/YASA-Engine#170 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
antgroup/YASA-Engine#171 ·
-
整个工程扫描,异常退出Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
antgroup/YASA-Engine#166 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
antgroup/YASA-Engine#162 ·
-
OSS26-Team
Difficulty 5/5 Over a week Newbie friendliness 35/100
antgroup/YASA-Engine#142 ·
All issues in antgroup/YASA-Engine
Similar issues
-
[Bug]: A Markdown link with both a :line suffix and a #L fragment opens a path containing ":line"Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
status:needs-triage type:bug workstream:refimpl
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
GenAI-Security-Project/agent-control-standard#764 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
TanbirRamim/vibereel#39 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 72/100
lingdojo/kana-dojo#34988 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day