oven-sh / bun

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

Bun v1.1.18 Crash on Windows 10 - Sentinel Mismatch #12493

Open chicken-suop opened 1 month ago

chicken-suop commented 1 month ago

What version of Bun is running?

Bun v1.1.18 (5a0b9352) Windows x64

What platform is your computer?

Windows 10 x64

What steps can reproduce the bug?

I'm encountering a crash when attempting to run Bun v1.1.18 on my Windows 10 x64 system created via vagrant. The crash message indicates a sentinel mismatch.

Crash Message:

vagrant@DESKTOP-PGRKF36 C:\Users\vagrant>powershell -c "irm bun.sh/install.ps1 | iex"
###################################################################################################################################################################################### 100.0%
============================================================
Bun v1.1.18 (5a0b9352) Windows x64
Args: 
Elapsed: 1ms | User: 0ms | Sys: 15ms
RSS: 16.77MB | Peak: 16.77MB | Commit: 59.96MB | Faults: 4236

panic(thread 6808): sentinel mismatch: expected 0, found 170
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.18/w_15a0b935AAm8Kor3j/CCA63yECAwk1WA0

Install Failed - could not verify bun.exe
The command 'C:\Users\vagrant\.bun\bin\bun.exe --revision' exited with code 3

1

System Configuration:

vagrant@DESKTOP-PGRKF36 C:\Users\vagrant>powershell -command "Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like '*Visual C++*' } | Select-Object Name, Version"

Name                                                           Version    
----                                                           -------
Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.40.33810    14.40.33810
Microsoft Visual C++ 2022 X64 Additional Runtime - 14.40.33810 14.40.33810

Steps taken:

Created VagrantFile with these contents:

Vagrant.configure("2") do |config|
    config.vm.box = "gusztavvargadr/windows-11"
    config.vm.box_version = "2302.0.2404"
end

Ran vagrant up and then vagrant ssh. Ran powershell -c "irm bun.sh/install.ps1 | iex" and got this error:

powershell -c "irm bun.sh/install.ps1|iex"
###################################################################################################################################################################################### 100.0%
Install Failed - You are missing a DLL required to run bun.exe
This can be solved by installing the Visual C++ Redistributable from Microsoft:
See https://learn.microsoft.com/cpp/windows/latest-supported-vc-redist
Direct Download -> https://aka.ms/vs/17/release/vc_redist.x64.exe

The command 'C:\Users\vagrant\.bun\bin\bun.exe --revision' exited with code -1073741515

1

Manually installed Visual C++ Redistributable with curl -L -o vc_redist.x64.exe https://aka.ms/vs/17/release/vc_redist.x64.exe and vc_redist.x64.exe /quiet /norestart, then checked it was installed:

vagrant@DESKTOP-PGRKF36 C:\Users\vagrant>powershell -command "Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like '*Visual C++*' }"

IdentifyingNumber : {B8B3BB4A-A10D-4F51-91B7-A64FFAC31EA7}
Name              : Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.40.33810
Vendor            : Microsoft Corporation
Version           : 14.40.33810
Caption           : Microsoft Visual C++ 2022 X64 Minimum Runtime - 14.40.33810

IdentifyingNumber : {59CED48F-EBFE-480C-8A38-FC079C2BEC0F}
Name              : Microsoft Visual C++ 2022 X64 Additional Runtime - 14.40.33810
Vendor            : Microsoft Corporation
Version           : 14.40.33810
Caption           : Microsoft Visual C++ 2022 X64 Additional Runtime - 14.40.33810

Reinstalled bun and got a different error:

vagrant@DESKTOP-PGRKF36 C:\Users\vagrant>rmdir /S /Q C:\Users\vagrant\.bun

vagrant@DESKTOP-PGRKF36 C:\Users\vagrant>powershell -c "irm bun.sh/install.ps1 | iex"
###################################################################################################################################################################################### 100.0%
============================================================
Bun v1.1.18 (5a0b9352) Windows x64
Args: 
Elapsed: 1ms | User: 0ms | Sys: 15ms
RSS: 16.77MB | Peak: 16.77MB | Commit: 59.96MB | Faults: 4236

panic(thread 6808): sentinel mismatch: expected 0, found 170
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:

 https://bun.report/1.1.18/w_15a0b935AAm8Kor3j/CCA63yECAwk1WA0

Install Failed - could not verify bun.exe
The command 'C:\Users\vagrant\.bun\bin\bun.exe --revision' exited with code 3

1

What is the expected behavior?

Bun would install without error

What do you see instead?

An error about sentinel mismatch

Additional information

No response

paperdave commented 1 month ago

crash reporter did not append the message somehow ... but the trace points here: https://github.com/oven-sh/bun/blob/5a0b93523134ca0043ee7ae84f01003aa4b7ff69/src/string_builder.zig#L72

Msfrhdsa commented 1 month ago

same problem on Bun v1.1.20 (ae194892)