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

Add RTLD_DEEPBIND flag to dlopen mode #2247

Merged
merged 1 commit into from
Sep 11, 2022
Merged

Add RTLD_DEEPBIND flag to dlopen mode #2247

merged 1 commit into from
Sep 11, 2022

Conversation

snnz
Copy link
Contributor

@snnz snnz commented Sep 9, 2022

Description of Change

By default, internal dependences of a library loaded with dlopen are 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 the libharfbuzz.so.0, that is often present in the system, exports the same symbols as libHarfBuzzSharp.so and is implicitly used by some dependencies of mono or dotnet. To avoid such conflicts, there is a flag RTLD_DEEPBIND in glibc since version 2.3.4. Earlier versions do not check the mode argument for unknown flags, and musl does 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

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

@mattleibow
Copy link
Contributor

@mattleibow mattleibow added this to the v2.88.3 milestone Sep 11, 2022
@mattleibow mattleibow merged commit 482e6ee into mono:main Sep 11, 2022
@mattleibow
Copy link
Contributor

Thanks for this PR! Always great to see SkiaSharp getting better!

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.

[BUG] SkiaSharp crash as it uses system provided Harfbuzz on Linux
2 participants