{"record":{"id":"eb3544de1112355a","repo":"affaan-m/ECC","slug":"command-commandname-terminated-by-signal-re","errorCode":null,"errorMessage":"Command \"${commandName}\" terminated by signal ${result.signal}","messagePattern":"Command \"(.+?)\" terminated by signal (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/ecc.js","lineNumber":309,"sourceCode":"\n  if (result.error) {\n    throw result.error;\n  }\n\n  if (result.stdout) {\n    process.stdout.write(result.stdout);\n  }\n\n  if (result.stderr) {\n    process.stderr.write(result.stderr);\n  }\n\n  if (typeof result.status === 'number') {\n    return result.status;\n  }\n\n  if (result.signal) {\n    throw new Error(`Command \"${commandName}\" terminated by signal ${result.signal}`);\n  }\n\n  return 1;\n}\n\nfunction main() {\n  try {\n    const resolution = resolveCommand(process.argv);\n\n    if (resolution.mode === 'help') {\n      showHelp(0);\n    }\n\n    if (resolution.mode === 'help-command') {\n      if (!resolution.command) {\n        showHelp(0);\n      }\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/ecc.js#L291-L327","documentation":"After spawnSync runs a subcommand, if the child did not exit normally but was killed by a signal, runCommand() throws 'Command \"<name>\" terminated by signal <signal>'. This surfaces signals like SIGINT or SIGSEGV instead of silently returning an exit code.","triggerScenarios":"The spawned script (process.execPath + command.script) is killed by a signal — user pressed Ctrl+C, the process OOM-killed (SIGKILL), segfaulted (SIGSEGV), or was terminated by a supervisor.","commonSituations":"Interrupting a long-running install with Ctrl+C, OOM killer terminating Node during heavy installs, signal-based CI timeouts, or a crashing native module in the child.","solutions":["Inspect which signal was reported (e.g. SIGKILL suggests OOM, SIGSEGV suggests a crash) and address the root cause.","Re-run the command; a one-off Ctrl+C just needs a retry.","For SIGKILL during installs, free memory or increase the container/memory limits.","Check CI timeout/signal settings if the command is being killed by the pipeline."],"exampleFix":"// before\n// child killed silently by SIGKILL in constrained container\n// after\n// raise memory limit then retry\nNODE_OPTIONS=--max-old-space-size=2048 ecc install","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  process.exitCode = runCommand(name, args);\n} catch (err) {\n  const m = err.message.match(/terminated by signal (\\w+)/);\n  if (m) {\n    console.error(`'${name}' was killed by ${m[1]}; check memory/timeout settings.`);\n    process.exit(1);\n  }\n  throw err;\n}","preventionTips":["Run long installs in environments with adequate memory to avoid OOM SIGKILL.","Avoid Ctrl+C mid-install; rerun if interrupted.","Configure generous CI timeouts so the runner doesn't SIGTERM the process.","Check dmesg/journal for OOM-killer events after SIGKILL failures."],"tags":["cli","process","signal","subprocess"],"backgroundTag":"process-killed-by-signal","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}