CLI: an indexer killed by a signal (out of memory) exits 1 with no message
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- node.js, typescript, wasm
Línea de trabajo
Empieza en src/extraction/wasm-runtime-flags.ts, especialmente en relaunchWithWasmRuntimeFlagsIfNeeded, e inspecciona cómo los resultados de spawnSync determinan el estado de salida de la CLI. Reproduce el caso en que el proceso hijo muere por una señal usando el comando con límite de memoria del issue y, después, revisa las pruebas existentes para esta ruta de relanzamiento. Se considera terminado cuando un proceso hijo terminado por una señal produce un mensaje en stderr que indique la señal y el código de salida esperado al estilo de la shell.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
When the indexer that the CLI relaunches with the WASM runtime flags is killed by a signal, the codegraph command exits 1 and prints nothing. An out-of-memory kill during codegraph init or codegraph index then looks like an ordinary failure with no message, and the exit code doesn't say a signal was involved.
relaunchWithWasmRuntimeFlagsIfNeeded drops result.signal:
const result = spawnSync(process.execPath, argv, { stdio: 'inherit', ... });
if (result.error) { return; }
process.exit(result.status ?? (result.signal ? 1 : 0));
Repro (main f72c9d2e, Node 22.22.2, Linux x64 on WSL2, CODEGRAPH_KERNEL=0)
Any repo works if memory is capped low enough. With honojs/hono at f6fbaf0 and a 400 MB cgroup cap, where the kernel kills only the largest process:
systemd-run --user --scope -q -p MemoryMax=400M -p MemorySwapMax=0 -p OOMPolicy=continue \
node --trace-exit dist/bin/codegraph.js init -i .
echo "exit=$?"
Scanning files...
Parsing code...
(node) WARNING: Exited the environment with code 1
at exit (node:internal/process/per_thread:245:13)
at relaunchWithWasmRuntimeFlagsIfNeeded (dist/extraction/wasm-runtime-flags.js:41:13)
at dist/bin/codegraph.js:100:63
exit=1
Kernel log for the same run: Memory cgroup out of memory: Killed process … (node) … anon-rss:375764kB. Without --trace-exit, nothing is printed after Parsing code....
Control: the same command with CODEGRAPH_NO_RELAUNCH=1 exits 137, and the shell reports Killed.
The same thing happens without an artificial cap. Indexing microsoft/vscode at ca43fc94 under a 6 GiB limit exits 1 silently after Resolving refs... (child at 5.8 GB RSS when killed). Effect-TS/effect 7a87ff9 exited 1 the same way after Resolving refs... while several indexers shared one machine's memory, with cgroup OOM kills in the kernel log at that time.
Expected
- Report the signal on stderr, e.g.
codegraph: the indexer was killed by SIGKILL (out of memory?). - Exit with 128 + the signal number (137 for
SIGKILL), as a shell would, so scripts and CI can tell a kill from a failure.
Related but different: #3137 is the MCP worker's watchdog respawn loop under memory exhaustion. This one is the one-shot CLI's exit path.
- Lenguaje dominante
- C
- Estrellas
- 73.2k
- Forks
- 4.7k
- Merge medio
- 3 h 11 min
- PR fusionados (30 d)
- 416
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de colbymchenry/codegraph
-
Separate Installation Commands into Individual Code BlocksPosiblemente ocupada @andrySD la tomó hace 7 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
colbymchenry/codegraph#3241 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
colbymchenry/codegraph#3228 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#3223 · 4 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
A `../` entry in package.json `workspaces` makes a folder outside the project count as a workspace package, and a call gets linked to the wrong functionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
colbymchenry/codegraph#3093 ·
Los mantenedores suelen responder en 1 día
-
Windows: npm-shim spawnSync missing windowsHide flashes a console window on every MCP server launchAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
colbymchenry/codegraph#3054 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de colbymchenry/codegraph
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
FujiNetWIFI/fujinet-config#379 ·
Los mantenedores suelen responder en 1 día
-
Ship /Local/Applications, the Local domain's Applications folderPosiblemente ocupada @pkgdemon la tomó hoy. Abiertoarea:base enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
nextbsd/nextbsd-userland#612 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zephyrproject-rtos/zephyr#125543 ·
Los mantenedores suelen responder en 2 días
-
good first issue needs-triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
InauguralSystems/EigenScript#2347 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100