Libsqlite3.so Loading On Python
Solution 1:
You might try to force loading of the lib with:
LD_PRELOAD=/path/to/libsqlite3.so.0 python ...
The library will be loaded in memory when python will be executed. So normally when _sqlite3
module will be imported, it will not load libsqlite3.so.0, and use the version already preloaded in memory.
Edit
The LD_LIBRARY_PATH doesn't work in that case cause libsqlite3.so.0 is loaded by _sqlite.so module, loaded by dlopen() within Python. In that case, the manpage of dlopen() said that the order is:
(ELF only) If the executable file for the calling program contains a DT_RPATH tag, and does not contain a DT_RUNPATH tag, then the directories listed in the DT_RPATH tag are searched.
If, at the time that the program was started, the environment variable LD_LIBRARY_PATH was defined to contain a colon-separated list of directories, then these are searched. (As a security measure this variable is ignored for set-user-ID and set-group-ID programs.)
...
So if an DT_RPATH is set on the binary, it will be taken prior to your LD_LIBRARY_PATH.
Post a Comment for "Libsqlite3.so Loading On Python"