oven-sh / bun

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

Segmentation fault at address 0xFFFFFFFFFFFFFFFF when using bun serve #11467

Closed tiagorangel2011 closed 4 months ago

tiagorangel2011 commented 4 months ago

How can we reproduce the crash?

Check "JavaScript/TypeScript code that reproduces the crash". Command ran: bun run dev

JavaScript/TypeScript code that reproduces the crash?

**index.js**

Bun.serve({
    development: true,
    fetch(req) {
      const url = new URL(req.url);
      const pathParts = url.pathname.split("/");
      const fileName = pathParts.pop();
      const dir = pathParts.join("/");
      const filePath = `./src/${dir}/${fileName}`;
      if (Bun.file(filePath)) return new Response(Bun.file(filePath));

      return new Response("404!");
    },
});

**package.json**
```json
{
  "name": "name",
  "module": "index.js",
  "devDependencies": {
    "@types/bun": "latest"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  },
  "scripts": {
    "dev": "bun run index.js --hot"
  },
  "type": "module"
}

### Relevant log output

```shell
GET - http://localhost:3000/ failed
============================================================
Bun v1.1.10 (5102a944) Windows x64
Args: "C:\Users\HUAWEI\.bun\bin\bun.exe" "run" "index.js" "--hot"
Features: jsc abort_signal http_server 
Builtins: "bun:main" 
Elapsed: 2463ms | User: 46ms | Sys: 156ms
RSS: 118.42MB | Peak: 118.42MB | Commit: 0.19GB | Faults: 29160

panic(main thread): Segmentation fault at address 0xFFFFFFFFFFFFFFFF
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.10/wr15102a94AihgBwlnzb8rv+Y+1shXolyhXw4yteut2uegtzueqz00G2rx61C60+tFA2DD

error: script "dev" exited with code 3

Stack Trace (bun.report)

Bun v1.1.10 (5102a94) on windows x86_64 [RunCommand]

Segmentation fault at address 0xFFFFFFFFFFFFFFFF

Jarred-Sumner commented 4 months ago

Duplicate of https://github.com/oven-sh/bun/issues/11617