Thunderbird Shutdown crash/hang due to endless wait loop when no password is entered (OAuth2) | WaitForSingleObjectEx | WaitForSingleObject | _PR_MD_WAIT_CV | _PR_WaitCondVar | PR_WaitCondVar | mozilla::CondVar::Wait | nsEventQueue::GetEvent
Categories
(MailNews Core :: Networking: IMAP, defect)
Tracking
(thunderbird_esr68 wontfix, thunderbird_esr115 wontfix, thunderbird_esr128 wontfix, thunderbird_esr153? fixed, thunderbird128 wontfix, thunderbird136 wontfix)
People
(Reporter: wsmwk, Assigned: maxe)
References
(Blocks 1 open bug)
Details
(6 keywords, Whiteboard: [shutdownhang][waiting on bug 1783573])
Crash Data
Attachments
(1 external file)
+++ This bug was initially created as a clone of Bug #1257058 +++
Unclear what impact the patch in Bug 1257058 had. But three signatures still topcrashes. With very similar, and somewhat odd history graphs. Note, the increase in crash volume over time can I think be attributed to users updating to version 60
| Reporter | ||
Updated•6 years ago
|
| Reporter | ||
Comment 2•6 years ago
|
||
Perhaps we'll be adding shutdownhang | nsThread::Shutdown | nsThreadManager::Shutdown (bug 1526127) as the version 68 equivalent signatures, because the signatures cited so far for this bug are all v60
| Reporter | ||
Comment 3•6 years ago
|
||
https://support.mozilla.org/en-US/questions/1273402 google oauth?
| Reporter | ||
Comment 5•6 years ago
•
|
||
Adding signature from bug 1526127
| Reporter | ||
Comment 6•5 years ago
|
||
For version 78, only remaining signature is shutdownhang | nsThread::Shutdown | nsThreadManager::Shutdown, and still a topcrash.
Steady crash rate for last 6 months despite multiple password prompts being gone (bug 1606711), although that's not a specific cause it might have contributed to user confusion.
Fortunately version 78 is available from Ubuntu repository since some weeks. The update didn't help. TB still crashes on shutdown, see:
Crash ID: bp-8ebffcf3-cc81-4c47-88e1-793c90210320
Comment 8•5 years ago
|
||
(In reply to Ulf Zibis from comment #7)
Fortunately version 78 is available from Ubuntu repository since some weeks. The update didn't help. TB still crashes on shutdown, see:
Crash ID: bp-8ebffcf3-cc81-4c47-88e1-793c90210320
78.7.1 from ubuntu repo shuts down OK for me with no crash. FWIW, home-built daily for me crashes on shutdown at, I would guess, 80% of the time,
but I just started and stopped 78.7.1 at least 6 times with no crash.
But I rarely run the repo verion so maybe it has to be running for a while to crash on shutdown?
| Comment hidden (obsolete) |
Comment 10•5 years ago
|
||
| Reporter | ||
Updated•4 years ago
|
Updated•4 years ago
|
| Reporter | ||
Comment 14•2 years ago
|
||
Frank, with version 115.5.2, do you still see the issue you mention in bug 1798108 ?
Comment 15•2 years ago
|
||
Can't tell. I'm still on version 102.15.1, because 115.x.x has to many other bugs, that are'nt fixed yet.
But heh ... it's easy to replicate on any MacOS:
Set a master password, restart TB, don't enter a password, when asked and quit TB from the menu.
Then try to restart it (it won't, because the process is still running in the background and need to be kill manually via terminal).
| Reporter | ||
Comment 16•2 years ago
|
||
shutdownhang | nsThread::Shutdown | nsThreadManager::Shutdown crash signature is gone after version 91.13.0
But there are still a few user comments about password for other signatures, primarily:
- Bug 1869297 - Shutdown crash due to "Empty Trash on Exit" for inactive account - shutdownhang | mozilla::SpinEventLoopUntil | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads
- Bug 1843744 - Crash in mozilla::dom::workerinternals::RuntimeService::CrashIfHanging shutting down Thunderbird (exit/quit)
| Reporter | ||
Comment 17•2 years ago
|
||
This issue might include signature [@ shutdownhang | mozilla::SpinEventLoopUntil | nsThread::WaitForAllAsynchronousShutdowns | nsThreadManager::ShutdownNonMainThreads ] which is current #1 for beta. Increased significantly since ~124.0b4
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•2 years ago
|
| Reporter | ||
Updated•1 year ago
|
| Reporter | ||
Comment 19•1 year ago
|
||
I had closed the profiler tool in developers, daily build bp-cddec85e-45ee-4029-8400-54cf60250605
Updated•1 year ago
|
Updated•1 year ago
|
Comment 20•1 year ago
•
|
||
I just got this crash while having the "Enter credentials for ttestescu6@gmail.com on imap.gmail.com" window opened and left for more than 5 minutes(while I was working on another screen and on another application) on the latest Daily 144.0a1(20250902104421) with macOS 15.6.1
Here is my crash report: https://crash-stats.mozilla.org/report/index/505975e2-4eeb-48e2-9ca6-5e5630250903#tab-details
| Reporter | ||
Comment 21•11 months ago
|
||
Bug 1783573 was fixed 2025-10-21 build, 146.0a1. I haven't tested nightly, where crash rate is only a couple per week. We need beta 146 to check for a positive impact where the crash rate is at least 40 per week.
And crashes are still seen on nightly, for example build 2025-10-26 bp-259ba90b-ea75-48af-8fa3-0cf960251101.
| Reporter | ||
Comment 22•11 months ago
|
||
I got bp-d061ee60-2205-423b-8847-deddd0251121 with 146.0b2 when attempting to shutdown after failed login because the server name was wrong.
No apparent change in beta crash rate, at least up to 146.0b2. I've commented in Bug 1783573.
Comment 23•7 months ago
•
|
||
Can someone who experience the issue under linux (crash at the shutdown) try the patch
in Bug 1956408 ?
I fixed a thread-race issue at shutdown in the patch there, and the problematic scenario fits
the description here and similar bugs during shutdown.
This is related to IMAP, though. So if you are not using IMAP, the problem may not be solved by the patch there.
TSAN build shows no errors in linux XPCSHELL tests for IMAP using TSAN-binary
https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=e86c0c989038e24f0c050fb76c2c5b9ccbd6c5dc&selectedTaskRun=dteRxg-nTv-boXG4APHXqA.0
Knowledgeable person can extract the TSAN binary for linux and test there.
Of course, other OS versions can be tested.
But TSAN-binary under linux would print stacktrace when there are thread races, etc. if the crash is related
TSAN-related and I would like to see the TSAN messages.
That is why TSAN-binary under linux is a good choice if the problem persists.
OTOH, if the problem disappears with the binary produced in the job mentioned above, that is a goo d sign.
One of the root cause of strange shutdown issue was that IMAP task was NOT
properly woken up if it was sleeping on a lock and TB was shutdown.
It was sleeping and no cleanup could be performed.
Now it is properly woken up as far as TSAN is concerned, and I no longer see strange
message that reports a task was still running at showdown.
TIA
EDIT: shows no errors in linux XPCSHELL tests FOR IMAP (for imap added). There are errors from other modules. The mochitest show so many issues to my disappointment, but I think it is not IMAP module per se.
| Reporter | ||
Comment 25•5 months ago
|
||
A topcrash for this signature for release 149.0/149.0.1, Windows 11 users (who are attempting to update to version 150) is being tracked at Bug 1505660 - Crash in shutdownhang | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads. Details at https://bugzilla.mozilla.org/show_bug.cgi?id=1505660#c67
| Reporter | ||
Comment 26•5 months ago
|
||
A recent datapoint, from v150, bp-722538d7-4f4c-43a2-a393-fad650260506 "I am unable to download update files; although I downloaded the latest files directly from the official website and performed an overwrite installation, the updates still fail to apply—the download remains stuck at 0 bytes. If I close Thunderbird while it is in this state, a crash report is generated; this cycle simply repeats itself."
(In reply to ISHIKAWA, Chiaki from comment #23)
Can someone who experience the issue under linux (crash at the shutdown) try the patch in Bug 1956408 ?
Not tested by anyone as far as I can tell. But it should be possible to trigger - comment 20 and comment 22 are two possible methods.
| Reporter | ||
Comment 27•4 months ago
|
||
Linux Bug 1957882 - Crash in [@ shutdownhang | __syscall_cancel_arch] - may be a duplicate.
(In reply to Wayne Mery (:wsmwk) from comment #25)
A topcrash for this signature for release 149.0/149.0.1, Windows 11 users (who are attempting to update to version 150) is being tracked at Bug 1505660 - Crash in shutdownhang | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads. Details at https://bugzilla.mozilla.org/show_bug.cgi?id=1505660#c67
That spike in crashes for Thunderbird users on Windows went away about May 13.
| Assignee | ||
Comment 28•3 months ago
|
||
Updated•3 months ago
|
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 29•3 months ago
|
||
Nowadays, this strongly appears to be just OAuth2, other root causes may have been fixed before.
| Assignee | ||
Updated•3 months ago
|
Updated•3 months ago
|
Comment 30•3 months ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/5f5fa03eeb37
Prevent shutdown hangs during IMAP OAuth authentication. r=jtracey
Updated•3 months ago
|
Updated•2 months ago
|
| Reporter | ||
Comment 31•2 months ago
|
||
Perhaps consider uplift to 153 after this rides the train?
| Reporter | ||
Comment 32•1 month ago
|
||
Beta's historical crash rate is high enough that we should be able to detect whether this v155 patch results in an improvement. So far there are no v155 beta crashes.
Seeing v155 crashes, there does not appear to be a reduction in release crash rate]
Comment 33•1 month ago
|
||
For the record: 153 ESR is already fixed since the changes here
https://hg-edge.mozilla.org/comm-central/rev/5f5fa03eeb37#l1.12
got merged into:
https://hg-edge.mozilla.org/releases/comm-esr153/rev/3a65b6886639fece0bb06d001def123229feedeb#l1.61
together with the changes from bug 2064058 (c-c code: https://hg-edge.mozilla.org/comm-central/rev/82e299547233#l1.61).
Comment 34•1 month ago
•
|
||
Plus, there is also a rebase error. This code was explicitly removed:
https://hg-edge.mozilla.org/comm-central/rev/5f5fa03eeb37#l1.43
But still present in 153:
https://hg-edge.mozilla.org/releases/comm-esr153/rev/3a65b6886639fece0bb06d001def123229feedeb#l1.92
And the test got lost.
| Assignee | ||
Comment 35•1 month ago
|
||
(In reply to Yury from comment #34)
Plus, there is also a rebase error. This code was explicitly removed:
https://hg-edge.mozilla.org/comm-central/rev/5f5fa03eeb37#l1.43
But still present in 153:
https://hg-edge.mozilla.org/releases/comm-esr153/rev/3a65b6886639fece0bb06d001def123229feedeb#l1.92And the test got lost.
I am not very familiar with how uplifts work and I don't think I can do anything meaningful here.
Comment 36•1 month ago
|
||
Well, there is now a remnant hunk on ESR 153:
nsCOMPtr<nsIRunnable> shutdownNotify = NS_NewRunnableFunction(
"GetXOAuth2StringShutdownNotifier", [self = RefPtr(this)]() {
mozilla::RunOnShutdown([self]() {
// Notify anyone waiting that we're done.
self->mMonitor.Notify();
});
});
rv = NS_DispatchToMainThread(shutdownNotify.forget());
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
that was removed in your patch here.
| Assignee | ||
Comment 37•1 month ago
|
||
(In reply to Yury from comment #36)
Well, there is now a remnant hunk on ESR 153:
nsCOMPtr<nsIRunnable> shutdownNotify = NS_NewRunnableFunction( "GetXOAuth2StringShutdownNotifier", [self = RefPtr(this)]() { mozilla::RunOnShutdown([self]() { // Notify anyone waiting that we're done. self->mMonitor.Notify(); }); }); rv = NS_DispatchToMainThread(shutdownNotify.forget()); if (NS_WARN_IF(NS_FAILED(rv))) { return; }that was removed in your patch here.
Isn't this the responsibility of release management? I do not think it should stay there, but I am not going to compile it to be certain whether it is a NOOP or actually harmful.
| Assignee | ||
Comment 38•1 month ago
|
||
Hi Corey, can you take a look at this? It should either be fully uplifted or left-out, I prefer the former.
Comment 39•1 month ago
|
||
We shouldn't have picked this up in esr153 without consulting you.
We're going to back out the fix for bug 2064058 and request esr153 versions for this fix and bug 2064058 fix, assuming changes are needed, and it seems both fixes are needed for uplift.
Comment 40•1 month ago
|
||
Comment on attachment 9610342 [details]
Bug 1524247 - Prevent shutdown hangs during IMAP OAuth authentication. r=#thunderbird-back-end-reviewers
[Triage Comment]
Approved for esr153
Comment 41•1 month ago
|
||
| bugherder uplift | ||
Thunderbird 153.3.0esr:
https://hg.mozilla.org/releases/comm-esr153/rev/3ffcea44ad88
| Reporter | ||
Comment 42•20 days ago
|
||
Looking good. The crashes that this patch didn't get, have been caught by Bug 2028760 - For login with a IMAP Gmail account using the Accounts Hub wizard: Crash in [@ shutdownhang | mozilla::SpinEventLoopUntil<T> | nsThread::WaitForAllAsynchronousShutdowns | nsThreadManager::ShutdownNonMainThreads]
Description
•