I guess it's just exponentially increasing the buffer size then until it reaches mail_process_size.
I recompile dovecot binaries with debug symbols, but seemed that gdb backtrace is broken.
Yeah, it is. Hmm. Since the core isn't working, can you attach gdb to imap process while it's still running? So something like:
- open the account so imap process starts
- gdb -p <imap process pid>
- gdb command: c
- cause imap to crash -> gdb should stop
- gdb command: bt full
Today, I have updated to version 1.2.7 and I was able to get gdb-backtrace with it. This is clean installation without any patches applied.
Error-log: Nov 18 09:55:37 IMAP(alice@domain.com): Panic: data stack: Out of memory when allocating 268435472 bytes Nov 18 09:55:37 IMAP(alice@domain.com): Error: Raw backtrace: imap [0x80d2381] -> imap [0x80d23f2] -> imap [0x80d1d59] -> imap [0x80d0b2d] -> imap [0x80d0fa7] -> imap [0x80db928] -> imap [0x80cfeda] -> imap(buffer_write+0xd2) [0x80d03d2] -> imap(buffer_append+0x26) [0x80d04f6] -> imap(mail_transaction_log_append+0x61c) [0x80b54cc] -> imap [0x80aa029] -> imap(mail_index_sync_commit+0xa5) [0x80ad525] -> /usr/lib/dovecot/imap/lib20_virtual_plugin.so [0xb7ea8bc6] -> /usr/lib/dovecot/imap/lib20_virtual_plugin.so(virtual_storage_sync_init+0x71c) [0xb7eab6ac] -> imap(mailbox_sync+0x35) [0x8097595] -> imap(cmd_select_full+0x3d8) [0x8062fb8] -> imap(cmd_select+0x19) [0x80636f9] -> imap [0x806597c] -> imap [0x8065a23] -> imap(client_handle_input+0x2d) [0x8065b7d] -> imap(client_input+0x5f) [0x80664bf] -> imap(io_loop_handler_run+0xe0) [0x80da4e0] -> imap(io_loop_run+0x20) [0x80d9980] -> imap(main+0x5dc) [0x806ee4c] -> /lib/libc.so.6(__libc_start_main+0xe5) [0xb7ef6725] -> imap [0x805e281] Nov 18 09:55:37 dovecot: Error: child 9173 (imap) killed with signal 6 (core dumped)
Gdb-backtrace is attached.