Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun segfaults when building library #14018

Open
mreinertssgr opened this issue Sep 18, 2024 · 2 comments
Open

Bun segfaults when building library #14018

mreinertssgr opened this issue Sep 18, 2024 · 2 comments
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS runtime

Comments

@mreinertssgr
Copy link

mreinertssgr commented Sep 18, 2024

How can we reproduce the crash?

I'm creating a simple library, that unfortunately I cannot share. This is my build file and the relevant parts of package.json

import dts from 'bun-plugin-dts';

await Bun.build({
    entrypoints: ['./src/index.ts'],
    outdir: './dist',
    minify: true,
    plugins: [dts()],
});
  "types": "dist/index.d.ts",
  "type": "module",
  "main": "dist/index.js",
  "scripts": {
    "build": "bun run build.mjs",
    "prepublishOnly": "bun run build"
  },
  "devDependencies": {
    "@biomejs/biome": "1.9.1",
    "@types/bun": "^1.1.9",
    "bun-plugin-dts": "^0.2.3"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "dependencies": {
    "@types/argon2-browser": "^1.18.4",
    "argon2-browser": "^1.18.0"
  }

Relevant log output

❯ bun run build
$ bun run build.mjs
============================================================
Bun Canary v1.1.28-canary.79 (b66d622c) macOS Silicon
macOS v14.5
Args: "bun" "run" "build.mjs"
Features: jsc transpiler_cache(2) tsconfig_paths tsconfig
Builtins: "bun:main" "node:buffer" "node:crypto" "node:fs" "node:module" "node:os" "node:path" "node:perf_hooks" "node:string_decoder" "node:util/types"
Elapsed: 725ms | User: 1847ms | Sys: 87ms
RSS: 0.49GB | Peak: 0.49GB | Commit: 1.05GB | Faults: 56

panic: Segmentation fault at address 0x4
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.28/Mr2b66d622AigggwD__+k61Bm+06Xuxo2W__A2AI

error: script "build" was terminated by signal SIGTRAP (Trace or breakpoint trap)
zsh: trace trap  bun run build

Stack Trace (bun.report)

Bun v1.1.28 (b66d622) on macos aarch64 [RunCommand]

Segmentation fault at address 0x00000004

  • 2 unknown/js code
  • src.bundler.bundle_v2.LinkerContext.generateChunksInParallel
  • src.bundler.bundle_v2.BundleV2.runFromJSInNewThread
  • Thread.PosixThreadImpl.spawn__anon_172370.Instance.entryFn
@mreinertssgr mreinertssgr added the crash An issue that could cause a crash label Sep 18, 2024
@github-actions github-actions bot added macOS An issue that occurs on macOS runtime labels Sep 18, 2024
@dylan-conway
Copy link
Collaborator

Do you import any wasm files? If so, I believe #14047 will fix this crash

@shinobu-uwu
Copy link

Yes, argon2-browser communicates with the C implementation via wasm.

That's great to hear, is there any ETA for a release including this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS runtime
Projects
None yet
Development

No branches or pull requests

3 participants