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

Lazy lazy404 at gmail.com
Tue May 15 16:08:51 EEST 2012


Program received signal SIGSEGV, Segmentation fault.
0x00007f1975cccdee in expire_mailbox_transaction_commit (t=<value
optimized out>, changes_r=<value optimized out>) at
expire-plugin.c:169
169                             } else if (strcmp(value, "0") == 0) {
(gdb) bt
#0  0x00007f1975cccdee in expire_mailbox_transaction_commit (t=<value
optimized out>, changes_r=<value optimized out>) at
expire-plugin.c:169
#1  0x00007f1975ed9bdf in quota_mailbox_transaction_commit
(ctx=0x659ce0, changes_r=0x7fff94908070) at quota-storage.c:94
#2  0x00007f197775dafd in mailbox_transaction_commit_get_changes
(_t=<value optimized out>, changes_r=0x7fff94908070) at
mail-storage.c:1491
#3  0x00007f197775db3e in mailbox_transaction_commit (t=0x60d330) at
mail-storage.c:1474
#4  0x00007f1975885ff7 in act_store_commit (action=<value optimized
out>, aenv=0x6523f0, tr_context=0x652588, keep=0x7fff9490812f) at
sieve-actions.c:665
#5  0x00007f197587d79b in sieve_result_execute (result=<value
optimized out>, keep=<value optimized out>) at sieve-result.c:1156
#6  0x00007f197588dca6 in sieve_execute (sbin=<value optimized out>,
msgdata=<value optimized out>, senv=<value optimized out>,
    ehandler=<value optimized out>, flags=<value optimized out>,
keep=0x0) at sieve.c:475
#7  0x00007f1975ac9a43 in lda_sieve_singlescript_execute
(mdctx=0x7fff949085a0, storage_r=<value optimized out>) at
lda-sieve-plugin.c:433
#8  lda_sieve_run (mdctx=0x7fff949085a0, storage_r=<value optimized
out>) at lda-sieve-plugin.c:657
#9  lda_sieve_deliver_mail (mdctx=0x7fff949085a0, storage_r=<value
optimized out>) at lda-sieve-plugin.c:796
#10 0x00007f19779df685 in mail_deliver (ctx=0x7fff949085a0,
storage_r=0x7fff94908518) at mail-deliver.c:389
#11 0x000000000040349c 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.c    2012-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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dovecot-2.1.5-expire.diff
Type: application/octet-stream
Size: 693 bytes
Desc: not available
URL: <http://dovecot.org/pipermail/dovecot/attachments/20120515/ff3fd143/attachment.obj>


More information about the dovecot mailing list