REPRODUCIBILITY: 75%-ish
OS VERSION: 4.5.0.19
HARDWARE: Xperia 10 II
UI LANGUAGE: English
REGRESSION: Present since Jolla 1 years and years ago, I don’t remember exactly.
DESCRIPTION:
When establishing a connection to my dovecot IMAP proxy to GMail there’s a chance that messageserver5 goes into what I assume is an infinite event loop. Assume because I can’t find the source code for messageserver5 and I don’t have strace or gdb to dig deeper. I don’t know that it’s inherently tied to the IMAP proxy. I have 4 IMAP accounts set up on the same server with 2 of them set to use IDLE but having reproduced it twice today it was seemingly the proxy account both times.
PRECONDITIONS:
It happens pretty regularly when I leave WiFi and the IMAP IDLE connection times out but while trying to get a baseline on WiFi today it happened seemingly without timing out and while still on WiFi.
STEPS TO REPRODUCE:
- Set up IMAP account with IDLE support.
- Leave WiFi range for an hour.
EXPECTED RESULT:
Messageserver5 keeps working.
ACTUAL RESULT:
Messageserver5 locks up in an infinite loop, uses 100% of 1 CPU core (12.5% on my Xperia 10 II) and doesn’t respond to the built-in e-mail client and ceases to log anything. The e-mail client will just say “Updating account…” forever if I try to sync. Killing and restarting messageserver5 brings it back to life.
MODIFICATIONS:
Chum and OpenRepos but no patches. It’s been happening since long before Chum even existed.
ADDITIONAL INFORMATION:
I have compiled logs from both messageserver5 and dovecot. Benefit of it being my own server I suppose. Messageserver5 went into an infinite loop at 10:27 and 12:31. From what I can see it establishes 2 connections for the proxy account and one of them it doesn’t bother to authenticate so it gets closed after 3 minutes for inactivity. The second is presumably kept open but gets closed in the first example after I killed messageserver5 and in the second example after I came back home and it went on WiFi.
Jul 6 10:27:17 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Started proxying to <74.125.205.108> (0.494 secs): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=192.168.0.226, lip=server.ip.addr.ess, TLS, session
=<8ka3SM3/JKzAqADi>
Jul 6 10:27:18 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Started proxying to <74.125.205.108> (0.466 secs): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=192.168.0.226, lip=server.ip.addr.ess, TLS, session
=<kDXCSM3/IqzAqADi>
Jul 6 10:27:19 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Disconnected by server (0s idle, in=209, out=138783): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=192.168.0.226, lip=server.ip.addr.ess, TLS, sess
ion=<kDXCSM3/IqzAqADi>
Jul 6 10:30:19 wirbelwind dovecot[341790]: imap-login: Disconnected: Inactivity (no auth attempts in 180 secs): user=<>, rip=192.168.0.226, lip=server.ip.addr.ess, TLS, session=<xL6aU83/JqzAqADi>
Jul 6 10:51:54 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Disconnected by client (1477s idle, in=114, out=801): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=192.168.0.226, lip=server.ip.addr.ess, TLS: Conn
ection closed, session=<8ka3SM3/JKzAqADi>
Messageserver5 ends on a positive note around line 16400:
[16568] Jul 06 10:27:19 [Debug] IMAP : "7" RECV: * 3134 FETCH (UID 4872 MODSEQ (784592) FLAGS (\Seen))
[16568] Jul 06 10:27:19 [Debug] IMAP : "7" RECV: * 3135 FETCH (UID 4873 MODSEQ (784914) FLAGS (\Seen))
[16568] Jul 06 10:27:19 [Debug] IMAP : "7" RECV: * 3136 FETCH (UID 4874 MODSEQ (785122) FLAGS (\Seen))
[16568] Jul 06 10:27:19 [Debug] IMAP : "7" RECV: a006 OK Success
[16568] Jul 06 10:27:19 [Debug] Messaging : Action completed 71159018160130 result success
[16568] Jul 06 10:27:19 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[16568] Jul 06 10:27:19 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[16568] Jul 06 10:27:19 [Debug] Messaging : Running action RetrieveMessageListRequest 71159018160131
[16568] Jul 06 10:27:19 [Debug] Messaging : Setting imap strategy 31ImapRetrieveMessageListStrategy
[16568] Jul 06 10:27:19 [Debug] IMAP : "9" About to open connection "regular-account-1@regular-domain.com" "mail.server.com"
[16568] Jul 06 10:27:19 [Debug] Messaging : QMailTransport::Socket::Socket SET PROXY host= "" port= 0
[16568] Jul 06 10:27:19 [Debug] Messaging : Opening connection - "mail.server.com" : 993 SSL
[16568] Jul 06 10:27:19 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[16568] Jul 06 10:27:19 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[16568] Jul 06 10:27:19 [Debug] IMAP : "7" SEND a007 LOGOUT
[16568] Jul 06 10:27:19 [Debug] Messaging : IMAP : connection established
[16568] Jul 06 10:27:19 [Debug] Messaging : IMAP : Secure connection established
[16568] Jul 06 10:27:19 [Debug] IMAP : "9" RECV: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ AUTH=PLAIN AUTH=LOGIN] Dovecot ready.
And later:
Jul 6 12:31:48 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Started proxying to <74.125.205.108> (0.724 secs): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=213.237.109.54, lip=server.ip.addr.ess, TLS, session=<i8EABs//xBPV7W02>
Jul 6 12:31:49 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Started proxying to <74.125.205.108> (0.445 secs): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=213.237.109.54, lip=server.ip.addr.ess, TLS, session=<WnQSBs//whPV7W02>
Jul 6 12:31:50 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Disconnected by server (0s idle, in=317, out=93296): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=213.237.109.54, lip=server.ip.addr.ess, TLS, session=<WnQSBs//whPV7W02>
Jul 6 12:34:50 wirbelwind dovecot[341790]: imap-login: Disconnected: Inactivity (no auth attempts in 180 secs): user=<>, rip=213.237.109.54, lip=server.ip.addr.ess, TLS, session=<8sruEM//xhPV7W02>
Jul 6 13:01:54 wirbelwind dovecot[341790]: imap-login: proxy(proxy-account@proxy-domain.com,74.125.205.108:993): Disconnected by client: read(size=188) failed: Connection reset by peer (1806s idle, in=114, out=801): user=<proxy-account@proxy-domain.com>, method=PLAIN, rip=213.237.109.54, lip=server.ip.addr.ess, TLS: read(size=188) failed: Connection reset by peer, session=<i8EABs//xBPV7W02>
I don’t know if this means messageserver5 went down another code path but it ends on a similar note:
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3132 FETCH (UID 4870 MODSEQ (784413) FLAGS (\Seen))
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3133 FETCH (UID 4871 MODSEQ (784413) FLAGS (\Seen))
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3134 FETCH (UID 4872 MODSEQ (784592) FLAGS (\Seen))
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3135 FETCH (UID 4873 MODSEQ (784914) FLAGS (\Seen))
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3136 FETCH (UID 4874 MODSEQ (785122) FLAGS (\Seen))
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3137 FETCH (UID 4875 MODSEQ (785178) FLAGS ())
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: a005 OK Success
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" SEND a006 UID FETCH 4875 (FLAGS UID INTERNALDATE RFC822.SIZE BODYSTRUCTURE RFC822.HEADER)
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3137 FETCH (UID 4875 RFC822.SIZE 14485 RFC822.HEADER {8548}
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: <8548 literal bytes received>
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: MODSEQ (785178) INTERNALDATE "06-Jul-2023 09:20:21 +0000" FLAGS () BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "utf-8") NIL NIL "QUOTED-PRINTABLE" 1194 24 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "utf-8") NIL NIL "QUOTED-PRINTABLE" 3836 77 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "Apple-Mail=_A7C1F910-D4BA-4869-99C3-ADAFADA02194") NIL NIL))
[26265] Jul 06 12:31:49 [Debug] Messaging : Checking for attachments to download
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: a006 OK Success
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" SEND a007 UID FETCH 4875 (FLAGS UID RFC822.SIZE BODY.PEEK[])
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * 3137 FETCH (UID 4875 RFC822.SIZE 14485 MODSEQ (785178) FLAGS () BODY[] {14485}
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: <14485 literal bytes received>
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: )
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: a007 OK Success
[26265] Jul 06 12:31:49 [Debug] Messaging : Checking for attachments to download
[26265] Jul 06 12:31:49 [Debug] Messaging : Push email established for account 7 "proxy-account@proxy-domain.com"
[26265] Jul 06 12:31:49 [Debug] Messaging : Action completed 112807316029445 result success
[26265] Jul 06 12:31:49 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[26265] Jul 06 12:31:49 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[26265] Jul 06 12:31:49 [Debug] Messaging : Running action RetrieveMessageListRequest 112807316029446
[26265] Jul 06 12:31:49 [Debug] Messaging : Setting imap strategy 31ImapRetrieveMessageListStrategy
[26265] Jul 06 12:31:49 [Debug] IMAP : "9" About to open connection "regular-account-1@regular-domain.com" "mail.server.com"
[26265] Jul 06 12:31:49 [Debug] Messaging : QMailTransport::Socket::Socket SET PROXY host= "" port= 0
[26265] Jul 06 12:31:49 [Debug] Messaging : Opening connection - "mail.server.com" : 993 SSL
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" SEND a008 LOGOUT
[26265] Jul 06 12:31:49 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[26265] Jul 06 12:31:49 [Debug] IMAP : void ImapClient::onAccountsUpdated(const QMailAccountIdList&) "proxy-account@proxy-domain.com"
[26265] Jul 06 12:31:49 [Debug] Messaging : IMAP : connection established
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: * BYE LOGOUT Requested
[26265] Jul 06 12:31:49 [Debug] IMAP : "7" RECV: a008 OK 73 good day (Success)
I thought this might have had something to do with dovecot but having just done a major update with no change in behavior I think the most likely cause is messageserver5 sitting in a poll loop not responding to some event.