! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
backdrop_settings.so not properly linked
Status:
CLOSED: WONTFIX
Product:
Xfdesktop
Component:
General

Comments

Description Alex V. Myltsev 2007-09-04 13:15:46 CEST
The backdrop MCS plugin uses symbols from libxfce4mcs-manager, but is not linked with it. Check it like this:

$ ldd -r /usr/lib/xfce4/ >/dev/null
undefined symbol: mcs_manager_add_channel
undefined symbol: mcs_manager_notify
...

To link the plugin properly, we have to link it with XFCE_MCS_MANAGER_LIBS.
Comment 1 Alex V. Myltsev 2007-09-04 13:18:12 CEST
Created attachment 1344 
Trivial patch to link backdrop_setttings.so correctly
Comment 2 Brian J. Tarricone (not reading bugmail) 2007-09-04 20:17:20 CEST
Are you actually having a problem?  The library should pull in symbols from xfce-mcs-manager when it's loaded (which is linked to libxfce4mcs-manager).  If it works as-is but you're just doing this for completeness, there's no reason to make the change.
Comment 3 Alex V. Myltsev 2007-09-07 10:49:20 CEST
No, I am not having any problems right now. I'm just used to correct DSO linkage. In practice, it can often prevent run-time linking errors.
I've just spent a bit of time reasoning about library dependencies in xfdesktop and libxfce4mcs*, and found no compelling reason to link the plugin correctly. So if there is any problem with doing it, by all means close this with WONTFIX. We will quite happily maintain this change as a separate patch in ALT Linux.
Comment 4 Brian J. Tarricone (not reading bugmail) 2007-09-07 17:30:24 CEST
The problem can occur if, for example, xfce-mcs-manager is linked to one version/copy of libxfce4mcs, and the plugin is linked to another.  This way, you ensure that only one copy is pulled in.  Really, the risk is minor, but it works fine either way.  On Linux (and most unixes, I believe), there's nothing wrong with having a shared lib with unresolved symbols.  As long as those symbols are resolved at runtime, there's no problem.  If it was a problem, the compile-time linker wouldn't let you do it.  So there's nothing "incorrect" about what we're doing.  In short: I'd rather have a simple runtime linker error that makes the module not load, than the module loading but the program crashing in a strange way.
Comment 5 Alex V. Myltsev 2007-09-07 18:35:42 CEST
Please note that by omitting the required libraries from the link, you never make this better; i. e. the module can still load fine and crash with an unresolved symbol error later. Only LD_BIND_NOW can help here, I believe. Correct linkage is just an added safeguard (for cases when e.g. mcs-manager library dependencies change).
Then again, prelinking does not work on underlinked libraries. (But it would not work on MCS plugins anyway, because they depend on some symbols not in any shared library, notably mcs_plugin_check_version.)
You just wait, I'm gonna find an underlinking problem in Xfce that really breaks something and get back to you with a patch :). (just kidding)

Bug #3531

Reported by:
Alex V. Myltsev
Reported on: 2007-09-04
Last modified on: 2009-07-14

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
0 users

Version

Attachments

Additional information