Closed Bug 321495 Opened 19 years ago Closed 16 years ago

Thunderbird 1.5rc1 and 1.5rc2 hangs with 945 messages in a POP account

Categories

(Thunderbird :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: wiktorw, Assigned: Bienvenu)

References

()

Details

(5 keywords)

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8) Gecko/20051111 Firefox/1.5

Recently I've upgraded the Thunderbird mail client from 1.0.7 PL to the
1.5-rc1 PL, and today to the 1.5-rc2 PL (Windows XP version). It seems
to hang when accessing one of my mailboxes. The messages are downloaded
fine, but when I want to see the contents of the "Incoming" folder,
program simply takes about 95-100% of the processor time and refuses
to switch the view.

[Lisa Chiang wrote:]

> Some general things to try before reporting a bug:
> 
> * If you had migrated your profile and encounter a bug, try creating
>   a new account or a new profile to see if the bug occurs.
>   If not, there may be a preference that was not migrated over correctly.

Yup, I tried both approaches. Initially I thought that the profile hasn't
migrated correctly, so I changed the name of the folder 
( F:\Documents and Settings\USERNAME\Application Data\Thunderbird ->
  F:\Documents and Settings\USERNAME\Application Data\Thunderbird.1.5rc2 )
and tried again. I've tried to isolate the problem and created only one
(offensive) account. However, the problem still appears.

I tried to execute the following commands:

F:\>mkdir F:\TMP
F:\>set NSPR_LOG_MODULES=POP3:5
F:\>set NSPR_LOG_MODULES=F:\TMP\tb-1.5rc2-pl-PL.log
F:\>"F:\Program Files\Mozilla Thunderbird\thunderbird.exe"

but the program didn't create any logs.

I tried again with the clean profile and I switched to the "Inbox" folder
before fetching the messages. Then I could even watch the subjects while
the emails were downloaded. But switching to another folder ("Thrash") and
switching back hung Thunderbird again.

I've also tried to start Thunderbird at 18:35 and I kept it running
with 100% processor utilization until 18:55, but it didn't help either.


Reproducible: Always

Steps to Reproduce:


Details follow:

1) There are currently 945 messages in this mailbox.
2) I use POP3 + SSL for accessing the mailbox. I've tried the POP3 only
   with the same effect.
3) I have the "Leave the messages on the server" option turned on.
   (And sorry, but I will NOT turn it off just in order to see if
   it automagically cures the situation or not. All the previous
   versions, from 0.8 to 1.0.7, worked flawlessly. I really want
   to preserve my current mail on the server.)
4) The account doesn't use the global mailbox.
5) No filters are used (I created a fresh profile, with only one account).
6) I used this site:

http://thunderbird.pl/pobierz-1.5rc1.html
http://thunderbird.pl/pobierz-1.5rc2.html

   to download the installers:

http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/1.5rc1/win32/pl/Thunderbird%20Setup%201.5rc1.exe
http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/1.5rc2/win32/pl/Thunderbird%20Setup%201.5rc2.exe

7) Thunderbird hangs only when I want to see the contents of the
   "Incoming" folder. The messages are downloaded without problems.
8) The problem persists after I kill and restart the program.
   Even if the automatic downloading is turned off.
9) OTOH, if run the Thunderbird, download the messages (it says in
   the status line that there are no new messages) and exit the program,
   all looks fine. I just cannot access the contents of my emails.



Expected Results:  
Please fix this hang issue before releasing Thunderbird 1.5 final.
Should my help was needed I can assist - just drop me an e-mail.
(I'll be accessing my account via web-mail interface of my provider)


I've tried to search the bugzilla with:
 "Thunderbird 1.5 hang"  and  "Thunderbird 1.5 lock"
but none of the results were apropriate. So I've created a new report.

Regards,
Wiktor Wandachowicz
Have you tried the en-US version, or is this problem specific for the polish version? Also, try to Compact the folder, if you haven't tried already.
(In reply to comment #1)
> Have you tried the en-US version, or is this problem specific for the polish
> version? Also, try to Compact the folder, if you haven't tried already.
> 

Sadly, the problem persists.

To make sure that everything is okay, I did the following:

1) I used another Windows XP installation, this time on my laptop.
2) I uninstalled the existing Thunderbird 1.0.7 pl-PL
3) I removed "Mozilla Thunderbird" folder from "C:\Program Files"
4) I installed Thunderbird 1.5rc2 en-US
5) I renamed my profile so the program would have to create a new one
6) I turned on TB and created exactly one, clean account, nothing fancy
   (see http://ics.p.lodz.pl/~wiktorw/thunderbird-problem/ for screenshots)
7) I downloaded the messages and the program hung.
8) I uninstalled the Thunderbird 1.5rc2 en-US
9) I removed "Mozilla Thunderbird" folder from "C:\Program Files" again
10) I installed back Thunderbird 1.0.7 pl-PL
11) I left the profile created by TB 1.5rc2, so TB 1.0.7 would have to use it
12) All came back to normal


Are you sure that there are no problems with sorting, etc. for accounts
accessed via POP3, which contain lots of messages?

Regards,
(In reply to comment #2)
> Are you sure that there are no problems with sorting, etc. for accounts
> accessed via POP3, which contain lots of messages?

None that I recall. To see if it has something to do with threading you can try this: http://kb.mozillazine.org/Stop_threading_by_subject

There is a (very small) chance the JavaScript console could give some clue on what the problem might be. Keep it open when you switch folders and see if there are any exceptions etc shown there. (You find JavaScript Console under the Tools menu). 


I've downloaded the source for TB 1.5rc2 and compiled it under Gentoo
Linux (even though the Gentoo developers consider it unstable "-*").
The problem didn't show up. So this looks like a Windows-only issue so far.

> To see if it has something to do with threading you can try
> this: http://kb.mozillazine.org/Stop_threading_by_subject

Hmm. Is this turned on by default? I repeat, I've used a clean profile,
and the program still gave me trouble.

> There is a (very small) chance the JavaScript console could give some
> clue on what the problem might be. Keep it open when you switch folders
> and see if there are any exceptions etc shown there. (You find JavaScript\
> Console under the Tools menu).

Ok, will see if it helps.
> > There is a (very small) chance the JavaScript console could give some
> > clue on what the problem might be. Keep it open when you switch folders
> > and see if there are any exceptions etc shown there. (You find JavaScript\
> > Console under the Tools menu).
> 
> Ok, will see if it helps.
> 

Nope, nothing is printed. See the screenshots:

Before switching to the "Inbox" folder:
http://ics.p.lodz.pl/~wiktorw/thunderbird-problem/tb-1.5rc2-en-US_take2_javascript_console.png

After switching, waiting, minimizing/restoring windows, etc:
http://ics.p.lodz.pl/~wiktorw/thunderbird-problem/tb-1.5rc2-en-US_take2_jsconsole_hung.png

No response and a 100% processor utilization (see the small green icon of the
Windows Task Manager in the lower right corner).

Regards,
Thanks for your efforts! So, you say 1.5rc1 works and 1.5rc2 doesn't. If you can get a regression window for us that would be of great help. 

There are nightly builds for the time between the releases http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/, the branch builds (which are the ones you want) are in dir {date}-mozilla1.8/.

rc1 was 2005-10-25 and rc2 have date 2005-12-01, so you'd download something in the middle, fire up that build to see if it works, and if it doesn't, download the build ~ in the middle of that interval until you know quite well when the problem started ocurring.
I've created another POP3 account in TB, for my Unix account at the university.
Then I've sent to myself about 1000 mails (using a bash script). This time all
messages were downloaded correctly and the program didn't hang.

It looks like there may be something in my current mailbox @people.pl that
creates this problem. But the previous versions (1.0.6 and 1.0.7) worked
correctly. This problem began since 1.5rc1 (alas).

I've checked the size of the new profile with the offending account/contents,
and it is only about 2MB (~400kB compressed). There are only message headers,
to save space and download time.

I've switched to another user, renamed its profile, and uncompressed the file.
Guess what, TB 1.5rc2 hung again, while TB 1.0.x worked. So it is repeatable.
So, I'll put this file online. Maybe you can reproduce the problem yourself.

You know the drill:
* Rename %USERPROFILE%\Application Data\Thunderbird to, say, Thunderbird-
* Create new folder %USERPROFILE%\Application Data\Thunderbird
* Unpack the Thunderbird.zip file there
* Start TB 1.5
* Notice the account name (collapsed), wiktorw@people.pl
* Expand the folders list and go into the "Inbox"
* Check if the program hangs or not

I removed the password to my mailbox from this profile, but anyway please
make sure that you don't clobber my mail accidentally.

Here's a link:
http://ics.p.lodz.pl/~wiktorw/people.pl/Thunderbird.zip

Please keep me informed about the progress.

Regards,
->new, regression at least from 1.0.x, on trunk/branch it seems at least since juli

I can reproduce this on using the attached mailbox, tested on Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051201 Thunderbird/1.5 ID:2005120113

What it seems to come down to is that for some reason there are (at least) two messages that have exaktly the same message id, which leads to a the hang. Will attach a small test mailbox.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
OS: Windows XP → All
Hardware: PC → All
So, in summary, to reproduce, put this mbox file in e.g. Local Folders, open tb and try to select the folder -> 99% CPU/hang.
Or maybe a little more specific: in the testcase mailbox (attachment 207004 [details]) there are three messages

M1
id: x

M2
id: y
ref: x
in-reply-to: x

M3
id: x
ref: x

Removing any of the messages makes the problem go away. Changing the id of M3 makes the problem go away.  
I was able to reproduce this with the test case, thx. I just need to figure out how to fix it w/o breaking other things...
Assignee: mscott → bienvenu
the problem is that two of the messages in the thread think the other is their parent - that causes an infinite loop in nsMsgDBView::FindLevelInThread. I have a small fix that will prevent that method from getting called if you're not in a threaded view that will fix this for most users, and speed up opening a folder for non-threaded views a bit. Next, I need to figure out a way to handle this case, and finally, I need to fix the threading code not to get us in this situation in the first place.
Attached patch proposed fixSplinter Review
actually, this will fix the hang for all cases...still need to fix the bogus thread structure.
Attachment #207349 - Flags: superreview?(mscott)
Attachment #207349 - Flags: superreview?(mscott) → superreview+
fix for hang checked in. I'm leaving this open so I can try to prevent the mis-threading.
First of all - thanks!

Could you please explain shortly how can I get the fixed source?
This way I would be able to test the functionality myself.

Or maybe should I wait for official -rc3 or possibly a 1.5 final?

Regards,
this fix won't be in 1.5, unfortunately, unless we have to respin 1.5. You can download a nightly trunk build from today when it shows up: ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk

We'll try to get it into the next point release - 1.5.01 or something

This bug should be really rare, since you should never have two messages with the same message-id on a pop3 server.
I need to report that the problem doesn't seem to be solved (or am I missing
something?). I've created a patch against tb-1.5rc2 source, which can be
downloaded from:
http://gentoo.prz.rzeszow.pl/distfiles/thunderbird-1.5rc2-source.tar.bz2

Then I compiled the program with the included patch. It still hangs.
Am I doing something incorrectly, or have I applied a wrong patch?

Regards,
The patch against mail-client/mozilla-thunderbird-1.5_rc2, as can be
found in the Gentoo Portage - I mean literally this package: http://packages.gentoo.org/ebuilds/?mozilla-thunderbird-1.5_rc2
(it's based on the patch 207349 by bienvenu)

The program still hangs at my mailbox. What should I do now?
> The program still hangs at my mailbox. What should I do now?

When I apply the patch to 1.5 there is no problem for me. Did you try ao official nightly trunk build?

Attachment #207349 - Flags: approval1.8.1?
Comment on attachment 207349 [details] [diff] [review]
proposed fix

hey Scott, pinging for 1.8.1 approval - this might also be nice for 1.8.0.1
Attachment #207349 - Flags: approval1.8.0.2?
Attachment #207349 - Flags: approval1.8.1? → approval1.8.1+
Attachment #207349 - Flags: approval1.8.1+ → branch-1.8.1?(mscott)
Comment on attachment 207349 [details] [diff] [review]
proposed fix

ugggh too many flags
Attachment #207349 - Flags: branch-1.8.1?(mscott) → branch-1.8.1+
fix checked into branch
Keywords: fixed1.8.1
(In reply to comment #19)
> > The program still hangs at my mailbox. What should I do now?
> 
> When I apply the patch to 1.5 there is no problem for me. Did you try ao
> official nightly trunk build?
> 

Hmm. I've applied the patch to the Gentoo's official 1.5 source.
It can be downloaded for example at:

http://src.gentoo.pl/distfiles/thunderbird-1.5-source.tar.bz2

But at the same time Gentoo maintainers provide quite a bit of patches already. I've only made a patch upon all of them. Maybe there's something that interferes with the patch discussed here?

Anyway, what's interesting the problem manifested itself on both Windows XP (official Mozilla binary build) and Gentoo Linux (built from source), both x86 and amd64 architectures. Because I kept a copy of my ~/.thunderbird profile I was able to check quickly that the problem still persists (TB hangs for me).
Right now I'm not so keen to try the trunk builds, because honestly I don't have time for this. I filtered and removed the offending e-mails from my inbox, this way I cured my favorite mail client. :-)

I'll be watching the progress and if any new RC version comes out I'll try to see if the original problem (as I reported) shows again or not.


Here I list the patches I've found in Gentoo - maybe they will be interesting to you as well?

http://src.gentoo.pl/distfiles/mozilla-jslibmath-alpha.patch
http://src.gentoo.pl/distfiles/mozilla-firefox-1.0-4ft2.patch.bz2

http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/files/firefox-1.5-visibility-check.patch
http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/files/firefox-1.5-visibility-fix.patch
http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/files/pango-cairo-1.patch
http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/files/thunderbird-rpath-1.patch
http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/files/firefox-1.1-uriloader-1.patch

And general comments why these patches are applied can be found in the ebuild file itself:

http://mirror2.etf.bg.ac.yu/gentooportage/mail-client/mozilla-thunderbird/mozilla-thunderbird-1.5.ebuild

HTH and thanks for your interest,
Wiktor Wandachowicz
Attachment #207349 - Flags: approval1.8.0.2? → approval1.8.0.2+
Keywords: fixed1.8.0.2
Magnus Melin in comment #9:
> Created an attachment (id=207004) [details]
> testcase from the reporters mailbox
> 
> So, in summary, to reproduce, put this mbox file in e.g. Local Folders, open tb
> and try to select the folder -> 99% CPU/hang.

TB version 3 alpha 1 (20061120) and version 2 beta 2 (20070116) appear to behave the same 
- no hang
- in date order, messages show in threadpane OK
- however, in threaded mode the message thread disappears
Opened bug 367896 about that.
verified fixed on 1.8.1.3 using Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.3) Gecko/20070326 Thunderbird/2.0.0.0 ID:2007032620 - the testcase is working fine (i also see bug 367896, but thats an other bug). 
I think it's time to close this...
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: