Skip to content

review: match libuv stack-size logic verbatim; drop test timeout; pru…

5985ac9
Select commit
Loading
Failed to load commit list.
Open

napi: polyfill uv_thread_* against pthread #29261

review: match libuv stack-size logic verbatim; drop test timeout; pru…
5985ac9
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 13, 2026 in 27m 8s

Code review found 1 potential issue

Found 1 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/bun.js/bindings/uv-posix-polyfills.c:254-261 uv_thread_create_ex missing overflow check after page-rounding

Annotations

Check warning on line 261 in src/bun.js/bindings/uv-posix-polyfills.c

See this annotation in the file changed.

@claude claude / Claude Code Review

uv_thread_create_ex missing overflow check after page-rounding

In `uv_thread_create_ex`, the page-rounding expression `(stack_size + pagesize - 1) & ~(pagesize - 1)` can integer-overflow when `stack_size` is near SIZE_MAX, producing a wrapped value that may silently fall below `uv__min_stack_size()` and cause a thread to be created with minimum stack rather than aborting; note that two refuters independently verified upstream libuv v1.x does not include an overflow guard here either, so this is not a divergence from libuv but a pre-existing limitation inher