Today I was looking for some spam and issued this command:
doveadm import -u restore@backup.invalid mdbox:/home/copymail2/mdbox INBOX header Reply-To bixrs.com
Then I immediately got a crash:
doveadm(restore@backup.invalid): Panic: file mail-index-util.c: line 10 (mail_index_uint32_to_offset): assertion failed: (offset < 0x40000000) doveadm(restore@backup.invalid): Error: Raw backtrace: /usr/lib/dovecot/libdovecot.so.0(backtrace_append+0x42) [0x7f757c0edf32] -> /usr/lib/dovecot/libdovecot.so.0(backtrace_get+0x1e) [0x7f757c0ee04e] -> /usr/lib/dovecot/libdovecot.so.0(+0xe692e) [0x7f757c0f892e] -> /usr/lib/dovecot/libdovecot.so.0(+0xe6971) [0x7f757c0f8971] -> /usr/lib/dovecot/libdovecot.so.0(i_fatal+0) [0x7f757c05321b] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_index_uint32_to_offset+0x70)[0x7f757c4a43c0] -> /usr/lib/dovecot/libdovecot-storage.so.0(mail_cache_add+0x83b)[0x7f757c48cf4b] -> /usr/lib/dovecot/libdovecot-storage.so.0(index_mail_parse_header+0x449)[0x7f757c46f5f9] -> /usr/lib/dovecot/libdovecot.so.0(+0xbf2c3) [0x7f757c0d12c3] -> /usr/lib/dovecot/libdovecot.so.0(i_stream_read_memarea+0x74)[0x7f757c105c94] -> /usr/lib/dovecot/libdovecot.so.0(i_stream_read+0x29) [0x7f757c105fc9]-> /usr/lib/dovecot/libdovecot.so.0(i_stream_read_data+0x3d) [0x7f757c10693d] -> /usr/lib/dovecot/libdovecot.so.0(message_parse_header_next+0x68) [0x7f757c0d79c8] -> /usr/lib/dovecot/libdovecot.so.0(message_parse_header+0x4f) [0x7f757c0d839f] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0xc9741) [0x7f757c479741] -> /usr/lib/dovecot/libdovecot-storage.so.0(+0xca9f4) [0x7f757c47a9f4] -> /usr/lib/dovecot/libdovecot-storage.so.0(index_storage_search_next_nonblock+0x10d)[0x7f757c47b1cd] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_search_next_nonblock+0x22)[0x7f757c3fd6e2] -> /usr/lib/dovecot/libdovecot-storage.so.0(mailbox_search_next+0x3d)[0x7f757c3fd74d] -> doveadm(+0x31a33) [0x559bc9c63a33] -> doveadm(+0x2c518) [0x559bc9c5e518] -> doveadm(+0x2d256) [0x559bc9c5f256] -> doveadm(doveadm_cmd_ver2_to_mail_cmd_wrapper+0x20e) [0x559bc9c600ce]-> doveadm(doveadm_cmd_run_ver2+0x548) [0x559bc9c70fa8] -> doveadm(doveadm_cmd_try_run_ver2+0x37) [0x559bc9c70ff7] -> doveadm(main+0x1d1) [0x559bc9c4e641] -> /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f757b653b97] -> doveadm(_start+0x2a) [0x559bc9c4eb3a] Command terminated by signal 6
Running it in gdb gives me:
# gdb doveadm
(gdb) set args import -u restore@backup.invalid
mdbox:/home/copymail2/mdbox mailbox INBOX header Reply-To bixrs.com
(gdb) run
Starting program: /usr/bin/doveadm import -u restore@backup.invalid mdbox:/home/copymail2/mdbox INBOX header Reply-To bixrs.com
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff68ec8b1 in __GI_abort () at abort.c:79
#2 0x00007ffff73728e1 in default_fatal_finish (status=0, type=LOG_TYPE_PANIC) at failures.c:459
#3 fatal_handler_real (ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at failures.c:471
#4 0x00007ffff7372971 in default_fatal_handler (ctx=<optimized out>, format=<optimized out>, args=<optimized out>) at failures.c:479
#5 0x00007ffff72cd21b in i_panic (format=format@entry=0x7ffff772dd60 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:523
#6 0x00007ffff771e3c0 in mail_index_uint32_to_offset (offset=<optimized out>) at mail-index-util.c:10
#7 0x00007ffff7706f4b in mail_cache_header_fields_write (ctx=0x55555585b690, buffer=<optimized out>, buffer=<optimized out>) at mail-cache-transaction.c:609
#8 mail_cache_header_add_field (field_idx=15, ctx=0x55555585b690) at mail-cache-transaction.c:690
#9 mail_cache_add (ctx=0x55555585b690, seq=1, field_idx=field_idx@entry=15, data=0x7ffff773b736, data_size=0) at mail-cache-transaction.c:739
#10 0x00007ffff76ebc34 in index_mail_cache_add_idx (mail=mail@entry=0x55555586e8d8, field_idx=field_idx@entry=15, data=data@entry=0x7ffff773b736, data_size=data_size@entry=0) at index-mail.c:631
#11 0x00007ffff76e95f9 in index_mail_parse_header_finish (mail=<optimized out>) at index-mail-headers.c:132
#12 index_mail_parse_header (part=<optimized out>, hdr=<optimized out>, mail=<optimized out>) at index-mail-headers.c:313
#13 0x00007ffff734b2c3 in read_header (mstream=0x555555879530) at istream-header-filter.c:356
#14 i_stream_header_filter_read (stream=0x555555879530) at istream-header-filter.c:446
#15 0x00007ffff737fc94 in i_stream_read_memarea (stream=stream@entry=0x5555558795b0) at istream.c:313
#16 0x00007ffff737ffc9 in i_stream_read (stream=stream@entry=0x5555558795b0) at istream.c:271
#17 0x00007ffff738093d in i_stream_read_data (stream=0x5555558795b0, data_r=data_r@entry=0x7fffffffdc18, size_r=size_r@entry=0x7fffffffdc20, threshold=threshold@entry=1) at istream.c:745
#18 0x00007ffff73519c8 in i_stream_read_bytes (wanted=2, size_r=0x7fffffffdc20, data_r=0x7fffffffdc18, stream=<optimized out>) at ../../src/lib/istream.h:217
#19 message_parse_header_next (ctx=0x55555582e580, hdr_r=hdr_r@entry=0x7fffffffdc80) at message-header-parser.c:85
#20 0x00007ffff735239f in message_parse_header (input=<optimized out>, hdr_size=hdr_size@entry=0x0, flags=flags@entry=MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE,
callback=callback@entry=0x7ffff76f2cb0
-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt@charite.de | https://www.charite.de