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

LD_LIBRARY_PATH not taken into account #2456

Closed
Wernfried opened this issue Dec 10, 2018 · 3 comments
Closed

LD_LIBRARY_PATH not taken into account #2456

Wernfried opened this issue Dec 10, 2018 · 3 comments
Labels

Comments

@Wernfried
Copy link

Wernfried commented Dec 10, 2018

I am referring to this topic: #2424

In order to use latest SQLite features I replaced file /usr/lib64/libsqlite3.so.0.8.6 with latest compiled version of sqlite source code. In general everything is working fine.

Problem is shared object /usr/lib64/libsqlite3.so.0.8.6 might be replaced again by outdated version if the admin applies any standard Linux patches. So I decided to move the latest shared object to private location /opt/mediation/lib and change LD_LIBRARY_PATH accordingly. However, syslog-ng does not use the new version, it seems to be hard-linked to /usr/lib64/libsqlite3.so.0.8.6

[mediation@t-mipmed-as-01 ~]$ echo $LD_LIBRARY_PATH
/opt/mediation/lib:/opt/app/oracle/product/11.2.0/client_1/lib

[mediation@t-mipmed-as-01 ~]$ ls -l /opt/mediation/lib/libsqlite3*
lrwxrwxrwx. 1 mediation mediation     19 Dec 10 08:20 /opt/mediation/lib/libsqlite3.so -> libsqlite3.so.0.8.6
lrwxrwxrwx. 1 mediation mediation     19 Dec 10 08:20 /opt/mediation/lib/libsqlite3.so.0 -> libsqlite3.so.0.8.6
-rwxr-xr-x. 1 mediation mediation 959345 Dec 10 07:59 /opt/mediation/lib/libsqlite3.so.0.8.6

[mediation@t-mipmed-as-01 ~]$ lsof -p 27965 | grep libsqlite3*
syslog-ng 27965 mediation  mem       REG              253,0   753232   83909662 /usr/lib64/libsqlite3.so.0.8.6

I run also a Perl script which uses SQLite, This perl script uses correct version /opt/mediation/lib/libsqlite3.so.0.8.6, so LD_LIBRARY_PATH is set properly.

I can force the correct file with LD_PRELOAD=/opt/mediation/lib/libsqlite3.so, however I wonder if this behavior is intended by syslog-ng or whether it should work with LD_LIBRARY_PATH only.

My impression is that LD_PRELOAD is more used for debugging and developing but less suitable for production code (but I might be wrong)

Best Regards

@bazsi
Copy link
Collaborator

bazsi commented Dec 10, 2018 via email

@Wernfried
Copy link
Author

Yes, cat /proc/<pid>/env | xargs -0 echo show environment as expected:

LD_LIBRARY_PATH=/opt/mediation/lib:/opt/app/oracle/product/11.2.0/client_1/lib

@alltilla alltilla added the bug label Jan 17, 2019
@MrAnno
Copy link
Collaborator

MrAnno commented Dec 12, 2020

LD_LIBRARY_PATH should work in general, but syslog-ng does not depend on libsqlite3 directly, it uses libdbi instead.
libdbi-dbd-sqlite is responsible for loading libsqlite3.

I would check whether /usr/lib64/dbd/libdbdsqlite3.so is force-linked to /usr/lib64/libsqlite3.so.0.8.6, for example:

LD_LIBRARY_PATH=/... ldd /usr/lib64/dbd/libdbdsqlite3.so

Please reopen this issue if you think it's an issue with syslog-ng, or you have further questions.

@MrAnno MrAnno closed this as completed Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants