oven-sh / bun

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

index out of bounds installing dependencies on windows #9808

Closed JJozef closed 3 months ago

JJozef commented 5 months ago

What version of Bun is running?

v1.1.0

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

At the moment of executing bun i, it is executed correctly, but there comes a moment when the following error occurs:

image

What is the expected behavior?

Install the package.json dependencies correctly.

What do you see instead?

Just run bun i.

Additional information

Node v20.12.0.

glitch-txs commented 5 months ago

same issue when running any bun command

$ bun -v

uh-oh: start index is larger than end index
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64 (baseline) 
Unknown: 
Elapsed: 2ms | User: 0ms | Sys: 0ms
RSS: 16.43MB | Peak: 16.43MB | Commit: 62.16MB | Faults: 4141
----- bun meta -----

0   00007FF77D978158
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???

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

thread 20960 panic: start index is larger than end index
???:?:?: 0x7ff77c5d7751 in ??? (bun)
???:?:?: 0x7ff77c3115fe in ??? (bun)
???:?:?: 0x7ff77ee2f2d3 in ??? (bun)
???:?:?: 0x7ffe101f257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe1072aa57 in ??? (ntdll.dll)
JJozef commented 5 months ago

same issue when running any bun command

$ bun -v

uh-oh: start index is larger than end index
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64 (baseline) 
Unknown: 
Elapsed: 2ms | User: 0ms | Sys: 0ms
RSS: 16.43MB | Peak: 16.43MB | Commit: 62.16MB | Faults: 4141
----- bun meta -----

0   00007FF77D978158
1   ???
2   ???
3   ???
4   ???
5   ???
6   ???

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

thread 20960 panic: start index is larger than end index
???:?:?: 0x7ff77c5d7751 in ??? (bun)
???:?:?: 0x7ff77c3115fe in ??? (bun)
???:?:?: 0x7ff77ee2f2d3 in ??? (bun)
???:?:?: 0x7ffe101f257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffe1072aa57 in ??? (ntdll.dll)

The solution I found was to delete the previous bun.lockb, that I had from Linux, once I deleted it, the bun i was executed correctly.

image

glitch-txs commented 5 months ago

for me, running bun.exe install instead worked.

gvilums commented 5 months ago

Possibly related to #9796

Atulin commented 5 months ago

Same issue calling bun i on Windows 10 on a project that uses NPM and Node:

❯ bun i
bun install v1.1.0 (5903a614)
[16.13ms] migrated lockfile from package-lock.json

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: extracted_packages(90) lockfile_migration_from_package_lock git_dependencies
Elapsed: 5643ms | User: 546ms | Sys: 3515ms
RSS: 0.18GB | Peak: 0.18GB | Commit: 0.27GB | Faults: 49267
----- bun meta -----

0   00007FF743EFA4C8
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 13856 panic: reached unreachable code
???:?:?: 0x7ff742a62c28 in ??? (bun.exe)
???:?:?: 0x7ff742aaa2cb in ??? (bun.exe)
???:?:?: 0x7ff742aa2610 in ??? (bun.exe)
???:?:?: 0x7ff742b554c2 in ??? (bun.exe)
???:?:?: 0x7ff742881603 in ??? (bun.exe)
???:?:?: 0x7ff7453b7e33 in ??? (bun.exe)
???:?:?: 0x7ffd1a9a7343 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffd1b7a26b0 in ??? (ntdll.dll)

then, after rm bun.lockb, trying to execute bun.exe install results in the following:

❯ bun.exe install
bun install v1.1.0 (5903a614)
[16.07ms] migrated lockfile from package-lock.json
  🚚 @hail2u/css-mqpacker... error: InstallFailed extracting tarball for @hail2u/css-mqpacker
error: moving "@hail2u/css-mqpacker" to cache dir failed: EEXIST: File or folder exists (NtSetInformationFile())
  From: .17c24ccbdf9dfffc-00000001.css-mqpacker
    To: @GH@hail2u-node-css-mqpacker-0c6b5ab

I tried to rm -r node_modules thinking that might be the issue. After the removal was done, bun.exe install threw the same error.

The package in question is specified in package.json as follows:

{
  "devDependencies": {
    "@hail2u/css-mqpacker": "github:hail2u/node-css-mqpacker#v8.0.1",
    "others": "..."
  }
}
abrahamseni commented 5 months ago

I have the same error when installing .tgz package, i.e:

XLSX: https://cdn.sheetjs.com/xlsx-0.20.1/xlsx-0.20.1.tgz

Error message: image

metaspartan commented 5 months ago

Running bun install at all on Windows, results in crash for any command like install or add, bun --version works and bun --help

bun install v1.1.0 (5903a614)

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: dotenv
Elapsed: 11ms | User: 0ms | Sys: 0ms
RSS: 45.94MB | Peak: 45.94MB | Commit: 92.25MB | Faults: 11377
----- bun meta -----
ShadyShenAli commented 5 months ago

Running bun install at all on Windows, results in crash for any command like install or add, bun --version works and bun --help

bun install v1.1.0 (5903a614)

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: dotenv
Elapsed: 11ms | User: 0ms | Sys: 0ms
RSS: 45.94MB | Peak: 45.94MB | Commit: 92.25MB | Faults: 11377
----- bun meta -----

same with me. windows 11 version 23H2 (OS build 22631.3296)

Jarred-Sumner commented 5 months ago

@Atulin the crash you ran into was fixed in #9729 and is unrelated to this issue

@metaspartan @ShadyShenAli @glitch-txs the crash you're running into is caused most likely is caused by using an older CPU. See #3312

metaspartan commented 5 months ago

@Atulin the crash you ran into was fixed in #9729 and is unrelated to this issue

@metaspartan @ShadyShenAli @glitch-txs the crash you're running into is caused most likely is caused by using an older CPU. See #3312

Running AMD 7950X AM5 platform

glitch-txs commented 5 months ago

@Jarred-Sumner I'm using a notebook:

Asus, 11th Gen Intel Core i7 2.80GHz RAM 16GB Type System 64bits x64

Maybe I need to install something?

Cristy94 commented 5 months ago

I want to switch from ParcelJS to Bun. I also get an erro trying to run bun install

[0.00ms] ".env.local"
bun install v1.1.0 (5903a614)
[24.63ms] migrated lockfile from package-lock.json

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: dotenv extracted_packages(127) lockfile_migration_from_package_lock git_dependencies(3)
Elapsed: 5857ms | User: 140ms | Sys: 937ms
RSS: 0.16GB | Peak: 0.16GB | Commit: 0.25GB | Faults: 43559
----- bun meta -----

0   00007FF6A7A0A4C8
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 21648 panic: reached unreachable code
???:?:?: 0x7ff6a6572c28 in ??? (bun.exe)
???:?:?: 0x7ff6a65ba2cb in ??? (bun.exe)
???:?:?: 0x7ff6a65b2610 in ??? (bun.exe)
???:?:?: 0x7ff6a66654c2 in ??? (bun.exe)
???:?:?: 0x7ff6a6391603 in ??? (bun.exe)
???:?:?: 0x7ff6a8ec7e33 in ??? (bun.exe)
???:?:?: 0x7ffb3855257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffb39e8aa57 in ??? (ntdll.dll)

After deleting the package-lock.json file I still get errors:

----- bun meta -----
Bun v1.1.0 (5903a614) Windows x64
InstallCommand: dotenv extracted_packages(127) lockfile_migration_from_package_lock git_dependencies(3)
Elapsed: 5857ms | User: 140ms | Sys: 937ms
RSS: 0.16GB | Peak: 0.16GB | Commit: 0.25GB | Faults: 43559
----- bun meta -----

0   00007FF6A7A0A4C8
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 21648 panic: reached unreachable code
???:?:?: 0x7ff6a6572c28 in ??? (bun.exe)
???:?:?: 0x7ff6a65ba2cb in ??? (bun.exe)
???:?:?: 0x7ff6a65b2610 in ??? (bun.exe)
???:?:?: 0x7ff6a66654c2 in ??? (bun.exe)
???:?:?: 0x7ff6a6391603 in ??? (bun.exe)
???:?:?: 0x7ff6a8ec7e33 in ??? (bun.exe)
???:?:?: 0x7ffb3855257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffb39e8aa57 in ??? (ntdll.dll)

C:\wamp64\www\userTrack>bun install
[0.00ms] ".env.local"
bun install v1.1.0 (5903a614)
  🔍 buildcheck [830/1158] error: InstallFailed extracting tarball for heatmap.js
error: moving "heatmap.js" to cache dir failed: EEXIST: File or folder exists (NtSetInformationFile())
  From: .17c3303f68bdfb7f-00000022.heatmap.js
    To: @GH@UXWizz-heatmap.js-1452fc7

Bun can not load a package from a GitHub repo?

This is the package that fails: "heatmap.js": "https://github.com/UXWizz/heatmap.js",

Cristy94 commented 5 months ago

For everyone it seems to crash when using dotenv.

Edit: this is not correct, it's a peer dependency issue

xPaw commented 5 months ago

I don't use dotenv, but it crashes when providing args to install:

(the only production dependency I have is esbuild)

.\bun.exe install --production
bun install v1.1.3 (2615dc74)

uh-oh: reached unreachable code
bun will crash now 😭😭😭

----- bun meta -----
Bun v1.1.3 (2615dc74) Windows x64
InstallCommand: spawn lifecycle_scripts
Elapsed: 309ms | User: 0ms | Sys: 0ms
RSS: 81.17MB | Peak: 81.17MB | Commit: 0.14GB | Faults: 20010
----- bun meta -----

0   00007FF6D84A3E18
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 15420 panic: reached unreachable code
???:?:?: 0x7ff6d6fea588 in ??? (bun.exe)
???:?:?: 0x7ff6d702699d in ??? (bun.exe)
???:?:?: 0x7ff6d7021351 in ??? (bun.exe)
???:?:?: 0x7ff6d70d484f in ??? (bun.exe)
???:?:?: 0x7ff6d6e01603 in ??? (bun.exe)
???:?:?: 0x7ff6d99a3eb3 in ??? (bun.exe)
???:?:?: 0x7ffa7466257c in ??? (KERNEL32.DLL)
???:?:?: 0x7ffa7694aa47 in ??? (ntdll.dll)