< December 2005 >
SuMoTuWeThFrSa
     1 2 3
4 5 6 7 8 910
11121314151617
18192021222324
25262728293031
Fri, 23 Dec 2005:

Got thunderbird 1.5rc2 compiled and with all the debug options in there.

[tbird@gopalv ~]$ /opt/thunderbird/bin/thunderbird --debug

/usr/bin/gdb /opt/thunderbird//lib/thunderbird-1.5/thunderbird-bin \
             -x /tmp/mozargs.AD6303
(gdb) r
Starting program: /opt/thunderbird/lib/thunderbird-1.5/thunderbird-bin 

Break points in place and broken into

(gdb) break nsImapProtocol::Logout
Breakpoint 1 at 0x238c9a9: file mozilla/mailnews/imap/src/nsImapProtocol.cpp, line 5677.

(gdb) bt
#0  nsImapProtocol::Logout (this=0x9b91f60, shuttingDown=1, waitForResponse=1)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:5677
#1  0x0237df2a in nsImapProtocol::TellThreadToDie (this=0x9b91f60, 
    isSafeToClose=0)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1035
#2  0x0237f8ee in nsImapProtocol::ProcessCurrentURL (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1475
#3  0x0237e4f4 in nsImapProtocol::ImapThreadMainLoop (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:1140
#4  0x0237d985 in nsImapProtocol::Run (this=0x9b91f60)
    at ./mozilla/mailnews/imap/src/nsImapProtocol.cpp:931
#5  0x007e9ba2 in nsThread::Main (arg=0x9b91f30)
    at ./mozilla/xpcom/threads/nsThread.cpp:118
#6  0x00288f9e in _pt_root (arg=0x9b9aa90)
    at ./mozilla/nsprpub/pr/src/pthreads/ptthread.c:220
#7  0x001163ae in start_thread () from /lib/tls/libpthread.so.0
#8  0x00672aee in clone () from /lib/tls/libc.so.6
(gdb)c
###!!! ASSERTION: syntax error in generic parser: 'PR_FALSE', 
file ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp,
line 94

Some progress, at least - we know that somewhere the syntax parser is screwing up :)

(gdb) break nsIMAPGenericParser::SetSyntaxError if error!=0
Breakpoint 4 at 0x233407b: file ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp, line 90.

Breakpoint 4, nsIMAPGenericParser::SetSyntaxError (this=0x9c937ac, error=1)
    at ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp:90
90        fSyntaxError = error;
(gdb) bt 4
#0  nsIMAPGenericParser::SetSyntaxError (this=0x9c937ac, error=1)
    at ./mozilla/mailnews/imap/src/nsIMAPGenericParser.cpp:90
#1  0x023a2243 in nsImapServerResponseParser::SetSyntaxError (this=0x9c937ac, 
    error=1)
    at ./mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:2922
#2  0x0239ffcf in nsImapServerResponseParser::msg_obsolete (this=0x9c937ac)
    at .mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:2122
#3  0x0239cffb in nsImapServerResponseParser::numeric_mailbox_data (
    this=0x9c937ac)
    at ./mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp:1031
(More stack frames follow...)

(gdb) p this->fNextToken
$2 = 0x9bdf13f "NO"
(gdb) p this->fCurrentLine
$6 = 0x9b76f50 "* 1072 NO  message error; can't fetch that message\r\n"

Ok, so the IMAP server returns some error message which my t-bird fails to understand ? bienvenu_ asked me to get an IMAP client side log

export NSPR_LOG_MODULES=IMAP:5
export NSPR_LOG_FILE=/tmp/tbird.log

The log file data is a bit interesting, but not really anything to wake anyone up.

112905136[b6562480]: ReadNextLine [stream=b6562750 nb=52 needmore=0]
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:
  CreateNewLineFromSocket: * 1072 NO  message error; can't fetch that message
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:PARSER:
  Internal Syntax Error: %s: * 1072 NO  message error; can't fetch that message
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:SendData:TellThreadToDie: 8 logout
112905136[b6562480]: b6559af8:us.f318.mail.yahoo.com:S-foss.in:TellThreadToDie: close socket connection

Let us move onto the RFC - 2060 (IMAP version 4, revision 1). Scroll down to section 6.4.8. The UID command seems to expect 'NO' as a valid response - but it is not entirely clear whether "* 1072 NO" is valid in the current context. (updated: bienvenu_ told me that's a valid response). Right now, hacking on a quick fix to ignore 'NO' lines in that output.

Index: nsImapServerResponseParser.cpp
===================================================================
RCS file: /cvsroot/mozilla/mailnews/imap/src/nsImapServerResponseParser.cpp,v
retrieving revision 1.122.8.2
diff -u -r1.122.8.2 nsImapServerResponseParser.cpp
--- nsImapServerResponseParser.cpp	22 Sep 2005 23:29:11 -0000	1.122.8.2
+++ nsImapServerResponseParser.cpp	23 Dec 2005 02:29:24 -0000
@@ -1027,6 +1027,11 @@
         fFlagState->ExpungeByIndex((PRUint32) tokenNumber);
       skip_to_CRLF();
     }
+    else if(!PL_strcasecmp(fNextToken, "NO"))
+    {
+       /* crude !! */
+       skip_to_CRLF();
+    }
     else
       msg_obsolete();
   }

One night's sleep - wasted.

--
Users who debug, shouldn't be punished for it

posted at: 07:57 | path: /hacks | permalink | Tags: , ,