Files
bun.sh/src
Claude Bot 82a55d41fe fix(shell,io): fix use-after-free in shell interpreter and pipe reader on Windows
Fix three related crashes reported in #26856:

1. Shell interpreter error path: When `setupIOBeforeRun()` failed in `runFromJS()`,
   `#deinitFromExec()` freed the interpreter immediately via `allocator.destroy(this)`.
   Since the interpreter is GC-managed, the GC finalizer would later access freed memory.
   Fix: clean up runtime resources with `#derefRootShellAndIOIfNeeded(true)` and
   `keep_alive.disable()`, letting the GC finalizer handle destruction.

2. Pipe reader EOF callbacks: `closeImpl` set `pipe.data`/`tty.data` to self-referencing
   pointers, but pending `onStreamRead`/`onStreamAlloc` callbacks from libuv would cast
   the invalid pointer to `WindowsBufferedReader`, causing a segfault.
   Fix: set `pipe.data`/`tty.data` to null and add null guards in the callbacks. The
   `onPipeClose`/`onTTYClose` handlers now use the handle parameter directly instead of
   casting from the data pointer.

Closes #26856

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-10 02:19:39 +00:00
..
2026-01-30 01:38:45 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2026-02-03 22:18:40 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-20 20:56:02 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-12-25 14:00:58 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-25 11:06:24 -08:00
2025-11-10 14:38:26 -08:00
2026-01-07 12:33:21 -08:00
2025-11-10 14:38:26 -08:00
2025-11-20 20:56:02 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2026-01-30 01:38:45 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2026-01-30 01:38:45 -08:00
2025-12-01 21:59:11 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2025-11-10 14:38:26 -08:00
2026-01-30 01:38:45 -08:00