Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VDSO: Fixes a pretty nasty bug where we were never using the host VDSO #4024

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

Sonicadvance1
Copy link
Member

This must have happened during a refactor or something, but since we're making a copy of the function pointers, it would have only gotten the version /prior/ to loading host VDSO symbols.

Moves the VDSO thunk definition setting to the end after VDSO symbol definitions in order to get host VDSO symbols working again.

Cherry-picked out of #3946

This must have happened during a refactor or something, but since we're
making a copy of the function pointers, it would have only gotten the
version /prior/ to loading host VDSO symbols.

Moves the VDSO thunk definition setting to the end after VDSO symbol
definitions in order to get host VDSO symbols working again.
@neobrain
Copy link
Member

neobrain commented Sep 2, 2024

What's the actual issue?

@Sonicadvance1
Copy link
Member Author

When setting the pointers in the VDSODefinitions array, we are copying the pointers provided eg, FEX::VDSO::x64::Handler_time.

These pointers default to the glibc handlers, but the LoadHostVDSO function parses out the host vdso symbols and updates those pointers to the VDSO handlers, eg FEX::VDSO::x64::Handler_time default points to x64::glibc::time but now points to x64::VDSO::time.

So the VDSODefinitions array needs to late initialize its pointers.

@neobrain
Copy link
Member

neobrain commented Sep 2, 2024

Ah, I was reading the description the wrong way, looking copies of VDSODefinitions[n].ThunkFunction rather than their assigned values. Thanks for the clarification!

@Sonicadvance1 Sonicadvance1 merged commit 0754aff into FEX-Emu:main Sep 2, 2024
12 checks passed
@Sonicadvance1 Sonicadvance1 deleted the fix_vdso_on_vdso_host branch September 2, 2024 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants