Re: [Dovecot] [PATCH] dovecot-lda with expire plugin segfaults if dict failed

2012-05-19 Thread Timo Sirainen
On Tue, 2012-05-15 at 15:08 +0200, Lazy wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 0x7f1975cccdee in expire_mailbox_transaction_commit (t= optimized out>, changes_r=) at
> expire-plugin.c:169
> 169 } else if (strcmp(value, "0") == 0) {

Fixed a bit differently:
http://hg.dovecot.org/dovecot-2.1/rev/8f72002cb394




[Dovecot] [PATCH] dovecot-lda with expire plugin segfaults if dict failed

2012-05-15 Thread Lazy
Program received signal SIGSEGV, Segmentation fault.
0x7f1975cccdee in expire_mailbox_transaction_commit (t=, changes_r=) at
expire-plugin.c:169
169 } else if (strcmp(value, "0") == 0) {
(gdb) bt
#0  0x7f1975cccdee in expire_mailbox_transaction_commit (t=, changes_r=) at
expire-plugin.c:169
#1  0x7f1975ed9bdf in quota_mailbox_transaction_commit
(ctx=0x659ce0, changes_r=0x7fff94908070) at quota-storage.c:94
#2  0x7f197775dafd in mailbox_transaction_commit_get_changes
(_t=, changes_r=0x7fff94908070) at
mail-storage.c:1491
#3  0x7f197775db3e in mailbox_transaction_commit (t=0x60d330) at
mail-storage.c:1474
#4  0x7f1975885ff7 in act_store_commit (action=, aenv=0x6523f0, tr_context=0x652588, keep=0x7fff9490812f) at
sieve-actions.c:665
#5  0x7f197587d79b in sieve_result_execute (result=, keep=) at sieve-result.c:1156
#6  0x7f197588dca6 in sieve_execute (sbin=,
msgdata=, senv=,
ehandler=, flags=,
keep=0x0) at sieve.c:475
#7  0x7f1975ac9a43 in lda_sieve_singlescript_execute
(mdctx=0x7fff949085a0, storage_r=) at
lda-sieve-plugin.c:433
#8  lda_sieve_run (mdctx=0x7fff949085a0, storage_r=) at lda-sieve-plugin.c:657
#9  lda_sieve_deliver_mail (mdctx=0x7fff949085a0, storage_r=) at lda-sieve-plugin.c:796
#10 0x7f19779df685 in mail_deliver (ctx=0x7fff949085a0,
storage_r=0x7fff94908518) at mail-deliver.c:389
#11 0x0040349c in main (argc=5, argv=0x60ca30) at main.c:454


this makes the error go away

--- dovecot-2.1.5.orig/src/plugins/expire/expire-plugin.c
2012-05-15 14:52:24.004189104 +0200
+++ dovecot-2.1.5/src/plugins/expire/expire-plugin.c2012-05-15
14:53:03.472187894 +0200
@@ -166,7 +166,7 @@
/* first time saving here with expire enabled */
first_save_timestamp(box, &new_stamp);
update_dict = TRUE;
-   } else if (strcmp(value, "0") == 0) {
+   } else if (ret > 0 && strcmp(value, "0") == 0) {
/* we're saving the first mail to this mailbox.
   ioloop_time may not be exactly the first
   message's save time, but a few seconds


-- 
Michal Grzedzicki


dovecot-2.1.5-expire.diff
Description: Binary data