A NOTE has been added to this issue. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=546 
====================================================================== 
Reported By:                idk
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   546
Category:                   IMAP daemon
Reproducibility:            unable to reproduce
Severity:                   minor
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             20-Mar-07 15:07 CET
Last Modified:              14-May-07 06:46 CEST
====================================================================== 
Summary:                    Memory corrupted in IMAP daemon
Description: 
I don't know what action causes this problem, but I seldom read the
dbmail.err file and I found some errors (see Additional Information). Due
a nonexistency of timestamp in logfile I don't know if this three issues
are relatives.
====================================================================== 

---------------------------------------------------------------------- 
 aaron - 23-Mar-07 02:18  
---------------------------------------------------------------------- 
Does this possibly happen right after a SIGHUP? I cleaned up some code in
that area, but I might have missed something. 

---------------------------------------------------------------------- 
 idk - 23-Mar-07 11:18  
---------------------------------------------------------------------- 
>From upgrading to rev. 2471 it didn't occurred. I restared by init script
(service dbmail-imapd restart) many times (but this is not a SIGHUP, but
stop/start, so killproc and new start).

BTW often during restarting of a daemon occurrs this issue: Stopping say
OK, but startning say already running with list of pids. After a while
next restart: stopping say FAILED and starting say OK. No errors are
logged.

I have tried service dbmail-imapd reload (so SIGHUP, killproc $dbmail
-HUP), process is ok and no error message was reported. 

---------------------------------------------------------------------- 
 idk - 23-Mar-07 11:24  
---------------------------------------------------------------------- 
After SIGHUP daemon stop to listen :( Telnet to lmtp connects to a port and
say

# telnet localhost lmtp
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
Connection closed by foreign host.

A had to restart them (imapd too). 

---------------------------------------------------------------------- 
 aaron - 24-Mar-07 22:19  
---------------------------------------------------------------------- 
Oh crap, I've confirmed that I SIGHUP handling very badly.

Probably will rearrange the code more significantly to make it very
obvious what is happening. Too many functions have side-effects on the
config struct. 

---------------------------------------------------------------------- 
 aaron - 24-Mar-07 23:32  
---------------------------------------------------------------------- 
Ok, I see what this bug might actually be about, and SIGHUP was me being
stupid and has nothing to do with the issue here.

In dbmail-imapsession.c, 'the_args' is an array of parsed out imap command
arguments. It is static memory that is passed around a lot. Someplace this
must not be going according to plan.

Would it be possible to trace the imap commands leading up to this error? 

---------------------------------------------------------------------- 
 ljackson - 25-Mar-07 05:14  
---------------------------------------------------------------------- 
I belive I have found the cause of this issue, in the way ic_uid was doing
pointer math on the args array. in the patch I have attached
dbmail-svn-2.2.4-2480.bug546.imap_args.diff it moves the imap args to only
the session and removes the global variable, it also moves all indexing of
the imap args to a session variable as well. This allows ic_uid to
increment the place in the args without killing the pointer. the new args
array is allocated on session creation with g_new0 and g_free'ed at the
end of a session it passes with all function from testimap.py and
valgrind. But please test.

-leif 

---------------------------------------------------------------------- 
 paul - 25-Mar-07 16:35  
---------------------------------------------------------------------- 
I've applied Leifs patch. (with some additional fixes cause the unit tests
where broken :)=) 

---------------------------------------------------------------------- 
 idk - 12-Apr-07 15:32  
---------------------------------------------------------------------- 
*** glibc detected *** /usr/sbin/dbmail-imapd: corrupted double-linked
list: 0x09c5db60 ***
======= Backtrace: =========
/lib/libc.so.6[0x80d33f]
/lib/libc.so.6[0x80f35a]
/lib/libc.so.6(malloc+0x74)[0x810c7c]
/usr/lib/libglib-2.0.so.0(g_malloc+0x36)[0xc6c666]
/usr/sbin/dbmail-imapd(mopen+0x4e)[0x805210e]
/usr/sbin/dbmail-imapd(init_cache+0x39)[0x804d139]
/usr/sbin/dbmail-imapd(dbmail_imap_session_new+0xe)[0x8056ebe]
/usr/sbin/dbmail-imapd(IMAPClientHandler+0x11)[0x804c6e1]
/usr/lib/dbmail/libdbmail.so.0(PerformChildTask+0x385)[0x570395]
/usr/lib/dbmail/libdbmail.so.0(CreateChild+0xf7)[0x570737]
/usr/lib/dbmail/libdbmail.so.0(manage_start_children+0x38)[0x5734f8]
/usr/lib/dbmail/libdbmail.so.0(StartServer+0x78)[0x56edc8]
/usr/lib/dbmail/libdbmail.so.0(server_run+0x3da)[0x56f3aa]
/usr/lib/dbmail/libdbmail.so.0(serverparent_mainloop+0x1b7)[0x571b97]
/usr/sbin/dbmail-imapd(main+0xc6)[0x8052236]
/lib/libc.so.6(__libc_start_main+0xdc)[0x7c07e4]
/usr/sbin/dbmail-imapd[0x804c2c1]
======= Memory map: ========

Because of http://www.dbmail.org/mantis/view.php?id=532 I havn't a timestamp, I
don't know if this is what my
users reported me: "IMAP closed connection unexpectedly" and "IMAP
connection timeout". Problem solved self, without my help.

All the time is logging messages into maillog/syslogd (statistic for last
4 days):

"Error write to client socket failed" 892 times
"Error Error setting lock. Trying again." 178 times
"Error [Success] on write-stream" 60 times
"Error client socket has set error indicator in fgetc" once
"Error error reading extra command info" once

At reporting time (about 30 minutes long) there is no more messages (so
only this described above, the same frequency).

 

---------------------------------------------------------------------- 
 aaron - 14-May-07 06:46  
---------------------------------------------------------------------- 
Is this error still happening to anybody? 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
20-Mar-07 15:07 idk            New Issue                                    
23-Mar-07 02:18 aaron          Note Added: 0001944                          
23-Mar-07 11:18 idk            Note Added: 0001948                          
23-Mar-07 11:24 idk            Note Added: 0001949                          
23-Mar-07 11:55 idk            Note Added: 0001950                          
23-Mar-07 11:55 idk            Note Deleted: 0001950                        
24-Mar-07 22:19 aaron          Note Added: 0001961                          
24-Mar-07 23:32 aaron          Note Added: 0001963                          
25-Mar-07 05:12 ljackson       File Added:
dbmail-svn-2.2.4-2480.bug546.imap_args.diff                    
25-Mar-07 05:14 ljackson       Note Added: 0001964                          
25-Mar-07 16:35 paul           Note Added: 0001966                          
12-Apr-07 15:23 idk            Note Added: 0002029                          
12-Apr-07 15:32 idk            Note Edited: 0002029                         
12-Apr-07 16:36 nethzt         Issue Monitored: nethzt                      
14-May-07 06:46 aaron          Note Added: 0002172                          
======================================================================

_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to