Add RTLD_DEEPBIND flag to dlopen mode#2247
Merged
Merged
Conversation
mattleibow
approved these changes
Sep 10, 2022
Collaborator
Collaborator
|
Thanks for this PR! Always great to see SkiaSharp getting better! |
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.
Description of Change
By default, internal dependences of a library loaded with
dlopenare resolved using the global lookup scope first. If there are already matched symbols in the global scope, internal calls in the library that are supposed to use its local functions, will be linked to some external code, which is usually results in segmentation faults when the library is used. This is particularly true for thelibharfbuzz.so.0, that is often present in the system, exports the same symbols aslibHarfBuzzSharp.soand is implicitly used by some dependencies ofmonoordotnet. To avoid such conflicts, there is a flag RTLD_DEEPBIND inglibcsince version 2.3.4. Earlier versions do not check the mode argument for unknown flags, andmusldoes not check it either. So just adding this flag to the mode appears to be quite harmless.Bugs Fixed
API Changes
None.
Behavioral Changes
None.
Required skia PR
None.
PR Checklist