[Dovecot] fts_squat hanging on some messages

Henning Rohlfs x+dovecot at xehonk.de
Fri Sep 17 12:31:06 EEST 2010


Hello,

I recently upgraded to dovecot 2.0.2 (on gentoo ~amd64) and now 
fts_squat's index building seems to hang for some of my mailboxes. The 
imap process gets stuck at 100% cpu usage and dovecot.index.search is 
never touched.

I traced the problem to a message (attached) for one of the 
problematic mailboxes. Also attached are a full backtrace and the 
output of dovecot -n.

The problem is reproducible:
 step 1) /usr/libexec/dovecot/imap
 step 2) . select Junk
 step 3) . search body sometext
-------------- next part --------------
An embedded message was scrubbed...
From: Windows Live-Team <communications_msn_cs_dede at microsoft.msn.com>
Subject: Sicher ist Sicher! Richten Sie jetzt Ihren Hotmail Junk-Mail Filter
	ein!
Date: Fri, 25 Apr 2008 05:26:50 -0700 (PDT)
Size: 11434
Url: http://dovecot.org/pipermail/dovecot/attachments/20100917/fd660314/attachment.mht 
-------------- next part --------------
(gdb) bt full
#0  0x00007ff667019002 in memchr () from /lib/libc.so.6
No symbol table info available.
#1  0x00007ff667332f48 in parse_next_body_to_boundary (ctx=0xcd0d70, block_r=0x7fff6dc020a0)
    at message-parser.c:350
        boundary = 0x0
        data = 0xcd64e0 "\n<html><head><title>Sicher ist Sicher! Richten Sie jetzt Ihren Hotmail Junk-Mail Filter ein!</title></head><body style=\"margin:0px;\"><table dir=\"ltr\" cellpadding=\"0\" cellspacing=\"0\" width=\"641\" border"...
        cur = 0xcd64e1 "<html><head><title>Sicher ist Sicher! Richten Sie jetzt Ihren Hotmail Junk-Mail Filter ein!</title></head><body style=\"margin:0px;\"><table dir=\"ltr\" cellpadding=\"0\" cellspacing=\"0\" width=\"641\" border="...
        next = 0xcd64e0 "\n<html><head><title>Sicher ist Sicher! Richten Sie jetzt Ihren Hotmail Junk-Mail Filter ein!</title></head><body style=\"margin:0px;\"><table dir=\"ltr\" cellpadding=\"0\" cellspacing=\"0\" width=\"641\" border"...
        end = 0xcd84e0 ""
        boundary_start = 0
        ret = -1
        full = false
        __FUNCTION__ = "parse_next_body_to_boundary"
#2  0x00007ff667333f55 in message_parser_parse_next_block (ctx=0xcd0d70, block_r=0x7fff6dc020a0)
    at message-parser.c:759
        ret = 1
        eof = false
        full = true
        __FUNCTION__ = "message_parser_parse_next_block"
#3  0x00007ff66676ae92 in fts_build_mail (ctx=0xcc7110, uid=6470) at fts-storage.c:170
        decoder_flags = MESSAGE_DECODER_FLAG_DTCASE
        input = 0xcd0ba0
---Type <return> to continue, or q <return> to quit---
        parser = 0xcd0d70
        decoder = 0xcd1140
        raw_block = {part = 0xc6e580, hdr = 0x0, 
          data = 0xcd64e0 "\n<html><head><title>Sicher ist Sicher! Richten Sie jetzt Ihren Hotmail Junk-Mail Filter ein!</title></head><body style=\"margin:0px;\"><table dir=\"ltr\" cellpadding=\"0\" cellspacing=\"0\" width=\"641\" border"..., size = 8192}
        block = {part = 0xc6e580, hdr = 0x0, data = 0xcd3250 "<?XML VERSION=\"1.0\" ENCODING=\"UTF-8\" ?>", 
          size = 39}
        prev_part = 0xc6e580
        parts = 0x0
        skip_body = false
        body_part = true
        ret = 1
        __FUNCTION__ = "fts_build_mail"
#4  0x00007ff66676c1ed in fts_build_more (ctx=0xcc7110) at fts-storage.c:625
        _data_stack_cur_id = 4
        count = 0
        ret = 0
#5  0x00007ff66676c5c2 in fts_mailbox_search_next_nonblock (ctx=0xcc4f60, mail=0xccbec0, 
    tryagain_r=0x7fff6dc0221b) at fts-storage.c:728
        fbox = 0xc9ebd0
        fctx = 0xcc5120
        ret = 0
#6  0x00007ff6675c465a in mailbox_search_next_nonblock (ctx=0xcc4f60, mail=0xccbec0, 
    tryagain_r=0x7fff6dc0221b) at mail-storage.c:1141
        box = 0xc9c150
#7  0x000000000041bf79 in cmd_search_more (cmd=0xc95110) at imap-search.c:346
        ctx = 0xc95210
---Type <return> to continue, or q <return> to quit---
        opts = SEARCH_RETURN_ALL
        sync_flags = 32767
        end_time = {tv_sec = 1024, tv_usec = 8}
        range = 0xcd06e0
        count = 0
        id = 128
        id_min = 0
        id_max = 0
        ok_reply = 0x7ff667595040 ""
        time_msecs = 13193816
        tryagain = 103
        minmax = false
        lost_data = false
        __FUNCTION__ = "cmd_search_more"
#8  0x000000000041c6e9 in imap_search_start (ctx=0xc95210, sargs=0xcc3950, sort_program=0x0)
    at imap-search.c:550
        cmd = 0xc95110
        wanted_fields = 0
        wanted_headers = 0x0
#9  0x000000000040f77c in cmd_search (cmd=0xc95110) at cmd-search.c:45
        ctx = 0xc95210
        sargs = 0xcc3950
        args = 0xc99978
        charset = 0x421004 "UTF-8"
        ret = 1
#10 0x0000000000413f9f in client_command_input (cmd=0xc95110) at imap-client.c:660
        client = 0xc8d090
        command = 0xc95110
---Type <return> to continue, or q <return> to quit---
        __FUNCTION__ = "client_command_input"
#11 0x00000000004141fe in client_command_input (cmd=0xc95110) at imap-client.c:710
        client = 0xc8d090
        command = 0xc77860
        __FUNCTION__ = "client_command_input"
#12 0x0000000000414329 in client_handle_next_command (client=0xc8d090, remove_io_r=0x7fff6dc0241d)
    at imap-client.c:751
        size = 21
#13 0x00000000004143a9 in client_handle_input (client=0xc8d090) at imap-client.c:763
        _data_stack_cur_id = 3
        ret = false
        remove_io = false
        handled_commands = false
        __FUNCTION__ = "client_handle_input"
#14 0x000000000041451f in client_input (client=0xc8d090) at imap-client.c:802
        cmd = 0x6dc0248c
        output = 0xc8d678
        bytes = 21
        __FUNCTION__ = "client_input"
#15 0x00007ff667358502 in io_loop_handler_run (ioloop=0xc768e0) at ioloop-epoll.c:212
        ctx = 0xc76af0
        events = 0xc76b60
        event = 0xc76b60
        list = 0xc8d750
        io = 0xc8d710
        tv = {tv_sec = 1786, tv_usec = 785121}
        events_count = 2
        t_id = 2
---Type <return> to continue, or q <return> to quit---
        msecs = 1786786
        ret = 1
        i = 0
        j = 0
        call = true
#16 0x00007ff6673570cd in io_loop_run (ioloop=0xc768e0) at ioloop.c:350
No locals.
#17 0x00007ff66733f826 in master_service_run (service=0xc767b0, callback=0x42004c <client_connected>)
    at master-service.c:496
No locals.
#18 0x00000000004202b6 in main (argc=1, argv=0xc76370) at main.c:358
        set_roots = {0x4239a0, 0x0}
        service_flags = 3
        storage_service_flags = 0
        postlogin_socket_path = 0x0
        username = 0x0
        c = -1
-------------- next part --------------
# 2.0.2: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.35.4 x86_64 Gentoo Base System release 2.0.1 
first_valid_gid = 100
first_valid_uid = 1000
hostname = xehonk.de
last_valid_gid = 100
last_valid_uid = 1100
mail_location = maildir:~/.maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = comparator-i;octet comparator-i;ascii-casemap fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date
passdb {
  args = *
  driver = pam
}
plugin {
  antispam_backend = mailtrain
  antispam_mail_notspam = --class=innocent
  antispam_mail_sendmail = /usr/bin/dspam
  antispam_mail_sendmail_args = --source=error
  antispam_mail_spam = --class=spam
  antispam_mail_tmpdir = /tmp
  antispam_signature = X-DSPAM-Signature
  antispam_signature_missing = move
  antispam_spam_pattern_ignorecase = Junk;Junk.*
  antispam_trash_pattern_ignorecase = Trash
  fts = squat
  fts_squat = partial=4 full=10
  sieve = ~/.maildir/sieve/main-filter
  sieve_dir = ~/.maildir/sieve/filters
}
postmaster_address = dovecot at xehonk.de
protocols = imap sieve
service imap-login {
  inet_listener imap {
    address = ::1
  }
  inet_listener imaps {
    address = [::], *
  }
}
service managesieve-login {
  inet_listener sieve {
    address = ::1, *
  }
}
ssl_cert = </etc/dovecot/honk.dyndns.info.crt
ssl_key = </etc/dovecot/honk.dyndns.info.key.insecure
userdb {
  driver = passwd
}
protocol lda {
  mail_plugins = sieve
}
protocol imap {
  mail_plugins = fts fts_squat antispam
}


More information about the dovecot mailing list