fix(libSceFiber): end the frame chain of a fiber with a null frame #4770
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4770"
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 ee6aba54 on 2026-10-12T21:25:35Z.
What
Aps5FiberMaincalls the fiber's entry function with the entry address left inrbp, because the library is built without frame pointers and the compiler keeps the call target there. The guest entry savesrbpas its caller's frame, so a guest that walks frame pointers from inside a fiber reads the entry function's machine code as a frame record and faults.libSceFiberis now built with-fno-omit-frame-pointer.Aps5FiberMainthen sets up a frame of its own whose savedrbpis the zero of the initial fiber frame, and a walk from a fiber ends there with a null frame.Tested
18c438b10(fibers run on host stacks since794714983; the fix applies there unchanged).fibergains a fiber whose entry walks the frame chain: every frame has to lie within 1 MiB above the first one and above the previous frame, and the chain has to end with a null frame. Without the change it fails withframe chain climbs the stack(the entry address is taken as a frame); with it the test passes.cteston the previous base8cf6a0bc3plus this change: 1072 tests pass.mov 0x8(%rax),%rcxwithraxholding instruction bytes (55 48 89 e5 41 57 41 56, a function prologue), so the process died withSIGSEGVand no message; the core dump shows the chain passingAps5FiberMainwith the entry address as the next frame. With the change the walk ends at the fiber's first frame and the title prints its error (LowLevelFatalError [File:.\Runtime/RenderCore/Private/RenderingThread.cpp] [Line: 1272] GameThread timed out waiting for RenderThread after 120.00 secs) with the collected addresses before it aborts.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T03:55:14Z.
Windows test: head
e51aacc90merged onto currentmain495bf91a0(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filterfiber: fiber passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by ee6aba54 on 2026-10-13T19:12:11Z.
Rebased onto
18c438b10:27b75311f. Fibers run on host stacks since794714983, so the test no longer requires the frames to lie inside the guest context; it bounds the chain by its first frame and requires each frame to lie above the previous one. The fix itself is unchanged and still needed: without it the test fails withframe chain climbs the stack.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-14T05:54:28Z.
Independent verification of your rebase — the current head builds and passes the full local suite on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV): 1099/1100 — the only failure is the knownmainregression (agc_driver_tessellationsegfault, #4727), not this PR. Conventions green. From my side this is merge-ready.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T17:06:18Z.
Checked on the head merged onto current
main: build and thefibertest pass; with the-fno-omit-frame-pointerline removed the test aborts withframe chain climbs the stack, so it covers the fix. The Windows run by @xXPBSXx and the full Linux suite by @blawesom agree. Merging.