[Dovecot] problem with deliver segfaulting
i'm facing a pretty hard to debug problem when trying to use
dovecot LDA (deliver) from postfix. After having all configured, mail deliver fails. This is from my maillog:
Feb 12 21:27:54 correio postfix/pipe[12484]: 930F9F6105: to=solutti@domain.com.br, relay=dovecot, delay=0.21, delays=0.03/0.01/0/0.18, dsn=4.3.0, status=SOFTBOUNCE (Command died with signal 11: "/usr/libexec/dovecot/deliver")
at the same time, i have from my /var/log/messages:
Feb 12 21:27:54 correio kernel: deliver[12485]: segfault at 0 ip 4c1be763 sp bff64c28 error 4 in libc-2.5.so[4c193000+13f000]
so, seems deliver segfaults.
so i tried enabling mail_debug=yes on dovecot.conf for getting some
debug ..... and, with mail_debug enabled, deliver WORKS !!!!
Feb 12 21:28:41 correio postfix/pipe[12748]: 1A969F6105: to=solutti@domain.com.br, relay=dovecot, delay=0.28, delays=0.03/0.01/0/0.24, dsn=2.0.0, status=sent (delivered via dovecot service)
disabling mail_debug makes the segfault happens again .... and
reenabling mail_debug make it works again !
how can i debug this !?!?!?
--
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
Em 12/02/2010 22:35, Leonardo Rodrigues escreveu:
Feb 12 21:28:41 correio postfix/pipe[12748]: 1A969F6105: to=solutti@domain.com.br, relay=dovecot, delay=0.28, delays=0.03/0.01/0/0.24, dsn=2.0.0, status=sent (delivered via dovecot service)
disabling mail_debug makes the segfault happens again .... and
reenabling mail_debug make it works again !
how can i debug this !?!?!?
and now the most weird thing i found ...
COMMENTING out the mail_debug line on dovecot.conf make it works !!!! Having 'mail_debug=no' makes it segfaults, having it mail_debug=yes make it works and commenting out the mail_debug line makes it works too !!!
i have found something mentioning postfix and mail_debug on
http://wiki.dovecot.org/LDA/Postfix
but that says about dovecot older than 1.0.1, which is not my case,
i'm running 1.2.10.
that was weird .....
--
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
On Fri, 2010-02-12 at 22:35 -0200, Leonardo Rodrigues wrote:
Feb 12 21:27:54 correio postfix/pipe[12484]: 930F9F6105: to=solutti@domain.com.br, relay=dovecot, delay=0.21, delays=0.03/0.01/0/0.18, dsn=4.3.0, status=SOFTBOUNCE (Command died with signal 11: "/usr/libexec/dovecot/deliver")
Can you cause it to crash by running deliver directly from command line? If so, gdb backtrace would be nice:
gdb /usr/libexec/dovecot/deliver run <it probably crashes here> bt full
Em 12/02/2010 22:57, Timo Sirainen escreveu:
Can you cause it to crash by running deliver directly from command line? If so, gdb backtrace would be nice:
gdb /usr/libexec/dovecot/deliver run <it probably crashes here> bt full
yes i can make it crash from command line. Hope the informations help you ....
i'm running a CentOS 5.4 i686 box, dovecot 1.2.10. i've just recompiled 1.2.10 to install it without stripping. i've always heard that (stripping) makes debug with gdb too weak ... i dont know about that, dont have sure. Anyway, i just recompiled and installed with 'make install' instead of my usual 'make install-strip'
dovecot -n is at the end of the email
as i've already found this seems to be mail_debug dovecot.conf variable related .... i'll try some variations here.
- running with 'mail_debug=no' on dovecot.conf, deliver segfaults
[root@correio dovecot]# gdb /usr/libexec/dovecot/deliver GNU gdb Fedora (6.8-37.el5) Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"... (gdb) run -c /etc/dovecot/dovecot.conf -p mensagem.eml -f solutti@domain.com.br -d solutti@domain.com.br Starting program: /usr/libexec/dovecot/deliver -c /etc/dovecot/dovecot.conf -p mensagem.eml -f solutti@domain.com.br -d solutti@domain.com.br [Thread debugging using libthread_db enabled] [New Thread 0xb8060a40 (LWP 20455)]
Program received signal SIGSEGV, Segmentation fault.
0x4c1be763 in unsetenv () from /lib/libc.so.6
(gdb) bt full
#0 0x4c1be763 in unsetenv () from /lib/libc.so.6
No symbol table info available.
#1 0x0805cc44 in main (argc=9, argv=0xbfe6da54) at deliver.c:497
_data_stack_cur_id = 2
config_path = 0xbfe6dbc0 "/etc/dovecot/dovecot.conf"
mailbox = 0x80f167d "INBOX"
auth_socket = <value optimized out>
home = <value optimized out>
destaddr = 0x0
user = 0xbfe6dc03 "solutti@domain.com.br"
errstr = <value optimized out>
path = 0x8107f70 "/etc/dovecot/mensagem.eml"
orig_user = <value optimized out>
extra_fields = {arr = {buffer = 0x0, element_size = 0}, v = 0x0,
v_modifiable = 0x0}
mail_user = <value optimized out>
raw_mail_user = <value optimized out>
raw_ns = <value optimized out>
storage = <value optimized out>
box = <value optimized out>
raw_box = <value optimized out>
input = <value optimized out>
t = <value optimized out>
headers_ctx = <value optimized out>
mail = <value optimized out>
cwd = "/etc/dovecot", '\0' Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) quit
[root@correio dovecot]# [root@correio dovecot]# gdb /usr/libexec/dovecot/deliver
GNU gdb Fedora (6.8-37.el5)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) run -c /etc/dovecot/dovecot.conf -p mensagem.eml -f
solutti@domain.com.br -d solutti@domain.com.br
Starting program: /usr/libexec/dovecot/deliver -c
/etc/dovecot/dovecot.conf -p mensagem.eml -f solutti@domain.com.br -d
solutti@domain.com.br
[Thread debugging using libthread_db enabled]
[New Thread 0xb8004a40 (LWP 20698)] Program exited normally.
(gdb) dovecot -n output: [root@correio dovecot]# dovecot -c /etc/dovecot/dovecot.conf -n
# 1.2.10: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.29.1-grsec-Solutti i686 CentOS release 5.4 (Final) ext3
base_dir: /var/run/dovecot/
protocols: imap imaps pop3 pop3s
listen(default): *:143
listen(imap): *:143
listen(pop3): *:110
ssl_listen(default): *:993
ssl_listen(imap): *:993
ssl_listen(pop3): *:995
ssl_cert_file: /etc/dovecot/ssl/certs/dovecot.pem
ssl_key_file: /etc/dovecot/ssl/private/dovecot.pem
ssl_cipher_list: ALL:!LOW:!SSLv2
disable_plaintext_auth: no
login_dir: /var/run/dovecot//login
login_executable(default): /usr/libexec/dovecot/imap-login
login_executable(imap): /usr/libexec/dovecot/imap-login
login_executable(pop3): /usr/libexec/dovecot/pop3-login
login_log_format_elements: user=<%u> method=%m rip=%r lip=%l %c %k
mail_max_userip_connections: 100
verbose_proctitle: yes
first_valid_uid: 8
last_valid_uid: 8
first_valid_gid: 12
last_valid_gid: 12
mail_access_groups: mail
mail_privileged_group: mail
mail_uid: mail
mail_gid: mail
mail_location: maildir:/var/spool/mail/%u
maildir_copy_with_hardlinks: no
mail_executable(default): /usr/libexec/dovecot/imap
mail_executable(imap): /usr/libexec/dovecot/imap
mail_executable(pop3): /usr/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota trash lazy_expunge expire
autocreate zlib
mail_plugins(imap): quota imap_quota trash lazy_expunge expire
autocreate zlib
mail_plugins(pop3): quota lazy_expunge expire autocreate zlib
mail_plugin_dir(default): /usr/lib/dovecot/imap
mail_plugin_dir(imap): /usr/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/pop3
mail_log_prefix: %Us(%u), rip=%r, lip=%l:
imap_client_workarounds(default): delay-newmail
imap_client_workarounds(imap): delay-newmail
imap_client_workarounds(pop3):
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
namespace:
type: private
prefix: INBOX.
inbox: yes
list: yes
subscriptions: yes
lda:
postmaster_address: postmaster@domain.com.br
mail_plugins: quota trash expire autocreate
mail_plugin_dir: /usr/lib/dovecot/lda
quota_full_tempfail: no
deliver_log_format: msgid=%m: %$
sendmail_path: /usr/lib/sendmail
rejection_subject: Rejected: %s
rejection_reason: Your message to <%t> was automatically rejected:%n%r
auth_socket_path: /var/run/dovecot/auth-master
auth default:
mechanisms: plain login
user: nobody
username_format: %Lu
passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
userdb:
driver: prefetch
userdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
master:
path: /var/run/dovecot/auth-master
mode: 384
user: mail
group: mail
plugin:
quota: maildir
[root@correio dovecot]# --
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
On Fri, 2010-02-12 at 23:28 -0200, Leonardo Rodrigues wrote:
Program received signal SIGSEGV, Segmentation fault. 0x4c1be763 in unsetenv () from /lib/libc.so.6 (gdb) bt full #0 0x4c1be763 in unsetenv () from /lib/libc.so.6 No symbol table info available. #1 0x0805cc44 in main (argc=9, argv=0xbfe6da54) at deliver.c:497
Oh, this one. It's a libc bug.. I reported it to Ubuntu people already: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/380487
Wouldn't hurt to report it elsewhere too :)
Anyway, it crashes only if the problematic setting is first in the config file. Also the attached patch probably helps?
Em 12/02/2010 23:43, Timo Sirainen escreveu:
Oh, this one. It's a libc bug.. I reported it to Ubuntu people already: https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/380487
Wouldn't hurt to report it elsewhere too :)
Anyway, it crashes only if the problematic setting is first in the config file. Also the attached patch probably helps?
why i'm always that lucky to hit this weird bugs ???? :)
mail_debug was really the first option on dovecot.conf. i've moved
base_dir to the first option and deliver works just fine, even having mail_debug = no ......
well ... dovecot LDA is running and will be, from now on, my
official delivery agent !!! I'm ready to try out that patch you commited to enable lda zlib compression .... but after patching and compiling, i cannot start dovecot anymore. I've just sent you an email some hours ago with that .... i dont know what to do by now, i'm stuck on that.
--
Atenciosamente / Sincerily,
Leonardo Rodrigues
Solutti Tecnologia
http://www.solutti.com.br
Minha armadilha de SPAM, NÃO mandem email
gertrudes@solutti.com.br
My SPAMTRAP, do not email it
participants (2)
-
Leonardo Rodrigues
-
Timo Sirainen