Chances of getting a segmentation fault at address 0xFFFFFFFFFFFFFFFF when opening a websocket (connecting to MongoDB and Discord)
How can we reproduce the crash?
Windows 11 23H2 22631.3527
Bun 1.1.6
[email protected]
[email protected]
import * as Discord from "discord.js";
import { Db, MongoClient, ServerApiVersion } from "mongodb";
const client = new Discord.Client({
intents: ["Guilds"],
shards: "auto",
}) as Client;
const cache = new NodeCache();
const mongodb = new MongoClient(
"mongodb+srv://URL_REDACTED/?retryWrites=true&w=majority",
{
serverApi: {
version: ServerApiVersion.v1,
strict: true,
deprecationErrors: true,
},
}
);
mongodb.connect();
client.login(process.env.DISCORD_TOKEN as string);
Video of me getting the error, and sometimes not.
https://github.com/oven-sh/bun/assets/43046854/b94837f1-ee2c-49b3-b130-a6549362ed13
Relevant log output
No response
Stack Trace (bun.report)
Bun v1.1.6 (e58d67b) on windows x86_64 [AutoCommand]
Segmentation fault at address 0xFFFFFFFFFFFFFFFF
-
?? -
?? -
quote_cmd_arg -
fs__open -
?? -
bun_js.zig:321:start -
JSC__JSValue__callCustomInspectFunction -
shimmer.zig:186:cppFn -
run_command.zig:1300:exec -
cli.zig:1852:start
The bug is still here in 1.1.7
Bun v1.1.7 (b0b7db5) on windows x86_64 [AutoCommand]
Segmentation fault at address 0xFFFFFFFFFFFFFFFF
-
?? -
?? -
uv__process_poll_req -
?? -
uv_run -
uws.zig:2619:run -
JSC__VM__holdAPILock -
shimmer.zig:186:cppFn -
run_command.zig:1307:exec -
cli.zig:1861:start
Args: "C:\Users\Sayrix\.bun\bin\bun.exe", "."
Features: jsc Bun.stdin(2) dotenv transpiler_cache(5) tsconfig(8) WebSocket(3)
Builtins: "bun:main" "node:buffer" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:net" "node:os" "node:path" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:url" "node:util" "node:util/types" "node:zlib" "node:worker_threads" "undici" "ws"
Elapsed: 5455ms | User: 78ms | Sys: 15ms
RSS: 0.26GB | Peak: 0.26GB | Commit: 0.32GB | Faults: 62872
panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
oh no: Bun has crashed. This indicates a bug in Bun, not your code.```
Hi, i stopped getting the error on Bun 1.1.17 Windows 11 23H2 22631.3737 x64 but now i have it on Bun 1.1.17 Ubuntu 22.04.4 LTS aarch64
Stack Trace (bun.report)
Bun v1.1.17 (bb66bba) on linux aarch64 [AutoCommand]
Segmentation fault at address 0x0000001A
-
ld-temp.o:0:WTF::jscSignalHandler -
process_common.rs:0:?? - 2 unknown/js code
-
ld-temp.o:0:llint_call_javascript -
ld-temp.o:0:JSC::Interpreter::executeCall -
ld-temp.o:0:JSC::runJSMicrotask -
ld-temp.o:0:JSC::VM::drainMicrotasks -
BunProcess.cpp:2558:Bun::jsFunctionDrainMicrotaskQueue - 1 unknown/js code
Features: jsc, Bun.stdin, fetch, http_server, transpiler_cache, tsconfig_paths, tsconfig, WebSocket
Just to let you know that the error is still here on Bun 1.1.21
Bun v1.1.21 (70ca2b7) on linux aarch64 [AutoCommand]
Segmentation fault at address 0x0000001A
-
ld-temp.o:0:WTF::jscSignalHandler -
alloc.rs:0:?? - 2 unknown/js code
-
ld-temp.o:0:llint_call_javascript -
ld-temp.o:0:JSC::Interpreter::executeCall -
ld-temp.o:0:JSC::runJSMicrotask -
ld-temp.o:0:JSC::VM::drainMicrotasks -
BunProcess.cpp:2570:Bun::jsFunctionDrainMicrotaskQueue - 1 unknown/js code
Features: jsc, Bun.stdin, fetch, http_server, transpiler_cache, tsconfig_paths, tsconfig, WebSocket
Fixed in canary v1.1.22