bun icon indicating copy to clipboard operation
bun copied to clipboard

Chances of getting a segmentation fault at address 0xFFFFFFFFFFFFFFFF when opening a websocket (connecting to MongoDB and Discord)

Open Sayrix opened this issue 1 year ago • 2 comments

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

Sayrix avatar Apr 30 '24 14:04 Sayrix

The bug is still here in 1.1.7

Bun v1.1.7 (b0b7db5) on windows x86_64 [AutoCommand]

Segmentation fault at address 0xFFFFFFFFFFFFFFFF

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.```

Sayrix avatar May 04 '24 17:05 Sayrix

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

Features: jsc, Bun.stdin, fetch, http_server, transpiler_cache, tsconfig_paths, tsconfig, WebSocket

Sayrix avatar Jun 27 '24 19:06 Sayrix

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

Features: jsc, Bun.stdin, fetch, http_server, transpiler_cache, tsconfig_paths, tsconfig, WebSocket

Sayrix avatar Jul 28 '24 17:07 Sayrix

Fixed in canary v1.1.22

cirospaciari avatar Aug 05 '24 16:08 cirospaciari