Closed Bug 480814 Opened 16 years ago Closed 15 years ago

within 15 minutes Thunderbird goes berserk and uses up ALL cpu and memory

Categories

(Thunderbird :: General, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: benm.morgan, Unassigned)

Details

(Keywords: hang, perf)

Attachments

(3 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b2) Gecko/20090213 Firefox/3.1b2 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2 Since Thunderbird b1, as well as all the nightlies, this problem has consistently been reoccurring. It has nearly driven me to the same insanity that comes over Thunderbird. I really like Thunderbird and the direction it is going, and so this is very painful. Within 15 minutes of starting Thunderbird (it changes from session to session) Thunderbird becomes possessed and within a few seconds maxes out all memory and cpu, entirely crippling the system. Other memory is swapped, and both ram and swap are completely filled up. CPU usage is at 100%. It takes about 30 seconds for me to find a way to kill Thunderbird. When this insanity overtakes Thunderbird, nothing less will suffice than: killall thunderbird thunderbird-bin However, if I exit Thunderbird normally before this problem has occurred, then it does exit and I don't have to kill it. Reproducible: Always Steps to Reproduce: I don't think this is reproducible on everyone's computer. I have not found any other bug reports, which for me is odd. 1. Start Thunderbird 2. Use it normally 3. Crash! I am using an up-to-date Archlinux x86 on a Celeron M CPU. I have 1G of RAM and 2G of swap. I have not compiled Thunderbird myself, but have downloaded it from: ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/ Thunderbird normally runs with 1 IMAP account and 2 POP accounts. Normally, RAM usage is around max. 300M and with Thunderbird max 400M. Until of course, Thunderbird tries to hijack all the computers resources. I use no extensions. My .thunderbird folder is no larger than 150M. I do not have many emails, max. 500 in a folder.
Be is gloda turned on on your profile ? ( xref 470445)
I never turned on indexing if that is what you are wondering. I just did another test in which I renamed ('deleted') the .thunderbird directory, and then started Thunderbird ... no problems then. I'll look into it a little more. Perhaps there is something messed up with my profile... (This kind of thing still shouldn't happen though.)
I then tried deleting a bunch of files in my original .thunderbird, except for my address book and my mail... and the problem is still there.
Ben please try current nightly now that Bug 481065 is fixed and post results. I had very high cpu a few days ago 20090303 build I think, with gloda supposedly turned off - I say supposedly because I had just turned it off and restarted, and should not have seen high cpu load. xref Bug 480848
Hmm, yeah come to think of it, I think Thunderbird has never misbehaved while I was actively using it. (I think at least.) Usually I went and used some other program, leaving Thunderbird on, and boom, suddenly the cursor moves really jaggedly, and I know... it's Thunderbird again. Well, you know what they say, "Water never boils when you're watching it", and "When the cat's away, the mice do play." I'll try the current nightly now, thanks for the tip.
Tried the current nightly (5th of March 2009). At first I thought that the problem was fixed. I had Thunderbird open for around a half hour and was doing something on Firefox the whole while, and I had no problems. But then I used it again, and the problem happened, again when I went to another program; however, I do remember once composing an email when it crashed in this way. So, the problem is still there, and it doesn't necessarily happen when you are away from Thunderbird, although it most often happens that way. Is there some kind of process that Thunderbird does when it thinks that it's not being watched or used?
I turned on Indexing, quit, then started again, turned it off, quit again, and then started. Just to make sure that it is 'off'. This shouldn't actually be necessary -- I never turned it on. But the profile was originally a migration from TB 2 I turned on a bit of debugging based on https://wiki.mozilla.org/Thunderbird:Using_Gloda (Had to create the latter setting.) I then ran: /opt/mozilla/bin/thunderbird 2> logfile.txt Killed it with xkill, it was in focus the whole time. I will attach the 'logfile-090305.txt' file. Doesn't really help very much, because it spits out a bunch and then doesn't say anything until it crashes. Thanks for your time.
Version: unspecified → Trunk
asuth, does the log illuminate anything?
Thank you for the log and not just throwing up your hands and switching to a lesser e-mail client ;) The log indicates that gloda is not active, which means that gloda should not have any hooks in the system. (Meaning that the problem should not be that gloda is disabled.) I would be strongly suspicious of the autosync mechanism, or the intersection of the autosync and activity managers. However, I have no proof of this, just the knowledge that the autosync mechanism operates when it thinks things are idle. 300M usage sounds a bit high unless we are talking about virtual memory instead of writable memory. Ben, how large is your IMAP account? Are all of your folders marked for offline use? (If you right-click on the account in the folder pane, choose "Settings", select the "Syncing & Disk Space" node beneath the account in the tree, and click on the "Advanced..." button under the "Message Synchronizing" heading on the page that shows up, are all the "Download" boxes checkmarked in the resulting display?) I think this is a strong reason for us to implement the memory reporters for Thunderbird (bug 480841 and bug 480843) and an interface appropriate to this frustrating situation where the UI itself is not interactive (so, use dump()).
Thanks for your help, I really appreciate it. My hope is in that this bug will be fixed some day ;) The last time that Thunderbird crashed, I was doing something on it actively, and at the bottom that "back-and-forth" progress bar was going. And I recall that the time it crashed before that, the progress bar was also "back-and-forth". However, I can't confirm that that has always been the case. Next time it crashes I'll make sure I observe. Oh no, the RAM usage is the total usage for all of my applications. So Thunderbird would be using around 100M normally, although generally in 'top' it is around 7% (of 1G) I think. In the IMAP account, everything is set to Offline usage. That's just me :D I like having everything offline as well as online. I suppose I could turn that off and see if it crashes when I don't have that set -- although I don't know what it would be doing; I already have everything downloaded and only get one or two emails a day.
I did also have another one or two sessions where Thunderbird didn't crash for 40 minutes, and I exited it normally.
Whenever I say 'crash', I mean the the symptoms that I had originally described. Thus, the RAM usage spikes up to 100% in a split second, and the CPU is also so high. Had another crash when I was using it; it was moving something into the Trash, I don't know what; I had just sent an email. In one of my folders, I have a lot of nstmp files. I am going to disable automatic compacting of folders, to see if that makes a difference at all.
Ok disabled auto compacting ... no difference. I started up Thunderbird (this is with the current nightly) and went to Drafts. There was an Email I had saved as Draft that wasn't there. I was waiting and at the bottom it said “Loading Message” and that was when it crashed. Very strange.
I started an strace from the very beginning, but was very frustrated because I couldn't get Thunderbird to crash. So I decided I would just attach strace once Thunderbird had started to 'crash'. I actually managed to get something fairly consistent: (in the IMAP account) clicking on Inbox, a message in Inbox, then on one or two other folders, and finally on Trash, and just waiting. The bouncy bar on the bottom... one... two... crash. Then I ran the command: strace -ff -o logfile -p `pidof thunderbird-bin` & sleep 30; killall strace; killall thunderbird-bin thunderbird When all was done, I could see that some main memory had been swapped -- about 90M. So I attached the output of the above command. There is also a file in the archive called 'command'. That is the command and the output of the above command.
Another comment: I don't know how this all works, but when I ran it, it certainly didn't sleep for 30 seconds; more like 10 seconds.
Thanks for the strace logs! I ran some analysis on the strace files, mainly because I thought it would be easier than it was. I'm attaching it. Since strace only sees our interaction with the OS it regrettably doesn't give us a lot of knowledge about what's happening... profiler output would give us a lot more info on what might be going on (https://developer.mozilla.org/en/Setting_up_jprof), although it still has serious limitations. Because the strace run doesn't include the phase where memory usage shot up, this will, at best, help us try and figure out what generally was happening in terms of processor utilization. (In general, almost no new memory is allocated; mmap2 is used to allocate 10 4k pages, which is chump change. So that isn't analyzed.) Caveat on the analysis is that since "-ttt" was not used (possibly a good thing though?), the script tries to intuit time from the gettimeofday results. Some threads don't call gettimeofday so they have no concept of time. Also, out of pragmatism I made minor tweaks to move gettimeofday calls a few calls earlier to avoid inconsistent views of time. The general overview is: 6847: this is the main thread, it most interestingly opens several msf files. it doesn't seem to close them, which seems concerning. 6854: this appears to be an IMAP thread. generates a medium number of futex and gettimeofday calls. 6866: this appears to be a different kind of IMAP thread; he uses the socket (60) opened by 6854. everyone else: dunno
Thanks for your time and effort, asuth! I will see if I can get the profiler set up to get you some more information. However, I have found out something which may perhaps be a lead: I have managed to make it consistently crash. Lately it hasn't really been crashing under normal circumstances -- although I haven't been using it very much, I have been able to leave it on for longer periods of time with nothing happened. (Key to that has been: Don't visit the Drafts folder!) So, I know how to make it crash: 1. I go to the Drafts folder. I looked at the Drafts file in my ImapMail folder, and I saw two emails. I looked at the Drafts folder through webmail, and I see four emails. 2. For some reason Thunderbird tries to move something to the trash. I recall I tried to delete these two emails in a session earlier, and then it crashed. 3. As it tries to do this, the bar on the bottom goes back and forth, and I could observe the RAM usage rapidly go up to max (about 2 seconds maybe). Notes: Trash is empty before and after the crash. Strangely enough, I have no problem deleting an email from the Inbox, and emptying trash is also no problem in this case. Hope this will give you an idea of what is perhaps happening.
(In reply to comment #18) > I have managed to make it consistently crash. Lately it hasn't really been > crashing under normal circumstances -- although I haven't been using it very Can you provide crashIDs ?
(In reply to comment #19) Whenever I say 'crash', I mean the the symptoms that I had originally described. Thus, the RAM usage spikes up to 100% in a second or two, and the CPU is also so high ... so I end up killing it. It's not really a crash, but I am at loss for better words. It's more of a freeze I suppose, but it's not really that either. Or is a crashID something else that I can somehow find in some log somewhere?
(In reply to comment #20) > (In reply to comment #19) > Whenever I say 'crash', I mean the the symptoms that I had originally > described. Thus, the RAM usage spikes up to 100% in a second or two, and the > Or is a crashID something else that I can somehow find in some log somewhere? You understand what I was asking for. so it's a hang that you experience
Keywords: hang
That's right, it's a hang; although on the other hand, it might count as a crash... because, Thunderbird is still running, it is just using up all of the cpu and ram. It doesn't really hang in that sense of the word. I recall that Talkback once appeared when I had this 'hang' after I killed it. The thing is, I don't have Talkback installed now for some reason -- I am using the nightly from: ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-trunk/ Is there an easy way to get Talkback installed?
Ben talkback is there - but does not show up because nothing goes wrong enough to trigger a crash. I'm not saying that thunderbird behaves correctly - just saying that it does not behave in way that would trigger the talkback.
Ben, this is 32 bit build running on 32 bit system, correct? since this is highly reproducible ... can we narrow this down possibly to one account - change your accounts so that none opens on startup, then login to only one account and run with one account for a while.
Keywords: perf
That is correct. However, after deleting the draft file which helped 'cause' the hang, I am having more trouble reproducing it. (I do have backups I could use though to reproduce the problem.)
jeez, that'll teach me to read. I got distracted by item 2 of comment 18. so what's up with the draft?
It's conceivable (though I'm not sure how likely) that ltrace could produce more useful information than strace did.
Ben, please try a recent nightly and report results. Thanks. http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-1.9.1/
Since comment #25 I have not had the problem anymore. If you want, you can call it fixed, or you can ask me to pull out my backups and see if the problem is still existent. I'll put it on my todo list and see if I can get around to it some time. Thanks for your time though; well appreciate it. I really like the way that Thunderbird is going, it's looking very nice.
-> WFM per comment #29.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: