"Sending of message failed" dialog needs 100% of one CPU as long as it is open.

Bug #1012858 reported by PeterPall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
Fix Released
Medium
thunderbird (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Priority: Low
How to reproduce:
 - Attach a large file to a message to make the sending process need enough time for the third step.
 - press the "send" button
 - Interrupt the internet connection before the sending of the message can be completed
Problem:
 The Dialog that pops up now telling the message could not be sent creates 100% CPU load for one CPU.
What was to be expected:
 The dialog pops up and does not need any CPU power until a button is clicked.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: thunderbird 14.0~b1+build2-0ubuntu1
ProcVersionSignature: Ubuntu 3.4.0-5.11-generic 3.4.0
Uname: Linux 3.4.0-5-generic x86_64
ApportVersion: 2.2.2-0ubuntu2
Architecture: amd64
Date: Wed Jun 13 22:49:39 2012
EcryptfsInUse: Yes
ExecutablePath: /usr/lib/thunderbird/thunderbird-bin
LocalLibraries: /<email address hidden>/lib/tray_x86_64-gcc3.so
SourcePackage: thunderbird
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Marek-nos (marek-nos) wrote :

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120312181643

Steps to reproduce:

1) Set SMTP server to one that timeout, particularly my network doesn't allow pings or more specific limitation. The SMTP definitely works outside this network.
2) Try to send an email

Actual results:

3) Message that connection to SMTP timeouted
4) CPU usage is raised to 50% (one core) until the message is clicked

Expected results:

3) Message that connection to SMTP timeouted
4) CPU usage is standard

Revision history for this message
In , hashemmasoud (wraithlike) wrote :

(In reply to Marek Nos from comment #0)
Found 2 similar bugs: bug 311663 & bug 189738.

Revision history for this message
In , Ludovic-mozilla (ludovic-mozilla) wrote :

Marek can you follow the instructions at https://developer.mozilla.org/en/How_to_get_a_stacktrace_with_WinDbg and get us a stack trace of your issue ?

Revision history for this message
In , Marek-nos (marek-nos) wrote :

Created attachment 613600
stacktrace

Running this tool for the first time. Excuse any incompleteness. This is what I got.

Revision history for this message
In , Acelists (acelists) wrote :

Is that SMTP server public so that you could tell us the host name? We do NOT need any username/password. We can try to connect to it and wait for the timeout.

Revision history for this message
In , Marek-nos (marek-nos) wrote :

smtp.centrum.cz:25

Revision history for this message
In , Marek-nos (marek-nos) wrote :

note: CPU usage is raised right after Thunderbird starts connecting to SMTP server, not after timeout message is shown.

Revision history for this message
In , Dbienvenu (dbienvenu) wrote :

nothing useful in that stack trace, unfortunately.

Revision history for this message
In , Acelists (acelists) wrote :

I got the raised CPU usage just after pressing Send, but I assume that is the spinning progressbar about "Connected to server XXX". It was just about 25% of a 3Ghz core.

I could not get the timeout from the server. I connected to it but did not provide any password. I let TB hang in the dialog requesting the password. After several minutes I gave a wrong password. The dialog closed and the send failed. But I didn't get any high CPU usage.

What should I try next?

Revision history for this message
In , Marek-nos (marek-nos) wrote :

Created attachment 614146
Steps to reproduce

To be correct it took 50% on my machine. Now I checked per core and it took more or less equally around 50% from each core. So maybe its natural load. But the load is there since I clicked send [1], then timeout message appeared. Load was still there until I clicked either cancel sending [2] or OK on timeout message [3] which in turn cancels sending. But when cancel sending [2] is clicked then timeout message is still there, but load drops. So it's definitely not caused by timeout message, but the connecting part, and it takes load (quite high) even timeout message is there. See attached image for more explanation on steps.

From user perspective, this SMTP is supposed to be available and should require log in. Don't know why it timeouts for me or if the error is somewhere else. Try at different networks with same result. It might be related to this high load.

Secure connection is none, authentication is set to password.

C:\Users\Marek Nos>telnet smtp.centrum.cz 25
Connecting To smtp.centrum.cz...Could not open connection to the host, on port 25: Connect failed

It does work for you?

Revision history for this message
In , Acelists (acelists) wrote :

Yes, I can connect to the server via telnet. Also TB log file shows it talked to the server.

Maybe that is the problem, that you do not even connect to the server and get the timeout. I used a nonexistent server now. I got timeout immediately and the progressbar still spinning.
Also notice there is another small progress bar in the bottom right corner of the compose window. So all those animations could be quite heavy, maybe they are redrawing too frequently. I can confirm this part of the bug.

Just for reference, what is your CPU?

Revision history for this message
In , Marek-nos (marek-nos) wrote :

Intel Core2 duo U9400, 1.4 ghz

Revision history for this message
PeterPall (peterpall) wrote :
Revision history for this message
In , PeterPall (peterpall) wrote :

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0
Build ID: 20120613200924

Steps to reproduce:

 - Attach a large file to a message to make the sending process need enough time for the third step.
 - press the "send" button
 - Interrupt the internet connection before the sending of the message can be completed

Actual results:

The Dialog that pops up now telling the message could not be sent creates 100% CPU load for one CPU.
The same thing seems to happen on mac computers with thunderbird version 16, too, even if I currently have none available to double-check.

Expected results:

The dialog pops up and does not need any CPU power until a button is pressed.

Detailled infos about my system can be found at:
http://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/1012858

Changed in thunderbird:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
In , Acelists (acelists) wrote :

*** Bug 764701 has been marked as a duplicate of this bug. ***

PeterPall (peterpall)
no longer affects: thunderbird
Revision history for this message
Micah Gersten (micahg) wrote :

Thanks for upstreaming this, marking it triaged.

Changed in thunderbird (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in thunderbird:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Acelists (acelists) wrote :

I'll see if there aren't too many updates of the progress bar in http://mxr.mozilla.org/comm-central/source/mailnews/compose/content/sendProgress.js.

Revision history for this message
In , Vseerror (vseerror) wrote :
Revision history for this message
In , Vseerror (vseerror) wrote :

(In reply to :aceman from comment #13)
> I'll see if there aren't too many updates of the progress bar in
> http://mxr.mozilla.org/comm-central/source/mailnews/compose/content/
> sendProgress.js.

aceman, what were you able to determine?

Perhaps this is similar to what I'm seeing as high CPU with progress meter during stalled imap syncing, and most of the cpu is in Paint http://people.mozilla.com/~bgirard/cleopatra/?1354620938776#report=6210e70a7a1f640f9bcbb57e9af8c95997b58917

Revision history for this message
In , Acelists (acelists) wrote :

My findings are in bug 791535.

Revision history for this message
In , Rsx11m-pub (rsx11m-pub) wrote :

*** Bug 875298 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Rsx11m-pub (rsx11m-pub) wrote :

FWIW, I see the CPU spike on Linux but can't reproduce on Windows 7...

Revision history for this message
In , dvo (mueller8) wrote :

This bug still exists. Until the connection timeouts, I get 12-13% CPU load in my i5 macbook.

Revision history for this message
In , Ludovic-mozilla (ludovic-mozilla) wrote :

Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.

Revision history for this message
In , Vseerror (vseerror) wrote :

David, thanks for reporting your results. Can you retest please and tell us if this reproduces with a curent beta?

If it reproduces, please run the performance profiler:
1. You must be using Thunderbird 68 or newer - betas from https://www.thunderbird.net/en-US/channel/ or current nightly build from https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central/
2. Install profiler add-on into thunderbird 68 (or newer https://www.thunderbird.net/en-US/channel/ ) - get the add-on file from https://github.com/firefox-devtools/Gecko-Profiler-Addon/blob/master/gecko_profiler.xpi?raw=true and in Tools > add-ons click the gear to install add-on from file
3. Follow instructions at https://profiler.firefox.com/ (videos BASED ON FIREFOX at https://profiler.firefox.com/docs/#/./videos-intro )
4. Create a profiler URL and post it here.

Revision history for this message
In , PeterPall (peterpall) wrote :

- Updated my thunderbird to the newest Version (Thunderbird 68/Ubuntu)
- Set my "saved messages" folder to an imap one
- turned my Internet connection off
- Pressed Ctrl+S
- The progressbar went forth and back using 100% of one CPU
- Re-enabled my internet. The progressbar still goes haywire using 100% of one CPU as the message dialogue telling the message could not be saved is still active.
- Started the profiler
The profiler result should be downloadable here: https://perfht.ml/30UuI1F

Revision history for this message
In , Acelists (acelists) wrote :

Do I read the profile correctly that most of the time (80%) is used in the poll() function in libc.so.6 (Linux system C standard library)? That would seem to confirm the theory really the drawing/synchronizing on the screen of the progress bar.
There is also a similar bug specifically for Linux at bug 854093.

Is the disabling of network needed to reproduce the bug or is it only to get the progressbar visible for a extended amount of time to capture the profile?

Revision history for this message
In , Nl0 (nl0) wrote :

(In reply to Wayne Mery (:wsmwk) from comment #21)
> David, thanks for reporting your results. Can you retest please and tell us if this reproduces with a curent beta?

Wayne, as I wrote several times over several years at several places in this bug tracker:
The problem is easily reproducible, also on Linux, with any TB version (meanwhile including 78.4.2.).
Why is there apparently not a single TB developer trying this himself?

Again: just enter an IP address such as 1.2.3.4 as the server name/address.
Then try fetching emails. Until this timeouts,
the progress bar moves forth and back with significant CPU load (10% of one core on my current Linux machine).

Revision history for this message
In , Bernie Innocenti (codewiz) wrote :

I have experienced this bug for several years on multiple Linux machines.

It just happened to me today on Thunderbird 89.0b1 (beta): sending a message over SMTP hung for several minutes while the progressbar keeps on scanning left and right, eating ~60% CPU on a fast machine.

Revision history for this message
In , Bernie Innocenti (codewiz) wrote :

Created attachment 9218295
Screenshot of Thunderbird being hung while connecting to SMTP server

Revision history for this message
In , Vseerror (vseerror) wrote :

CPU usage goes away if you do View > toolbar > status bar to remove the status bar?

Revision history for this message
In , rns (remotenonsense) wrote :

Created attachment 9262260
Bug 742697 - Emit stop sending event before prompt failure message to dismiss progress bar. r=mkmelin

Revision history for this message
In , rns (remotenonsense) wrote :

The patch stops progress bar on SMTP connection timeout or other errors. For the progress bar during copying operation (usually through IMAP), I don't know how to fix it. Maybe there are other bugs tracking it.

Revision history for this message
In , Pulsebot (pulsebot) wrote :

Pushed by <email address hidden>:
https://hg.mozilla.org/comm-central/rev/e0962bae9283
Emit stop sending event before prompt failure message to dismiss progress bar. r=mkmelin

Changed in thunderbird:
status: Confirmed → Fix Released
Revision history for this message
In , K-it-m (k-it-m) wrote :

Somewhat nice that after nearly 10 years something has been done about this.

Yet I strongly suspect that this "cures" just one of the symptoms of a deeper issue,
namely some busy waiting whenever a network connection is a attempted but the network or the addressed server is (temporarily) unavailable.

See also bug 1107251, bug 683651, bug 562977, and likely several more.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.