feat(libc): restore macOS guest backtraces #9344
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9344"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T18:58:20Z.
What
Restore
sceLibcBacktraceGetBufferSizeandsceLibcBacktraceSelfon macOS. Apple provides the samebacktrace,dladdrandDl_infointerfaces used by the Linux path. Enable the existingguest_backtraceregression test on Apple and update the libc debt entry to match the supported host platforms.Tested
Backtrace.cppwithGuestBacktrace.cppusing g++ and ran the focused test successfully.-U__linux__ -D__APPLE__: compiled and ran the same focused test successfully through the Apple preprocessor path. This is not a native macOS run.python3 tools/check_conventions.py --base upstream/mainpassed;python3 tools/pr_overlap.py --branch codex/macos-backtrace-supportreported no overlap.CMakeLists.txt, and the host lacks the XRandR support required by the project configuration.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)Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-22T22:49:54Z.
Review: COMMENTED
First native macOS run, since the description only covers Linux and a
-D__APPLE__build on Linux.Machine: Apple M2 Max, macOS 27.2 (26B5112a), Xcode 27 (Apple clang), x86-64 build under Rosetta 2, Release,
BUILD_TESTING=ON, Python 3.9.6.Base:
mainalone doesn't link on macOS, so the tree is #8658 (feat/macos-port) @04d942dc80with this PR's diff at4618ff54eaapplied on top (clean apply). Fullcmake --buildwith 0 errors before testing.guest_backtracepasses 3/3 (ctest --repeat until-fail:3). That covers the whole test: the first record is the calling module/function (checked throughdladdr), the record chain and the 8-byte alignment, the frame limits 0/1/2, and the small-buffer cases with no writes past the end. So Apple'sbacktrace()+dladdr()give the same frame layout the Linux path expects.Backtrace.cppto the #8658 version and rebuilt.guest_backtraceaborts withstd::runtime_error: sceLibcBacktraceGetBufferSize_nid_postfix not implemented. With the PR'sBacktrace.cppit passes again. The test catches a regression of the change.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.