{"record":{"id":"9512d6a8c7c43a6a","repo":"can1357/oh-my-pi","slug":"terminated-abnormally","errorCode":null,"errorMessage":"{} terminated abnormally","messagePattern":"(.+?) terminated abnormally","errorType":"exception","errorClass":"SortError","httpStatus":null,"severity":"error","filePath":"crates/pi-builtins/src/sort.rs","lineNumber":2611,"sourceCode":"\t#[error(\"write failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tWriteFailed { path: OsString, error: std::io::Error },\n\n\t#[error(\"{}\", format_disorder(.file, .line_number, .line, .silent))]\n\tDisorder { file: OsString, line_number: usize, line: String, silent: bool },\n\n\t#[error(\"open failed: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tOpenFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"cannot read: {}: {}\", .path.maybe_quote(), strip_errno(.error))]\n\tReadFailed { path: PathBuf, error: std::io::Error },\n\n\t#[error(\"failed to open temporary file: {}\", strip_errno(.error))]\n\tOpenTmpFileFailed { error: std::io::Error },\n\n\t#[error(\"could not run compress program '{}': {}\", .prog, strip_errno(.error))]\n\tCompressProgExecutionFailed { prog: String, error: std::io::Error },\n\n\t#[error(\"{} terminated abnormally\", .prog.quote())]\n\tCompressProgTerminatedAbnormally { prog: String },\n\n\t#[error(\"cannot create temporary file in {}:\", .path.quote())]\n\tTmpFileCreationFailed { path: PathBuf },\n\n\t#[error(\"extra operand {}\\nfile operands cannot be combined with --files0-from\\nTry 'sort --help' for more information.\", .file.quote())]\n\tFileOperandsCombined { file: PathBuf },\n\n\n\t#[error(\"multiple output files specified\")]\n\tMultipleOutputFiles,\n\n\t#[error(\"when reading file names from standard input, no file name of '-' allowed\")]\n\tMinusInStdIn,\n\n\t#[error(\"no input from {}\", .file.quote())]\n\tEmptyInputFile { file: PathBuf },\n","sourceCodeStart":2593,"sourceCodeEnd":2629,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/crates/pi-builtins/src/sort.rs#L2593-L2629","documentation":"`SortError::CompressProgTerminatedAbnormally` is raised when the compression program started via `--compress-program` exits with a nonzero/signal status rather than completing normally. The message includes the quoted program name. The compressor itself failed on the data stream.","triggerScenarios":"The compress program launches successfully but crashes or exits nonzero while compressing or decompressing a chunk during an external-merge sort.","commonSituations":"A program that is not a filter-style compressor (e.g. exits on its own without reading stdin); corrupt/incompatible compressor versions; a wrapper script failing on some inputs.","solutions":["Use a supported stream compressor such as gzip, bzip2, xz, or zstd.","Test the compressor standalone: `cat sample | <prog> | <prog> -d > /dev/null`.","Check the compressor's own stderr/version for incompatibilities; upgrade or replace it.","Drop --compress-program to sort without compression and isolate whether the compressor is at fault."],"exampleFix":"// before\nsort --compress-program=mycustomcomp big.txt\n\n// after\nsort --compress-program=zstd big.txt","handlingStrategy":"try-catch","validationCode":"// smoke-test the compressor round-trip before relying on it\nlet ok = std::process::Command::new(\"sh\")\n    .arg(\"-c\")\n    .arg(\"echo x | gzip | gzip -d > /dev/null\")\n    .status()\n    .map(|s| s.success())\n    .unwrap_or(false);\nif !ok { eprintln!(\"compress program failed round-trip test\"); }","typeGuard":null,"tryCatchPattern":"match sort_result {\n    Err(SortError::CompressProgTerminatedAbnormally { prog }) => {\n        eprintln!(\"'{prog}' terminated abnormally; switch to gzip/zstd or drop --compress-program\");\n    }\n    Err(e) => eprintln!(\"sort: {e}\"),\n    Ok(_) => {}\n}","preventionTips":["Only use filter-style compressors (gzip, bzip2, xz, zstd) with --compress-program.","Round-trip test custom compressor wrappers on representative data first.","Pin and test compressor versions in the deployment environment."],"tags":["sort","compress-program","process","cli"],"backgroundTag":"compressor-exit-nonzero","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}