oven-sh / bun

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

Windows: Discord.js Sharding doesn't work #9591

Open smokey019 opened 5 months ago

smokey019 commented 5 months ago

What version of Bun is running?

1.0.35-canary.4+ee5fd51e8

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

Use Discord.js sharding

What is the expected behavior?

Launches multiple shards.

What do you see instead?

Segmentation fault at address 0xffffffffffffffff
???:?:?: 0x7ff74162c6f6 in ??? (bun.exe)
???:?:?: 0x7ff73fdf37fd in ??? (bun.exe)
???:?:?: 0x7ff73fde69eb in ??? (bun.exe)
???:?:?: 0x7ff73fde643f in ??? (bun.exe)
???:?:?: 0x7ff73f18f891 in ??? (bun.exe)
???:?:?: 0x7ff7415c7d6a in ??? (bun.exe)
???:?:?: 0x7ff73f1089ae in ??? (bun.exe)
???:?:?: 0x7ff73f131fba in ??? (bun.exe)
???:?:?: 0x7ff73f12036e in ??? (bun.exe)
???:?:?: 0x7ff73ee516f4 in ??? (bun.exe)
???:?:?: 0x7ff7419694c3 in ??? (bun.exe)
???:?:?: 0x7fff154b257c in ??? (KERNEL32.DLL)
???:?:?: 0x7fff16f2aa57 in ??? (ntdll.dll)
176 |       const onDeath = () => {
177 |         cleanup();
178 |         reject(new DiscordjsError(ErrorCodes.ShardingReadyDied, this.id));
179 |       };
180 |
181 |       const onTimeout = () => {
                     ^
error: Shard 2's process exited before its Client became ready.
 code: "ShardingReadyDied"

      at onDeath (C:\Users\jbate\OneDrive\Desktop\smokeybot\node_modules\discord.js\src\sharding\Shard.js:181:16)
      at native:1:1
      at emit (native:1:1)
      at _handleExit (C:\Users\jbate\OneDrive\Desktop\smokeybot\node_modules\discord.js\src\sharding\Shard.js:441:4)
      at emit (native:1:1)
      at #handleOnExit (native:1:1)
      at processTicksAndRejections (native:1:1)

Additional information

The bot does seem to run afterwards and doesn't close out all the shards, but it just randomly closes out that shard on load.

Electroid commented 5 months ago

Would it be possible to share a minimal reproduction in code? Does this happen all the time, or only sometimes when using sharding?

smokey019 commented 5 months ago

Would it be possible to share a minimal reproduction in code? Does this happen all the time, or only sometimes when using sharding?

the code is available over at my repo here . it happens randomly during sharding.

seems like it will crash while initially loading sometimes then it will automatically restart that shard and it's fine. but every initial load i'll get at least one (my bot loads 3 shards. you won't be able to load multiple shards in a test environment i don't think)

github-actions[bot] commented 1 month ago

This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment.