Re: [Dovecot] doveadm-lda - segfault

2012-12-20 Thread Kamil Jońca
Timo Sirainen  writes:

> On Tue, 2012-12-11 at 23:15 +0100, Kamil Jońca wrote:
>> #0  0x7f99d591fe6f 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-majewskiej-wprowadzenie/
"Remember, extremism in the nondefense of moderation is not a virtue."
-- Peter Neumann, about usenet



Re: [Dovecot] doveadm-lda - segfault

2012-12-18 Thread Timo Sirainen
On Tue, 2012-12-11 at 23:15 +0100, Kamil Jońca wrote:
> #0  0x7f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, 
> _ctx=0x7fff8914fc28) at mail-copy.c:56
> 56mail-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"




Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
kjo...@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 
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:
...
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  0x7f99d591fe6f 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  0x7f99d591fe6f in mail_storage_try_copy (mail=0x198dbb0, 
_ctx=0x7fff8914fc28) at mail-copy.c:56
ctx = 0x19a6610
pmail = 0x198dbb0
from_envelope = 0x0
input = 
guid = 
received_date = -1
#1  mail_storage_copy (ctx=ctx@entry=0x19a6610, mail=mail@entry=0x198dbb0) at 
mail-copy.c:93
No locals.
#2  0x7f99d58f1561 in maildir_copy (ctx=0x19a6610, mail=0x198dbb0) at 
maildir-copy.c:148
_t = 
mbox = 
__FUNCTION__ = "maildir_copy"
#3  0x7f99d592723b in mailbox_copy (_ctx=_ctx@entry=0x7fff8914fd30, 
mail=mail@entry=0x198dbb0) at mail-storage.c:1721
ctx = 0x19a6610
box = 0x19942c0
keywords = 0x0
ret = 
#4  0x7f99d377c0c1 in act_store_execute (action=, 
aenv=0x1980960, tr_context=0x1980a88) at sieve-actions.c:551
trans = 0x1980a88
mail = 0x198dbb0
real_mail = 
save_ctx = 0x0
keywords = 0x0
result = true
#5  0x7f99d37724bb in _sieve_result_implicit_keep 
(result=result@entry=0x1980930, rollback=) at sieve-result.c:996
rac = 
success = true
rsef = 
rsef_first = 0x0
tr_context = 0x1980a88
act_keep = {def = 0x7f99d39b9500, ext = 0x0, location = 0x0, context = 
0x0, mail = 0x198dbb0, executed = false}
#6  0x7f99d377385f 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  0x7f99d3782f65 in sieve_execute (sbin=, 
msgdata=, senv=, 
ehandler=ehandler@entry=0x1975140, 
flags=flags@entry=SIEVE_RUNTIME_FLAG_NOGLOBAL, 
keep=keep@entry=0x0) at sieve.c:508
result = 0x1980930
ret = 1
#8  0x7f99d39c4112 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 = 
cpflags = SIEVE_COMPILE_FLAG_NOGLOBAL
ret = 
ehandler = 0x1975140
error = 
#9  lda_sieve_deliver_mail (mdctx=0x7fff891501b0, storage_r=0x7fff89150140) at 
lda-sieve-plugin.c:812
count = 
i = 
_data_stack_cur_id = 2
srctx = {svinst = 0x1971440, mdctx = 0x7fff891501b0, scripts = 
0x1944ff0, script_count = 1, user_script = 0x1974d30, main_script = 0x1974d30, 
msgdata = 0x7fff8914ff70, scriptenv = 0x7fff8915, 
  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 "<2126133839.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 , smtp_close = 0x7f99d39c3010 
, 
  duplicate_check = 0x7f99d39c2fc0 , 
duplicate_mark = 0x7f99d39c2ff0 , reject_mail = 
0x7f99d39c2fb0 , 
  exec_status = 0x7fff8914ff20, trac

Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
Ben Morrow  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: 
>> --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 
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:
...
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  0x7f99d591fe6f in mail_storage_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
(gdb) bt full
#0  0x7f99d591fe6f in mail_storage_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#1  0x7f99d58f1561 in maildir_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#2  0x7f99d592723b in mailbox_copy () from 
/usr/lib/dovecot/libdovecot-storage.so.0
No symbol table info available.
#3  0x7f99d377c0c1 in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#4  0x7f99d37724bb in ?? () from /usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#5  0x7f99d377385f in sieve_result_execute () from 
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#6  0x7f99d3782f65 in sieve_execute () from 
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#7  0x7f99d39c4112 in ?? () from 
/usr/lib/dovecot/modules/lib90_sieve_plugin.so
No symbol table info available.
#8  0x7f99d5bb98d5 in mail_deliver () from 
/usr/lib/dovecot/libdovecot-lda.so.0
No symbol table info available.
#9  0x0040295a 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"



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Ben Morrow
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: 
> --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



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca
Pascal Volk  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: 
--8<---cut here---end--->8---
to example message makes dovecot-lda working.

-- 
http://modnebzdury.wordpress.com/2009/10/01/niewiarygodny-list-prof-majewskiej-wprowadzenie/
You can no more win a war than you can win an earthquake.
-- Jeannette Rankin



Re: [Dovecot] doveadm-lda - segfault

2012-12-11 Thread Pascal Volk
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.1234...@localdomain.org


[Dovecot] doveadm-lda - segfault

2012-12-11 Thread Kamil Jońca

I have simple old message: 
--8<---cut here---start->8---
X-Mozilla-Status: 0011
X-Mozilla-Status2: 
Date: Wed, 26 Jan 2000 13:38:41 +0100
From: Kamil Jonca 
To: Somebody X  
Subject: Re: Opisy 
Message-ID: <2126133839.B2888@localhost.localdomain>
References: 
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: ; from 
Somebody X on Wed, Jan 26, 2000 at 01:37:52PM +
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-majewskiej-wprowadzenie/
Sanity and insanity overlap a fine grey line.