Files
bun.sh/test/cli/run/fixture-crash.js
dave caruso c99d7ed331 feat: overhaul the crash handler (#10203)
* some work

* linux things

* linux things

* feat: tracestrings on Windows

* bwaa

* more work on the crash handler

* okay

* adgadsgbcxcv

* ya

* dsafds

* a

* wuh

* a

* bru h

* ok

* yay

* window

* alright

* oops

* yeah

* a

* a

* OOM handling

* fix on window
2024-04-17 15:32:25 -07:00

16 lines
498 B
JavaScript

let crash_handler;
try {
crash_handler = require("bun:internal-for-testing").crash_handler;
} catch {
console.error("This version of bun does not have internal-for-testing exposed");
console.error("BUN_GARBAGE_COLLECTOR_LEVEL=0 BUN_FEATURE_FLAG_INTERNALS_FOR_TESTING=1 bun");
process.exit(1);
}
const approach = process.argv[2];
if (approach in crash_handler) {
crash_handler[approach]();
} else {
console.error("usage: bun fixture-crash.js <segfault|panic|rootError|outOfMemory>");
}