Bug: TB 91 ESR continual high CPU usage - EAGAIN (Resource temporarily unavailable) - gone in 102
Status: RESOLVED
Priority: --
Resolution: WORKSFORME
Created: 2022-05-31 23:30:29+00:00
Resolved: 2022-08-09 06:15:07+00:00

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

Steps to reproduce:

Updated to Thunderbird 91 on openSUSE Leap 15.4 (current 91.9.0). I have always left Thunderbird running while my computer is on (always, have done so for roughly two decades).

I noticed my laptop fan was on much more than normal, so I checked with top and thunderbird-bin was always the top CPU user. 2-6% of CPU continually. (when thunderbird is just at idle, not mail-check, no editing of new message). By comparison, Firefox uses 0.00 to 0.33% CPU at idle -- which is normal.


Actual results:

Thunderbird continually uses between 2-6% CPU (i7 2.7GHz).

Running strace on the parent process shows thunderbird is continually stuck on `recvmsg` where it results in the error "recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)" over and over again. It appears something is misbehaving in one thread either blocking or deadlocked looking for a resource that it can't find.

For example, the last 4M of a 5M strace is all similar to:

```none
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=28, events=POLLIN}, {fd=147, events=POLLIN}], 5, 0) = 1 ([{fd=28, revents=POLLIN}])
read(28, "\372", 1)                     = 1
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=28, events=POLLIN}, {fd=147, events=POLLIN}], 5, 0) = 0 (Timeout)
write(29, "\372", 1)                    = 1
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=28, events=POLLIN}, {fd=147, events=POLLIN}], 5, 0) = 1 ([{fd=28, revents=POLLIN}])
read(28, "\372", 1)                     = 1
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=28, events=POLLIN}, {fd=147, events=POLLIN}], 5, 0) = 0 (Timeout)
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(4, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=10, events=POLLIN}, {fd=28, events=POLLIN}, {fd=147, events=POLLIN}], 5, 0) = 0 (Timeout)
```



Expected results:

Thunderbird should not have consumed 2-6% of the CPU continually, instead it should idle between 0.00 and 0.33% as Firefox does.

Let me know what information you want to see and whether I need to submit the tbird strace output as a private attachment (not sure if it captures any login info in the time period)