A NOTE has been added to this issue. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=940 
====================================================================== 
Reported By:                john
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   940
Category:                   IMAP daemon
Reproducibility:            sometimes
Severity:                   crash
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             11-Nov-11 16:01 CET
Last Modified:              12-Nov-11 21:07 CET
====================================================================== 
Summary:                    SIGSEGV (segmentation fault) while running imapsync
Description: 
dbmail-imapd crashed after about 16 hours of running against multiple
imapsyncs.

No errors in the logs, no core dump (and no symbols anyways) available.

I've now compiled a debug build of dbmail and libgmime (-O0 -g, no
stripping) and bumped the log level to debug (256). I've resumed the
imapsyncs while running "dbmail-imapd -D" from gdb. This way, I hope I can
provide more details the next time it crashes (fear the heisenbug). As
noted, this might take a while...

dbmail-imapd[18072]: segfault at 0 ip 00007f2de99b70f5 sp 00007f2ddf355ab0
error 6 in libgmime-2.4.so.2.4.14[7f2de9995000+4f000]
====================================================================== 

---------------------------------------------------------------------- 
 (0003328) john (reporter) - 11-Nov-11 16:20
 http://www.dbmail.org/mantis/view.php?id=940#c3328 
---------------------------------------------------------------------- 
Just a quick note:
The crash occured with 288b73a79fe20bae7737fb622aefff761bb34c3f 

---------------------------------------------------------------------- 
 (0003329) john (reporter) - 12-Nov-11 01:54
 http://www.dbmail.org/mantis/view.php?id=940#c3329 
---------------------------------------------------------------------- 
Crashed again, nothing interesting in the debug log, but this looks
promising:


Starting program: /usr/sbin/dbmail-imapd -D
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffff24e1700 (LWP 27355)]
[New Thread 0x7ffff1ad7700 (LWP 27356)]
[New Thread 0x7ffff12d6700 (LWP 27357)]
[New Thread 0x7ffff0ad5700 (LWP 27359)]
[New Thread 0x7ffff02d4700 (LWP 27360)]
[New Thread 0x7fffefad3700 (LWP 27361)]
[New Thread 0x7fffef2d2700 (LWP 27362)]
[New Thread 0x7fffeead1700 (LWP 27363)]
[New Thread 0x7fffee2d0700 (LWP 27364)]
[New Thread 0x7fffedacf700 (LWP 27365)]
[New Thread 0x7fffed2ce700 (LWP 27366)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffeead1700 (LWP 27363)]
0x00007ffff5aee52a in memset () from /lib/libc.so.6

(gdb) info threads
  12 Thread 0x7fffed2ce700 (LWP 27366)  0x00007ffff5ddf0bd in read () from
/lib/libpthread.so.0
  11 Thread 0x7fffedacf700 (LWP 27365)  0x00007ffff5ddf0bd in read () from
/lib/libpthread.so.0
  10 Thread 0x7fffee2d0700 (LWP 27364)  0x00007ffff5ddf0bd in read () from
/lib/libpthread.so.0
* 9 Thread 0x7fffeead1700 (LWP 27363)  0x00007ffff5aee52a in memset ()
from /lib/libc.so.6
  8 Thread 0x7fffef2d2700 (LWP 27362)  0x00007ffff5ddc16c in
pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
  7 Thread 0x7fffefad3700 (LWP 27361)  0x00007ffff5ddf0bd in read () from
/lib/libpthread.so.0
  6 Thread 0x7ffff02d4700 (LWP 27360)  0x00007ffff5ddf0bd in read () from
/lib/libpthread.so.0
  5 Thread 0x7ffff0ad5700 (LWP 27359)  0x00007ffff5ddebe4 in
__lll_lock_wait () from /lib/libpthread.so.0
  4 Thread 0x7ffff12d6700 (LWP 27357)  0x00007ffff5ddc16c in
pthread_cond_wait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
  3 Thread 0x7ffff1ad7700 (LWP 27356)  0x00007ffff5b32f1d in write () from
/lib/libc.so.6
  2 Thread 0x7ffff24e1700 (LWP 27355)  0x00007ffff5ddc4d9 in
pthread_cond_timedwait@@GLIBC_2.3.2 ()
   from /lib/libpthread.so.0
  1 Thread 0x7ffff7fe5720 (LWP 27344)  0x00007ffff5b3f623 in epoll_wait ()
from /lib/libc.so.6

(gdb) bt
http://www.dbmail.org/mantis/view.php?id=0  0x00007ffff5aee52a in memset () from
/lib/libc.so.6
http://www.dbmail.org/mantis/view.php?id=1  0x00007ffff7957e89 in
g_mime_iconv_strndup (cd=0x798730, 
    str=0x7fffd81e8b10 "Änderungen an der Artikel-Detailseite", n=38) at
gmime-iconv-utils.c:161
http://www.dbmail.org/mantis/view.php?id=2  0x00007ffff7957f30 in
g_mime_iconv_strdup (cd=0x798730, 
    str=0x7fffd81e8b10 "Änderungen an der Artikel-Detailseite") at
gmime-iconv-utils.c:199
http://www.dbmail.org/mantis/view.php?id=3  0x00007ffff6281a79 in
dbmail_iconv_str_to_db (str_in=0x7fffd81e8b10
"Änderungen an der Artikel-Detailseite", 
    charset=0x7fffd80cc9c0 "utf-8") at dm_iconv.c:134
http://www.dbmail.org/mantis/view.php?id=4  0x00007ffff6257384 in _header_cache
(key=0x7fffd804ede0 "Subject",
header=0x7fffd804ede0 "Subject", 
    user_data=0x7fffd831ad50) at dbmail-message.c:1572
http://www.dbmail.org/mantis/view.php?id=5  0x00007ffff706c8a6 in g_tree_foreach
() from /lib/libglib-2.0.so.0
http://www.dbmail.org/mantis/view.php?id=6  0x00007ffff6256140 in
dbmail_message_cache_headers
(self=0x7fffd831ad50) at dbmail-message.c:1298
http://www.dbmail.org/mantis/view.php?id=7  0x00007ffff6255865 in
dbmail_message_store (self=0x7fffd831ad50) at
dbmail-message.c:1165
http://www.dbmail.org/mantis/view.php?id=8  0x00007ffff6277acf in db_append_msg
(
    msgdata=0x7fffd81e4060 "Received: from xxx.xxxxx.xx (xxx.xxx.xxxxx.xx
[10.10.1.5])\r\n\tby xxx.xxxxx.xx (xxxxxx) with ESMTP id
AEF7940914\r\n\tfor <xxxxxxxxxxxxx@xxxxxxxxxx>; Mon, 31 Oct 2011 17:44:28
+0100 (CET)\r\nReceived: from b"..., mailbox_idnr=569, user_idnr=1639,
internal_date=0x7fffeead0d70 "2011-10-31 16:44:28", 
    msg_idnr=0x7fffeead0d98) at dm_db.c:3627
http://www.dbmail.org/mantis/view.php?id=9  0x000000000040e614 in
_ic_append_enter (D=0x7fffd81f67f0) at
imapcommands.c:1254
http://www.dbmail.org/mantis/view.php?id=10 0x00007ffff6283929 in
dm_thread_dispatch (data=0x7fffd81f67f0,
user_data=0x0) at server.c:162
http://www.dbmail.org/mantis/view.php?id=11 0x00007ffff706b5cf in ?? () from
/lib/libglib-2.0.so.0
http://www.dbmail.org/mantis/view.php?id=12 0x00007ffff7069784 in ?? () from
/lib/libglib-2.0.so.0
http://www.dbmail.org/mantis/view.php?id=13 0x00007ffff5dd78ba in start_thread
() from /lib/libpthread.so.0
http://www.dbmail.org/mantis/view.php?id=14 0x00007ffff5b3f02d in clone () from
/lib/libc.so.6
http://www.dbmail.org/mantis/view.php?id=15 0x0000000000000000 in ?? ()

(gdb) bt full 5
http://www.dbmail.org/mantis/view.php?id=0  0x00007ffff5aee52a in memset () from
/lib/libc.so.6
No symbol table info available.
http://www.dbmail.org/mantis/view.php?id=1  0x00007ffff7957e89 in
g_mime_iconv_strndup (cd=0x798730, 
    str=0x7fffd81e8b10 "Änderungen an der Artikel-Detailseite", n=38) at
gmime-iconv-utils.c:161
        inleft = 0
        outleft = 140736817703276
        converted = 134665270
        out = 0x7fffd806a910 ""
        outbuf = 0x0
        inbuf = 0x7fffd81e8b36 ""
        outlen = 92
        errnosav = 32767
http://www.dbmail.org/mantis/view.php?id=2  0x00007ffff7957f30 in
g_mime_iconv_strdup (cd=0x798730, 
    str=0x7fffd81e8b10 "Änderungen an der Artikel-Detailseite") at
gmime-iconv-utils.c:199
No locals.
http://www.dbmail.org/mantis/view.php?id=3  0x00007ffff6281a79 in
dbmail_iconv_str_to_db (str_in=0x7fffd81e8b10
"Änderungen an der Artikel-Detailseite", 
    charset=0x7fffd80cc9c0 "utf-8") at dm_iconv.c:134
        subj = 0x0
        conv_iconv = 0x2600000026
http://www.dbmail.org/mantis/view.php?id=4  0x00007ffff6257384 in _header_cache
(key=0x7fffd804ede0 "Subject",
header=0x7fffd804ede0 "Subject", 
    user_data=0x7fffd831ad50) at dbmail-message.c:1572
        t = 0x7fffd81e8b10 "Änderungen an der Artikel-Detailseite"
        value = 0x7fffd81d1310 "[xxxxxxxxxxxxxxxxxx.xx 0000747]:
Änderungen an der Artikel-Detailseite"
        headername_id = 7
        headervalue_id = 0
        self = 0x7fffd831ad50
        values = 0x7fffd82e0530
        raw = 0x7fffd819cff0
"=?utf-8?Q?[xxxxxxxxxxxxxxxxxx.xx_0000747]:_=C3=84nderungen_an_der_Artikel?=
=?utf-8?Q?-Detailseite?="
        i = 0
        date = 0
        isaddr = 0
        isdate = 0
        issubject = 1
        charset = 0x7fffd80cc9c0 "utf-8"
        sortfield = 0x0
        datefield = 0x0
        emaillist = 0x0
        ia = 0x7fffe01b0300
        __func__ = "_header_cache"
(More stack frames follow...)


On first sight, it looks like gmime's frame 1 g_mime_iconv_strndup() went
nuts, notice the locals "outleft" and "converted", they seem way off. I've
not yet looked into dbmail's frame 4, i.e. why "t" is only part of "value"
(perhaps this is expected).

I've dumped core to inspect this later on. Perhaps you see something
obvious.

Here is the exact version of gmime-iconv-utils.c used to compile libgmime
on the system. Notice the line number 161 (memset) as reported above:
http://git.gnome.org/browse/gmime/tree/gmime/gmime-iconv-utils.c?h=gmime-2-4&id=GMIME_2_4_14#n102

I've looked up their history, there were *no* code changes to
gmime-iconv-utils.c after that on the whole 2.4 branch. (on 2.6 they
refactored g_mime_iconv_strndup():
http://git.gnome.org/browse/gmime/commit/?id=9ab4d7fc16fe0df5d0da55dbe2f8422c66ee21b6
)

So in the end, on first sight (it's 2 a.m. here...), it looks like a gmime
bug :-) 

---------------------------------------------------------------------- 
 (0003330) john (reporter) - 12-Nov-11 01:59
 http://www.dbmail.org/mantis/view.php?id=940#c3330 
---------------------------------------------------------------------- 
(... the bug tracker replaced gdb's frame identifiers with links to issues
....) 

---------------------------------------------------------------------- 
 (0003333) paul (administrator) - 12-Nov-11 21:06
 http://www.dbmail.org/mantis/view.php?id=940#c3333 
---------------------------------------------------------------------- 
I'm assuming this is a gmime bug. Squeeze's version is quite old (januari
2010), and ubuntu's (2.4.24) at least doesn't crash on this Subject. 

---------------------------------------------------------------------- 
 (0003334) paul (administrator) - 12-Nov-11 21:07
 http://www.dbmail.org/mantis/view.php?id=940#c3334 
---------------------------------------------------------------------- 
fyi, the modified Subject value in dbmail's frame is due to base-subject
reduction which is needed for THREAD=ORDEREDSUBJECT 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
11-Nov-11 16:01  john           New Issue                                    
11-Nov-11 16:20  john           Note Added: 0003328                          
12-Nov-11 01:54  john           Note Added: 0003329                          
12-Nov-11 01:59  john           Note Added: 0003330                          
12-Nov-11 21:06  paul           Note Added: 0003333                          
12-Nov-11 21:07  paul           Note Added: 0003334                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev

Reply via email to