debian 'lenny' cyrus-imapd-2.2 grrr

hey kids! so i hit an error that i couldn't google ( hence this article... ) whilst migrating a debian cyrus-imapd mail service from an old sluggish box running 'sarge' to a new shiny box running 'lenny'...

why lenny? as is somewhat usual with debian, to get support in the packaged kernel for new SATA controllers...

the setup is cyrus-imapd-2.2, exim4, sasl auth, etc all from lenny debs... here is the error:



cyrus/lmtp[PID]: FATAL: Internal error: assertion failed:
duplicate.c: 146: (len == sizeof(time_t)) || (len == sizeof(time_t) + sizeof(unsigned long))

switched exim to use lmtpunix socket instead (just in case)...



cyrus/lmtpunix[PID]: FATAL: Internal error: assertion failed:
duplicate.c: 146: (len == sizeof(time_t)) || (len == sizeof(time_t) + sizeof(unsigned long))

hmm.

more googling for different search terms found me this, which describes a similar failure mode to the one i was experiencing and more importantly, points out this in the cyrus install notes, which understates:

"(If you have a Berkeley DB version mismatch, somewhat perplexing crashes result.)"

nice.

heres some post-mortem ldd-ing:



# this is 'lenny' and cyrus-imapd-2.2:

mail:~# ldd /usr/lib/cyrus/bin/imapd 
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0x00002b6cd9b87000)
        libgssapi.so.2 => /usr/lib/libgssapi.so.2 (0x00002b6cd9da0000)
        libkrb5.so.22 => /usr/lib/libkrb5.so.22 (0x00002b6cd9fd4000)
        libasn1.so.8 => /usr/lib/libasn1.so.8 (0x00002b6cda242000)
        libroken.so.18 => /usr/lib/libroken.so.18 (0x00002b6cda4c5000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x00002b6cda6d9000)
        libcom_err.so.2 => /lib/libcom_err.so.2 (0x00002b6cda911000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00002b6cdab14000)
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0x00002b6cdad29000)
        libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00002b6cdb00f000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00002b6cdb25c000)
        libwrap.so.0 => /lib/libwrap.so.0 (0x00002b6cdb5e9000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x00002b6cdb7f2000)
        libc.so.6 => /lib/libc.so.6 (0x00002b6cdba0b000)
        libdl.so.2 => /lib/libdl.so.2 (0x00002b6cdbd69000)
        libheimntlm.so.0 => /usr/lib/libheimntlm.so.0 (0x00002b6cdbf6d000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002b6cdc173000)
        libhx509.so.1 => /usr/lib/libhx509.so.1 (0x00002b6cdc38e000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00002b6cdc5ce000)
        /lib64/ld-linux-x86-64.so.2 (0x00002b6cd9969000)
mail:~# ldd /usr/lib/sasl2/libsasldb.so
        libdb-4.6.so => /usr/lib/libdb-4.6.so (0x00002b1468841000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x00002b1468b7f000)
        libc.so.6 => /lib/libc.so.6 (0x00002b1468d95000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00002b14690f3000)
        /lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

# this is 'etch' and cyrus-imapd-2.2:

mail:/# ldd /usr/lib/cyrus/bin/imapd
        linux-gate.so.1 =>  (0xffffe000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xf7f00000)
        libresolv.so.2 => /lib/tls/libresolv.so.2 (0xf7eed000)
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0xf7e17000)
        libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xf7dd8000)
        libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xf7c9e000)
        libwrap.so.0 => /lib/libwrap.so.0 (0xf7c96000)
        libnsl.so.1 => /lib/tls/libnsl.so.1 (0xf7c80000)
        libc.so.6 => /lib/tls/libc.so.6 (0xf7b4e000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0xf7b49000)
        libz.so.1 => /usr/lib/libz.so.1 (0xf7b35000)
        /lib/ld-linux.so.2 (0xf7f1d000)
mail:/# ldd /usr/lib/sasl2/libsasldb.so
        linux-gate.so.1 =>  (0xffffe000)
        libdb-4.2.so => /usr/lib/libdb-4.2.so (0xf7eb4000)
        libresolv.so.2 => /lib/tls/libresolv.so.2 (0xf7ea0000)
        libc.so.6 => /lib/tls/libc.so.6 (0xf7d6e000)
        /lib/ld-linux.so.2 (0x56555000)

the lines to note are the libdb-X.X.so lines

i did try the 'experimental' package cyrus-imapd-2.3 on lenny ( to get an imapd linked to libdb-4.6.so ) but that resulted errors like these:



cyrus/imaps[PID]: incorrect version of Berkeley db: compiled against 4.5.20, linked against 4.4.20

cyrus/ctl_mboxlist[PID]: incorrect version of Berkeley db: compiled against 4.5.20, linked against 4.4.20

...leaving me unable to upgrade the cyrus dbs as per the upgrade notes, so decided lenny was a bad idea for now and cyrus.

Posted by doug on Sunday, March 02, 2008