Bug #3095

Dovecot worker segmentation fault

Added by Davide Principi over 6 years ago. Updated over 6 years ago.

Status:CLOSEDStart date:
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:nethserver-mail-server
Target version:v6.6
Security class: Resolution:
Affected version:v6.6-final NEEDINFO:No

Description

Steps to reproduce
  • Install nethserver-mail-server and nethserver-mail-filter
  • Enable dovecot-deleted-to-trash plugin
  • Run an IMAP session

The IMAP session dies during FETCH command:

    # nc localhost 143
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
a login admin ******
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS SPECIAL-USE ACL RIGHTS=texk] Logged in
b select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 3 EXISTS
* 0 RECENT
* OK [UNSEEN 1] First unseen.
* OK [UIDVALIDITY 1427729562] UIDs valid
* OK [UIDNEXT 4] Predicted next UID
* OK [NOMODSEQ] No permanent modsequences
b OK [READ-WRITE] Select completed.
c fetch 1 all
[connection closed]

In /var/log/imap

Mar 30 15:37:09 vm3 dovecot: imap-login: Login: user=<admin>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, mpid=3942, secured, session=<eeZPQYMSkgB/AAAB>
Mar 30 15:37:16 vm3 dovecot: imap(admin): Fatal: master: service(imap): child 3942 killed with signal 11 (core dumps disabled)

Installed packages

   # rpm -qa | grep ^dovecot
dovecot-2.1.16-1.el6.x86_64
dovecot-deleted-to-trash-0.6-1.ns6.x86_64
dovecot-pigeonhole-2.1.16-1.el6.x86_64
dovecot-antispam-0.0.49-1.ns6.x86_64
   # rpm -qa | grep ^nethserver-mail
nethserver-mail-server-1.8.6-1.2.g70ba93e.ns6.noarch
nethserver-mail-common-1.4.2-1.ns6.noarch

History

#1 Updated by Davide Principi over 6 years ago

  • Description updated (diff)
  • Status changed from NEW to TRIAGED
  • % Done changed from 0 to 20

Stack trace:

#0  0x00007f2f2fcbee80 in antispam_transaction_commit (t=<value optimized out>, changes_r=0x7fff425b8ce0) at mailbox.c:220
#1  0x00007f2f32ba98be in mailbox_transaction_commit_get_changes () from /usr/lib64/dovecot/libdovecot-storage.so.0
#2  0x00007f2f32ba9916 in mailbox_transaction_commit () from /usr/lib64/dovecot/libdovecot-storage.so.0
#3  0x0000000000412adb in imap_fetch_deinit ()
#4  0x000000000040a0f4 in ?? ()
#5  0x000000000041155d in command_exec ()
#6  0x000000000040fd8e in ?? ()
#7  0x0000000000410ff3 in client_output ()
#8  0x00007f2f328f8fa9 in ?? () from /usr/lib64/dovecot/libdovecot.so.0
#9  0x00007f2f328eeba6 in io_loop_call_io () from /usr/lib64/dovecot/libdovecot.so.0
#10 0x00007f2f328efc2f in io_loop_handler_run () from /usr/lib64/dovecot/libdovecot.so.0
#11 0x00007f2f328eeb48 in io_loop_run () from /usr/lib64/dovecot/libdovecot.so.0
#12 0x00007f2f328da053 in master_service_run () from /usr/lib64/dovecot/libdovecot.so.0
#13 0x00000000004195bd in main ()

Workaround
The problem disappears by swapping the loading order of antispam and deleted_to_trash :

   # ls -1 /usr/lib64/dovecot/lib*
[...]
/usr/lib64/dovecot/lib30_imap_zlib_plugin.so
/usr/lib64/dovecot/lib90_antispam_plugin.so
/usr/lib64/dovecot/lib90_sieve_plugin.so
/usr/lib64/dovecot/lib90_stats_plugin.so
/usr/lib64/dovecot/lib95_imap_stats_plugin.so
/usr/lib64/dovecot/lib_deleted_to_trash_plugin.so
[...]
   # mv /usr/lib64/dovecot/lib_deleted_to_trash_plugin.so /usr/lib64/dovecot/lib89_deleted_to_trash_plugin.so

The deleted_to_trash plugin is just before antispam.

#2 Updated by Davide Principi over 6 years ago

  • Status changed from TRIAGED to ON_DEV
  • Assignee set to Davide Principi
  • % Done changed from 20 to 30

#3 Updated by Davide Principi over 6 years ago

  • Category set to nethserver-mail-server

#4 Updated by Davide Principi over 6 years ago

  • Status changed from ON_DEV to MODIFIED
  • % Done changed from 30 to 60

MODIFIED

#5 Updated by Davide Principi over 6 years ago

  • Status changed from MODIFIED to ON_QA
  • Assignee deleted (Davide Principi)
  • % Done changed from 60 to 70

In nethserver-testing 6.6:
dovecot-deleted-to-trash-0.6-2.ns6.x86_64.rpm

#6 Updated by Davide Principi over 6 years ago

  • Category changed from nethserver-mail-server to dovecot-deleted-to-trash

#7 Updated by Filippo Carletti over 6 years ago

  • Category changed from dovecot-deleted-to-trash to nethserver-mail-server
  • Status changed from ON_QA to VERIFIED
  • % Done changed from 70 to 90

Enable dovecot to trash, read email via imap, crash:

. OK [READ-WRITE] Select completed.
. fetch 1 all
[root@ns65 ~]# tail /var/log/imap
Mar 31 11:02:07 ns65 dovecot: imap(admin): Fatal: master: service(imap): child 32550 killed with signal 11 (core dumps disabled)

Update plugin:
[root@ns65 ~]# yum --enablerepo=nethserver-testing update dovecot-deleted-to-trash

Read mail again:
. OK [READ-WRITE] Select completed.
. fetch 1 all
* 1 FETCH (FLAGS (\Deleted \Seen) INTERNALDATE "26-Feb-2015 18:52:38 +0100" RFC822.SIZE 648 ENVELOPE ("Thu, 26 Feb 2015 18:52:38 +0100" "test" (("root" NIL "root" "ns65.neth.net")) (("root" NIL "root" "ns65.neth.net")) (("root" NIL "root" "ns65.neth.net")) ((NIL NIL "admin" "ns65.neth.net")) NIL NIL NIL "<20150226175238.D6D5F41C28@ns65.neth.net>"))
. OK Fetch completed.

#8 Updated by Davide Principi over 6 years ago

  • Status changed from VERIFIED to CLOSED
  • % Done changed from 90 to 100

Moved into nethserver-updates 6.6:
dovecot-deleted-to-trash-0.6-2.ns6.x86_64.rpm

Also available in: Atom PDF