Re: [Dovecot] dovecot cores
On 12.10.2012, at 10.02, dovecot@freakout.de wrote:
According to Timo Sirainen:
Simply specifying -I or -L paths doesn't link with libmysql. What exactly did you use for CPPFLAGS/LDFLAGS/configure?
ok - i specified: CFLAGS="-I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include" LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib -lmysqlclient"
-lmysqlclient shouldn't be in LDFLAGS.
if i omit "-lmysqlclient" (seems to be the reason for the hassle) i get:
libtool: link: gcc4 -std=gnu99 -g -I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -Wstrict-aliasing=2 -I/opt/ssl/include -o .libs/auth auth.o auth-cache.o auth-client-connection.o auth-master-connection.o auth-postfix-connection.o mech-otp-skey-common.o mech-plain-common.o auth-penalty.o auth-request.o auth-request-handler.o auth-settings.o auth-stream.o auth-worker-client.o auth-worker-server.o db-checkpassword.o db-dict.o db-sql.o db-passwd-file.o main.o mech.o mech-anonymous.o mech-plain.o mech-login.o mech-cram-md5.o mech-digest-md5.o mech-external.o mech-gssapi.o mech-ntlm.o mech-otp.o mech-scram-sha1.o mech-skey.o mech-rpa.o mech-apop.o mech-winbind.o passdb.o passdb-blocking.o passdb-bsdauth.o passdb-cache.o passdb-checkpassword.o passdb-dict.o passdb-passwd.o passdb-passwd-file.o passdb-pam.o passdb-shadow.o passdb-sia.o passdb-vpopmail.o passdb-sql.o passdb-static.o passdb-template.o userdb.o userdb-blocking.o userdb-checkpassword.o userdb-dict.o userdb-nss.o userdb-passwd.o userdb-passwd-file.o userdb-prefetch.o userdb-static.o userdb-vpopmail.o userdb-sql.o userdb-template.o db-ldap.o passdb-ldap.o userdb-ldap.o -Wl,--export-dynamic -L/opt /zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib libpassword.a ../lib-ntlm/libntlm.a ../lib-otp/libotp.a ../../src/lib-sql/.libs/libsql.a ../../src/lib-dovecot/.libs/libdovecot.so -lcrypt -ldl -Wl,-rpath -Wl,/opt/dovecot/lib ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_connect': /usr/src/rpm/BUILD/dovecot-2.1.10/src/lib-sql/driver-mysql.c:83: undefined reference to
mysql_options'... tons of other undefined reference to mysqlclient /usr/src/rpm/BUILD/dovecot-2.1.10/src/lib-sql/driver-mysql.c:470: undefined reference to `mysql_error'
collect2: error: ld returned 1 exit status
I'm not sure why it's doing that. It really shouldn't. You could try SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient if one of them helps.
Timo Sirainen wrote the following on 12.10.2012 14:34:
On 12.10.2012, at 10.02, dovecot@freakout.de wrote:
According to Timo Sirainen:
Simply specifying -I or -L paths doesn't link with libmysql. What exactly did you use for CPPFLAGS/LDFLAGS/configure?
ok - i specified: CFLAGS="-I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include" LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib -lmysqlclient" -lmysqlclient shouldn't be in LDFLAGS.
if i omit "-lmysqlclient" (seems to be the reason for the hassle) i get:
libtool: link: gcc4 -std=gnu99 -g -I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -Wstrict-aliasing=2 -I/opt/ssl/include -o .libs/auth auth.o auth-cache.o auth-client-connection.o auth-master-connection.o auth-postfix-connection.o mech-otp-skey-common.o mech-plain-common.o auth-penalty.o auth-request.o auth-request-handler.o auth-settings.o auth-stream.o auth-worker-client.o auth-worker-server.o db-checkpassword.o db-dict.o db-sql.o db-passwd-file.o main.o mech.o mech-anonymous.o mech-plain.o mech-login.o mech-cram-md5.o mech-digest-md5.o mech-external.o mech-gssapi.o mech-ntlm.o mech-otp.o mech-scram-sha1.o mech-skey.o mech-rpa.o mech-apop.o mech-winbind.o passdb.o passdb-blocking.o passdb-bsdauth.o passdb-cache.o passdb-checkpassword.o passdb-dict.o passdb-passwd.o passdb-passwd-file.o passdb-pam.o passdb-shadow.o passdb-sia.o passdb-vpopmail.o passdb-sql.o passdb-static.o passdb-template.o userdb.o userdb-blocking.o userdb-checkpassword.o userdb-dict.o userdb-nss.o userdb-passwd.o userdb-passwd-file.o userdb-prefetch.o userdb-static.o userdb-vpopmail.o userdb-sql.o userdb-template.o db-ldap.o passdb-ldap.o userdb-ldap.o -Wl,--export-dynamic -L/opt /zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib libpassword.a ../lib-ntlm/libntlm.a ../lib-otp/libotp.a ../../src/lib-sql/.libs/libsql.a ../../src/lib-dovecot/.libs/libdovecot.so -lcrypt -ldl -Wl,-rpath -Wl,/opt/dovecot/lib ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_connect': /usr/src/rpm/BUILD/dovecot-2.1.10/src/lib-sql/driver-mysql.c:83: undefined reference to
mysql_options'... tons of other undefined reference to mysqlclient /usr/src/rpm/BUILD/dovecot-2.1.10/src/lib-sql/driver-mysql.c:470: undefined reference to `mysql_error'
collect2: error: ld returned 1 exit status I'm not sure why it's doing that. It really shouldn't. You could try SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient if one of them helps. Axel, please let us know whether one of these works: "SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient".
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location).
On 12.10.2012, at 10.45, Tamsy wrote:
Axel, please let us know whether one of these works: "SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient".
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location).
If you run configure without adding the -lmysqlclient, what do you get with:
egrep -i 'mysql|auth_libs|sql_libs' Makefile
I guess the problem is that I shouldn't have copy&pasted the mysql detection code from php, and configure somehow passes successfully without actually setting any MYSQL_LIBS..
Timo Sirainen wrote the following on 12.10.2012 14:50:
On 12.10.2012, at 10.45, Tamsy wrote:
Axel, please let us know whether one of these works: "SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient".
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location). If you run configure without adding the -lmysqlclient, what do you get with:
egrep -i 'mysql|auth_libs|sql_libs' Makefile
I guess the problem is that I shouldn't have copy&pasted the mysql detection code from php, and configure somehow passes successfully without actually setting any MYSQL_LIBS..
Just ran configure without adding the -lmysqlclient (CPPFLAGS='-I/opt/mysql/include/mysql' LDFLAGS='-L/opt/mysql/lib/mysql -lz -lcrypt -lnsl -lm' ./configure --with-mysql....
egrep -i 'mysql|auth_libs|sql_libs' Makefile
says:
AUTH_LIBS = CPPFLAGS = -I/opt/mysql/include/mysql LDFLAGS = $(NOPLUGIN_LDFLAGS) -L/opt/mysql/lib/mysql -lz -lcrypt -lnsl -lm MYSQL_CFLAGS = MYSQL_CONFIG = NO MYSQL_LIBS = PGSQL_LIBS = SQL_LIBS = sql_drivers = mysql scan-build -o scan-reports ../configure --with-ldap=auto --with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto --with-gssapi=auto --with-libwrap=auto; \
configure runs without error but make ends with:
<snip>
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_get_error': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:469: undefined reference to
mysql_errno'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:470: undefined
reference to mysql_error' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_get_field_value_binary':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:436: undefined
reference to mysql_fetch_lengths' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_fetch_fields':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:383: undefined
reference to mysql_num_fields' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:384: undefined reference to
mysql_fetch_fields'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_next_row': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:366: undefined reference to
mysql_fetch_row'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:370: undefined
reference to mysql_errno' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_result_free':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:351: undefined
reference to mysql_free_result' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_do_query':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:233: undefined
reference to mysql_query' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:237: undefined reference to
mysql_errno'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_query_s': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:315: undefined reference to
mysql_affected_rows'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:316: undefined
reference to mysql_store_result' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:321: undefined reference to
mysql_next_result'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:332: undefined
reference to mysql_free_result' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:327: undefined reference to
mysql_errno'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_exec': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:284: undefined reference to
mysql_error'
../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_escape_string': /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:274: undefined reference to
mysql_real_escape_string'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:268: undefined
reference to mysql_escape_string' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_connect':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:83: undefined
reference to mysql_options' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:87: undefined reference to
mysql_options'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:92: undefined
reference to mysql_ssl_set' /usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:110: undefined reference to
mysql_real_connect'
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:123: undefined
reference to mysql_error' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_deinit_v':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:226: undefined
reference to mysql_close' ../../src/lib-sql/.libs/libsql.a(driver-mysql.o): In function
driver_mysql_parse_connect_string':
/usr/local/src/dovecot-2.1.10/src/lib-sql/driver-mysql.c:198: undefined
reference to mysql_init' collect2: ld returned 1 exit status make[3]: *** [auth] Error 1 make[3]: Leaving directory
/usr/local/src/dovecot-2.1.10/src/auth'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /usr/local/src/dovecot-2.1.10/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/usr/local/src/dovecot-2.1.10'
make: *** [all] Error 2
According to Tamsy:
Timo Sirainen wrote the following on 12.10.2012 14:34:
On 12.10.2012, at 10.02, dovecot@freakout.de wrote:
According to Timo Sirainen:
Simply specifying -I or -L paths doesn't link with libmysql. What exactly did you use for CPPFLAGS/LDFLAGS/configure?
ok - i specified: CFLAGS="-I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include" LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib -lmysqlclient" -lmysqlclient shouldn't be in LDFLAGS.
I'm not sure why it's doing that. It really shouldn't. You could try SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient if one of them helps. Axel, please let us know whether one of these works: "SQL_LIBS=-lmysqlclient or AUTH_LIBS=-lmysqlclient or MYSQL_LIBS=-lmysqlclient".
Since Dovecot 1.x all the way up to 2.1.10 I had trouble with this and only by putting -lmysqlclient in LDFLAGS as described before Dovecot compiles without error (Ubuntu Server 8.04 & 10.04, mySQL in a non-standart location).
SQL_LIBS=-lmysqlclient => not working AUTH_LIBS=-lmysqlclient => not working
MYSQL_LIBS=-lmysqlclient
LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib"
./configure --prefix=%{_prefix}
--sysconfdir=%{_etcdir} --mandir=%{_mandir} --docdir=%{_docdir} --libexecdir=%{_sbindir} --datadir=%{_prefix}
--with-rundir=/var/dovecot/run
--with-statedir=/var/dovecot/state
--with-mysql
=> WORKING
BUT:
[axel@joe rpm]$ ldd BUILD/dovecot-2.1.10-root/opt/dovecot-2.1.10-5/sbin/dovecot libdovecot.so.0 => /opt/dovecot/lib/libdovecot.so.0 (0x00993000) libgcc_s.so.1 => /opt/gcc4/lib/libgcc_s.so.1 (0x0092c000) libc.so.6 => /lib/libc.so.6 (0x00ebf000)
! libmysqlclient.so.18 => /opt/mysql/lib/libmysqlclient.so.18 (0x001cc000) libdl.so.2 => /lib/libdl.so.2 (0x00ae3000) libssp.so.0 => /opt/ssp/lib/libssp.so.0 (0x0057b000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x002c6000) libstrings.so => /opt/mysql/lib/libstrings.so (0x0057e000) libz.so.1 => /opt/zlib/lib/libz.so.1 (0x00110000) libpthread.so.0 => /lib/libpthread.so.0 (0x00b08000) libm.so.6 => /lib/libm.so.6 (0x00135000)
dovecot still seems to be linked with the mysqlclient!
i have just compiled - not tried the binaries - the core dump occurs only in the night!
If you run configure without adding the -lmysqlclient, what do you get with:
egrep -i 'mysql|auth_libs|sql_libs' Makefile
[axel@joe dovecot-2.1.10]$ egrep -i 'mysql|auth_libs|sql_libs' Makefile AUTH_LIBS = -lcrypt -lmysqlclient CFLAGS = -std=gnu99 -g -I/opt/zlib/include -I/opt/ssl/include -I/opt/mysql/include -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast -fno-builtin-strftime -Wstrict-aliasing=2 -I/opt/ssl/include LDFLAGS = $(NOPLUGIN_LDFLAGS) -L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib MYSQL_CFLAGS = MYSQL_CONFIG = NO MYSQL_LIBS = -lmysqlclient PGSQL_LIBS = SQL_LIBS = -lmysqlclient sql_drivers = mysql scan-build -o scan-reports ../configure --with-ldap=auto --with-pgsql=auto --with-mysql=auto --with-sqlite=auto --with-solr=auto --with-gssapi=auto --with-libwrap=auto; \
Cheers Axel
On 12.10.2012, at 11.10, dovecot@freakout.de wrote:
MYSQL_LIBS=-lmysqlclient
LDFLAGS="-L/opt/zlib/lib -L/opt/ssl/lib -L/opt/mysql/lib"
./configure --prefix=%{_prefix}
--sysconfdir=%{_etcdir} --mandir=%{_mandir} --docdir=%{_docdir} --libexecdir=%{_sbindir} --datadir=%{_prefix}
--with-rundir=/var/dovecot/run
--with-statedir=/var/dovecot/state
--with-mysql => WORKING
I think this is the correct fix for this. Basically same as what I committed now: http://hg.dovecot.org/dovecot-2.1/rev/c8d55ba25f39
BUT:
[axel@joe rpm]$ ldd BUILD/dovecot-2.1.10-root/opt/dovecot-2.1.10-5/sbin/dovecot libdovecot.so.0 => /opt/dovecot/lib/libdovecot.so.0 (0x00993000) libgcc_s.so.1 => /opt/gcc4/lib/libgcc_s.so.1 (0x0092c000) libc.so.6 => /lib/libc.so.6 (0x00ebf000)
! libmysqlclient.so.18 => /opt/mysql/lib/libmysqlclient.so.18 (0x001cc000) libdl.so.2 => /lib/libdl.so.2 (0x00ae3000) libssp.so.0 => /opt/ssp/lib/libssp.so.0 (0x0057b000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x002c6000) libstrings.so => /opt/mysql/lib/libstrings.so (0x0057e000) libz.so.1 => /opt/zlib/lib/libz.so.1 (0x00110000) libpthread.so.0 => /lib/libpthread.so.0 (0x00b08000) libm.so.6 => /lib/libm.so.6 (0x00135000)
dovecot still seems to be linked with the mysqlclient!
Maybe the old LDFLAGS was cached somehow? Or maybe the rpm build does something strange? I don't see how that could happen otherwise.
participants (3)
-
dovecot@freakout.de
-
Tamsy
-
Timo Sirainen