You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reject oversized POSIX descriptors before narrowing them for readiness waits #807
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
net_wait_readable and net_wait_writable accept an i64 descriptor but narrow it to i32 after checking only for negative values. 4294967295 becomes -1, which POSIX poll ignores, so an invalid descriptor is reported as a timeout. With an infinite timeout this can wait indefinitely; other large values can alias a different descriptor.
Linux amd64; source-built compiler at ade878134519b0f957ca28a23c6f9cd98e43dff3, LLVM 21, with the matching checkout std. The affected source files are byte-identical to canonical master 286dad9c8fcb0616f7c719c72cbf453a7d9925fd.
Both O0 and O2 print 0 0. Expected: both calls reject the out-of-range descriptor, using the existing bad-descriptor error convention.
Scope
Easy: validate the POSIX descriptor range before conversion. Apply the same rule through net_wait_connected. Preserve full-width Windows socket handles and generic poll semantics for deliberately disabled negative entries.
Completion criteria
Reject values above the POSIX descriptor range without calling poll.
Cover negative values, 2147483648, 4294967295 and 4294967296, with a normal valid descriptor control.
Preserve Windows handle behavior; run the regression at O0/O2.
bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.
Activity