lulyon
lulyon

Reputation: 7265

ERROR: ld.so: object LD_PRELOAD cannot be preloaded: ignored

I am using ubuntu 12.04. Every time I start my bash terminal and every time when I finish typing a command(and press enter) , I get this message:

ERROR: ld.so: object '/usr/lib/liblunar-calendar-preload.so' from LD_PRELOAD cannot be preloaded: ignored.

It is weird. So what is the environment variable LD_PRELOAD used for? And what is the going on behind the scene?

Thanks.

Upvotes: 74

Views: 335487

Answers (8)

Jrfaster
Jrfaster

Reputation: 71

The solution that worked for me was using sudo vim and going into /etc/ld.so.preload

I then just removed the line

/usr/local/lib/AppProtection/libAppProtection.so

Then I just saved the file and everything worked without issues.

Upvotes: 7

xzx.weiliang
xzx.weiliang

Reputation: 11

When I executed the following command, everything became better.

unset LD_PRELOAD

Upvotes: -2

Robert Norman
Robert Norman

Reputation: 21

I got this type of error when I installed Citrix client on my Raspberry Pi. In short there is a file /etc/ld.so.preload. The library my system was complaining about was listed in that file. I commented it out with a # and system stopped complaining.

Upvotes: 2

hetepeperfan
hetepeperfan

Reputation: 4421

The linker takes some environment variables into account. one is LD_PRELOAD

from man 8 ld-linux:

LD_PRELOAD
          A whitespace-separated list of additional,  user-specified,  ELF
          shared  libraries  to  be loaded before all others.  This can be
          used  to  selectively  override  functions   in   other   shared
          libraries.   For  setuid/setgid  ELF binaries, only libraries in
          the standard search directories that are  also  setgid  will  be
          loaded.

Therefore the linker will try to load libraries listed in the LD_PRELOAD variable before others are loaded.

What could be the case that inside the variable is listed a library that can't be pre-loaded. look inside your .bashrc or .bash_profile environment where the LD_PRELOAD is set and remove that library from the variable.

Upvotes: 28

SDJSK
SDJSK

Reputation: 1326

You can check /etc/ld.so.preload file content

I fix it by:

echo "" > /etc/ld.so.preload

Upvotes: -7

purplesky
purplesky

Reputation: 37

It means the path you input caused an error. In your LD_PRELOAD command, modify the path like the error tips:

/usr/lib/liblunar-calendar-preload.so

Upvotes: 2

Einar
Einar

Reputation: 243

If you want to make sure that the library is loaded if and only if the program lunar-calendar-gtk is launched, you can apply this:

You set the environment variable per command by prefixing the command with it:

$ LD_PRELOAD="liblunar-calendar-preload.so" printenv "LD_PRELOAD"
liblunar-calendar-preload.so
$ printenv "LD_PRELOAD"
$

You can then choose to put this in a shell script and make lunar-calendar-gtk a symlink to this shell script, replaceing the original referencee. This effectively makes sure that the library is loaded everytime the original application is executed.

You will have to rename the original lunar-calendar-gtk to something else, which might not be too intriguing as it possibly may cause issues with uninstallation and upgrading. However, I found it useful with a former version of Skype.

Upvotes: 12

lulyon
lulyon

Reputation: 7265

Thanks for the responses. I think I've solved the problem just now.

Since LD_PRELOAD is for setting some library proloaded, I check the library that ld preloads with LD_PRELOAD, one of which is "liblunar-calendar-preload.so", that is not existing in the path "/usr/lib/liblunar-calendar-preload.so", but I find a similar library "liblunar-calendar-preload-2.0.so", which is a difference version of the former one.

Then I guess maybe liblunar-calendar-preload.so was updated to a 2.0 version when the system updated, leaving LD_PRELOAD remain to be "/usr/lib/liblunar-calendar-preload.so". Thus the preload library name was not updated to the newest version.

To avoid changing environment variable, I create a symbolic link under the path "/usr/lib"

sudo ln -s liblunar-calendar-preload-2.0.so liblunar-calendar-preload.so

Then I restart bash, the error is gone.

Upvotes: 5

Related Questions