Files
bun.sh/src
Claude Bot be6d3ca2d8 fix(shell): prevent use-after-free in runFromJS error path
When `setupIOBeforeRun()` fails in `runFromJS`, `#deinitFromExec()` was
called which immediately frees the interpreter via `allocator.destroy(this)`.
Since the interpreter is a GC-managed object (`JSShellInterpreter`), the
GC finalizer later calls `deinitFromFinalizer()` on already-freed memory,
causing a segfault.

Replace `#deinitFromExec()` with `#derefRootShellAndIOIfNeeded(true)` which
cleans up runtime resources (IO, shell env) and sets `cleanup_state` to
`.runtime_cleaned`, letting the GC finalizer safely handle the actual struct
destruction.

Closes #26907

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-11 20:44:17 +00: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-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
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