Native CLI (scriptc.exe) segfaults on a large program that the same release compiles under Node
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- nodejs, typescript
- 领域
- compilers
调研方向
The crash is in the natively compiled CLI bin/scriptc.exe during scriptc coverage and scriptc build, with no reproduction because the app source is private. The entry point to read is packages/cli/src/main.ts, which the reporter ran under Node as a working comparison. Start by building a symbolized CLI and reproducing the crash on a large entry. Done means the native CLI finishes coverage on that entry without SIGSEGV and matches the Node output.
由索引模型根据 Issue 内容生成。
描述
The native CLI that the scriptc npm package installs (bin/scriptc.exe, linux-x64-gnu) crashes with SIGSEGV (exit 139) on a large program, before it prints any report. The same release's compiler, run as JavaScript under Node, analyzes and builds the same program without errors.
Environment
- scriptc 0.4.12 from npm (
scriptcwith@scriptc/cli-linux-x64-gnu); 0.4.11 from npm crashes the same way. - Linux 6.8.0 x86_64, glibc 2.39.
- Node v24.22.0 for the JavaScript run.
What happens
scriptc coverage crashes with exit 139 and no report:
$ scriptc coverage src/main.ts --print=diagnostics --fail-on=blockers
Segmentation fault (core dumped)
scriptc build of the same entry, with the app's FFI manifest, crashes the same way.
The entry is a terminal app of about 25,000 statements: a TypeScript app on light's native packages. The coverage crash doesn't need its FFI manifest. Smaller entries from the same workspace (41 of light's own coverage entries and 118 of the app's test entries) pass scriptc coverage with the native CLI.
The crash doesn't depend on the stack limit: it also happens under ulimit -s unlimited. The binary is stripped, and gdb shows a shallow stack, so this isn't deep recursion:
Thread 1 "scriptc.exe" received signal SIGSEGV, Segmentation fault.
0x0000000005e3ec38 in ?? ()
#0 0x0000000005e3ec38 in ?? ()
#1 0x0000000002f9e1a7 in ?? ()
#2 0x0000000002ef6c6e in ?? ()
#3 0x0000000002f792c8 in ?? ()
#4 0x00000000040a0037 in ?? ()
#5 0x00000000040a01fc in ?? ()
#6 0x0000000004283b49 in ?? ()
#7 0x0000000004c778af in ?? ()
#8 0x00000000037048ba in ?? ()
#9 0x00000000044b644d in ?? ()
#10 0x0000000003ae2a4f in ?? ()
#11 0x0000000002f8e6ac in ?? ()
#12 0x000000000299830d in ?? ()
#13 0x000000000298cbb1 in ?? ()
#14 __libc_start_call_main (main=0x298c880, argc=4, ...)
What works
The same program compiles when the compiler runs under Node:
@scriptc/compiler0.4.12 from npm, driven by a copy ofpackages/cli/src/main.tsat v0.4.12:scriptc coveragereports the entry fully static, andscriptc buildproduces a working executable.- A source build of v0.4.11 plus #3504, run with
node packages/cli/dist/main.js:scriptc coveragereports 24,873 statements, 100% static.
So the failure seems specific to the natively compiled CLI rather than to the compiler's handling of the program.
Reproducing
The app's sources aren't public yet. I can try to reduce it to a standalone reproduction, or run a build of the CLI with symbols, or with whatever diagnostics would help, if you can point me to one.
- 主要语言
- TypeScript
- 星标
- 6.6k
- 派生
- 216
- 平均合并
- 9 小时 35 分钟
- 30 天内合并 PR
- 775
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
vercel-labs/scriptc 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
vercel-labs/scriptc#3979 ·
维护者通常 1 天内回复
-
Support undici 8.x request() through the built-in implementation可能已有人在做 @younggglcy 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 35/100
vercel-labs/scriptc#3894 ·
维护者通常 1 天内回复
-
A native program crashes with SIGSEGV when a string or JSON builder grows past 4 MiB可能已有人在做 @alantriesagain 于 5 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 22/100
vercel-labs/scriptc#3642 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 22/100
vercel-labs/scriptc#3613 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
vercel-labs/scriptc#3605 ·
维护者通常 1 天内回复
查看 vercel-labs/scriptc 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
milind-soni/OpenMausBot#6730 ·
维护者通常 1 天内回复
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)未关闭area: @angular/build
难度 2/5 1-3 小时 新手友好度 65/100
angular/angular-cli#34764 ·
维护者通常 1 天内回复
-
status/need-triage
难度 2/5 1-3 小时 新手友好度 76/100
google-gemini/gemini-cli#30384 · 1 条评论 ·
维护者通常 1 天内回复
-
P2
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
area:image documentation good first issue
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复