akumuli / Akumuli

Time-series database
http://akumuli.org
Apache License 2.0
836 stars 85 forks source link

Libakumuli cannot load sqlite3 database driver when creating database. #247

Open dmitrios opened 6 years ago

dmitrios commented 6 years ago

Symptoms: creating database works, but sqlite driver is not loaded. The volumes are created. Exporting the driver library export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_sqlite3.so" returns wc: symbol lookup error: /usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_sqlite3.so: undefined symbol: apr_pool_cleanup_null

The apr_dbd_sqlite3.so library cannot be open with dlopen. Sqlite3 works fine and all prerequisites are installed. Building from fix_245 branch works fine. Given the fact apache2 had similar issue, it is unclear if some of dbd sqlite3 driver library should be linked or it is a probing issue.

libaprutil1-dbd-sqlite3 is already the newest version (1.5.4-1build1). The sqlite3 db driver test in python works fine.

Output from test:

Create /media/tests/data/volumes/test_0.vol size: 4294967296 Create /media/tests/data/volumes/test_1.vol size: 4294967296 Disk space for /media/tests/data/volumes/test_0.vol preallocated Disk space for /media/tests/data/volumes/test_1.vol preallocated Creating fixed file storage Can't load driver, maybe libaprutil1-dbd-sqlite3 isn't installed Can't load sqlite3 driver Can't load sqlite3 driver

Lazin commented 6 years ago

apr_dbd_sqlite3.so depend on apr library and doesn't load it explicitly so the executable that loads it should load both.

export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/apr-util-1/apr_dbd_sqlite3.so /usr/lib/x86_64-linux-gnu/libapr-1.so"
Lazin commented 6 years ago

I think that apr-util-dbd loads apr_dbd_sqlite3 dynamically using the dlopen call. Maybe I can add apr_dbd_sqlite3 as an implicit dependency, let me try.

dmitrios commented 6 years ago

I did try different sequences, including loading libapr-1 and libaprutil with dlopen. It works fine for other libraries, with exception of dbd library with sqlite3 driver. Perhaps I can try building apr from source and see if problem will go away.

dmitrios commented 6 years ago

Found workaround: the same problem described at here

Looks like this is mandatory export LD_PRELOAD='/usr/lib/libapr-1.so:/usr/lib/libaprutil-1.so' # this is the workaround

Lazin commented 6 years ago

I added workaround for this. Not sure that it will work though.

Lazin commented 6 years ago

The libakumuli.so already links this two libraries so everything should work without LD_PRELOAD.