[Dovecot] doveadm-lda - segfault
I have simple old message: --8<---------------cut here---------------start------------->8--- X-Mozilla-Status: 0011 X-Mozilla-Status2: 00000000 Date: Wed, 26 Jan 2000 13:38:41 +0100 From: Kamil Jonca kjonca@localhost.localdomain To: Somebody X xx@tiger.com.pl Subject: Re: Opisy Message-ID: 20000126133839.B2888@localhost.localdomain References: Pine.LNX.4.05.10001261335010.19250-100000@aa.bbb.ccc Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.95.5us In-Reply-To: Pine.LNX.4.05.10001261335010.19250-100000@xxx.yyy.cc; from Somebody X on Wed, Jan 26, 2000 at 01:37:52PM +0000 X-Operating-System: 'Linux localhost.localdomain 2.2.9-27mdk #1 Mon Jan 24 15:49:34 CET 2000 i686 unknown' X-Geek: GIT d s+:- a-- C++ UL P+ L++ E W N+ w- PS+ PE++ PGP t-- X-- R- tv- b+ D+ G e h-- r- z? Lines: 30 X-KJONCA-Clamav-Status: No
jd;fladflsd;lc dfgn;sdhgfad abffhahgl fadn;al sdfnad;hfa fna;lhfla
shfkah --8<---------------cut here---------------end--------------->8--- When I try to
dovecot-lda < message.txt
(for sieve refiltering) I got segmentation fault. Does it is bug in lda, or message does not keep standards? KJ
-- http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewski... Sanity and insanity overlap a fine grey line.
On 12/11/2012 11:18 AM Kamil Jońca wrote:
When I try to
dovecot-lda < message.txt
(for sieve refiltering) I got segmentation fault. Does it is bug in lda, or message does not keep standards? KJ
I've saved your example message and delivered it twice (Dovecot 2.1.11 and 2.0.21). I'm unable to reproduce the crash.
Please read http://dovecot.org/bugreport.html and provide the necessary details.
Regards, Pascal
The trapper recommends today: 5e1f1e55.1234620@localdomain.org
Pascal Volk user+dovecot@localhost.localdomain.org writes:
On 12/11/2012 11:18 AM Kamil Jońca wrote:
When I try to
dovecot-lda < message.txt
(for sieve refiltering) I got segmentation fault. Does it is bug in lda, or message does not keep standards? KJ
I've saved your example message and delivered it twice (Dovecot 2.1.11 and 2.0.21). I'm unable to reproduce the crash.
Please read http://dovecot.org/bugreport.html and provide the necessary details.
dovecot -n --8<---------------cut here---------------start------------->8--- # 2.1.12 (f13f2725882e): /etc/dovecot/dovecot.conf # OS: Linux 3.6.7+1 x86_64 Debian wheezy/sid auth_debug = yes auth_mechanisms = plain digest-md5 cram-md5 login auth_username_format = %n auth_verbose = yes log_path = /var/log/dovecot namespace { hidden = no inbox = yes list = yes location = maildir:~/Mail/0:LAYOUT=fs:INBOX=~/Mail/0/INBOX prefix = separator = / subscriptions = yes type = private } passdb { args = scheme=PLAIN /etc/security/dovecot.pwd driver = passwd-file } plugin { mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename flag_change save mail_log_fields = uid box msgid size from flags sieve = ~/.dovecot.sieve sieve_execute_bin_dir = %h/sieve/bin sieve_execute_exec_timeout = 86400s sieve_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute +vnd.dovecot.filter sieve_filter_bin_dir = %h/sieve/bin sieve_filter_exec_timeout = 86400s sieve_pipe_bin_dir = %h/sieve/bin sieve_pipe_exec_timeout = 86400s sieve_plugins = sieve_extprograms } protocols = " imap lmtp" service auth { user = root } ssl_cert = 8---
Dovecot taken from deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.1 main
- manually compiled sieve exptrograms plugin.
Maybe its worth noticing that adding line
--8<---------------cut here---------------start------------->8--- Return-path: a@b.c --8<---------------cut here---------------end--------------->8--- to example message makes dovecot-lda working.
-- http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewski... You can no more win a war than you can win an earthquake. -- Jeannette Rankin
At 10PM +0100 on 11/12/12 Kamil Jońca wrote:
Dovecot taken from deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.1 main
- manually compiled sieve exptrograms plugin.
Maybe its worth noticing that adding line
--8<---------------cut here---------------start------------->8--- Return-path: a@b.c --8<---------------cut here---------------end--------------->8--- to example message makes dovecot-lda working.
Which revision of the extprograms plugin are you using? As of changeset 47 the Return-Path manipulation has been removed, so if there was a bug in that code rebuilding with the latest version may make it go away.
Otherwise, can you get a backtrace? It would be more use if you can rebuild with debug symbols, but even without it should give some useful information.
Ben
Ben Morrow ben@morrow.me.uk writes:
At 10PM +0100 on 11/12/12 Kamil Jońca wrote:
Dovecot taken from deb http://xi.rename-it.nl/debian/ testing-auto/dovecot-2.1 main
- manually compiled sieve exptrograms plugin.
Maybe its worth noticing that adding line
--8<---------------cut here---------------start------------->8--- Return-path: a@b.c --8<---------------cut here---------------end--------------->8--- to example message makes dovecot-lda working.
Which revision of the extprograms plugin are you using? As of changeset 47 the Return-Path manipulation has been removed, so if there was a bug in that code rebuilding with the latest version may make it go away.
I think that is most recent which can I get with --8<---------------cut here---------------start------------->8--- hg clone http://hg.rename-it.nl/pigeonhole-0.3-sieve-extprograms/ --8<---------------cut here---------------end--------------->8---
If I understand hg commands "hg branches -v" gives me: --8<---------------cut here---------------start------------->8--- default 47:3bd6ed27ae26 --8<---------------cut here---------------end--------------->8---
Otherwise, can you get a backtrace? It would be more use if you can rebuild with debug symbols, but even without it should give some useful information.
I don't know if I did it properly (how to compile it with debug symbols?)
--8<---------------cut here---------------start------------->8--- gdb -c ~/core /usr/lib/dovecot/dovecot-lda GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 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 "x86_64-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/lib/dovecot/dovecot-lda...(no debugging symbols found)...done. [New LWP 25303]
warning: Can't read pathname for load map: Input/output error. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/usr/lib/dovecot//dovecot-lda'. Program terminated with signal 11, Segmentation fault. #0 0x00007f99d591fe6f in mail_storage_copy () from /usr/lib/dovecot/libdovecot-storage.so.0 (gdb) bt full #0 0x00007f99d591fe6f in mail_storage_copy () from /usr/lib/dovecot/libdovecot-storage.so.0 No symbol table info available. #1 0x00007f99d58f1561 in maildir_copy () from /usr/lib/dovecot/libdovecot-storage.so.0 No symbol table info available. #2 0x00007f99d592723b in mailbox_copy () from /usr/lib/dovecot/libdovecot-storage.so.0 No symbol table info available. #3 0x00007f99d377c0c1 in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0 No symbol table info available. #4 0x00007f99d37724bb in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0 No symbol table info available. #5 0x00007f99d377385f in sieve_result_execute () from /usr/lib/dovecot/libdovecot-sieve.so.0 No symbol table info available. #6 0x00007f99d3782f65 in sieve_execute () from /usr/lib/dovecot/libdovecot-sieve.so.0 No symbol table info available. #7 0x00007f99d39c4112 in ?? () from /usr/lib/dovecot/modules/lib90_sieve_plugin.so No symbol table info available. #8 0x00007f99d5bb98d5 in mail_deliver () from /usr/lib/dovecot/libdovecot-lda.so.0 No symbol table info available. #9 0x000000000040295a in main () No symbol table info available. --8<---------------cut here---------------end--------------->8---
-- http://blogdebart.pl/2009/12/22/mamy-chorych-dzieci/ They have been at a great feast of languages, and stolen the scraps. -- William Shakespeare, "Love's Labour's Lost"
kjonca@o2.pl (Kamil Jońca) writes:
I don't know if I did it properly (how to compile it with debug symbols?)
After sending previous post I realized that debug symbols should be in dovecot-dbg package. Below backtrace:
gdb -c ~/core /usr/lib/dovecot/dovecot-lda GNU gdb (GDB) 7.4.1-debian Copyright (C) 2012 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 "x86_64-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/lib/dovecot/dovecot-lda...Reading symbols from /usr/lib/debug/usr/lib/dovecot/dovecot-lda...done. done. [New LWP 25303]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/lib/dovecot//dovecot-lda'.
Program terminated with signal 11, Segmentation fault.
#0 0x00007f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, _ctx=0x7fff8914fc28) at mail-copy.c:56
56 mail-copy.c: No such file or directory.
(gdb) bt full
#0 0x00007f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, _ctx=0x7fff8914fc28) at mail-copy.c:56
ctx = 0x19a6610
pmail = 0x198dbb0
from_envelope = 0x0
input = <optimized out>
guid = <optimized out>
received_date = -1
#1 mail_storage_copy (ctx=ctx@entry=0x19a6610, mail=mail@entry=0x198dbb0) at mail-copy.c:93
No locals.
#2 0x00007f99d58f1561 in maildir_copy (ctx=0x19a6610, mail=0x198dbb0) at maildir-copy.c:148
_t = <optimized out>
mbox = <optimized out>
__FUNCTION__ = "maildir_copy"
#3 0x00007f99d592723b in mailbox_copy (_ctx=_ctx@entry=0x7fff8914fd30, mail=mail@entry=0x198dbb0) at mail-storage.c:1721
ctx = 0x19a6610
box = 0x19942c0
keywords = 0x0
ret = <optimized out>
#4 0x00007f99d377c0c1 in act_store_execute (action=<optimized out>, aenv=0x1980960, tr_context=0x1980a88) at sieve-actions.c:551
trans = 0x1980a88
mail = 0x198dbb0
real_mail = <optimized out>
save_ctx = 0x0
keywords = 0x0
result = true
#5 0x00007f99d37724bb in _sieve_result_implicit_keep (result=result@entry=0x1980930, rollback=<optimized out>) at sieve-result.c:996
rac = <optimized out>
success = true
rsef = <optimized out>
rsef_first = 0x0
tr_context = 0x1980a88
act_keep = {def = 0x7f99d39b9500, ext = 0x0, location = 0x0, context = 0x0, mail = 0x198dbb0, executed = false}
#6 0x00007f99d377385f in sieve_result_execute (result=0x1980930, keep=keep@entry=0x0) at sieve-result.c:1230
implicit_keep = true
success = true
commit_ok = true
rac = 0x0
first_action = 0x1
#7 0x00007f99d3782f65 in sieve_execute (sbin=<optimized out>, msgdata=<optimized out>, senv=<optimized out>, ehandler=ehandler@entry=0x1975140, flags=flags@entry=SIEVE_RUNTIME_FLAG_NOGLOBAL,
keep=keep@entry=0x0) at sieve.c:508
result = 0x1980930
ret = 1
#8 0x00007f99d39c4112 in lda_sieve_singlescript_execute (srctx=0x7fff8914ffa0) at lda-sieve-plugin.c:436
sbin = 0x19782a0
rtflags = SIEVE_RUNTIME_FLAG_NOGLOBAL
debug = false
svinst = 0x1971440
script = 0x1974d30
user_script = <optimized out>
cpflags = SIEVE_COMPILE_FLAG_NOGLOBAL
ret = <optimized out>
ehandler = 0x1975140
error = <optimized out>
#9 lda_sieve_deliver_mail (mdctx=0x7fff891501b0, storage_r=0x7fff89150140) at lda-sieve-plugin.c:812
count = <optimized out>
i = <optimized out>
_data_stack_cur_id = 2
srctx = {svinst = 0x1971440, mdctx = 0x7fff891501b0, scripts = 0x1944ff0, script_count = 1, user_script = 0x1974d30, main_script = 0x1974d30, msgdata = 0x7fff8914ff70, scriptenv = 0x7fff89150000,
user_ehandler = 0x1975140, master_ehandler = 0x1974c20, userlog = 0x1945070 "/home/kjonca/.dovecot.sieve.log"}
svenv = {hostname = 0x194f2e0 "alfa.kjonca", base_dir = 0x195be78 "/var/run/dovecot", username = 0x195b440 "kjonca", home_dir = 0x195c4a8 "/home/kjonca", flags = SIEVE_FLAG_HOME_RELATIVE}
svinst = 0x1971440
msgdata = {mail = 0x196b010, return_path = 0x0, orig_envelope_to = 0x1944c90 "kjonca@alfa.kjonca", final_envelope_to = 0x1944c90 "kjonca@alfa.kjonca", auth_user = 0x195b440 "kjonca",
id = 0x196d660 "20000126133839.B2888@localhost.localdomain"}
scriptenv = {action_log_format = 0x194f358 "msgid=%m: %$", user = 0x195b380, default_mailbox = 0x403583 "INBOX", postmaster_address = 0x194f2d0 "root@localhost", mailbox_autocreate = false,
mailbox_autosubscribe = false, script_context = 0x7fff891501b0, smtp_open = 0x7f99d39c3030
-- http://blogdebart.pl/2012/06/24/hiena/ You can't carve your way to success without cutting remarks.
On Tue, 2012-12-11 at 23:15 +0100, Kamil Jońca wrote:
#0 0x00007f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, _ctx=0x7fff8914fc28) at mail-copy.c:56 56 mail-copy.c: No such file or directory.
raw-storage's envelope_sender is NULL. Fixed Dovecot to make sure NULL isn't returned: http://hg.dovecot.org/dovecot-2.1/rev/579984fdb6e5
But I think Pigeonhole also shouldn't set it to NULL. sieve-message.c:sieve_message_get_sender() apparently returns NULL if it can't find anything. Elsewhere this is used when nothing else is there:
#define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON"
Timo Sirainen tss@iki.fi writes:
On Tue, 2012-12-11 at 23:15 +0100, Kamil Jońca wrote:
#0 0x00007f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, _ctx=0x7fff8914fc28) at mail-copy.c:56 56 mail-copy.c: No such file or directory.
raw-storage's envelope_sender is NULL. Fixed Dovecot to make sure NULL isn't returned: http://hg.dovecot.org/dovecot-2.1/rev/579984fdb6e5
But I think Pigeonhole also shouldn't set it to NULL. sieve-message.c:sieve_message_get_sender() apparently returns NULL if it can't find anything. Elsewhere this is used when nothing else is there:
#define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON"
LDA from dovecot 2:2.1.12-0~auto+10 does not segfaults. Thanks.
KJ
-- http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewski... "Remember, extremism in the nondefense of moderation is not a virtue." -- Peter Neumann, about usenet
participants (4)
-
Ben Morrow
-
kjonca@o2.pl
-
Pascal Volk
-
Timo Sirainen