Hello! I'm using maildir format with zlib_save=bz2. Here is the way how I generate empty mails and this leads to segfault: create empty message: # echo -n "" | /usr/libexec/dovecot/dovecot-lda -d marcin@mejor.pl
this creates empy email in maildir (size 14B): # ls -l 1518011524.M96165P15900.jowisz\,S\=0\,W\=0\:2\, -rwxrw----+ 1 mail mail 14 Feb 7 14:52 '1518011524.M96165P15900.jowisz,S=0,W=0:2,'
# file 1518011524.M96165P15900.jowisz\,S\=0\,W\=0\:2\, 1518011524.M96165P15900.jowisz,S=0,W=0:2,: bzip2 compressed data, block size = 200k
next I'm accesing to Inbox, deleting mail using Thunderbird. Since message is moved to Trash I'm getting segfaults, backtrace:
Reading symbols from /usr/libexec/dovecot/imap...Reading symbols from /usr/lib64/debug//usr/libexec/dovecot/imap.debug...done.
done.
[New LWP 16520]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `dovecot/imap'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 }
(gdb) #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007f744769e12a in __GI_abort () at abort.c:89
#2 0x00007f7447adab79 in default_fatal_finish (type=LOG_TYPE_PANIC, status=status@entry=0) at failures.c:201
#3 0x00007f7447adacd3 in i_internal_fatal_handler (ctx=0x7ffc16d911e0, format=<optimized out>, args=<optimized out>) at failures.c:670
#4 0x00007f7447a5108c in i_panic (format=format@entry=0x7f7447e9ed40 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:275
#5 0x00007f7447e85108 in mail_index_transaction_get_uid (t=t@entry=0x55a2a17c3c30, seq=<optimized out>) at mail-index-transaction-finish.c:185
#6 0x00007f7447e8517a in mail_index_convert_to_uids (t=t@entry=0x55a2a17c3c30, array=array@entry=0x55a2a17e2c90) at mail-index-transaction-finish.c:205
#7 0x00007f7447e858df in mail_index_transaction_convert_to_uids (t=0x55a2a17c3c30) at mail-index-transaction-finish.c:313
#8 mail_index_transaction_finish (t=t@entry=0x55a2a17c3c30) at mail-index-transaction-finish.c:345
#9 0x00007f7447e8b783 in mail_index_transaction_commit_real (commit_size_r=0x7ffc16d91490, t=0x55a2a17c3c30) at mail-index-transaction.c:197
#10 mail_index_transaction_commit_v (t=<optimized out>, result_r=0x7ffc16d91480) at mail-index-transaction.c:239
#11 0x00007f7447e8be4e in mail_index_transaction_commit_full (_t=_t@entry=0x7ffc16d914d0, result_r=result_r@entry=0x7ffc16d91480) at mail-index-transaction.c:298
#12 0x00007f7447e8bf0b in mail_index_transaction_commit (t=t@entry=0x7ffc16d914d0) at mail-index-transaction.c:272
#13 0x00007f7447e71bef in mail_cache_set_seq_corrupted_reason (cache_view=cache_view@entry=0x55a2a17cf140, seq=362, reason=<optimized out>) at mail-cache.c:71
#14 0x00007f7447dd0d34 in mail_set_mail_cache_corrupted (mail=0x55a2a17d7118, fmt=0x7f7447eb1bab "Broken %s in mailbox %s: %s") at mail-storage.c:2828
#15 0x00007f7447dfb88a in maildir_mail_set_cache_corrupted_reason (_mail=0x55a2a17d7118, field=MAIL_FETCH_PHYSICAL_SIZE,
reason=0x55a2a1706678 "read(/dane/domeny/mejor.pl/mail/marcin/.maildir/.Trash/tmp/1518011650.M572516P16520.jowisz) failed: Cached message size smaller than expected (0 < 14, box=Trash, UID=0)") at maildir-mail.c:770
#16 0x00007f7447e6ac52 in i_stream_mail_set_size_corrupted (mstream=mstream@entry=0x55a2a18014f0, size=size@entry=14) at istream-mail.c:95
#17 0x00007f7447e6ae5b in i_stream_mail_read (stream=0x55a2a18014f0) at istream-mail.c:121
#18 0x00007f7447ae9c84 in i_stream_read (stream=stream@entry=0x55a2a1801560) at istream.c:174
#19 0x00007f7447aeaa3d in i_stream_read_data (stream=0x55a2a1801560, data_r=data_r@entry=0x7ffc16d917a8, size_r=size_r@entry=0x7ffc16d917b0, threshold=threshold@entry=1) at istream.c:569
#20 0x00007f7447abc27f in message_parse_header_next (ctx=0x55a2a17c04c0, hdr_r=hdr_r@entry=0x7ffc16d91810) at message-header-parser.c:84
#21 0x00007f7447abcc9f in message_parse_header (input=<optimized out>, hdr_size=hdr_size@entry=0x55a2a17d7398,
flags=flags@entry=(MESSAGE_HEADER_PARSER_FLAG_SKIP_INITIAL_LWSP | MESSAGE_HEADER_PARSER_FLAG_DROP_CR), callback=callback@entry=0x7f7447e50210
Marcin