{"record":{"id":"d788be094c4583e5","repo":"oven-sh/bun","slug":"workload-workload-name-exited-r-status-r","errorCode":null,"errorMessage":"workload \"${workload.name}\" exited ${r.status}\n${r.stderr}","messagePattern":"workload \"(.+?)\" exited (.+?)\n(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/orderfile/generate.ts","lineNumber":307,"sourceCode":"      const out = join(scratch, `trace-${i}.bin`);\n      // The tracer loads into the traced process and nowhere else. On a terminal\n      // ptyrun is the parent, so it is the one that hands the preload down.\n      const preloadVar = darwin ? \"DYLD_INSERT_LIBRARIES\" : \"LD_PRELOAD\";\n      const preload = workload.tty ? { PTYRUN_PRELOAD: tracer } : { [preloadVar]: tracer };\n      const r = runCommand(workload.tty ? [ptyrun, bunProfile, ...workload.args] : [bunProfile, ...workload.args], {\n        env: {\n          ...preload,\n          BUN_FUNCTRACE_STARTS: startsPath,\n          BUN_FUNCTRACE_OUT: out,\n          BUN_DEBUG_QUIET_LOGS: \"1\",\n          ...workload.env,\n        },\n        cwd: workload.cwd,\n        input: workload.input,\n        timeout: WORKLOAD_TIMEOUT_MS,\n        label: `workload \"${workload.name}\"`,\n      });\n      if (r.status !== 0) throw new Error(`workload \"${workload.name}\" exited ${r.status}\\n${r.stderr}`);\n\n      const before = order.length;\n      let unresolved = 0;\n      for (const address of readTrace(out, workload.name)) {\n        const names = symbols.get(address);\n        if (!names) {\n          unresolved++;\n          continue;\n        }\n        for (const name of names) {\n          if (seen.has(name)) continue;\n          seen.add(name);\n          order.push(name);\n        }\n      }\n      const note = unresolved ? ` (${unresolved} unresolved)` : \"\";\n      log(`  ${workload.name.padEnd(21)} +${order.length - before} functions${note}`);\n    }","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/orderfile/generate.ts#L289-L325","documentation":"One of the representative workloads (`bun -e`, hello.ts, server.js, `bun test`, `bun pm install`, …) run under the functrace preload exited non-zero; the workload name and its stderr are included. The generator treats any workload failure as fatal because a broken run yields an unrepresentative order file.","triggerScenarios":"The profile binary crashing only when instrumented by the tracer; fixture bugs (missing files in scratch); workload-specific env (BUN_DEBUG_QUIET_LOGS plus workload.env) breaking execution. Note a timeout surfaces separately as an ETIMEDOUT spawn error (167), not as this status-based error.","commonSituations":"Tracer interfering with the runtime (interposition bugs); regressions in the traced build making a normal command fail; scratch fixture setup races.","solutions":["Read the appended stderr — it is the workload's own failure output","Re-run the same command without the BUN_FUNCTRACE_* preload env to see whether the failure is tracer-induced","Re-run the generator: fixtures are recreated in a fresh scratch dir each time","If it only reproduces under preload, file/inspect a tracer issue rather than skipping the workload"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { spawnSync } from \"node:child_process\";\n\n// Dry-run each workload without the tracer to separate real failures from tracer-induced ones.\nfor (const w of workloads) {\n  const dry = spawnSync(bunProfile, w.args, { cwd: w.cwd, input: w.input });\n  if (dry.status !== 0) throw new Error(`workload \"${w.name}\" fails even untraced — fix it before orderfile runs`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkload(workload);\n} catch (err) {\n  if (/workload \".*\" exited/.test(String(err))) {\n    console.error(`Workload stderr is included above — rerun without BUN_FUNCTRACE_* to test tracer involvement`);\n  }\n  throw err;\n}","preventionTips":["Keep the workload fixture set green in normal CI so orderfile runs only surface tracer-specific breakage","Always inspect the embedded stderr first; most failures are ordinary workload bugs, not tracing bugs"],"tags":["orderfile","workload","tracing","regression"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}