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: 25-Mar-07 16:35 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 :)=) 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 ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://twister.fastxs.net/mailman/listinfo/dbmail-dev