Library "ulogd_MYSQL.so" should be linked to "libmysqlclient.so"

Bug #291374 reported by Anderson
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
ulogd (Ubuntu)
Confirmed
Undecided
usergray
Nominated for Intrepid by Anderson
Nominated for Jaunty by Anderson
Nominated for Karmic by KBios

Bug Description

Binary package hint: ulogd-mysql

I know "ulogd" is a software from Universe, but... I need it. And I think this bug can be easily fixed by a package developer...

I just upgraded an server from Ubuntu Hardy to Ubuntu Intrepid and now, MySQL plugin in ULOG does not work because of an undefined symbol:

# invoke-rc.d ulogd start
Starting netfilter userspace log daemon: Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `raw'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `oob'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `ip'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `tcp'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `icmp'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `udp'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `ahesp'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:308 registering interpreter `local'
Fri Oct 31 00:32:09 2008 <3> ulogd.c:363 registering output `syslogemu'
Fri Oct 31 00:32:09 2008 <7> ulogd.c:462 load_plugins: '/usr/lib/ulogd/ulogd_MYSQL.so': /usr/lib/ulogd/ulogd_MYSQL.so: undefined symbol: mysql_fetch_field
ulogd.

--------------

When preloading /usr/lib/libmysqlclient.so, the plugin works:

# env LD_PRELOAD=/usr/lib/libmysqlclient.so invoke-rc.d ulogd start
Starting netfilter userspace log daemon: Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `raw'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `oob'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `ip'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `tcp'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `icmp'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `udp'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `ahesp'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:308 registering interpreter `local'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:363 registering output `syslogemu'
Fri Oct 31 00:32:18 2008 <3> ulogd.c:363 registering output `mysql'
ulogd.

usergray (surtaevm)
Changed in ulogd:
assignee: nobody → surtaevm
Revision history for this message
Victor Stinner (vstinner) wrote :

I have the same problem (ulogd.c... load_plugins... ulogd_MYSQL.so... undefined symbol: mysql_fetch_field).

Ubuntu source package contains a patch specific to Ubuntu about the MySQL module:
--------------------------- 8< ------------------------
--- ulogd-1.24/mysql/Makefile.in 2005-11-25 20:58:27.000000000 +0100
(...)
 SHARED_LIBS=ulogd_MYSQL.so

+# fix the LDFLAGS included in MYSQL_LDFLAGS
+MYSQL_LDFLAGS:=$(shell echo $(MYSQL_LDFLAGS) | sed s/-Wl,//;s/-rpath//)
+

(...)
--------------------------- 8< ------------------------

First remark: I don't understand how the sed can work because ";" is the separator for shell commands. It should be >sed 's/-Wl,//;s/-rpath//'<.

The command "mysql_config --libs" creates arguments for gcc, not for ld program:
--------------------------- 8< ------------------------
$ mysql_config --libs
-Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient
--------------------------- 8< ------------------------

It looks like -rdynamic causes a link problem (bad -rpath option).

I don't know ld/gcc/dlopen options very well, but I'm sure that ulogd_MYSQL.so have to linked to libmysqlclient.so.15. Example on Ubuntu Ibex :
$ ldd /usr/lib/ulogd/ulogd_MYSQL.so
 linux-gate.so.1 => (0xb7f48000)
 libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7dd5000)
 /lib/ld-linux.so.2 (0xb7f49000)

Example on Debian Lenny:
$ ldd /usr/lib/ulogd/ulogd_MYSQL.so
 linux-gate.so.1 => (0xb7f98000)
 libmysqlclient.so.15 => /usr/lib/libmysqlclient.so.15 (0xb7db4000)

The bug is still open since 3 months, why? Do you need more informations? The package is compiled correctly on Debian.

Revision history for this message
KBios (kbios) wrote :

Confirmed on Ubuntu server amd64.
Thanks for the workaround, I didn't know what to do!

Changed in ulogd:
status: New → Confirmed
Revision history for this message
LGB [Gábor Lénárt] (lgb) wrote :

I can confirm this too, with Ubuntu 9.04 server on x86_64 arch. I also used the LD_PRELOAD trick to make it work, but I think this bug should be fixed, otherwise this package is totally unusable and broken.

Version of the package (ulogd-mysql): 1.24-2.1ubuntu2

Tue Jun 16 09:32:55 2009 <7> ulogd.c:462 load_plugins: '/usr/lib/ulogd/ulogd_MYSQL.so': /usr/lib/ulogd/ulogd_MYSQL.so: undefined symbol: mysql_fetch_field

Revision history for this message
Simon Engelsman (simon-engelsman) wrote :

Confirmed on Ubuntu 9.10

ulogd 1.24-2.1ubuntu2
ulogd-mysql 1.24-2.1ubuntu2

When starting ulogd with the MySQL plugin enabled:
...
ulogd.c:462 load_plugins: '/usr/lib/ulogd/ulogd_MYSQL.so': /usr/lib/ulogd/ulogd_MYSQL.so: undefined symbol: mysql_fetch_field
...

Worked around it by adding:

export LD_PRELOAD=/usr/lib/libmysqlclient.so.16

to the ulogd init script (/etc/init.d/ulogd)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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