oven-sh / bun

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

Bun crashes when running Discord bot example #10946

Open cronJ opened 3 months ago

cronJ commented 3 months ago

How can we reproduce the crash?

Build the example project from https://bun.sh/guides/ecosystem/discordjs

JavaScript/TypeScript code that reproduces the crash?

// import discord.js
import { Client, Events, GatewayIntentBits } from "discord.js";

// create a new Client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

// listen for the client to be ready
client.once(Events.ClientReady, (c) => {
  console.log(`Ready! Logged in as ${c.user.tag}`);
});

// login with the token from .env.local
client.login(process.env.DISCORD_TOKEN);

Relevant log output

Bun v1.1.7 (b0b7db5c) Windows x64
Args: "C:\Users\xxxxx\.bun\bin\bun.exe", "run", "bot.ts"
Features: jsc Bun.stdin(2) dotenv fetch transpiler_cache(3) tsconfig(4) WebSocket 
Builtins: "bun:main" "node:buffer" "node:events" "node:fs" "node:fs/promises" "node:http" "node:path" "node:string_decoder" "node:timers" "node:timers/promises" "node:url" "node:util" "node:util/types" "node:zlib" "node:worker_threads" "undici" "ws" 
Elapsed: 795ms | User: 140ms | Sys: 15ms
RSS: 0.16GB | Peak: 0.16GB | Commit: 0.20GB | Faults: 38876

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

Stack Trace (bun.report)

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

Segmentation fault at address 0xFFFFFFFFFFFFFFFF

quangpao commented 3 months ago

Bump, I got the same issue with bun --watch ...

============================================================
Bun v1.1.8 (89d25807) Windows x64
Args: "C:\Users\xxxx\.bun\bin\bun.exe", "--watch", "src/app.ts"
Features: jsc Bun.stdin(2) Bun.stdout dotenv fetch transpiler_cache(6) tsconfig_paths(2) tsconfig(5) WebSocket 
Builtins: "bun:main" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:crypto" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:os" "node:path" "node:process" "node:stream" "node:string_decoder" "node:timers" "node:timers/promises" "node:tty" "node:url" "node:util" "node:util/types" "node:zlib" "node:worker_threads" "undici" "ws" 
Elapsed: 1539ms | User: 296ms | Sys: 93ms
RSS: 0.28GB | Peak: 0.28GB | Commit: 0.34GB | Faults: 68455

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