charset_to_utf8 assertion of remaining src_size

Xin Li delphij at delphij.net
Sat May 16 06:39:39 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

On 5/15/15 10:58, Xin Li wrote:
> Hi,
> 
> I have seen the following assertion fails on my own mail server 
> (indexer-worker):
> 
> Panic: file charset-iconv.c: line 132 (charset_to_utf8): assertion 
> failed: (*src_size - pos <= CHARSET_MAX_PENDING_BUF_SIZE)

I've managed to narrow down the issue to one mail, and can reliably
trigger the assertion with 'doveadm index -u user INBOX' with only that
email.

Maybe we should reset the iconv descriptor after each full conversion?
 i.e.:

diff -r 91bbd6753689 src/lib-mail/message-decoder.c
- --- a/src/lib-mail/message-decoder.c    Thu May 14 23:49:12 2015 +0300
+++ b/src/lib-mail/message-decoder.c    Fri May 15 22:52:41 2015 -0700
@@ -347,6 +347,8 @@
                                 sizeof(ctx->translation_buf));
                        memcpy(ctx->translation_buf, data + pos,
                               ctx->translation_size);
+               } else {
+                       charset_to_utf8_reset(ctx->charset_trans);
                }
                output->data = ctx->buf2->data;
                output->size = ctx->buf2->used;

Cheers,
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVVuYpAAoJEJW2GBstM+nsrr8P+wZRjznaTJuAE7eaKlmO5Zba
m9bUHsHh/rZdjfTCfUiwYwU66+EI8O2WEgr0sXynMrRhRWp5BVWMKGTl2loJ/oNL
O3qXrGoVmAJoWmnd+ZQ49s+zSJUgXk9rJneN1i4erId6vjN1pcWXfrLbmeKhreN8
EmOMDO8WtV/XBq20UerKu+kGnatC8tNzpTQ5PCTnMc9z1nvNytE/NxM3Gli3wTRG
8nhZY8fS+y6guJfi68RZK6Th1W6jKQQW8+sNPlNbCRPxDb5delXLGq58DnQVk4mM
Y6VxzQF4ItTU5h+ikNOaY7v4LoC3uydUdhPkMVVb5JVH+wx9en7PefhV4dH2MNjJ
a8dJ4gvsYNBLZ1r3QLFF0NqJMhPXtidKLy7iQkBW0Z1LqmQrEpwZpLVGrdDtWLpA
E4HkOmTMEyIbTuK5hG5zNyoF2+XLHSCAELZBHxJAxoHhwakm3n4MhJJao+aJho8+
DbgbGMFk4dDgvOAD0gqANSrIfpZkWGAzUiNiMP015Trg4bQm7CSztuvM6+xhr8EE
zzvYjbeCAl3A1+u2q2UFaw8Ze60kD345FyRmkkxLxgJY3r32fSaU+1VvazlbIFKa
zq4R2aospgIIxwVQOH3drqGgXpxEe54QG++3IQxmZyNCh3qocb+FnatVupHIJzX/
vvqgdswgAsXP04duqKKn
=QaAX
-----END PGP SIGNATURE-----


More information about the dovecot mailing list