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

[BUG] Regression: libHarfBuzzSharp.so uses symbols from the system libharfbuzz.so.0 which causes SIGSEGV #3038

Open
kekekeks opened this issue Oct 15, 2024 · 2 comments
Labels

Comments

@kekekeks
Copy link
Contributor

kekekeks commented Oct 15, 2024

This was previously fixed by #2247, however LibraryLoader is only used for netfx builds, net6.0 build doesn't contain it anymore.

As of the issue details, see the original PR

Repro:

Use GtkSharp and the following code:

class Program
{    
    static void Main(string[] args)
    {
        // Causes SIGSEGV
        Gtk.Application.Init();
        var font = new HarfBuzzSharp.Font(new Face((_, _) => null));
        font.TryGetGlyph(65, out _);

        Console.WriteLine("Survived");
    }
}
@kekekeks
Copy link
Contributor Author

I suspect that the proper solution would be to generate some wrappers with HBSharp_ prefix and mark the list of the symbols as private.

@kekekeks
Copy link
Contributor Author

Also, linking with -Bsymbolic could help too:

-Bsymbolic
  When creating a shared library, bind references to global symbols to the 
  definition within the shared library, if any. Normally, it is possible 
  for a program linked against a shared library to override the definition 
  within the shared library. 

  This option is only meaningful on ELF platforms which support shared libraries.

-Bsymbolic-functions
  When creating a shared library, bind references to global function symbols 
  to the definition within the shared library, if any.  

  This option is only meaningful on ELF platforms which support shared libraries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant