Repository navigation
winrun: safe SuspendThread, Steam accept context, 2048 threads per process - #106
Conversation
- kernel32: SuspendThread lets the target run on to a point where it holds none of winrun's locks and the allocator is free (half a second at most) before it returns. Chromium's stack sampler suspends threads and then calls VirtualQuery; a thread stopped inside the loader, region or heap lock hung the whole web helper browser process. - ws2_32: setsockopt SO_UPDATE_ACCEPT_CONTEXT (the accepted socket takes the listener's buffer sizes) and SO_UPDATE_CONNECT_CONTEXT. Steam's client calls the first after AcceptEx on its local web UI transport server and dropped every connection when it failed with WSAENOPROTOOPT. - ws2_32: socket, bind, connect, listen, accept and Winsock errors are logged under OSYX_WINRUN_FAILTRACE too, not only under -v. - ws2_32/overlapped: a helper thread that cannot be started fails the operation with WSAENOBUFS instead of panicking the process; helpers use 64 KiB stacks like winrun's other helpers. - abi: MAX_THREADS per process 256 -> 2048. The web helper's browser process reached the limit (its own threads plus winrun's helpers for registered waits and overlapped I/O) and winrun panicked spawning one. - tokens: GetTokenInformation on another process's token refuses the classes that process can change (privileges, owner, primary group, default DACL, integrity level) instead of reporting their start state. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
The kernel connects loopback sockets at once, so a non-blocking connect to 127.0.0.1 returned 0. On Windows it always fails with WSAEWOULDBLOCK and reports the connection through FD_CONNECT and select's writability; Chromium's TCPSocketWin treats a 0 as unreachable (NOTREACHED) on every connection its network service made to Steam's local servers. The call now reports a completed non-blocking connect the Windows way; the event watcher records FD_CONNECT when the connected socket is writable. Overlapped socket completions are logged under OSYX_WINRUN_FAILTRACE (the first 400), to follow the traffic. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Follow-up to #105. With this PR the 64-bit Steam client gets through its web helper start, the web UI transport connects, and Steam's "Sign in to Steam" window opens fully rendered (test run s67o: the sign-in form and the QR code the Steam servers sent).
Changes, in the order the Steam test runs found them
kernel32.rs). The target runs on until it holds none of winrun's locks and the allocator is free (500 ms at most). Before this, Chromium's stack sampler suspended a thread inside the loader, region or heap lock, then called VirtualQuery, and the web helper's browser process hung.SO_UPDATE_ACCEPT_CONTEXT/SO_UPDATE_CONNECT_CONTEXT(ws2_32.rs). Steam calls the first after AcceptEx and dropped every connection when it failed.shared/abi, was 256). Overlapped I/O fails with WSAENOBUFS instead of panicking when no helper thread can start.kernel/src/net.rs,NetSocket::pid, which replaces the oldreservedfield, so the record stays 56 bytes;GetExtendedTcpTabledwOwningPid). Steam answers its/transportsocket/with 403 unless it can open the peer process found through the TCP table.mem.rs). V8 code pages that were discarded, or never touched, while mapped read-execute faulted as not present and the renderer died. MEM_RESET now keeps pages committed, as on Windows.xwindow.exetests it (6/6 on Windows 11, passes on OSyx).selectwith every set empty fails with WSAEINVAL, as on Windows 11.Verification
cargo buildof the kernel and all user programs (flags fromscripts/build.ps1) succeeds.cargo test -p osyx-abi: 22 passed.wsaext.exeIPv6 checks (from Steam: CEF browser starts its child processes, disk caches and GPU fallback #105) andnewlibs.exeatlthunk (5/5).scripts/win-test.ps1): 2947 passed, 0 failed.Remaining
Labels: bug, network, kernel
🤖 Generated with Claude Code