usockets (Windows): keep a closed socket allocated until the dispatch that closed it returns - #39910
Closed
dylan-conway wants to merge 6 commits into
Closed
usockets (Windows): keep a closed socket allocated until the dispatch that closed it returns#39910dylan-conway wants to merge 6 commits into
dylan-conway wants to merge 6 commits into
Claude / Claude Code Review
completed
Aug 22, 2026 in 21m 59s
Code review found 1 important issue
Found 2 candidates, confirmed 1. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | packages/bun-usockets/src/eventing/libuv.c:164-177 |
uv_close deferred past bsd_close_socket: AFD cancel ioctl on closed/reused handle |
Annotations
Check failure on line 177 in packages/bun-usockets/src/eventing/libuv.c
claude / Claude Code Review
uv_close deferred past bsd_close_socket: AFD cancel ioctl on closed/reused handle
Deferring `uv_close` from `us_poll_stop` to `us_poll_free` reorders it to run *after* the caller's `bsd_close_socket` (socket.c:201-202/304-313, context.c:484-485, udp.c:118-119), so `uv__poll_close`'s AFD cancel ioctl now targets a closed socket handle. Under `ProcessStrictHandleCheckPolicy` (always on inside AppContainer) that terminates the process with `0xC0000008 STATUS_INVALID_HANDLE` — robobun's dual-build comparison reproduced this 3/3 on this build with the extended `appcontainer.test
Loading