fix(libc): count call trace offsets from the first page of a non-PIE executable #8974
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8974"
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 rooklz on 2026-10-21T08:00:09Z.
What
On Linux the call trace (
APS5_TRACE_CALLS) names a caller asmodule+offset, with the offset taken fromdlpi_addr. For a non-PIE imagedlpi_addris 0, so a caller in an executable converted with--linux-fixed-baseis printed with its absolute address,app.elf+0x402716, while the same caller in a PIE output is printed asapp.elf+0x2716.Each module's base is now its lowest
PT_LOADpage (dlpi_addrplus the first segment's page-aligned vaddr), which is wheredladdrputsdli_fbase. Nothing changes for a PIE executable or library whose first segment starts at 0. For an executable placed at a fixed base the offset is counted from that base, so it is again the caller's virtual address in the input executable, and it matches how the Windows report counts from the image base.This becomes the usual case with #8973, which places Linux executables at
0x400000by default; the two PRs don't depend on each other.guest_call_trace_fixed_base_abortbuildsGuestCallTrace.cpponce more as a non-PIE executable, the wayguest_dynamic_loader_fixed_basedoes, and checks that the abort report names the caller with an offset inside the image rather than its absolute address.Tested
guest_call_trace_fixed_base_abortfails onmain, where the caller is printed asguest_call_trace_fixed_base_tests+0x402716, and passes with the change (+0x2716).guest_call_trace,guest_call_trace_abortandguest_call_trace_abort_racepass before and after; the PIE test's caller is still printed asguest_call_trace_tests+0x2734.a07e985c8: the fourguest_call_trace*tests pass, and the rest matches the base apart fromagc_driver_sgpr_pattern_fill_keys, which failed on the branch run only ("the dispatch completed 17 times without a pending write over the keys"). That AGC check is intermittent under parallel ctest (#8708) and failed on both sides of an earlier run of mine on another base. The threenet_dontwait_blocking_*tests fail on both.CrashReport.cpp.check_conventions.pypasses.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 github-actions[bot] on 2026-10-21T08:21:54Z.
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.
main)core/libs/prx/libc/src/specifics/x86_64/CallTrace.cppL18Some 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.
core/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txtcore/libs/prx/libc/CMakeLists.txt