bun icon indicating copy to clipboard operation
bun copied to clipboard

Bun throws 'index out of bounds' when installing packages on Windows

Open m1abdullahh opened this issue 10 months ago • 13 comments

What version of Bun is running?

1.1.0

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

  1. Navigate to a dir containing a package-lock.json. (I also rm -rf'ed node_modules beforehand).
  2. Run bun i.

What is the expected behavior?

It should install all the packages without any issue.

What do you see instead?

I got an error, saying index out of bounds. Here's the error:

image

uh-oh: index out of bounds bun will crash now 😭😭😭

----- bun meta ----- Bun v1.1.0 (5903a614) Windows x64 InstallCommand: extracted_packages(18) lockfile_migration_from_package_lock HTTP: 256 Elapsed: 49793ms | User: 38890ms | Sys: 3015ms RSS: 0.15GB | Peak: 0.15GB | Commit: 0.24GB | Faults: 45614 ----- bun meta -----

0 00007FF7A89CA4C8 1 ??? 2 ??? 3 ??? 4 ??? 5 ??? 6 ??? 7 ??? 8 ??? 9 ??? 10 ??? 11 ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 11476 panic: index out of bounds ???:?:?: 0x7ff7a771051a in ??? (bun.exe) ???:?:?: 0x7ff7a771123c in ??? (bun.exe) ???:?:?: 0x7ff7a758193b in ??? (bun.exe) ???:?:?: 0x7ff7a75785dd in ??? (bun.exe) ???:?:?: 0x7ff7a7572610 in ??? (bun.exe) ???:?:?: 0x7ff7a76254c2 in ??? (bun.exe) ???:?:?: 0x7ff7a7351603 in ??? (bun.exe)

???:?:?: 0x7ff7a9e87e33 in ??? (bun.exe) ???:?:?: 0x7fffe33d257c in ??? (KERNEL32.DLL) ???:?:?: 0x7fffe3f8aa57 in ??? (ntdll.dll)

Additional information

I just installed bun after watching the Bundows videos, and got this.

m1abdullahh avatar Apr 01 '24 19:04 m1abdullahh

Hi, could you attach your package.json and package-lock.json?

gvilums avatar Apr 01 '24 21:04 gvilums

Quite unexpectedly, I reran bun i, and it worked fine. I don't know why it did so. Here are my package files. package.json package-lock.json

m1abdullahh avatar Apr 01 '24 21:04 m1abdullahh

I unfortunately can't reproduce the crash, neither using both files nor just the package.json

gvilums avatar Apr 01 '24 22:04 gvilums

This happened the very first time I tried using bun to add a package to an existing package.json with a yarn.lock, but every time I try to reproduce it, I can't. It works fine now, even if I do bun pm cache rm, delete node_modules, delete the package I was adding from package.json (i was adding @types/bun), reinstall using yarn, and then re-run the command that initially failed (bun add --dev @types/bun). Dunno /shrug

JL102 avatar Apr 03 '24 04:04 JL102

It seems like this error comes up on the first try of bun install.. and never after that.

m1abdullahh avatar Apr 03 '24 05:04 m1abdullahh

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update .

// EDIT: this happens for both existing yarn project and for an empty (freshly initialised) project.

cimak avatar Apr 03 '24 06:04 cimak

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update

Do you see the package name that was being installed when you got this error? Like I had apisauce in my case.

m1abdullahh avatar Apr 03 '24 06:04 m1abdullahh

It seems like this error comes up on the first try of bun install.. and never after that.

not in my case, I'm getting this error every single time for bun install, bun add react or bun update

Do you see the package name that was being installed when you got this error? Like I had apisauce in my case.

no:

OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.19045 N/A Build 19045
C:\projects\buntest>bun init
bun init helps you get started with a minimal project and tries to guess sensible defaults. Press ^C anytime to quit

package name (buntest):
entry point (index.ts):

Done! A package.json file was saved in the current directory.
 + index.ts
 + .gitignore
 + tsconfig.json (for editor auto-complete)
 + README.md

To get started, run:
  bun run index.ts
C:\projects\buntest>bun run index.ts
Hello via Bun!
C:\projects\buntest>bun add react
bun add v1.1.0 (5903a614)

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
AddCommand:
Elapsed: 9ms | User: 0ms | Sys: 15ms
RSS: 44.10MB | Peak: 44.10MB | Commit: 91.93MB | Faults: 10924
----- bun meta -----

0   00007FF610DBA4C8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???
10  ???
11  ???
12  ???
13  ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 25920 panic: index out of bounds
???:?:?: 0x7ff60f9e03d8 in ??? (bun.exe)
???:?:?: 0x7ff60f8f73b8 in ??? (bun.exe)
???:?:?: 0x7ff60f8fac45 in ??? (bun.exe)
???:?:?: 0x7ff60f92cdda in ??? (bun.exe)
???:?:?: 0x7ff60f964ce0 in ??? (bun.exe)
???:?:?: 0x7ff60f962f55 in ??? (bun.exe)
???:?:?: 0x7ff60f9759c2 in ??? (bun.exe)
???:?:?: 0x7ff60fa1518b in ??? (bun.exe)
???:?:?: 0x7ff60f741603 in ??? (bun.exe)
???:?:?: 0x7ff612277e33 in ??? (bun.exe)
???:?:?: 0x7ffeb87f7343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffeb8e426b0 in ??? (ntdll.dll)

cimak avatar Apr 03 '24 06:04 cimak

Yeah you're adding react. When I got this error, I was also running bun i in a react proj. dir.

m1abdullahh avatar Apr 03 '24 06:04 m1abdullahh

bun upgrade also doesn't work:

C:\projects\buntest>bun upgrade

uh-oh: index out of bounds
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
UpgradeCommand:
Elapsed: 1ms | User: 0ms | Sys: 0ms
RSS: 22.56MB | Peak: 22.56MB | Commit: 70.80MB | Faults: 5641
----- bun meta -----

0   00007FF64735A4C8
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???
7   ???
8   ???
9   ???

Search GitHub issues https://bun.sh/issues or join in #windows channel in https://bun.sh/discord

thread 1328 panic: index out of bounds
???:?:?: 0x7ff645f803d8 in ??? (bun.exe)
???:?:?: 0x7ff645fa4f41 in ??? (bun.exe)
???:?:?: 0x7ff645fa8ee6 in ??? (bun.exe)
???:?:?: 0x7ff645fb5ab7 in ??? (bun.exe)
???:?:?: 0x7ff645ce1603 in ??? (bun.exe)
???:?:?: 0x7ff648817e33 in ??? (bun.exe)
???:?:?: 0x7ffdb2517343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffdb35026b0 in ??? (ntdll.dll)

cimak avatar Apr 03 '24 08:04 cimak

OS Name: Microsoft Windows 10 OS Version: Build 19044

uh-oh: index out of bounds bun will crash now 😭😭😭

----- bun meta ----- Bun v1.1.1 (ca1dbb4e) Windows x64

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

cavidev avatar Apr 04 '24 18:04 cavidev

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

@CarlosMarioV is it happening consistently or did it only happen once? For me and most others I saw on this thread, it's a one time occurrence.

JL102 avatar Apr 05 '24 01:04 JL102

Hi, today I did a "bun install" too and I am getting the same issue, anyone found a solution or some workaround??

@CarlosMarioV is it happening consistently or did it only happen once? For me and most others I saw on this thread, it's a one time occurrence.

During the morning this happened consistently after that I could download the libraries and I am not tested for today.

cavidev avatar Apr 05 '24 14:04 cavidev

Duplicate of #9932

Electroid avatar Apr 08 '24 22:04 Electroid