Repository navigation
feat(libc): implement sceLibcBacktraceSelf on Linux - #2040
Aryansh1520 wants to merge 2 commits into
Conversation
PPSA28997 (IL2CPP) calls sceLibcBacktraceGetBufferSize and sceLibcBacktraceSelf. On Linux the host call stack is captured with backtrace and each frame is resolved to its module and offset with dladdr, then written as a linked list of frame records. The record layout is inferred and listed in TechnicalDebt. Windows throws.
|
The inferred record layout is documented as technical debt, but this ABI needs a regression that checks GetBufferSize against records written by Self, including a frame limit and a too-small buffer. Also, the PR describes this implementation as Linux-only, while the current non-Windows guard enables it on macOS too; please either gate the implementation to Linux and throw elsewhere, or provide macOS validation. GitHub reports no checks on this head. |
|
Same as #2038, for |
|
Updated in 75c1fa6:
Where PPSA28997 stops: after loading its first scene, the title calls Main exports neither function. On main (as of Oct 8) the title stops earlier, at The build workflows on this head are waiting for approval to run (fork PR). |
|
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
No title was run. 🤖 Addressed by Claude Code |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the __linux__ gate and the layout/limit/small-buffer test; build and ctest are green here (guest_backtrace passes, 524/524).
One blocker left:
- The signatures and the record layout (next, u32 offset, u32 at +0xC, name at +0x10, 8-byte alignment) are "inferred from the title", but no evidence is in the PR, and none of KytyPS5, shadPS4, fpPS4 or prosper has a body for these exports. The test pins the PR's own layout, so it can't catch a wrong guess. Please attach static evidence from the title's call site (instruction offsets showing how the returned list is walked: the
nextload, the offset use, the name pointer, and which return values are checked), or a log of the title consuming the result. If it can't be confirmed, say which parts are guesses in TechnicalDebt (return value on a too-small buffer, whethercountincludes truncated frames).
|
Closing: the record layout is inferred and the frames are host frames, so what the title gets back isn't what the console returns. Please reopen with the exact layout, or a version that throws for what isn't known. |
What
PPSA28997 (God of War Sons of Sparta, IL2CPP) calls
sceLibcBacktraceGetBufferSizeandsceLibcBacktraceSelf. On Linux, the host call stack is captured withbacktrace, and each frame is resolved to its module and offset withdladdr. Frames are written as a linked list of records: next pointer, u32 module offset, then the module name at +0x10.GetBufferSizereports the count and the bytesSelfwill need. The signatures and record layout are inferred from the title and listed in TechnicalDebt, including the unknown u32 at +0xC (written as 0). Windows throws.Tested
tools/check_conventions.py --base origin/mainandtools/pr_overlap.py --branchpass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)