Repository navigation
fix(libc): hand out the unwind cursor table through a _nid_no_patch export - #5014
Merged
oneandonlydean merged 1 commit intoOct 13, 2026
Conversation
…xport _Unwind_Context took its cursor table from LibcUnwind::CursorSlots, a C++ data symbol of libc. On Windows LibcUnwind::Frame holds an _Unwind_Context, so libSceAgcDriver, which builds frames for its worker sampler, imported _ZN10LibcUnwind11CursorSlotsE from libc.prx. The NID patcher renames that export in the patched libc and leaves the import alone, so the patched libSceAgcDriver, libSceAgc and libSceVideoOut failed to load with error 127 and patched_libraries failed. The table is now file-local and the context reads it through UnwindCursorSlots_nid_no_patch, which keeps its name on both sides.
This was referenced Oct 13, 2026
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The Windows job fails on
patched_librariessince #4945 was merged (first seen on builds based on 6d7b873, and on the push build of fc1f063):#4945 gave
_Unwind_Contexta default member initializer that points atLibcUnwind::CursorSlots, a C++ data symbol defined in libc. On WindowsLibcUnwind::Framecontains an_Unwind_Context, and libSceAgcDriver builds frames inStackWalk.hppfor the worker sampler, so it now imports_ZN10LibcUnwind11CursorSlotsEfromlibc.prx. The NID patcher renames that export in the patched libc and does not touch the import (it only rewritessce*and_nid_postfixnames), so the patched libSceAgcDriver has an import nothing exports. libSceAgc and libSceVideoOut link to it and fail the same way. Linux is not affected becauseFramehas no context member there.The table is now local to
Unwind.cppand the context reads it throughUnwindCursorSlots_nid_no_patch(), the same naming the other libc helpers used across libraries have, so the name is the same in the patched libc and in the importer. Behaviour of #4945 is unchanged.Tested
Linux, GCC, Release: built libc, all patched libraries and the tests below;
patched_libraries,exception_runtime(includes the cursor table check from #4945),exception_personality,exception_c_cleanup,guest_exception_handler,guest_raise_exception,guest_unwind_module_info,guest_dynamic_cast,agc_stack_walk,unwind_record_boundsand the standaloneregister_contexttests pass. The patchedlibc.prxexportsUnwindCursorSlots_nid_no_patchunder that name.Not built on Windows locally. The cause is read from the sources and the CI logs; the Windows job of this PR is what shows the three libraries load again.
The Linux failure of
guest_fminfon main (fminf check failed at line 33, from #4592) is a different problem and is not touched here.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)