Repository navigation
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
There was a problem hiding this comment.
The macOS behavior is narrowly scoped: an ENOTCONN result is treated as an already-shut direction only when getpeername confirms the socket still has a peer; SHUT_RDWR explicitly attempts the write shutdown after XNU’s read-side early exit. The reported macOS control (same integration tree without this change fails, with it passes) and Linux test pass are useful, but the hosted product jobs are skipped and I did not rerun runtime tests here. Exact-head conventions and whitespace pass. Please coordinate the shared Udp.cpp hunk with #8658 and #7201 before merge; the description says either port PR must drop these lines if this one lands first, so record the agreed order/dependency in the checklist or thread.
I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
|
On the #5239 direction: this came from running the suite on the macOS port tree discussed on #1, where the shutdown tests fail without it, not from a title. I am fine holding it until the queue drops or a maintainer says otherwise, or closing it in favour of #8658 if that is preferred. Merge order, recorded here: if #8658 or #7201 lands first, I rebase this and drop whatever their |
|
I rechecked the exact PR head ( |
a170171 to
7c21378
Compare
|
Rebased onto current Refreshed results on this head: Landing order with the two port PRs is now written on both of them, #8658 and #7201: whichever lands first, the other drops its copy of the |
|
The hosted Linux run on head |
|
I’ve noticed that asking you to hold this PR was unnecessary. It’s fine to keep submitting PRs; maintainers will handle them in due course. |
Independent test: Apple M1 Pro, macOS 27.0.1Apple M1 Pro, macOS 27.0.1, Apple clang 21, x86-64 Release build under Rosetta 2,
Full AI-assisted: yes (Claude Code ran the build and the tests). |
|
@maximilianfv thanks for the M1 Pro run on macOS 27; the description's Tested section now lists it. That covers both macOS majors the series builds on. |
What
guest_socket_pairfails on macOS hosts atGuestSocketPair.cpp:238: after the peer'sshutdown(SHUT_WR),shutdown(pair[1], SHUT_RD)returns -1 withENOTCONN. A small host program shows the same thing: on a connectedAF_UNIXstream pair,shutdown(b, SHUT_RD)succeeds on a fresh pair, fails withENOTCONN(57) once the peer has shut its sending side, and the 5 queued bytes are still readable afterwards.The two kernels differ here:
soshutdownlock_final(bsd/kern/uipc_socket.c) returnsENOTCONNwhen the direction asked for is already shut (/* read already shut down */,/* write already shut down */), and forSHUT_RDWRit jumps todonebefore the write side when the read side was already shut.soshutdown(sys/kern/uipc_socket.c) returnsENOTCONNonly when the socket isn't connected; for a connected socket it shuts what was asked and returns 0, whatever was shut before.On macOS,
shutdownnow treatsENOTCONNfrom a socket that still has a peer (getpeernamesucceeds) as a direction that was already shut: the call succeeds and the guest's shut state is recorded as before. ForSHUT_RDWRthe write side is then shut explicitly, since XNU skipped it. A socket without a peer still fails withENOTCONN, as on FreeBSD. Linux and Windows behave as before.@iamthehimansh's #8658 and @marion909's #7201 make the same change as part of their macOS ports (#8658 for
SHUT_RDonly). This is that change on its own with the test it fixes, as #8920 did for thefflushguard. Whichever lands first, the other drops these lines.Tested
mainalone, so this ran on @mugurc'sci/macos-series-2at53db0badbwith fix(tests): compare the Bessel exports with fixed reference values #7524, the code of feat(libkernel): JIT shared memory on macOS hosts #7937 and the libSceSsl change of feat: macOS on Apple Silicon host support (Rosetta 2 and MoltenVK) #7332.guest_socket_pairwithout this change aborts atGuestSocketPair.cpp:238(found with lldb); with it, it passes.guest_socket_pairpasses.ci/macos-series-2at27e968974with this change and six other macOS PRs cherry-picked:guest_socket_pairaborts atGuestSocketPair.cpp:238without it and passes 2 of 2 with it; no test that passed before fails with the batch applied.check_conventions.pypasses.pr_overlap.pyreports the same lines in feat: macOS host support (Apple Silicon via Rosetta 2, Vulkan on MoltenVK) #8658, as described above.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)