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

Crash on route handler returning SSE stream. #17947

Open
lithdew opened this issue Mar 6, 2025 · 0 comments
Open

Crash on route handler returning SSE stream. #17947

lithdew opened this issue Mar 6, 2025 · 0 comments
Labels
crash An issue that could cause a crash macOS An issue that occurs on macOS

Comments

@lithdew
Copy link
Contributor

lithdew commented Mar 6, 2025

How can we reproduce the crash?

Will attempt to make a minimal reproduction.

I have a backend and frontend. The backend serves the SSE stream via. Bun.serve which has an idleTimeout set to 255. The frontend repeatedly reconnects to the SSE stream every time it gets disconnected due to the idleTimeout.

Relevant log output

Request (0 KB) {
  method: "POST",
  url: "http://localhost:3000/api/stream",
  headers: Headers {
    "host": "localhost:3000",
    "connection": "keep-alive",
    "content-length": "247",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
    "content-type": "text/plain;charset=UTF-8",
    "accept": "*/*",
    "origin": "http://localhost:3000",
    "sec-fetch-mode": "cors",
    "sec-fetch-dest": "empty",
    "referer": "http://localhost:3000/",
    "accept-encoding": "gzip, deflate, br, zstd",
    "accept-language": "en-US,en-AU;q=0.9,en;q=0.8",
    "cookie": "omitted",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-ch-ua": "\"Not A(Brand\";v=\"8\", \"Chromium\";v=\"132\", \"Google Chrome\";v=\"132\"",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-site": "same-origin",
  }
  ReadableStream {
    locked: [Getter],
    cancel: [Function],
    getReader: [Function],
    pipeTo: [Function],
    pipeThrough: [Function],
    tee: [Function],
    values: [Function],
    [Symbol(Symbol.asyncIterator)]: [Function],
  }
}
============================================================
Bun v1.2.4 (fd9a5ea6) macOS Silicon
macOS v14.5
Args: "bun" "./server.ts"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) abort_signal(19) bunfig dotenv(2) fetch(37) http_server(2) jsc spawn(3) transpiler_cache(51) tsconfig(25) tsconfig_paths napi_module_register process_dlopen(4) 
Builtins: "bun:jsc" "bun:main" "bun:sqlite" "detect-libc" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:constants" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:perf_hooks" "node:process" "node:querystring" "node:readline" "node:stream" "node:stream/web" "node:string_decoder" "node:tls" "node:tty" "node:url" "node:util" "node:util/types" "node:vm" "node:zlib" "node:worker_threads" "ws" "node:v8" "node:http2" 
Elapsed: 446575ms | User: 498386ms | Sys: 46963ms
RSS: 13.17GB | Peak: 15.16GB | Commit: 0.02ZB | Faults: 2848

panic(main thread): Segmentation fault at address 0x10
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

Stack Trace (bun.report)

Bun v1.2.4 (fd9a5ea) on macos aarch64 [AutoCommand]

Segmentation fault at address 0x00000010

  • 2 unknown/js code
  • WebCore::structuredCloneForStream
  • 3 unknown/js code
  • llint_call_javascript
  • JSC::Interpreter::executeCall
  • JSC::runJSMicrotask
  • JSC::VM::drainMicrotasks

Features: transpiler_cache, tsconfig, tsconfig_paths, napi_module_register, process_dlopen, Bun.stderr, Bun.stdin, Bun.stdout, abort_signal, bunfig, dotenv, fetch, http_server, jsc, spawn

Sentry Issue: BUN-DTF

@lithdew lithdew added the crash An issue that could cause a crash label Mar 6, 2025
@github-actions github-actions bot added the macOS An issue that occurs on macOS label Mar 6, 2025
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
Projects
None yet
Development

No branches or pull requests

1 participant