oven-sh / bun

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

Panic on parsing package.json with specific dependencies #15290

Closed dyc3 closed 1 day ago

dyc3 commented 1 day ago

How can we reproduce the crash?

In a monorepo, if a package contains dependencies that look like this:

"devDependencies": {
    "bits-ui-current": "npm:bits-ui@^0.21.15",
    "bits-ui-next": "npm:bits-ui@^1.0.0-next.57"
  }

Attempting to run scripts will fail and result in a panic.

To reproduce: using this repo: https://codesandbox.io/p/devbox/blazing-snowflake-0uzq6f?fork=true

  1. Run bun run format
  2. See panic

Relevant log output

$ biome format --write && bun --filter='*' run format
Formatted 108 files in 21ms. No fixes applied.
============================================================
Bun v1.1.36 (ededc168) Linux x64
Linux Kernel v5.15.0 | glibc v2.35
CPU: sse42 popcnt avx avx2
Args: "bun" "--filter=*" "run" "format"
Elapsed: 2ms | User: 5ms | Sys: 0ms
RSS: 1.07GB | Peak: 11.19MB | Commit: 1.07GB | Faults: 0

Stack Trace (bun.report)

Bun v1.1.36 (ededc16) on linux x86_64 [RunCommand]

Segmentation fault at address 0x0006024C

github-actions[bot] commented 1 day ago

Thank you for reporting this crash.

For Bun's internal tracking, this issue is BUN-8PM.

dyc3 commented 1 day ago

I tested with other versions, and this starts panicking in v1.1.35.