Subject: imap2002a STATUS bug

From: 최성훈 <[email-masked]>
Date: Wed, 8 Jan 2003 13:46:10 +0900 (KST)

Hello

For web-mail service( about 9,000,000 users && 50 imap servers ), we use UW-IMAP packages.

I upgraded UW-IMAP from 2000c to 2002a yesterday and got many syslog error messages.

[syslog messages]

   Jan  7 15:15:42 host0 /kernel: pid 45690 (imapd), uid 2002: exited on signal 11
   Jan  7 15:15:42 host0 /kernel: pid 45701 (imapd), uid 2002: exited on signal 11
   Jan  7 15:16:02 host0 /kernel: pid 45790 (imapd), uid 2002: exited on signal 11
   Jan  7 15:16:09 host0 /kernel: pid 45817 (imapd), uid 2002: exited on signal 11

By gdb, I found the position of SEGV and made a patch for imap-2002a.

Please, check the following patch and examine the possiblity of stream == NIL.

*** imap-2002a/src/imapd/imapd.c.orig   Wed Jan  8 12:18:27 2003
--- imap-2002a/src/imapd/imapd.c        Wed Jan  8 12:18:52 2003
***************
*** 896,902 ****
            if (state == LOGOUT) response = lose;
                                /* get mailbox status */
            else if (lastsel && (!strcmp (s,lastsel) ||
!                                !strcmp (s,stream->mailbox))) {
              unsigned long unseen;
  #ifndef ENTOURAGE_BRAIN_DAMAGE
                                /* snarl at cretins which do this */
--- 896,902 ----
            if (state == LOGOUT) response = lose;
                                /* get mailbox status */
            else if (lastsel && (!strcmp (s,lastsel) ||
!                                (stream&&!strcmp (s,stream->mailbox)))) {
              unsigned long unseen;
  #ifndef ENTOURAGE_BRAIN_DAMAGE
                                /* snarl at cretins which do this */

Thanks.

 Choi, Sung-hoon

 DreamWiz Inc. Development Team ( Mail/Web/Network/System )

 Phone  : +82-2-3434-3541
 HP     : 011-9730-9689
 MSN    : [email-masked],[email-masked]
 ICQ    : 33529335
 WWW    : http://my.dreamwiz.com/shoon/
 E-mail : mailto:[email-masked]

-------------------------------------------------
Your Life on the Net
DreamWiz Free Mail @ http://www.dreamwiz.com/

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Tue, 7 Jan 2003 21:24:14 -0800 (PST)

Thank you for reporting this issue.

The problem only happens in a very specific circumstance: there must be a
successful SELECT, followed by a failing SELECT (no such name) in the same
session, followed by a STATUS in the same session.

Although your patch makes the crash go away, the correct fix is to clear
lastsel in the case of a failing SELECT.  This fix will be in the release
version of imap-2002b.

I also suggest that your webmail program is probably doing something very
wrong if that scenario happens frequently.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.