-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbd5103
commit 2d1c830
Showing
8 changed files
with
110 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { crash_handler } from "bun:internal-for-testing"; | ||
|
||
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>"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { crash_handler } from "bun:internal-for-testing"; | ||
import { test, expect } from "bun:test"; | ||
import { bunExe, bunEnv } from "harness"; | ||
import path from "path"; | ||
const { getMachOImageZeroOffset } = crash_handler; | ||
|
||
test.if(process.platform === "darwin")("macOS has the assumed image offset", () => { | ||
// If this fails, then https://bun.report will be incorrect and the stack | ||
// trace remappings will stop working. | ||
expect(getMachOImageZeroOffset()).toBe(0x100000000); | ||
}); | ||
|
||
test("a panic dumps a trace string", async () => { | ||
const result = Bun.spawnSync([bunExe(), path.join(import.meta.dir, "fixture-crash.js"), "panic"], { | ||
env: { | ||
...bunEnv, | ||
}, | ||
}); | ||
}); |