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

FIX(overlay): Implement library search list for dlsym(), add "libc.so.6" to it #5949

Merged

Conversation

davidebeatrici
Copy link
Member

@davidebeatrici davidebeatrici commented Nov 6, 2022

glibc 2.34 moved all functionality of various libraries into the main one.
As a result, dlsym() is now exported by libc instead of libdl.

This commit also makes the related code more robust.
We now iterate through a common library name/path list, regardless of the OS.

@davidebeatrici
Copy link
Member Author

@carlocastoldi Could you check whether this fixes #5852, please?

@Krzmbrzl
Copy link
Member

Krzmbrzl commented Nov 6, 2022

Shouldn't we also search in libdl, if the search in libc is not successful? Otherwise, I think we would essentially lose support for older systems wouldn't we?

@carlocastoldi
Copy link
Contributor

This PR indeed fixes #5852 for me!
Congrats! :D

@davidebeatrici
Copy link
Member Author

This PR indeed fixes #5852 for me!
Congrats! :D

Thank you for testing!

Shouldn't we also search in libdl, if the search in libc is not successful? Otherwise, I think we would essentially lose support for older systems wouldn't we?

Indeed, now that we have a library list it's just a matter of adding a line.

Ubuntu 22.04 (glibc 2.35):

$ readelf -Ws --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep dlsym
   793: 00000000000907c0   206 FUNC    GLOBAL DEFAULT   15 dlsym@@GLIBC_2.34
   795: 00000000000907c0   206 FUNC    GLOBAL DEFAULT   15 dlsym@GLIBC_2.2.5

Ubuntu 20.04 (glibc 2.31):

$ readelf -Ws --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep dlsym
  2155: 000000000015f980   249 FUNC    GLOBAL DEFAULT   15 __libc_dlsym@@GLIBC_PRIVATE

Ubuntu 18.04 (glibc 2.27):

$ readelf -Ws --dyn-syms /lib/x86_64-linux-gnu/libc.so.6 | grep dlsym
  2123: 00000000001663b0   214 FUNC    GLOBAL DEFAULT   13 __libc_dlsym@@GLIBC_PRIVATE

….6" to it

glibc 2.34 moved all functionality of various libraries into the main one.
As a result, dlsym() is now exported by libc instead of libdl.

This commit also makes the related code more robust.
We now iterate through a common library name/path list, regardless of the OS.
@davidebeatrici davidebeatrici changed the title FIX(overlay): Search for dlsym() in "libc.so.6" instead of "libdl.so.2" FIX(overlay): Implement library search list for dlsym(), add "libc.so.6" to it Nov 6, 2022
Copy link
Member

@Krzmbrzl Krzmbrzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically, having the refactoring and the actual fix in separate commits would be desirable, but not sure if worth the effort in this case...

@davidebeatrici
Copy link
Member Author

I thought about that, but hiding whitespace changes shows a clear diff:

@carlocastoldi
Copy link
Contributor

carlocastoldi commented Nov 13, 2022

Dunno if this is related (as without this patch overlay doesn't work at all), but on GNOME 43 if I change desktop or the game minimizes, I get strange purple artefacts.
Schermata del 2022-11-13 02-27-13

Changing resolution temporary fixes it

@davidebeatrici
Copy link
Member Author

davidebeatrici commented Nov 13, 2022

Does it happen if you switch to borderless windowed mode too?

@carlocastoldi
Copy link
Contributor

carlocastoldi commented Nov 13, 2022

Yes, it happens in fullscreen and windowed version. I no don't know how to run the game in borderless window, tho

@davidebeatrici
Copy link
Member Author

-sw -noborder

@carlocastoldi
Copy link
Contributor

It doesn't happen with -sw -noborder. Weirdly enough:

  • it doesn't happen if I switch to full screen after launching the game in borderless windowed mode
  • it does happen if I switch to borderless windowed mode after launching the game in full screen

@carlocastoldi
Copy link
Contributor

what is stopping this from being merged?

@davidebeatrici davidebeatrici merged commit e2debec into mumble-voip:master Nov 23, 2022
@davidebeatrici davidebeatrici deleted the overlay_gl_dlsym_lib_fix branch November 23, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Failed to load the launcher entry proc" when running Team Fortress 2 with mumble overlay
3 participants