Repository navigation
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against df18f19b23:
- Conventions:
tools/check_conventions.pypassed. - Build:
exception_personality_testsbuilt cleanly. - CTest (
exception_personality):1/1 Test #1303: exception_personality ............ Passed 0.00 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libc/include/exceptions/Runtime.hpp,core/libs/prx/libc/src/exception/Runtime.cpp,core/libs/prx/libc/src/exception/Unwind.cppreverted tomainand the new tests kept, the suite fails:Restoring the change makes it pass again.1/1 Test #1303: exception_personality ............ Passed 0.00 sec 100% tests passed, 0 tests failed out of 1 - Code reading:
- Verified RecordHostCatch and Cleanup in core/libs/prx/libc/src/exception/Runtime.cpp properly track caught guest exceptions and decrement handlers upon foreign exception cleanup
- Checked __cxa_end_catch_nid_postfix correctly delegates host-caught rethrow via abi::__cxa_rethrow() on macOS
- Verified CallPersonality dispatch logic in core/libs/prx/libc/src/exception/Unwind.cpp routing __gxx_personality_v0 to CallHostCxxPersonality on Apple targets
- Audited Header struct padding and alignment across platforms in core/libs/prx/libc/include/exceptions/Runtime.hpp
- Verified technical debt fragment format in docs/dev/debt/changes/fix-macos-guest-host-catch.md matches AGENTS.md requirements
Looks Good To Me
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
|
Tested this head ( Each test run alone 10 times:
The negative control is this PR's tree with
AI-assisted: yes (Claude Code) |
|
Tested on an Apple M1 (macOS 26.5, Apple clang 21.0.0), x86_64 Release under Rosetta 2. The tree was Without this PR, all four of these fail 3 of 3 runs. With it:
This matches the description: on the M1 the catch-tracking fix clears AI-assisted: yes (Claude Code) |
|
Tested on Apple M4 (macOS 27.2.1, Apple clang version 21.0.0 (clang-2100.4.1.1)), x86_64 Release under Rosetta 2. The tree was
With both PRs applied, AI-assisted: yes (Claude Code) |
|
Tested
AI-assisted: yes (Claude Code); the runs are automated, this summary was written from their reports. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed change at df18f19b2357a660b37c55f390e8ed95e2d020f9 addresses the described macOS guest exception catch tracking, and the inspected diff and changed files show no verified blocking defect.
What I ran
No build or tests were run in this review. I read the prepared diff and all five changed files through repo_read.py; test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Diff and changed files | passed | All five reviewed files read |
| Tests in this review | not run | Author-reported results only |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and runtime behavior were not independently verified. No files were excluded from review; all five files listed as reviewed in the manifest were read.
To get this to a good state
Nothing is required.
df18f19 to
b4635cf
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the host catch registration and cleanup logic are consistent with the existing guest catch accounting.
What I ran
Reviewed head b4635cf2d292e27a8471d62773821d6f52cc2ae9. Read the prepared description, commit summary, diff, manifest, and all five changed files listed in the manifest. Inspected the related catch bookkeeping and host personality dispatch. No tests or builds were run.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Five changed files read |
| Tests and builds | not run | Contributor results are author reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
Tests and builds were not run in this review. review/files.json was not available through the reader, so excluded-by-rule files could not be checked; the manifest lists all five changed files as included.
To get this to a good state
Nothing is required.
Romannachwievor
left a comment
There was a problem hiding this comment.
macOS measurement on an M1 (x86_64 build, Release, BUILD_TESTING=ON, same flags as my local nightly).
Base is f42464a6fe: origin/main at a901acf65c plus #17425, #11049, #26739 and #27621, which the macOS build needs (without #17425 the curl backend builds arm64 and 31 tests do not run; without #27621 libwebrtc does not build).
PR head b4635cf2d2, merged into the base as ad906a95d9 (supplement run: 558467c75c, same head).
Tests: tools/select_tests.py select picked 6621 of 6781 tests and 3603 build targets. Tests whose names match ^agc_|videoout|vulkan|shader|gpu are dropped from the selection because the PR touches no AGC, shader recompiler or VideoOut code. That leaves 4529 selected tests. Run 1 (ctest -j8 --timeout 300) had a mistake in my script and covered 4483 of them plus 131 unselected ones; run 2 ran the 46 missing selected tests (47 with one CTest fixture) against the PR build, 47/47 passed.
- Base (4665 non-GPU tests, run once): 18 failed, the known macOS failures
- PR: 17 failed in run 1, all 17 also fail on the base;
guest_firmware_constant_returnsandguest_posix_spawnpassed on a serial retry guest_throw_bad_array_new_lengthfails on the base ("Subprocess aborted") and 0/3 serially on base + #24415 (which does not touch exceptions), but passes with this PRexception_personality(touched by the PR) passed on base and PRguest_exception_pointer,guest_libcxx_exception_pointerandguest_libc_internal_exception_virtualsfail on both (0/3 serial with the PR)
A test counts as broken by the PR only if it passes on the base and fails 3 of 3 serial reruns with the PR. None did.
The only build failure, on both base and PR, is core/libs/prx/libSceAgcDriver/tests/execution/PipelinedFlushReadOrder.cpp:232 (use of undeclared identifier 'mapped'). It is already on main.
NobleBrains
left a comment
There was a problem hiding this comment.
Confirmed on an older macOS and toolchain than the ones in the description. This matters because the macos-15 runner and most users' Macs are on macOS 15.
Setup: Apple M4, macOS 15.7.9, Apple clang 17.0.0 (clang-1700.6.3.2), x86_64 Release under Rosetta, BUILD_TESTING=ON.
Tree: main 93d64f2d1e + the open macOS build fixes #27201, #27739, #27843, #17425, #27827, #27767 (main does not build on macOS without them, see #28168), then this PR at b4635cf2d2. It merges cleanly.
Full ctest -j 6 against the same tree without this PR:
- Now passes:
guest_throw_bad_array_new_length. It aborted without this PR in each of 3 earlier runs and passed 3/3 with it. - Still pass:
exception_personality(the expanded test),exception_compact_unwind,guest_unwind_accessors,unwind_cursor,unwind_enclosing_function,guest_dynamic_cast,guest_kernel_app_archive_mmap. - Unchanged, as the description says:
guest_libc_internal_exception_virtualsandrun_report(3/3 each).guest_exception_pointerandguest_libcxx_exception_pointeralso still abort; those belong to the rest of #21538. - No regressions.
guest_http2_cookiesandguest_net_oob_inlinefailed once during the parallel full run, then passed 3/3 when rerun. They don't fail on their own.
So the results in the description hold on macOS 15 / Apple clang 17 as well.
AI-assisted: yes (Claude Code)
There was a problem hiding this comment.
CheckHostCatch now covers the host and guest rethrow routes and verifies that TLS queries are cleared after each catch. Could it also count destruction of the retained primary exception? Checking zero destructions before the final release and one afterward would verify that the host cleanup unlinks the catch record and balances ownership, including the dependent exception created by __cxa_rethrow_primary_exception.
Source review at b4635cf2d2. A trial merge onto 484e8e6b77 succeeds. exception_personality, guest_exception_abi_entry_points, and guest_exception_pointer passed on Linux with this head merged into the native test base 6c6b29320f. The new host-catch cases are macOS-only and remain unverified here.
AI-assisted: yes.
What
On macOS, a host catch calls libc++abi's
__cxa_begin_catch, leaving AnyPS5's guest caught-exception state empty. Register an AnyPS5 exception when the unwind dispatcher installs the selected host C++ handler. Its Itanium cleanup callback retires the guest catch before releasing the exception. A rethrow from a host-owned catch stays with libc++abi.The macOS personality regression exercises current type, current primary exception, uncaught count, retained references, and a dependent exception rethrown through both entry points. This addresses the catch-tracking part of #21538. The typed RTTI and host-thrown terminate/report issues remain open.
Tested
Apple M5 Pro, macOS 27.3 (26C5035r), Apple Clang 21.0.0, CMake 4.5.0 and Ninja 1.13.2. Full-runtime Release configuration with
BUILD_TESTING=ONandCMAKE_OSX_ARCHITECTURES=x86_64, running under Rosetta 2.Both macOS builds used the libc++abi enum fix from #26739 (
6d85fbf66b). The base was upstream21940f44a5and the candidate was #22091 rebased asb4635cf2d2. The #26739 change was applied to each build for validation.guest_throw_bad_array_new_lengthexception_personalityexception_compact_unwind,guest_unwind_accessors,unwind_cursor,unwind_enclosing_function,guest_dynamic_cast,guest_kernel_app_archive_mmapguest_libc_internal_exception_virtualsstd::future_errorrun_reportchild-uncaught-missing-functionThe expanded
exception_personalityaborted when run against the base runtime with #26739 applied. Conventions and whitespace checks passed on the rebased commit.The contributor ran identical focused CTest commands before and after applying the patch in separate Release builds with
BUILD_TESTING=ON.15.2.0posix-14.0.0-ucrt-r7)All four runs had zero failures and zero skips.
exception_compact_unwind,exception_runtime, andexception_c_cleanuppassed on Linux and are unregistered on Windows. CMake's DWARF exception probe passed on Windows.run_reportpassed on both platforms before and after applying the patch.The Linux and Windows test base was
d642b4efeeeb3ed33c39301fcbe9eb4dc2170347. The PC commitb2f4ac498ecad8ca890579692c0fb2e087385f03had the same stable Git patch ID as the attachment frome01ba12971f79e564bb42d86708f831c3cdaa751, and the attachment's SHA-256 was unchanged. On the PC,python3 tools/check_conventions.py --base origin/mainpassed againsta72186d3cfdb657c2b0c062471ca47c9b0d9cf13. Both whitespace checks passed.PC logs are under
validation-logs.verification.logrecords the test-to-target mapping, andlinux-run.logandwindows-run.logrecord the exact commands.Manually reviewed the PRs named in the overlap report. #25253 adds a separate test block at the same spot in
ExceptionPersonality.cpp. A three-way merge of that file conflicts, and the two blocks can coexist. #23395 also changes the macOS exception bridge. The combined run reported in review covers the original #22091 head. #16791, #25204, and #25935 address other unwind paths.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)