oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
72.26k stars 2.58k forks source link

Seg fault when using SSH2 and exception thrown #12345

Open PhilBladen opened 3 weeks ago

PhilBladen commented 3 weeks ago

How can we reproduce the crash?

Run bun i ssh2 first. Then run:

import "ssh2";
throw new Error("This is a test error");

Relevant log output

1 | import "ssh2";
2 | throw new Error("This is a test error");
          ^
error: This is a test error
      at D:\segfault.mjs:2:7

Bun v1.1.17 (Windows x64)
============================================================
Bun v1.1.17 (bb66bba1) Windows x64
Args: "C:\Users\Phil\.bun\bin\bun.exe" ".\segfault.mjs"
Features: jsc transpiler_cache(5) 
Builtins: "bun:main" "node:assert" "node:buffer" "node:child_process" "node:crypto" "node:dns" "node:events" "node:fs" "node:http" "node:https" "node:net" "node:path" "node:stream" "node:string_decoder" "node:tls" "node:util" "node:util/types" "node:zlib" 
Elapsed: 321ms | User: 15ms | Sys: 15ms
RSS: 0.29GB | Peak: 0.29GB | Commit: 0.36GB | Faults: 71044

panic(main thread): Segmentation fault at address 0x7FFD527657DC
oh no: Bun has crashed. This indicates a bug in Bun, not your code

Stack Trace (bun.report)

Bun v1.1.17 (bb66bba) on windows x86_64 [AutoCommand]

Segmentation fault at address 0x7FF8001C3B38

Jarred-Sumner commented 2 weeks ago

wow thank you for this reproduction

we've seen at least 180 crash reports with a similar stacktrace, and had no way to reproduce this