linux - LD_LIBRARY_PATH side effects -


i having strange side effects on changing ld_library_path.

when append path containing library, e.g. :

ld_library_path=$ld_library_path:/my_path/lib 

then, becomes unbelievably slow. example, simple ls can 10 seconds long.

ldd output same before , after ld_library_path change , tried debug execution of slow ls strace : exact same execution in both cases. execution not stuck during execution of ls (since strace not output during 10-second lag , executes ls). thought come shell, same, running strace on bash , executing ls in both cases gives me same strace output : shell executes ls , wait end of execution (the last strace output before lag strace waitpid(...)). guess wrong happens between the launch of ls , execution, if kernel-level issue. acts if sleep made on ls (0 cpu usage).

during lag, cpu , network activity normal...

note library in new ld path not conflict "standard library", not disturb ls in example.

so interesting in deeper explanations ld_library_path side effects or how debug example.

this post quit old, don't know if find solution. anyway, don't know if may help, in modern gnu/linux systems, the use of ld_library_path deprecated , discouraged.

therefore have couple of suggestions:

  1. if want continue using it, try first pre-pending instead of appending library path ld_library_path. should if there takes long time scan path in previous library directories.

  2. use ldconfig system, (new) proper way of using ld directories nowadays. have add path library in /etc/ld.so.conf file, or better, add file in /etc/ld.so.conf.d/ contains path library (it sourced if there include directive in /etc/ld.so.conf, case default). run sudo ldconfig update system ld search path.

i hope help. cheers


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -