Repository navigation
fix(libcurl): use poll backend on macOS - #24064
Romannachwievor wants to merge 1 commit into
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against f25303bfdd:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_curl_Sockets_testsbuilt cleanly. - CTest (
guest_curl_sockets):1/1 Test #5509: guest_curl_sockets ............... Passed 0.15 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libcurl/src/CurlSockets.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #5509: guest_curl_sockets ............... Passed 0.15 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified CMakeLists.txt for libcurl properly forwards CMAKE_OSX_ARCHITECTURES and sets HAVE_POLL_FINE on APPLE platforms
- Verified CurlSockets.cpp Wait_nid_no_patch character-device guard under APPLE correctly checks fstat and S_ISCHR before NotImplemented_nid_no_patch
- Verified technical debt fragment docs/dev/debt/changes/fix-curl-macos-poll.md matches AGENTS.md conventions for known gaps
- Verified tests in CurlSockets.cpp properly test extra descriptor handling and character-device NotImplemented exception under APPLE
- Audited error handling, memory safety, pointer bounds, and concurrency in CurlSockets.cpp Wait_nid_no_patch
Looks Good To Me
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the reported platform runs support the fix, and the inspected code raises no verified defect.
What I ran
Reviewed head f25303bfdd388b306e6e0db2fdf6cf1a0a978a41. No commands or tests were run; the author-reported test results are summarized below.
Results
| Check | Result | Note |
|---|---|---|
| Code review | passed | All changed files and added lines read |
| Tests | not run | Author reports macOS and Linux runs |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not independently reproduce the reported macOS or Linux runs. No changed files were excluded.
To get this to a good state
Nothing is required.
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
Jazeupoi
left a comment
There was a problem hiding this comment.
Ran it on a second Mac: Apple M4, macOS 27.0.1, Apple clang (Command Line Tools), x86_64 Release build under Rosetta 2, main e825fa1492 with #17425 and #11049.
Merge with #17425: this PR adds its own if(APPLE) block with CMAKE_OSX_ARCHITECTURES to libcurl/CMakeLists.txt, at the same place #17425 adds one. So the hunk does not apply on a tree that has #17425, and the two PRs will conflict when the second one is merged. For this run I applied CurlSockets.cpp and its test from head f25303bfdd as they are, and added -DHAVE_POLL_FINE:BOOL=ON to #17425's existing line. curl_config.h then has #define HAVE_POLL_FINE 1. In main's build it is /* #undef HAVE_POLL_FINE */.
| Tree | guest_curl_sockets |
|---|---|
this PR's test with main's code (select backend) |
fails 3 of 3 at CurlSockets.cpp:508, the new pipe wait check |
| this PR | gets past that check and the rest of ErrorsAndExtraDescriptors, then fails 3 of 3 at CurlSockets.cpp:629 in MultiWakeupPoll |
main |
fails 3 of 3 at CurlSockets.cpp:603, the same MultiWakeupPoll check |
The MultiWakeupPoll failure is the drained poll after the two wakeups: curl_multi_poll with a 60 ms timeout returns in under 25 ms. It happens with and without this PR, so it is not caused by it. On this M4 it fails every run, not only now and then as on the M1 in the description.
AI-assisted: yes (Claude Code)
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
|
@oneandonlydean, the AI-assisted: yes (Claude Code) |
ligmaSec
left a comment
There was a problem hiding this comment.
Built and ran the integrated curl socket fixture on Linux. It passed from a short working directory after the standard scratch path exceeded sun_path. I traced the macOS backend selection to the poll implementation. The macOS wakeup path still needs a Darwin run.
AI-assisted: yes.
|
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.
|
What
Set
HAVE_POLL_FINEfor the macOS libcurl backend so high descriptors usepoll. On macOS, reject character-device extra descriptors whose readiness cannot matchselectbehavior.Tested
mac-full-run2with fix(libcurl): build the curl backend for the macOS target architecture #17425 present: clean-cache baseline failed at the high-FD assertion; fixed selector passed three times. The fullguest_curl_group passed 10/10 once; a later run failed atMultiWakeupPolltiming.^guest_curl_passed 10/10 tests on base and fix, three runs each.build-full, maina4d1053d4b+ fix(libcurl): build the curl backend for the macOS target architecture #17425 + build(audio): link one SDL copy on macOS #11049, without this change):guest_curl_socketsalso fails intermittently at the sameMultiWakeupPolltiming check (CurlSockets.cpp:603, drainedcurl_multi_pollreturns before 25 ms): 2 of 3 base runs aborted there. So that failure is not caused by this change.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)