Merge pull request #5484 from neobrain/fix_code_cache_no_guest_wrappers

CodeCache: Fix crash when guest library wrappers aren't installed
This commit is contained in:
Ryan Houdek authored and GitHub committed 2026-05-07 10:59:32 -07:00
commit e517f3259c
2 files changed
+8 -2

No files matched your search

@@ -601,8 +601,10 @@ int main(int argc, char** argv, char** const envp) {
// Request code cache generation
FEXServerClient::PopulateCodeCache(FEXServerClient::GetServerFD(), Loader.GetMainElfFD(), FEXCore::Config::Get_MULTIBLOCK());
// Finalize code cache for libVDSO-guest.so. This needs to be done explicitly since VDSO doesn't use LoadLib.
SyscallHandler->TriggerGuestLibWrapperCodeCacheLoad(*ParentThread->Thread, reinterpret_cast<uintptr_t>(VDSOMapping.VDSOBase));
if (VDSOMapping) {
// Finalize code cache for libVDSO-guest.so. This needs to be done explicitly since VDSO doesn't use LoadLib.
SyscallHandler->TriggerGuestLibWrapperCodeCacheLoad(*ParentThread->Thread, reinterpret_cast<uintptr_t>(VDSOMapping.VDSOBase));
}
}
// Pull RIP and stack pointer from loader and set the thread data to it.
@@ -21,6 +21,10 @@ struct VDSOMapping {
size_t VDSOSize {};
void* X86GeneratedCodePtr {};
size_t X86GeneratedCodeSize {};
explicit operator bool() const {
return VDSOBase != nullptr;
}
};
struct VDSOEntrypoints {