Repository navigation
test(libc): skip floating-point trap tests where the host keeps no unmasked exception - #19838
Merged
oneandonlydean merged 1 commit intoNov 14, 2026
Conversation
…masked exception Rosetta 2 keeps the six MXCSR exception masks set and raises no x87 SIGFPE, so guest_set_env and guest_raise_except aborted on macOS on checks that need a host able to trap. Probe the host with the same HostKeepsSseTraps check that GuestUpdateEnv and GuestFloatingPoint use. The pending and trap cases exit 77 and are registered with SKIP_RETURN_CODE 77. The independent mask checks expect the SSE masks to stay set when the host cannot clear them. Hosts that keep them run the strict checks unchanged. The first C++ exception of a macOS process sets errno to ENOENT, which tripped the null-pointer errno check of guest_set_env, so the test throws and catches one exception before it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
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.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
guest_set_envandguest_raise_exceptfail on macOS under Rosetta 2, which keeps the six MXCSR exception masks set and raises no x87SIGFPE(already recorded forfeupdateenvindocs/dev/debt/libc.md). The two tests assume a host that can hold and deliver unmasked exceptions. They abort on checks that need one; the library code is not at fault.GuestSetEnv.cppandGuestRaiseExcept.cppgain theHostKeepsSseTrapsprobe thatGuestUpdateEnv.cppandGuestFloatingPoint.cppalready use.guest_set_env_pending_0..5andguest_raise_except_trap_0..5exit 77 when the host keeps no unmasked exception and are registered withSKIP_RETURN_CODE 77, asguest_update_env_pending_*is.guest_set_envand the differing-masks check ofguest_raise_exceptexpect the SSE masks to stay set when the host cannot clear them. A host that keeps them runs the same strict comparison as before.errnotoENOENT, which broke the null-pointererrnocheck ofguest_set_env(a plainthrow/catchofstd::invalid_argumentin a standalone x86-64 program does it too:errno123 became 2 on the first throw and stayed 123 on later ones). The test throws and catches one exception before that check.docs/dev/debt/libc.mdrecords the Rosetta limit and theerrnobehavior.pr_overlap.py --branch(main2b9d71c, 1603 open pull requests) found 105 that share a file with the branch, merged 105/105 into the base, and could not compare 25 that conflict withmain(feat(libc): support archive-backed stdio reads #7447, fix(libc): provide ASOBI_ROOT environment variable for title path resolution #7715, fix(libc): support character reads from random device streams #8150, fix(libc): use the Annex K size limit and codes of the PS5 libc, as measured on a PS5 #8965, fix(libc): follow snprintf_s and sscanf_s constraints as measured on a PS5 #9087, feat(libc): decode non-ASCII scanset members and non-BMP characters in the guest wide scanf #9340, feat(libc): add the std::__sce_v2 thread start, timed wait, clock and processor count calls #9447, feat(libc): add the C locale helpers _Getctype, _Getcoll, _Getcvt, _Getdateorder, _Strcoll and _Strxfrm #9466, feat(libc): add std::__sce_v2::_Random_device, _Fiopen and setw #9526, feat(libc): wire the codecvt<wchar_t,char> facet vtable #11172, fix(libc): bound narrow formatting fields #11332, feat(relinker): support short scalar guest GS instructions #11661, feat(relinker): support SSE guest GS memory accesses #11689, feat(relinker): support VEX guest GS memory accesses #11698, feat(libkernel): cancel blocked POSIX reads with owned operations #12682, fix(libkernel): preserve blocking sockets over nonblocking native transport #12688, feat(libkernel): cancel blocked POSIX writes with partial progress #12700, feat(libc): add SSE2 paths for trivial search and min helpers #12717, fix(libc): optionally reclaim and lazily commit small heap spans #12849, feat(libkernel): support deferred cancellation in POSIX accept #12965, feat(run-report): recover the report of a run that ended without writing one #15973, fix(videoout): end shutdown when a host thread cannot unwind #16791, feat(relinker): emit per-NID call hook table #17557, feat(tools): nid_names client for the debugger #17558, feat(libSceLibcInternal): implement std mutex object lifecycle and locking #19602), all throughcore/libs/prx/libc/CMakeLists.txtordocs/dev/debt/libc.md. I compared those 25 by hand: none changesGuestSetEnv.cpporGuestRaiseExcept.cpp, none mentionsfesetenv,feraiseexcept,guest_set_env,guest_raise_exceptorHostKeepsSseTrapsin its diff, and feat(libkernel): cancel blocked POSIX reads with owned operations #12682, fix(libkernel): preserve blocking sockets over nonblocking native transport #12688, feat(libkernel): cancel blocked POSIX writes with partial progress #12700 and feat(libkernel): support deferred cancellation in POSIX accept #12965 changelibc/CMakeLists.txtonly at line 170, away from the registrations here.Tested
macOS 27.0.1, Apple M3 Pro, AppleClang 21, Ninja, Release, x86-64 full build under Rosetta 2,
BUILD_TESTING=ON. The tree also carried the one-file change of #17425 locally, which the full macOS build needs to linklibcurl.prx; it is not part of this PR.mainf83d7e1: a fullctestrun listedguest_set_env,guest_set_env_pending_0..5,guest_raise_exceptandguest_raise_except_trap_0..5asSubprocess aborted. Run alone,guest_set_envprintedfesetenv: independent x87/SSE exception masks restoredand died withSIGABRTfromRequireinStateMatrix(); after that check was fixed it stopped atnull rejected without state or errno change, and with the three conditions split only theerrnoone failed.0x3f; all 64 x87 mask values round-trip.main2ac33b4 (the currentmain2b9d71c differs from it only indocs/dev/debt/libSceNKWebKit.md, and the branch is rebased on it):ctest --test-dir build-mac -R '^guest_(set_env|raise_except)'passed 100% (15/15 includingguest_raise_exception):guest_set_envandguest_raise_exceptpass, the 12 pending and trap tests are reported as skipped.guest_set_env_testsrun directly printsfesetenv checks passed:196608 state combinations,4096 mask pairs, bounds/errors/tags/threads.HostKeepsSseTrapsis true nothing is skipped and the expected values are unchanged, so the strict checks run as before.python3 tools/check_conventions.py --base origin/mainwith this title and description.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)🤖 Generated with Claude Code