Hi,
So it happens regularly? Can you reproduce it? I can't really see how it's crashing. Could you apply the attached patch, and also compile the lib/*.c and lib-mail/istream-header-filter.c without -O2 so the backtrace will be more usable? (I usually do it by removing -O2 from the subdirs' Makefile and then make clean + make in those subdirs.)
reproducing is not easy, it happens on more frequented customer-servers, on my testmachine is not enough traffic but i have a new core ;) same user was affected. i patched dovecot 1.1.4 like you told and compiled it without -O2
Thats what i got:
dovecot -n # 1.1.4: /etc/dovecot.conf protocols: imap imaps pop3 pop3s ssl_ca_file: /path/to/*.servername.com.bundle.crt ssl_cert_file: /path/to/*.servername.com.crt ssl_key_file: /path/to/*.servername.com.key disable_plaintext_auth: no login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login login_greeting: servername.com mailserver ready. login_process_per_connection: no login_processes_count: 1 max_mail_processes: 100 verbose_proctitle: yes mail_location: mbox:~/mail:INBOX=/var/spool/mail/%u mail_cache_min_mail_count: 30 mail_debug: yes lock_method: flock mbox_read_locks: dotlock mbox_very_dirty_syncs: yes mail_drop_priv_before_exec: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): mail_log mail_plugins(imap): mail_log mail_plugins(pop3): mail_plugin_dir(default): /usr/lib/dovecot/imap mail_plugin_dir(imap): /usr/lib/dovecot/imap mail_plugin_dir(pop3): /usr/lib/dovecot/pop3 imap_client_workarounds(default): outlook-idle netscape-eoh tb-extra-mailbox-sep delay-newmail imap_client_workarounds(imap): outlook-idle netscape-eoh tb-extra-mailbox-sep delay-newmail imap_client_workarounds(pop3): pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): oe-ns-eoh outlook-no-nuls auth default: verbose: yes passdb: driver: shadow userdb: driver: passwd
gdb /usr/libexec/dovecot/imap /home/popuser/username/core GNU gdb 6.4 Copyright 2005 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"...Using host libthread_db library "/lib/libthread_db.so.1".
Core was generated by `imap [username 78.69.54.113]'. Program terminated with signal 6, Aborted.
warning: Can't read pathname for load map: Eingabe-/Ausgabefehler. Reading symbols from /lib/libdl.so.2...done. Loaded symbols for /lib/libdl.so.2 Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Reading symbols from /usr/lib/dovecot/imap/lib20_mail_log_plugin.so...done. Loaded symbols for /usr/lib/dovecot/imap/lib20_mail_log_plugin.so Reading symbols from /lib/libnss_files.so.2...done. Loaded symbols for /lib/libnss_files.so.2 Reading symbols from /lib/libgcc_s.so.1...done. Loaded symbols for /lib/libgcc_s.so.1 #0 0xffffe410 in __kernel_vsyscall () (gdb) fr 6 #6 0x080eb86d in i_stream_read (stream=0x813eac0) at istream.c:82 82 istream.c: Datei oder Verzeichnis nicht gefunden. in istream.c (gdb) p *stream.parent There is no member named parent. (gdb) p *stream.parent.real_stream There is no member named parent. (gdb) bt full #0 0xffffe410 in __kernel_vsyscall () No symbol table info available. #1 0xb7ecd7d0 in raise () from /lib/libc.so.6 No symbol table info available. #2 0xb7eceea3 in abort () from /lib/libc.so.6 No symbol table info available. #3 0x080e608f in default_fatal_finish (type=LOG_TYPE_PANIC, status=0) at failures.c:150 backtrace = 0x811eb20 "imap [0x80e606d] -> imap [0x80e68d8] -> imap(i_fatal+0) [0x80e61e7] -> imap(i_stream_read+0xdc) [0x80eb86d] -> imap(i_stream_read_data+0x4b) [0x80ec07f] -> imap(message_parse_header_next+0xfd) [0x80dc"... #4 0x080e68d8 in i_internal_fatal_handler (type=LOG_TYPE_PANIC, status=0, fmt=0x8111c38 "file %s: line %d (%s): assertion failed: (%s)", args=0xbfb05e34 ".\034\021\bR") at failures.c:430 No locals. #5 0x080e61e7 in i_panic (format=0x8111c38 "file %s: line %d (%s): assertion failed: (%s)") at failures.c:197 args = 0xbfb05e34 ".\034\021\bR" #6 0x080eb86d in i_stream_read (stream=0x813eac0) at istream.c:82 _stream = (struct istream_private *) 0x813ea98 ret = -1 orig_count = 64 __PRETTY_FUNCTION__ = "i_stream_read" #7 0x080ec07f in i_stream_read_data (stream=0x813eac0, data_r=0xbfb05ee0, size_r=0xbfb05edc, threshold=64) at istream.c:303 ret = 0 read_more = false __PRETTY_FUNCTION__ = "i_stream_read_data" #8 0x080dc8fa in message_parse_header_next (ctx=0x8138cf0, hdr_r=0xbfb05f6c) at message-header-parser.c:89 line = (struct message_header_line *) 0x8138cf0 msg = ( const unsigned char *) 0x8136b35 "eQ4TJNHy2PNaxiJiub1zAQla5uSWXbFNL0EMJ+N9lJDzhnvdf301eNZ0TAR9E/u+Gf+Pe5//Eft7\n2Gy9Mj5////21n/978iM2Iy4j/s0Ne5d34/PTZraHIQYZj3EgiF6WAwuiAOAwGmfb9jyZPYe2jWj\nLswhKDsgDj8jBDBPW27lUMFXn6gNLuNBoKiHnGtw27kdxf"... i = 63 size = 64 startpos = 63 colon_pos = 4294967295 parse_size = 63 value_pos = 3216006936 ret = 1 continued = false continues = false last_no_newline = 56 last_crlf = 237 no_newline = false crlf_newline = false #9 0x080d8e2f in read_header (mstream=0x813eb78) at istream-header-filter.c:163 hdr = (struct message_header_line *) 0x0 highwater_offset = 452 pos = 77 ret = 77 matched = false hdr_ret = 1 __PRETTY_FUNCTION__ = "read_header" #10 0x080d91a4 in i_stream_header_filter_read (stream=0x813eb78) at istream-header-filter.c:293 mstream = (struct header_filter_istream *) 0x813eb78 ret = 135523672 pos = 0 #11 0x080d93c3 in parse_header (mstream=0x813eb78) at istream-header-filter.c:333 pos = 77 #12 0x080d943a in i_stream_header_filter_seek (stream=0x813eb78, v_offset=2396, mark=false) at istream-header-filter.c:347 mstream = (struct header_filter_istream *) 0x813eb78 #13 0x080ebbb9 in i_stream_seek (stream=0x813eba0, v_offset=2396) at istream.c:148 _stream = (struct istream_private *) 0x813eb78 ---Type <return> to continue, or q <return> to quit--- #14 0x0807a946 in mbox_mail_get_physical_size (_mail=0x813a0a0, size_r=0xbfb06178) at mbox-mail.c:255 mail = (struct index_mail *) 0x813a0a0 data = (struct index_mail_data *) 0x813a11c mbox = (struct mbox_mailbox *) 0x8130030 input = (struct istream *) 0x813eba0 hdr_size = {physical_size = 1944, virtual_size = 1986, lines = 42} old_offset = 2396 body_offset = 322633803 body_size = 452 next_offset = 289381720 #15 0x080a3d37 in mail_get_physical_size (mail=0x813a0a0, size_r=0xbfb06178) at mail.c:100 p = (struct mail_private *) 0x813a0a0 #16 0xb7fd0833 in mail_log_action (dest_trans=0x8139120, mail=0x813a0a0, event=MAIL_LOG_EVENT_COPY, data=0x81340d8 "Trash") at mail-log-plugin.c:305 lt = (struct mail_log_transaction_context *) 0x8142690 msgid = 0x813a99c "24697.ashish@abram " size = 2396 str = (string_t *) 0x811e898 pool = (pool_t) 0x8142678 #17 0xb7fd0c40 in mail_log_copy (t=0x8139120, mail=0x813a0a0, flags=MAIL_SEEN, keywords=0x813ea30, dest_mail=0x0) at mail-log-plugin.c:400 _data_stack_cur_id = 4 lbox = (union mailbox_module_context *) 0x8134118 name = 0x81340d8 "Trash" #18 0x080a6f9b in mailbox_copy (t=0x8139120, mail=0x813a0a0, flags=MAIL_SEEN, keywords=0x813ea30, dest_mail=0x0) at mail-storage.c:761 No locals. #19 0x0805a776 in fetch_and_copy (client=0x8127548, destbox=0x8133f40, t=0x8139120, search_args=0x8128a10, src_uidset_r=0xbfb06294, copy_count_r=0xbfb06290) at cmd-copy.c:66 search_ctx = (struct mail_search_context *) 0x8139fe8 src_trans = (struct mailbox_transaction_context *) 0x81399c8 keywords = (struct mail_keywords *) 0x813ea30 keywords_list = (const char * const *) 0x813a968 mail = (struct mail *) 0x813a0a0 copy_count = 1 srcset_ctx = {str = 0x811e320, first_uid = 0, last_uid = 4294967295} src_uidset = (string_t *) 0x811e320 ret = 1 #20 0x0805aa0e in cmd_copy (cmd=0x81289c8) at cmd-copy.c:136 client = (struct client *) 0x8127548 storage = (struct mail_storage *) 0x8128108 destbox = (struct mailbox *) 0x8133f40 t = (struct mailbox_transaction_context *) 0x8139120 search_arg = (struct mail_search_arg *) 0x8128a10 messageset = 0x812cac8 "6918" mailbox = 0x812cad0 "Trash" src_uidset = 0x0 msg = 0x0 sync_flags = 0 imap_flags = 0 copy_count = 3086937280 uid_validity = 135428860 uid1 = 25 uid2 = 135428860 ret = 35 __PRETTY_FUNCTION__ = "cmd_copy" #21 0x08060173 in cmd_uid (cmd=0x81289c8) at cmd-uid.c:26 command = (struct command *) 0x8127afc cmd_name = 0x812cac0 "copy" #22 0x08061534 in client_command_input (cmd=0x81289c8) at client.c:580 client = (struct client *) 0x8127548 command = (struct command *) 0x23 ---Type <return> to continue, or q <return> to quit--- __PRETTY_FUNCTION__ = "client_command_input" #23 0x08061769 in client_command_input (cmd=0x81289c8) at client.c:629 client = (struct client *) 0x8127548 command = (struct command *) 0x8127af0 __PRETTY_FUNCTION__ = "client_command_input" #24 0x08061867 in client_handle_next_command (client=0x8127548, remove_io_r=0xbfb063d5) at client.c:670 size = 25 #25 0x080618a3 in client_handle_input (client=0x8127548) at client.c:680 _data_stack_cur_id = 3 ret = 18 remove_io = false handled_commands = false #26 0x08061a31 in client_input (client=0x8127548) at client.c:725 cmd = (struct client_command_context *) 0xb7f62d98 output = (struct ostream *) 0x8128904 bytes = 25 __PRETTY_FUNCTION__ = "client_input" #27 0x080f0801 in io_loop_handler_run (ioloop=0x81269b0) at ioloop-epoll.c:203 ctx = (struct ioloop_handler_context *) 0x8126aa8 events = (struct epoll_event *) 0x8126ae8 event = (const struct epoll_event *) 0x8126ae8 list = (struct io_list *) 0x81275b8 io = (struct io_file *) 0x8128960 tv = {tv_sec = 1799, tv_usec = 999711} events_count = 4 t_id = 2 msecs = 1800000 ret = 1 i = 0 j = 0 call = true #28 0x080efb18 in io_loop_run (ioloop=0x81269b0) at ioloop.c:320 No locals. #29 0x0806ce89 in main (argc=3, argv=0xbfb06534, envp=0xbfb06544) at main.c:293 No locals. (gdb) p *stream $1 = {v_offset = 2421, stream_errno = 0, mmaped = 0, blocking = 1, closed = 0, seekable = 1, eof = 0, real_stream = 0x813ea98}
Hope this helps to find the bug. :) I will do some tests with 1.1.5
Thanks, Andre