oven-sh / bun

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

Segmentation Fault Crash on MacOS #11154

Closed xela7 closed 1 month ago

xela7 commented 4 months ago

How can we reproduce the crash?

install bun 1.1.8 globally on macOSX 14.1.1

I suspect that the wrong binary file is being installed for some reason -- see the refernce to the .exe in the logs.

JavaScript/TypeScript code that reproduces the crash?

the following generates the crash: bun test/health-api.test.ts

import type { OpenAPIHono } from "@hono/zod-openapi";
import { beforeAll, describe, expect, test } from "bun:test";

import application from "../src/index";

describe("misc routes", () => {
  let app: OpenAPIHono;

  beforeAll(() => {
    app = application.app;
  });

  test("GET /health", async () => {
    const res = await app.request("/health");
    expect(res.status).toBe(200);
    expect(await res.text()).toBe("OK");
  });
});

the following works: bun test/test.test.ts

console.log("Bun is working!");

### Relevant log output

```shell
bun test test/health-api.test.ts 
bun test v1.1.8 (89d25807)

test/health-api.test.ts:
============================================================
Bun v1.1.8 (89d25807) macOS x64
Args: "/Users/alex/.pnpm/global/5/node_modules/bun/bin/bun.exe", "test", "test/providers-api.test.ts"
Features: jsc dotenv transpiler_cache(7) tsconfig(16) 
Builtins: "node:assert" "node:buffer" "node:crypto" "node:dns" "node:events" "node:fs" "node:module" "node:net" "node:os" "node:path" "node:string_decoder" "node:tty" "node:url" "node:util" "node:util/types" "node:worker_threads" 
Elapsed: 335ms | User: 278ms | Sys: 135ms
RSS: 94.99MB | Peak: 94.99MB | Commit: 1.07GB | Faults: 2194

panic(main thread): Segmentation fault at address 0x1A
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.8/mt189d2580AiogggF___4rm9yCy9t76Byj8mkC4quuoC4m/1e_yo5kzCA2A0B

/Users/alex/.pnpm/bun: line 13: 70212 Illegal instruction: 4  "$basedir/global/5/node_modules/bun/bin/bun.exe" "$@"

Stack Trace (bun.report)

Bun v1.1.8 (89d2580) on macos x86_64 [TestCommand]

Segmentation fault at address 0x0000001A

KaiWenRui commented 3 months ago

同样出现了这个问题,不知道如何解决