{"record":{"id":"1b7ad11ed76fcd00","repo":"oven-sh/bun","slug":"s-serror-s","errorCode":null,"errorMessage":"%s%serror%s ","messagePattern":"%s%serror%s ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/h3blast/src/h3blast.c","lineNumber":180,"sourceCode":"    _Atomic uint64_t req_other;\n    _Atomic uint64_t req_err;\n    _Atomic uint64_t bytes_rx;       // HTTP body bytes\n    _Atomic uint64_t bytes_rx_wire;  // UDP payload bytes (incl. headers, QUIC framing)\n    _Atomic uint64_t bytes_tx;\n    _Atomic uint64_t conns_open;\n    _Atomic uint64_t handshake_fail;\n};\n\nstatic volatile sig_atomic_t g_stop;\nstatic volatile sig_atomic_t g_intr;   // SIGINT/SIGTERM — abort remaining targets\nstatic volatile sig_atomic_t g_warm;   // set once warmup window has passed\n\n// ───────────────────────── util ─────────────────────────\n\nstatic void die(const char *fmt, ...) {\n    va_list ap;\n    va_start(ap, fmt);\n    fprintf(stderr, \"%s%serror%s \", RED, BLD, RST);\n    vfprintf(stderr, fmt, ap);\n    fputc('\\n', stderr);\n    va_end(ap);\n    exit(1);\n}\n\nstatic uint64_t now_ns(void) {\n    struct timespec ts;\n    clock_gettime(CLOCK_MONOTONIC, &ts);\n    return (uint64_t)ts.tv_sec * 1000000000ull + (uint64_t)ts.tv_nsec;\n}\n\nstatic void on_sigint(int sig) {\n    (void)sig;\n    if (g_intr) {\n        static const char restore[] = \"\\x1b[?7h\\x1b[?25h\";\n        if (g_isatty) write(STDERR_FILENO, restore, sizeof(restore) - 1);\n        _exit(130);","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/packages/h3blast/src/h3blast.c#L162-L198","documentation":"die() is h3blast's fatal-error exit path: it prints '<red><bold>error<rst> <message>' to stderr and exits with status 1. It is used for unrecoverable setup failures — bad CLI arguments, invalid target URLs/schemes, TLS certificate or keylog-file problems, worker/histogram allocation failures — so seeing this prefix means the run never started or aborted hard.","triggerScenarios":"Invoking h3blast with a malformed or non-HTTP(S) URL, a negative/zero worker or duration argument, an unreadable --keylog file, unsupported ALPN/scheme, or environments where pthread/hdr_init fail.","commonSituations":"Typos in target URLs; passing http:// targets to an HTTP/3-only mode; CI machines with low ulimits starving thread creation; flag mistakes after upgrading CLI argument formats.","solutions":["Re-run with --help and correct the flagged argument; the message after the 'error' prefix names the exact problem","Verify each target URL parses and uses a scheme the tool supports","Check the keylog/cert paths given on the command line exist and are writable/readable","Raise ulimits (threads) if the failure is resource-related"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { spawnSync } from 'node:child_process';\nconst r = spawnSync(h3blastPath, ['--help']);\nif (r.status !== 0) throw new Error(`h3blast unusable (exit ${r.status}): ${r.stderr}`);\n// validate targets up front:\nfor (const t of targets) new URL(t); // throws on malformed URLs","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate every target URL and flag before launching the benchmark","Check the process exit code; die() always exits 1 with the reason on stderr","Smoke-test with one connection and a short duration before full runs"],"tags":["cli","http3","benchmark","fatal"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}