A random crash
ZYRACX opened this issue · comments
ZYARCX commented
How can we reproduce the crash?
I don't know. It just crashed randomly
JavaScript/TypeScript code that reproduces the crash?
const Discord = require("discord.js");
const client = new Discord.Client({intents: ["Guilds", "GuildMessages"]});
const prefix = "!";
client.on("messageCreate", function(message) {
if (message.author.bot) return;
if (!message.content.startsWith(prefix)) return;
const commandBody = message.content.slice(prefix.length);
const args = commandBody.split(' ');
const command = args.shift().toLowerCase();
if (command === "ping") {
const timeTaken = Date.now() - message.createdTimestamp;
message.reply(`Pong! This message had a latency of ${timeTaken}ms.`);
}
else if (command === "sum") {
const numArgs = args.map(x => parseFloat(x));
const sum = numArgs.reduce((counter, x) => counter += x);
message.reply(`The sum of all the arguments you provided is ${sum}!`);
}
});
client.login('Bot Token');
Relevant log output
Bun v1.1.5 (b257a309) Windows x64
Args: "C:\Users\soumy\.bun\bin\bun.exe", "."
Features: Bun.stdin(2) fetch transpiler_cache(3) tsconfig(2) 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: 1949ms | User: 15ms | Sys: 0ms
RSS: 0.16GB | Peak: 0.16GB | Commit: 0.18GB | Faults: 38755
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.5 (b257a30
) 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