storage_db.so: undefined symbol ser_string_get because of missing linkage against libutil

Bug #345947 reported by thm42
14
Affects Status Importance Assigned to Milestone
Jabberd
Fix Released
Low
Unassigned

Bug Description

I recently upgraded my jabberd on a debian lenny box to version 2.2.7.1 from 2.2.4. Compiling and installing worked flawless. However when trying to connect to the server with a jabber client, the sm process crashes:
 /usr/local/bin/sm: symbol lookup error: /usr/local/lib/jabberd/storage_db.so: undefined symbol: ser_string_get

After some trial and error i narrowed the bug down to the make process. In 2.2.4 storage_db.so is created this way:
gcc -shared .libs/storage_db.o -Wl,--whole-archive /root/jabberd-2.2.4/util/.libs/libutil.a -Wl,--no-whole-archive -L/root/jabberd-2.2.4/util -ldb -lssl -lcrypto -lgsasl -ludns /usr/lib/libidn.so /usr/lib/libexpat.so -lresolv -ldl -lz -Wl,-soname -Wl,storage_db.so -o .libs/storage_db.so
-> Trying that in the "storage" directory of 2.2.7.1 and installing it afterwards will resolve the problem.

In 2.2.7.1 storage_db.so is created this way:
libtool: link: gcc -shared .libs/storage_db.o -L/root/jabberd-2.2.7.1/util -ldb-4 -lssl -lcrypto -lgsasl -ludns /usr/lib/libidn.so /usr/lib/libexpat.so -lresolv -ldl -lz -Wl,-soname -Wl,storage_db.so -o .libs/storage_db.so
-> This will produce the undefined symbol error.

Could you resolve this bug that it compiles and works flawless from a vanilla source?

Thanks in advance!

Revision history for this message
Tomasz Sterna (smoku) wrote :

I guess the problem is in the difference of -ldb (2.2.4) and -ldb-4 (2.2.7.1).
Do you have two versions of BerkeleyDB installed?

Revision history for this message
TH (tino-hirschmann) wrote :

I do habe multiple versions installed. However only one development library is installed ..
...
ii libdb1-compat 2.1.3-9 The Berkeley database routines [glibc 2.0/2.
ii libdb3 3.2.9+dfsg-0.1 Berkeley v3 Database Libraries [runtime]
ii libdb4.3 4.3.29-8 Berkeley v4.3 Database Libraries [runtime]
ii libdb4.4 4.4.20-8 Berkeley v4.4 Database Libraries [runtime]
ii libdb4.5 4.5.20-13 Berkeley v4.5 Database Libraries [runtime]
ii libdb4.6 4.6.21-11 Berkeley v4.6 Database Libraries [runtime]
ii libdb4.6-dev 4.6.21-11 Berkeley v4.6 Database Libraries [developmen
...

Revision history for this message
Tomasz Sterna (smoku) wrote :

So, if you have db4 dev files installed, the behavior of linking db-4 is correct.

If you need linking db3, please try installing libdb3-dev files and see whether that helps.

Revision history for this message
TH (tino-hirschmann) wrote :

I do not need db3 linking.
What I don't understand is that it works one way (-ldb) and not the other (-ldb-4). In both cases it is built against the db-4 4.6 libraries. Am I missing anything here?

Revision history for this message
Tomasz Sterna (smoku) wrote :

Could you do:
ls -l /usr/lib/libdb* /usr/local/lib/libdb*
and
ldd /root/jabberd-2.2.7.1/storage/.libs/storage_db.so

Changed in jabberd2:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
TH (tino-hirschmann) wrote :

ls -l /usr/lib/libdb* /usr/local/lib/libdb*
ls: cannot access /usr/local/lib/libdb*: No such file or directory
lrwxrwxrwx 1 root root 15 Mar 27 2008 /usr/lib/libdb-3.2.so -> libdb3.so.3.0.2
lrwxrwxrwx 1 root root 15 Mar 27 2008 /usr/lib/libdb-3.so -> libdb3.so.3.0.2
-rw-r--r-- 1 root root 928724 Feb 19 2007 /usr/lib/libdb-4.3.so
-rw-r--r-- 1 root root 1023476 Aug 16 2006 /usr/lib/libdb-4.4.so
-rw-r--r-- 1 root root 1178304 Sep 13 2008 /usr/lib/libdb-4.5.so
-rw-r--r-- 1 root root 1638052 Sep 13 2008 /usr/lib/libdb-4.6.a
-rw-r--r-- 1 root root 800 Sep 13 2008 /usr/lib/libdb-4.6.la
-rw-r--r-- 1 root root 1256548 Sep 13 2008 /usr/lib/libdb-4.6.so
lrwxrwxrwx 1 root root 12 Mar 5 14:34 /usr/lib/libdb-4.so -> libdb-4.6.so
lrwxrwxrwx 1 root root 11 Mar 5 14:34 /usr/lib/libdb.a -> libdb-4.6.a
lrwxrwxrwx 1 root root 12 Mar 5 14:34 /usr/lib/libdb.so -> libdb-4.6.so
lrwxrwxrwx 1 root root 15 Mar 27 2008 /usr/lib/libdb3.so.3 -> libdb3.so.3.0.2
-rw-r--r-- 1 root root 679624 Aug 4 2006 /usr/lib/libdb3.so.3.0.2

ldd /root/jabberd-2.2.7.1-working/storage/.libs/storage_db.so /root/jabberd-2.2.7.1/storage/.libs/storage_db.so
/root/jabberd-2.2.7.1-working/storage/.libs/storage_db.so:
        linux-gate.so.1 => (0x02cdc000)
        libdb-4.6.so => /usr/lib/libdb-4.6.so (0x02cf5000)
        libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0x02e28000)
        libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0x02e6e000)
        libgsasl.so.7 => /usr/local/lib/libgsasl.so.7 (0x02fc1000)
        libidn.so.11 => /usr/lib/libidn.so.11 (0x02fd3000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x03004000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x0302a000)
        libdl.so.2 => /lib/libdl.so.2 (0x0303d000)
        libz.so.1 => /usr/lib/libz.so.1 (0x03041000)
        libc.so.6 => /lib/libc.so.6 (0x03056000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x03194000)
        /lib/ld-linux.so.2 (0x42bcc000)
/root/jabberd-2.2.7.1/storage/.libs/storage_db.so:
        linux-gate.so.1 => (0x03c51000)
        libdb-4.6.so => /usr/lib/libdb-4.6.so (0x03c56000)
        libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0x03d89000)
        libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0x03dcf000)
        libgsasl.so.7 => /usr/local/lib/libgsasl.so.7 (0x03f22000)
        libidn.so.11 => /usr/lib/libidn.so.11 (0x03f34000)
        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x03f65000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x03f8b000)
        libdl.so.2 => /lib/libdl.so.2 (0x03f9e000)
        libz.so.1 => /usr/lib/libz.so.1 (0x03fa2000)
        libc.so.6 => /lib/libc.so.6 (0x03fb7000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x040f5000)
        /lib/ld-linux.so.2 (0x4bb41000)

Hope this helps. Working means compiled with -ldb.

Revision history for this message
Michael Weiser (michael-weiser) wrote :

Hi there,

I ran into the same bug. It was introduced with 2.2.5 which changed the linking for storage modules:

ser_string_get is in libutil which all storage modules were linked up until 2.2.4. In 2.2.5 and after it is missing for storage_db. The respective change was introduced with changeset 714 and can be seen at http://jabberd2.xiaoka.com/changeset?new=714%40trunk%2Fstorage%2FMakefile.am&old=466%40trunk%2Fstorage%2FMakefile.am.

The attached patch fixes it for me.
--
Thanks,
Micha

summary: - storage_db.so: undefined symbol
+ storage_db.so: undefined symbol ser_string_get because of missing
+ linkage against libutil
Revision history for this message
Tomasz Sterna (smoku) wrote :

Thank you for the resolution.
It was commited in r763.

Changed in jabberd2:
status: Incomplete → Fix Committed
Revision history for this message
Tomasz Sterna (smoku) wrote :

jabberd 2,2.8 released

Changed in jabberd2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.