Wait 5 minutes without entering password, Thunderbird stops responding/hangs if pop connection was closed while the password prompt was up. [pop]

VERIFIED FIXED in Thunderbird 13.0

Status

MailNews Core
Networking: POP
--
critical
VERIFIED FIXED
7 years ago
5 years ago

People

(Reporter: Kim Burton, Assigned: aceman)

Tracking

({hang})

Trunk
Thunderbird 13.0
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gs][gssolved], URL)

Attachments

(3 attachments, 3 obsolete attachments)

(Reporter)

Description

7 years ago
User-Agent:       Opera/9.80 (Windows NT 5.1; U; en) Presto/2.6.30 Version/10.61
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2

After opening Thunderbird the password dialog is displayed. If nothing is entered for approx 5 minutes, Thunderbird will hang.

Reproducible: Always

Steps to Reproduce:
1. Start Thunderbird (password dialog is displayed.
2. Wait 5 minutes without entering a password.
3. Thunderbird stops responding. 
Actual Results:  
Stops responding

Expected Results:  
Should be able to wait indefinitely for the password to be entered.
I cannot reproduce. Does it reproduce in safe mode ? https://support.mozillamessaging.com/en-US/kb/Safe+Mode
Severity: normal → critical
Keywords: hang
What kind of password dialog is showing up - master password - imp/pop password - ldap password ?
Component: General → Security
QA Contact: general → thunderbird
(Reporter)

Comment 3

7 years ago
Yes this bug still happens in safe mode.

The dialog is the Master Password for the software security device which gets displayed at Thunderbird startup.

I've noticed the following:

After approx 1 min 15 sec "connected to pop.XXXXX.net.." appears in the status bar. This is the second of two POP mail accounts I have Thunderbird set to check. Both pop mail accounts are set for check messages at startup.

On one occasion the caret in the password edit box disappeared. I didn't note the time.

On my next try the caret stopped flashing at about 2 min 10 sec and Thunderbird was unresponsive. Clicking the dialog adds "(Not Responding)" to the dialog title.
(Reporter)

Comment 4

7 years ago
Using the same settings this bug does not happen on my Vista Laptop, so maybe something specific to XP or my XP computer.

Comment 5

7 years ago
(In reply to comment #3)
> After approx 1 min 15 sec "connected to pop.XXXXX.net.." appears in the status
> bar. This is the second of two POP mail accounts I have Thunderbird set to
> check. Both pop mail accounts are set for check messages at startup.

This is likely a "bogus connection" ala Bug 533083, but probably unrelated to the "unresponsiveness".

(In reply to comment #4)
> Using the same settings this bug does not happen on my Vista Laptop, so maybe
> something specific to XP or my XP computer.

Just in case it IS related to Bug 533083, are the "Check for new messages at startup" and "Automatically download new messages" settings the same on XP/Vista ?
(Reporter)

Comment 6

7 years ago
I have rechecked the settings on both computers. "Check new messages at startup" was not set the same on both computers. I have done a bit more checking and it is only my second email account that causes the problem and I can now replicate this problem on both my XP and Vista computers.

I have set both computers not to automatically check or download messages. By Starting Thunderbird and just clicking get mail from my Freeserve account, I can crash Thunderbird by doing nothing at the Master Password entry and waiting a couple of minutes. 

Since it may be important to understand this bug, the actual pop server I am connecting to is pop.freeserve.net.  So it appears to be caused by something that pop.freeserve.net does whilst waiting for a password.

I don't understand all aspects of Bug 533083 but I think it is likely that is is related in some way. I can't see why there's a need to contact the mail server before the master password has been entered.

Comment 7

7 years ago
(In reply to comment #6)
> I don't understand all aspects of Bug 533083 but I think it is likely that is
> is related in some way. I can't see why there's a need to contact the mail
> server before the master password has been entered.

There isn't -- that's why Bug 533083 was submitted.  The scenario in your case is slightly different, in that the saved passwords are available -- IF you enter the Master Password.  There may be a slightly different set of circumstances that occurs when you don't respond to the password prompt; I'd suspect the server is closing the connection after waiting 3-4 minutes for the "PASS" command.

Can you get a POP3 log of such an occurrence ?  Use "POP3:5":
http://kb.mozillazine.org/Session_logging_for_mail/news
https://wiki.mozilla.org/MailNews:Logging

Have you ever used Wireshark (www.wireshark.org) ?  If you can manage it, a packet capture ("raw", or ".pcap" format) would also be very helpful.

Attach, don't "paste" the log (and the packet capture if possible).
(Reporter)

Comment 8

7 years ago
(In reply to comment #7)
> (In reply to comment #6)
> > I don't understand all aspects of Bug 533083 but I think it is likely that is
> > is related in some way. I can't see why there's a need to contact the mail
> > server before the master password has been entered.
> 
> There isn't -- that's why Bug 533083 was submitted.  The scenario in your case
> is slightly different, in that the saved passwords are available -- IF you
> enter the Master Password.  There may be a slightly different set of
> circumstances that occurs when you don't respond to the password prompt; I'd
> suspect the server is closing the connection after waiting 3-4 minutes for the
> "PASS" command.
> 
> Can you get a POP3 log of such an occurrence ?  Use "POP3:5":
> http://kb.mozillazine.org/Session_logging_for_mail/news
> https://wiki.mozilla.org/MailNews:Logging
> 
> Have you ever used Wireshark (www.wireshark.org) ?  If you can manage it, a
> packet capture ("raw", or ".pcap" format) would also be very helpful.
> 
> Attach, don't "paste" the log (and the packet capture if possible).

I have set up a batch file with the following contents:

set NSPR_LOG_MODULES=pop:5
set NSPR_LOG_FILE=%APPDATA%\kimspop.log
"C:\Program Files\Mozilla Thunderbird\thunderbird.exe"

The log file produced is empty, 0 bytes.

I will attempt wireshark and report back, but have no idea how to attach anything to these messages.
kim, you need pop3:5  not pop:5  :)

Comment 10

7 years ago
(In reply to comment #9)
> kim, you need pop3:5  not pop:5  :)

[Thanks, Wayne]  To attach something to a bug report, use the "Add an attachment" link, just above the original problem description (left-hand side).
(Reporter)

Comment 11

7 years ago
I just started uploading the log file, then noticed it was huge, approx 20mb! So I've aborted. I've typed the file and it contains thousands of lines "0[1b29140]: POP3: Entering state: 47" 

The main bit of the file is:

0[1b29140]: Setting server busy in nsPop3Protocol::LoadUrl
0[1b29140]: Entering NET_ProcessPop3 32
0[1b29140]: POP3: Entering state: 1
0[1b29140]: POP3: Entering state: 2
0[1b29140]: POP3: Entering state: 4
0[1b29140]: RECV: +OK connected to pop3 on 3611 
0[1b29140]: POP3: Entering state: 26
0[1b29140]: SEND: AUTH0[1b29140]: Entering NET_ProcessPop3 22
0[1b29140]: POP3: Entering state: 3
0[1b29140]: RECV: -ERR unknown command
0[1b29140]: POP3: Entering state: 27
0[1b29140]: POP3: Entering state: 28
0[1b29140]: SendCapa()
0[1b29140]: SEND: CAPA0[1b29140]: Entering NET_ProcessPop3 22
0[1b29140]: POP3: Entering state: 3
0[1b29140]: RECV: -ERR unknown command
0[1b29140]: POP3: Entering state: 29
0[1b29140]: POP3: Entering state: 30
0[1b29140]: ProcessAuth()
0[1b29140]: POP auth: server caps 0x4AA, pref 0x1C00, failed 0x0, avail caps 0x400
0[1b29140]: (GSSAPI = 0x100000, CRAM = 0x2000, APOP = 0x4000, NTLM = 0x8000, MSN =  

0x10000, PLAIN = 0x1000, LOGIN = 0x800, USER/PASS = 0x400)
0[1b29140]: trying auth method 0x400
0[1b29140]: POP username
0[1b29140]: POP3: Entering state: 5
0[1b29140]: OnPromptStart()
0[1b29140]: Entering NET_ProcessPop3 48
0[1b29140]: POP3: Entering state: 47
0[1b29140]: POP3: Entering state: 47........etc.

I will upload the wireshark capture and if I'm reading this correctly pop.freeserve.net responds with a "Disconnect because authentication is too long" message in a malformed packet.
(Reporter)

Comment 12

7 years ago
Created attachment 470301 [details]
Wireshark Capture -Thunderbird Crash

Wireshark Capture.

Comment 13

7 years ago
The disconnect occurs after one minute (and, as the reporter notes, is malformed because it does not begin with -ERR).  It's possible the disconnect is causing a loop (i.e., POP handler doesn't recognize the connection's gone).

I don't know if the behavior noted in Bug 533083 (or the disconnect therefrom) is what's causing the hang, though.  I tried to recreate using just a plain password prompt (I have no master PW), and I didn't "hang" even though the connection was closed by server after 1 minute -- the code path could be different for the master PW case, though.
(Reporter)

Comment 14

7 years ago
It should be easy to recreate the hang by just setting any mail account to point to pop.freeserve.net. It wouldn't have to actually log in to that server as the hang occurs before any username or password is sent.

Comment 15

7 years ago
I don't have any saved passwords, nor a MasterPW, but the problem does NOT happen by just letting the server password prompt sit for 10 minutes; the POP log never shows state 47.  That code is all new, and was added by changeset "5495:2fb73ad3a589".

Anybody (besides Kim) happen to have saved passwords & a Master Password, who can recreate & set status to "NEW" ?
(Reporter)

Comment 16

7 years ago
Bug still there in latest release:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.9) Gecko/20100825 Thunderbird/3.1.3
Can you give us a stack trace as described at https://developer.mozilla.org/en/How_to_get_a_stacktrace_with_WinDbg ?
(Reporter)

Comment 18

7 years ago
Created attachment 475200 [details]
Debug log file
(Reporter)

Comment 19

7 years ago
I've attached the log file from windbg. I tried changing Firefox to Thunderbird when following the instructions on the link, but got an error when loading the symbols. If it isn't any good, I can try again if you can supply the correct URL to the Thunderbird symbols.
http://symbols.mozilla.org/thunderbird should do it
(Reporter)

Comment 21

7 years ago
Created attachment 476617 [details]
Debug file

Second go at creating a stack trace.
Attachment #475200 - Attachment is obsolete: true
(Reporter)

Comment 22

7 years ago
Debug file has been uploaded, hope it helps.
Note: hook.dll is part of my mouse driver.

Problem still exists with version Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4

If Thunderbird is left long enough without a master password entered it will eventually crash my entire computer.
(In reply to comment #21)
> Created attachment 476617 [details]
> Debug file
> 
> Second go at creating a stack trace.

David anything interesting here ?

Comment 24

7 years ago
yeah, that stack trace is potentially illuminating - I suspect we're spinning forever in the   while(!m_pop3ConData->pause_for_read) loop. We may not have realized that the connection was closed while the password prompt was up.
Status: UNCONFIRMED → NEW
Ever confirmed: true
blocking-thunderbird3.2: --- → ?
Duplicate of this bug: 603064
Summary: Start Thunderbird wait 5 minutes without entering password, Thunderbird stops responding → Start Thunderbird wait 5 minutes without entering password, Thunderbird stops responding if connection was closed while the password prompt was up
(Reporter)

Comment 26

7 years ago
Any progress fixing this bug?
Duplicate of this bug: 623924
xref pop Bug 533006 - We don't notice that the server closed the connection after failed password

I may have seen something like this on wife's work computer, but think her accounts are all imap - off to do some digging
Summary: Start Thunderbird wait 5 minutes without entering password, Thunderbird stops responding if connection was closed while the password prompt was up → Start Thunderbird wait 5 minutes without entering password, Thunderbird stops responding/hangs if connection was closed while the password prompt was up. [pop]
http://getsatisfaction.com/mozilla_messaging/topics/thunderbird_crashes_if_master_password_not_entered_at_startup_not_good may be an example

Comment 30

7 years ago
I can reproduce the bug with pop.sfr.fr on linux platform
OS: Windows XP → All

Comment 31

7 years ago
(In reply to comment #24)
> yeah, that stack trace is potentially illuminating - I suspect we're spinning
> forever in the   while(!m_pop3ConData->pause_for_read) loop. We may not have
> realized that the connection was closed while the password prompt was up.

One of the problems is that, when m_pop3ConData->next_state is not trapped by the switch cases and ends up in the default statement, an infinite loop happens. Returning after NS_ERROR prevents the interface from freezing (but may be it does not fix the root problem, I'm not sure)

Comment 32

7 years ago
Created attachment 512500 [details] [diff] [review]
patch

return after NS_ERROR to avoid infinite loop
(In reply to comment #32)
> patch
> return after NS_ERROR to avoid infinite loop

No need of NSPR logging or assertion for ease of problem analysis?
It's done by caller if NS_ERROR_FAILURE is returned from nsPop3Protocol::ProcessProtocol?

Comment 34

7 years ago
(In reply to comment #32)
> Created attachment 512500 [details] [diff] [review]
> patch
> 
> return after NS_ERROR to avoid infinite loop

When using this patch, thunderbird does not try to prompt for password any more to the server until thunderbird is restarted.
You may also want to remove 
ClearFlag(POP3_PASSWORD_FAILED|POP3_AUTH_FAILURE);
in nsPop3Protocol::OnStopRequest so thunderbird will prompt for password again. I'm not sure of all the drawbacks of this modifications.
Comment on attachment 512500 [details] [diff] [review]
patch

David, this patch has been up for a bit, can you take a look?
Attachment #512500 - Flags: feedback?(dbienvenu)
blocking-thunderbird3.2: ? → ---

Comment 36

6 years ago
Comment on attachment 512500 [details] [diff] [review]
patch

What is the unexpected state, I wonder? And does the patch in bug 428611, which has to do with our handling of dropped connections, affect this?

I'd really prefer to see a explicit case statement for the unexpected state we're getting to, and some code to handle it, even if that code is to return NS_ERROR_FAILURE (and I think you might be right about clearing the auth failure flags). This approach might be an acceptable stop-gap, but I'd really prefer something explicit.
Attachment #512500 - Flags: feedback?(dbienvenu) → feedback+

Comment 37

6 years ago
I have the same problems:

If i spent too much time to answer the master-password-dialog, the dialog consumes 100% CPU-Power and there is no chance to type in the passwort.

My Scenario: Windows XP, 3x POP accounts (no freenet), 
autostart-folder contains: firefox, thunderbird, ...
http://getsatisfaction.com/mozilla_messaging/topics/thunderbird_freezes_when_the_user_doesnt_log_in_fast_enough is potentially a report of this.
Summary: Start Thunderbird wait 5 minutes without entering password, Thunderbird stops responding/hangs if connection was closed while the password prompt was up. [pop] → Wait 5 minutes without entering password, Thunderbird stops responding/hangs if pop connection was closed while the password prompt was up. [pop]
Whiteboard: [needs updated patch]
Whiteboard: [needs updated patch] → [needs updated patch][gs]
(Assignee)

Updated

6 years ago
Blocks: 691494
(Assignee)

Comment 39

6 years ago
I can confirm comment 31.
On the server from comment 30, there is an infinite loop saying "POP3: Entering state: 47" that fills the logfile.

This does not happen on my normal pop3 server.
(Assignee)

Updated

6 years ago
Duplicate of this bug: 715805

Comment 41

6 years ago
User agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1

I confirm that i had the problem with pop.sfr.fr

After disabling the "check mail on start up" for this specific account, i cannot reproduce the problem anymore.
arno, are you up for taking another swing at this?


(In reply to David :Bienvenu from comment #36)
> Comment on attachment 512500 [details] [diff] [review]
> patch
> 
> What is the unexpected state, I wonder? And does the patch in bug 428611,
> which has to do with our handling of dropped connections, affect this?
> 
> I'd really prefer to see a explicit case statement for the unexpected state
> we're getting to, and some code to handle it, even if that code is to return
> NS_ERROR_FAILURE (and I think you might be right about clearing the auth
> failure flags). This approach might be an acceptable stop-gap, but I'd
> really prefer something explicit.
Duplicate of this bug: 691494
Arno seems to be gone.
Whiteboard: [needs updated patch][gs] → [patchlove][needs updated patch][gs]
(Assignee)

Comment 45

6 years ago
Maybe POP3 would be a better component for this.
Assignee: nobody → acelists
Hardware: x86 → All
Version: unspecified → Trunk
also, probably one or two other duplicate bugs amongst https://bugzilla.mozilla.org/buglist.cgi?type1-0-0=anywords;list_id=2416589;field0-0-0=short_desc;type0-0-1=substring;field0-0-1=keywords;type1-0-1=anywords;resolution=---;value1-0-1=pop%20;classification=Client%20Software;classification=Components;query_format=advanced;value1-0-0=pop%20pop3;type0-0-0=anywordssubstr;value0-0-0=password;component=Backend;component=General;component=Mail%20Window%20Front%20End;component=Networking%3A%20POP;component=Security;field1-0-0=short_desc;product=MailNews%20Core;product=Thunderbird;field1-0-1=component

any reason we might be seeing more reports of this lately? (or so it seems)
Assignee: acelists → nobody
Component: Security → Networking: POP
Product: Thunderbird → MailNews Core
QA Contact: thunderbird → networking.pop
(Assignee)

Comment 47

6 years ago
I consider it a bug in bugzilla, that when changing component it resets the assignee by default :) It should only do it if the previous assignee was the previous component's default one.

Actually couldn't find any dupes in the linked query.
Assignee: nobody → acelists
(Assignee)

Updated

6 years ago
Blocks: 729433
Aceman are you taking up the pacth ?
(Assignee)

Comment 49

6 years ago
I had to assign this to myself 2 times today. So it seems I'll look into it :)
Duplicate of this bug: 729433
(Assignee)

Comment 51

6 years ago
The problem still happens in TB13.
In the log you can see these states:
POP3_FINISH_OBTAIN_PASSWORD_BEFORE_USERNAME, ( 48)
POP3_OBTAIN_PASSWORD_BEFORE_USERNAME,       ( 47) - spinning in this state.

-1218537216[b734e1c0]: POP username
-1218537216[b734e1c0]: POP3: Entering state: 5
-1218537216[b734e1c0]: OnPromptStart()
-1218537216[b734e1c0]: Entering NET_ProcessPop3 48
-1218537216[b734e1c0]: POP3: Entering state: 47
-1218537216[b734e1c0]: ###!!! ASSERTION: Got to unexpected state in nsPop3Protocol::ProcessProtocolState: 'Error', file /var/SSD/TB-hg/mailnews/local/src/nsPop3Protocol.cpp, line 4170
-1218537216[b734e1c0]: POP3: Entering state: 47
-1218537216[b734e1c0]: ###!!! ASSERTION: Got to unexpected state in nsPop3Protocol::ProcessProtocolState: 'Error', file /var/SSD/TB-hg/mailnews/local/src/nsPop3Protocol.cpp, line 4170

From the log I can't see if the server closed the connection.

On a normal server the log is like this:
-1218586368[b734e1c0]: OnPromptStart()
-1218586368[b734e1c0]: Entering NET_ProcessPop3 0
-1218586368[b734e1c0]: POP3: Entering state: 24
-1218586368[b734e1c0]: POP3: Entering state: 25
-1218586368[b734e1c0]: Clearing server busy in POP3_FREE
-1218586368[b734e1c0]: Clearing running protocol in POP3_FREE
-1218586368[b734e1c0]: WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x8000FFFF: file /var/SSD/TB-hg/mozilla/content/base/src/nsContentUtils.cpp, line 2625
-1218586368[b734e1c0]: WARNING: NS_ENSURE_TRUE(pusher.Push(aBoundElement)) failed: file /var/SSD/TB-hg/mozilla/content/xbl/src/nsXBLProtoImplMethod.cpp, line 359
-1218586368[b734e1c0]: WARNING: NS_ENSURE_SUCCESS(rv, false) failed with result 0x8000FFFF: file /var/SSD/TB-hg/mozilla/content/base/src/nsContentUtils.cpp, line 2625
-1218586368[b734e1c0]: WARNING: NS_ENSURE_TRUE(pusher.Push(aBoundElement)) failed: file /var/SSD/TB-hg/mozilla/content/xbl/src/nsXBLProtoImplMethod.cpp, line 359
-1218586368[b734e1c0]: ###!!! ASSERTION: Invalid next_state in GetNextPasswordObtainState: 'Not Reached', file /var/SSD/TB-hg/mailnews/local/src/nsPop3Protocol.cpp, line 744
-1218586368[b734e1c0]: Entering NET_ProcessPop3 0
-1218586368[b734e1c0]: POP3: Entering state: 24
-1218586368[b734e1c0]: POP3: Entering state: 25
-1218586368[b734e1c0]: Clearing server busy in POP3_FREE
-1218586368[b734e1c0]: Clearing running protocol in POP3_FREE
-1218586368[b734e1c0]: Calling ReleaseFolderLock from ~nsPop3Sink

The connection is probably closed too so providing the password does not help. But there is no loop.
(Assignee)

Comment 52

6 years ago
Created attachment 600510 [details] [diff] [review]
patch v2

This is my attempt at this.

I do not yet know why we get into POP3_OBTAIN_PASSWORD_BEFORE_USERNAME in ProcessProtocolState. The function does not check for that state it should probably be processed somewhere else (in the GetAsyncPassword functionality?).

Adding the status=-1 to the unknown case makes the function exit cleanly with POP3_ERROR_DONE. Cancelling or filling the password prompt makes subsequent connections work fine (either asking the password again or connecting with the username and password obtained). I tested this with the real password dialog, not password manager.
Attachment #512500 - Attachment is obsolete: true
Attachment #600510 - Flags: feedback?(dbienvenu)
Blocks: 699186

Comment 53

6 years ago
Comment on attachment 600510 [details] [diff] [review]
patch v2

I'd probably prefer an explicit check for the state we're getting into in the switch.
Attachment #600510 - Flags: feedback?(dbienvenu) → feedback+
(Assignee)

Comment 54

6 years ago
Created attachment 603352 [details] [diff] [review]
patch v3

Ok.
Attachment #600510 - Attachment is obsolete: true
Attachment #603352 - Flags: review?(dbienvenu)

Comment 55

6 years ago
Comment on attachment 603352 [details] [diff] [review]
patch v3

thx for the patch
Attachment #603352 - Flags: review?(dbienvenu) → review+
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Whiteboard: [patchlove][needs updated patch][gs] → [gs]
http://hg.mozilla.org/comm-central/rev/9ebce24271f8

For future patches, please try to make the checkin comment more descriptive of what the patch is actually doing rather than just re-stating the bug title. Thanks!
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 13.0
https://getsatisfaction.com/mozilla_messaging/topics/thunderbird_freezes_when_the_user_doesnt_log_in_fast_enough confirms fixed in v13
Status: RESOLVED → VERIFIED
Whiteboard: [gs] → [gs][gssolved]
You need to log in before you can comment on or make changes to this bug.