conformal / spectrwm

A small dynamic tiling window manager for X11.
ISC License
1.33k stars 97 forks source link

The well known LD_PRELOAD bug when launching an xterm #22

Closed alexad closed 10 years ago

alexad commented 10 years ago

Every time I start an xterm, I get this message multiple times:

ERROR: ld.so: object 'libswmhack.so.0.0' from LD_PRELOAD cannot be preloaded: ignored.

If I add LD_PRELOAD="" in .bashrc, then: 1) launching an xterm typing the command "xterm" is OK (no error message); 2) launching an xterm with the keyboard shortcut still causes the error message to get displayed (1 time).

So far, the workaround is to add "LD_PRELOAD=''; clear" in ~/.bashrc: The error message about LD_PRELOAD is cleared and I do not see it anymore. But it is only a workaround.

(Version: 2.3.0)

alexad commented 10 years ago

The downside of this workaround is that now the apps are launched on the wrong desktops (when they take time to launch)...

lsm5 commented 10 years ago

If you're on linux, can you check if this works: https://github.com/conformal/spectrwm/pull/26/files , this sets LD_PRELOAD to the full path for libswmhack.so.0.0

alexad commented 10 years ago

Thanks a lot lsm5! This worked—with a small modification, though, because on my box, the path of the library is not /usr/local/lib/libswmhack.so.0.0, but /usr/lib/spectrwm/libswmhack.so.0.0.

lsm5 commented 10 years ago

yup, the locations could be distro specific, also iiuc /usr/local is a safe place to put stuff so as not to interfere with distro managed stuff, and spectrwm defaults to /usr/local. Anyway, glad it worked for you :)

LordReg commented 10 years ago

This is fixed on ce68dc21d8bae4dfafb33842feaa13600bb8. ld.so was trying to load a non-existant 32-bit libswmhack.so.0.0 for 32-bit binaries since LD_PRELOAD was not an absolute/relative path. Package maintainers could also choose to build, and include in their package, a 32-bit libswmhack.so and remove the path in SWM_LIB.