Open Bug 544596 Opened 14 years ago Updated 3 years ago

8MB paste into compose message window hangs Thunderbird indefinitely

Categories

(Thunderbird :: Message Compose Window, defect)

x86
Windows Vista
defect
Not set
critical

Tracking

(Not tracked)

People

(Reporter: emoore, Unassigned)

References

Details

(Keywords: hang, perf)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2pre) Gecko/20100119 Lanikai/3.1a1

I copied the contents of a 7,560KB 7bit ASCII text file and then tried to paste it into a plain text compose message window. It crashed Thunderbird.

I opened the compose message window, selected the message body and pasted the text. It initially did nothing. I clicked on the message body and the window title changed to Write (no subject) Not Responding and the mouse cursor becomes a rotating circle. I waited 5 minutes and it never finished. When I tried to close the compose message window Windows tells me the process is not responding and I had to press the button to kill it.

I can copy and paste that text into a editor such as Notepad, OpenOffice Writer or Vi. OpenOffice Writer caused it to display "not responding" for less than 2 seconds. Notepad never displayed "not responding", it just displayed the rotating circle mouse cursor for about 4 seconds. I saved the Notepad file and checked its size to verify it really pasted the entire buffer since older versions of windows used to limit its file size to about 54KB. 

Several of my email providers support messages of that size. For example, Fastmail supports 10MB messages, AIM 16MB, Gmail 25MB and GMX.com 50MB. 

I was doing this to see if I could duplicate the problems of a user in MozillaZine who reported that Thunderbird 2.0.0.23 under Linux crashed when he moved a 8MB message (that had no attachments) between folders .

This problem occurs with 2.0.0.23, 3.0.1, 20100204 Shredder/3.0.2pre and 3.1 alpha 1

If the built-in editor can't handle somebody pasting that large a block of text it should fail gracefully, it should not crash the application.


Reproducible: Always
Version: unspecified → Trunk
Confirmed with 35MiB test file (CSV) using Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 ID:20100111101938.
Severity: normal → critical
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: hang, perf
If we're getting confirmed crashes, can we get some crash ids please?

http://kb.mozillazine.org/Breakpad
This isn't a crashing issue; Thunderbird merely hangs (and has to be force-quit/terminated/killed). Fixing summary to make that clearer.
Summary: 8MB paste into compose message window crashes Thunderbird → 8MB paste into compose message window hangs Thunderbird indefinitely
Eric, can you reproduce with current trunk?  Does disabling spell check help?
if you can reproduce, a stacktrace or testcase file would be useful.

perhaps similar to bug 531055.
Bug 545613 may be a dupe
I tested with a 9mb logfile - compose and UI were unresponsive for about 45 sec. and then for another minute or so, UI was responsive but cpu very high. then all is well, until ...

I saved it as a draft and tried closed the compose window, got the two different prompts about whether I really want to quit, etc (I forget the exact wording), and after the last prompt thundbird is hung. (this may be a different bug entirely, but I'm attaching stacktrace anyway)

used trunk build  Mozilla/5.0 (Windows NT 6.0; rv:2.0b8pre) Gecko/20101008 Thunderbird/3.3a1pre
I tried entering the exact same 8MB I used before with Thunderbird 3.1.6pre ID:20101010002306

I got "Not responding" in the window title as soon as I clicked on it again. Process Explorer showed it taking 46-51% of the CPU and page faulting (added over a million) like crazy. It took about 4 minutes before it became responsive and showed something in the compose text window. In the interim the rest of Thunderbird was fine. 

I then saved it as a draft in a remote folder on Fastmail.fm's Cyrus IMAP server. That caused the main window for Thunderbird to state it was "Not Responding". That used about 50% of the CPU but didn't appear to create any page faults. I killed the process after 14 minutes since it didn't seem to be making any progress. 

I started Thunderbird again and looked at the draft. It had the entire message body. It look less than 2 minutes to fetch the entire draft (I know it was the entire draft because I compared both the top and bottom page with the original) so its not clear why it took so long to upload it.
The attached stack trace doesn't have enough entries to be useful...

Mark, does Thundebird's compose UI use a <textarea> behind the scenes?  (that's what <xul:textbox> uses.)
(In reply to comment #7)
> Mark, does Thundebird's compose UI use a <textarea> behind the scenes?  (that's
> what <xul:textbox> uses.)

Not sure, I'm not actually sure where to look either. Neil may have a better idea than I do.
Message compose uses a <xul:editor> which is initialised in plain text or HTML mode as appropriate.
(In reply to comment #9)
> Message compose uses a <xul:editor> which is initialised in plain text or HTML
> mode as appropriate.

Bug 240933 might have helped here.  It would be helpful if someone can profile a recent build to see how we perform now...
Tested on Windows 7, w/ release build 7.0.1 and the following test files:

10MB ASCII Text file
40MB ASCII Text file

There was a typical hang of 3-5 seconds; this was more indicative of the clipboard copy process than Mozilla Thunderbird however.
Blocks: 598442
I retested using 12.0.1 with the same 8MB test file. I immediately get "Not responding" in the title. A couple of seconds later the cursor becomes a hourglass. If I click on the compose message page it becomes foggy. I can't select the main Thunderbird window anymore. If I try to close the compose message window I get a popup from Windows telling me the process is not responding, and asking me if I want to kill it. 

Same results with a 15.0a1 daily build (20120504031629).

Does this still happen with a more modest sized test file - one that doesn't hang completely?
And if so, can you capture a profile? https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance

Flags: needinfo?(emoore)

I'm configured to create a HTML message by default. Pasting 400KB of plain text is fine. Pasting 1.5MB of plain text causes the process to be "not responding". Pasting a 6.55 MB image or inserting it via insert -> image works fine.

Pasting 1.5MB of text causes Thunderbird to use about 6% CPU, 380MB, no network, no disk (what it normally uses on my PC when its not talking to the server) and become "not responding" until about 20 seconds later the text is pasted. It briefly becomes normal and then becomes non-responding again.

I didn't bother to try to find what the threshold is. I'm using version 78.10.0. Same problem with 89.0 beta 1.

I'll attach a compose_paste_profile.json file created when I saved the performance profile using 78.10.0. I tried to share it per https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance but I could not find a green publish button on https://profiler.firefox.com/. I also couldn't find the Share Performance Profile panel. There are local profile, update and docs buttons (each color less) in the upper right corner.

Pressing the docs button shows some documentation with a green share button, and color less save as file and docs buttons in the upper right.

Flags: needinfo?(emoore)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: