Closed Bug 1768344 Opened 3 years ago Closed 1 year ago

Removing all saved passwords & attempting to shut down causes a hang and crash [@ shutdownhang | kernelbase.dll | mozilla::TaskControlleMr::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] mozilla::SpinEventLoopUntil

Categories

(Thunderbird :: General, defect)

Thunderbird 101
x86_64
Windows 10
defect

Tracking

(thunderbird_esr115+ fixed, thunderbird120 verified)

VERIFIED FIXED
121 Branch
Tracking Status
thunderbird_esr115 + fixed
thunderbird120 --- verified

People

(Reporter: thee.chicago.wolf, Assigned: mkmelin)

References

Details

(5 keywords, Whiteboard: [TM 115.5.2])

Crash Data

Attachments

(4 files, 1 obsolete file)

This happened to me on my work PC the other day and repro'ed on my home PC as well.

STR with 101.0b1 (and now updated for 104.0b2):

  1. Go to Tools > Settings > Privacy & Security > Passwords > Saved Passwords
  2. Highlight all of your saved passwords and click Remove All (assuming here that you know your password(s) and can re-enter them again later)
  3. Close the Saved Logins windows. Close the Settings tab
  4. File > Exit to shut down Thunderbird
  5. Open Task Manager to verify that one instance of TB is still not yet shut down

Expected Result:

  1. No hang that leads to an eventual crash

Actual Result:

  1. Hang that leads to an eventual crash

Crash: https://crash-stats.mozilla.org/report/index/b73ae5d3-b38d-48fd-8286-9b14d0220507

Antony, does this crash for you on Mac?

Crash Signature: [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::Shutdown ]
Flags: needinfo?(acdp)
Keywords: crash
See Also: → 1749142

TCW, how reproducible is this for you?

I was not able to reproduce on Mac nor Windows with 101.0b2 (but I would very much love to)

Flags: needinfo?(thee.chicago.wolf)

(In reply to Wayne Mery (:wsmwk) from comment #2)

TCW, how reproducible is this for you?

I was not able to reproduce on Mac nor Windows with 101.0b2 (but I would very much love to)

Apparently not reproducible on 101.b2. I just tried and TB just repeatedly bombarded me with login window prompts a second after clearing out passwords. I didn't see that behavior in 101.0b1. So for now and as of 101.b2, seems it's WFM.

Odd though that that same thing I did on my office PC and home PC caused the shutdown crash. Are you able to at least verify that there are two crashes on the same day? Those would have been mine.

Flags: needinfo?(thee.chicago.wolf)

This was the crash that happened on my work PC: https://crash-stats.mozilla.org/report/index/b73ae5d3-b38d-48fd-8286-9b14d0220507 same as my home PC.

(In reply to Wayne Mery (:wsmwk) from comment #1)

Antony, does this crash for you on Mac?

Not seen any evidence and I do edit and change PWs a few times...

Flags: needinfo?(acdp)

Robert can you reproduce using the steps in comment 0 on Windows ?

Severity: -- → S2
Flags: needinfo?(Robert_Hartmann)
Summary: Removing some saved password and attempting to shut down causes a hang and crash → Removing saved password and attempting to shut down causes a hang and crash in Thunderbird
Keywords: testcase
Whiteboard: [has str]

(In reply to Wayne Mery (:wsmwk) from comment #6)

Robert can you reproduce using the steps in comment 0 on Windows ?

Walt, can you reproduce a crash with steps in comment 0?

Flags: needinfo?(Robert_Hartmann) → needinfo?(wls220spring)

(In reply to Wayne Mery (:wsmwk) from comment #6)

Robert can you reproduce using the steps in comment 0 on Windows ?

Hi, I cannot reproduce the crash on Windows 10 (64bit) using TB 91.11.0 (64-Bit)
and I cannot reproduce the crash using TB 102.0 (64-Bit) on Windows 10 (64bit)

No, I cannot reproduce using 91.11.0 on Fedora Linux.

Flags: needinfo?(wls220spring)

I cannot reproduce the crash on Windows 10 (64 bit) using

  • TB Daily 104.0a1 (2022-07-02) (64-bit)
  • TB beta 103.0b2 (64-Bit)
    Best regards

Maybe bug 1629669 will help

Severity: S2 → S3
Depends on: 1629669

(In reply to Wayne Mery (:wsmwk) from comment #11)

Maybe bug 1629669 will help

Some similarities but not 100% 1:1. Could be caused by different things.

So I just tried to repro using 104.0b2 and my STR. I got this crash: https://crash-stats.mozilla.org/report/index/e0dca0f9-14f7-492e-b507-4e4e40220802

I am going to modify my STR a tad to reflect what I just did to repro.

Summary: Removing saved password and attempting to shut down causes a hang and crash in Thunderbird → Removing saved password and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads
Summary: Removing saved password and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads → Removing saved password and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]
Summary: Removing saved password and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] → Removing all saved passwords and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]

I'm sure it probably won't make much difference but when I repro'ed the issue this time, it took TB a full 2m 45s from the time I did File > Exit until it disappeared from the screen. As before, one TB process was still running.

If I need to repro for you guys again, will I likely have any luck doing a perf profile? I'm guessing I will crash out before I can capture anything useful. But I can try if you want.

The STR didn't cause a crash for me on linux.

(In reply to Magnus Melin [:mkmelin] from comment #15)

The STR didn't cause a crash for me on linux.

Can't be my profile since I started from complete scratch early in Feb this year. I just tried to repro and TB is sitting in a state waiting to crash. While it is doing so, I tried to grab a perf profile for 5 seconds. This is it: https://share.firefox.dev/3Shqwo1

And when I blew away all the passwords to repro, I had Error Console open but nothing showed up.

Once again I was able to easily repro. Here's the crash: https://crash-stats.mozilla.org/report/index/be460cf3-c7d2-450f-87b3-9a9530220803

Walt, can you reproduce this on Windows? And Linux?

Flags: needinfo?(wls220spring)

(In reply to Wayne Mery (:wsmwk) from comment #18)

Walt, can you reproduce this on Windows? And Linux?

I can not reproduce using Thunderbird 102.1.1 on Windows 10, or Fedora 35 Linux.

On Windows, I only had passwords for my POP3 account, and it's SMTP server.
Linux had those and passwords for my 4 IMAP accounts and my AIOE news account.

Flags: needinfo?(wls220spring)

(In reply to WaltS48 [:walts48] from comment #19)

(In reply to Wayne Mery (:wsmwk) from comment #18)

Walt, can you reproduce this on Windows? And Linux?

I can not reproduce using Thunderbird 102.1.1 on Windows 10, or Fedora 35 Linux.

On Windows, I only had passwords for my POP3 account, and it's SMTP server.
Linux had those and passwords for my 4 IMAP accounts and my AIOE news account.

So I am wondering how the heck I can repro with 100% ease and everyone else cannot. Could it be a setting I have turned on/off from the Settings menu? I'm curious if the fix in bug 1629669 will make it into 104.0b3 or b4? I can test again if it does.

This is how we look for 104.0b3: https://crash-stats.mozilla.org/report/index/b8f82bcb-876d-4398-9b27-05d510220810

Shows a slight signature change for 104.0b3. Only thing that changed between then and now is I am running 19045.1889 from yesterday's Patch Tuesday.

Summary: Removing all saved passwords and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] → Removing all saved passwords and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | kernelbase.dll | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]

Well, I had high hopes for 104.0b4 but here is another crash I just repro'ed: https://crash-stats.mozilla.org/report/index/576cb0b4-b0da-4008-86e2-f2ac30220816

This is how we're looking for 105.0b1: https://crash-stats.mozilla.org/report/index/7ddc0d68-1b08-4731-82c0-57af60220825

Slight change between:
OLD: toolkit/xre/nsAppRunner.cpp:2060 > NEW: toolkit/xre/nsAppRunner.cpp:2069
OLD: mfbt/UniquePtr.h:275 > NEW: mfbt/UniquePtr.h:271
OLD: toolkit/xre/nsAppRunner.cpp:5914 > NEW: toolkit/xre/nsAppRunner.cpp:5940
OLD: toolkit/xre/nsAppRunner.cpp:5949 > NEW: toolkit/xre/nsAppRunner.cpp:5975
OLD: mail/app/nsMailApp.cpp:368 > NEW: mail/app/nsMailApp.cpp:389

So I am starting to suspect fully the password manager has some kind of bug because today something new happened. I woke my home PC from sleep and TB presented me with the username/password window as if it had forgotten them. Instead of entering the username and password and then proceeding to the "Allow TB to manage..." button, I simply closed the window using the [X] close button. I did a File > Exit action and TB went into a state of Not Responding to input. Task Manager showed it was still running but thinking about something. Eventually, it crashed: https://crash-stats.mozilla.org/report/index/9b3f9cac-4ab5-44c3-9060-9c9950220901

Signature is a bit different [@ shutdownhang | ZwWaitForAlertByThreadId | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]

I am not able to reproduce this on Windows 10 using daily. But I am hopeful others can.

Can anyone else reproduce?

(In reply to Wayne Mery (:wsmwk) from comment #25)

I am not able to reproduce this on Windows 10 using daily. But I am hopeful others can.

Can anyone else reproduce?

There's got to be something I have set on my instances of TB that allows me to repro with such ease.

This is how we're looking for 106.0b1: https://crash-stats.mozilla.org/report/index/41ba1bb4-6f87-4a48-adf4-21fd80220920

Signature has changed it seems: [@ shutdownhang | mozilla::OffTheBooksCondVar::Wait ]

Sadly I cannot add it to the bug title as it's now too long =\ Shall I open a new bug?

Bug 1790983 references this signature.

And this is with 106.0b5: https://crash-stats.mozilla.org/report/index/c0f48712-ffb1-4abe-987c-bf3990221011

Same @ shutdownhang | mozilla::OffTheBooksCondVar::Wait signature

This also looks like a duplicate of bug 1505660. The signature changes I'm doing in bug 1794587 will make the signatures in these bugs all the same.

Depends on: 1505660

The hang time, at least for me using my STR, has gotten progressively longer since 106. And with 107 it took around 4-5 minutes after a File > Exit action before TB finally crashed.

This is how we're looking for 107.0b1 build2: https://crash-stats.mozilla.org/report/index/09215680-e37b-454f-ba7d-165170221018
Still the same sig as in comment 26.

The only difference I see now is:

106.0b5
12 xul.dll XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) toolkit/xre/nsAppRunner.cpp:5934 cfi
13 xul.dll XRE_main(int, char**, mozilla::BootstrapConfig const&) toolkit/xre/nsAppRunner.cpp:5969 cfi

107.0b1
12 xul.dll XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&) toolkit/xre/nsAppRunner.cpp:5937 cfi
13 xul.dll XRE_main(int, char**, mozilla::BootstrapConfig const&) toolkit/xre/nsAppRunner.cpp:5972 cfi

I got excited for a moment that this may have gotten fixed in 107.0b4 as I had removed two saved passwords (of four) from PW manager but it was a red herring. Took 4-5 minutes to eventually shut down and finally crash: https://crash-stats.mozilla.org/report/index/5184cdcd-5c31-4da9-800b-dee040221110

Signature seems a bit different though.

Summary: Removing all saved passwords and attempting to shut down causes a hang and crash in Thunderbird [@ shutdownhang | kernelbase.dll | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] → Removing all saved passwords & attempting to shut down causes a hang and crash [@ shutdownhang | kernelbase.dll | mozilla::TaskControlleMr::GetRunnableForMTTask | nsThread::Shutdown | nsThreadanager::ShutdownNonMainThreads ] mozilla::SpinEventLoopUntil

Yes, like bug 1790983, as of October 25 the signature will have changed. Thanks for checking it.

Crash Signature: [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::Shutdown ] → [@ shutdownhang | mozilla::TaskController::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::Shutdown ] [@ shutdownhang | mozilla::SpinEventLoopUntil | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]

Just tested with the 108.0b1 build. Took around 4 minutes to crash but eventually did: https://crash-stats.mozilla.org/report/index/7af9cf9f-db02-4c4b-a145-6857f0221115

For me, I don't remember removing any saved passwords when my crash happened.

Just tested with the 109.0b1 build. Took around 4 minutes to crash but eventually did: https://crash-stats.mozilla.org/report/index/948e4027-ab0b-4c83-93a4-0ef770221214

Could you provide some info on the following queries:

If you restart Windows OS in 'Safe mode with Networking' and start Thunderbird as normal, then do usual remove password and exit test, do you stll get same problem hang/crash?

In the 'profile name' folder, how many 'prefs-n.js' files do you see ? (Where 'n' is a number)

If you put Thunderbird into 'Offline' mode first, then remove passwords and exit TB, do you get same result ?

Flags: needinfo?(thee.chicago.wolf)

(In reply to Anje from comment #37)

Could you provide some info on the following queries:

If you restart Windows OS in 'Safe mode with Networking' and start Thunderbird as normal, then do usual remove password and exit test, do you stll get same problem hang/crash?

Yes: https://crash-stats.mozilla.org/report/index/7a7bb16f-fb35-48f9-992c-28a780221215

In the 'profile name' folder, how many 'prefs-n.js' files do you see ? (Where 'n' is a number)

There's only one prefs.js file.

If you put Thunderbird into 'Offline' mode first, then remove passwords and exit TB, do you get same result ?

Nope. TB shuts down instantly. So what does that tell us?

Flags: needinfo?(thee.chicago.wolf)

And though I doubt it would have any clues in it, I had error console running while in a state of TB being stuck shutting down and this is what it captured:

10:36:24.370 mailnews.smtp:
error { target: TCPSocket, isTrusted: true, name: "NetworkTimeoutError", message: "Network", errorCode: 2152398862, srcElement: TCPSocket, currentTarget: TCPSocket, eventPhase: 2, bubbles: false, cancelable: false, … }
SmtpClient.jsm:438:17
_onError resource:///modules/SmtpClient.jsm:438
goQuitApplication chrome://global/content/globalOverlay.js:96
oncommand chrome://messenger/content/messenger.xhtml:1

10:36:43.910
<Provider> does not support changing store on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions. react-redux.js:881:13
Redux 3
React 13
goQuitApplication chrome://global/content/globalOverlay.js:96
oncommand chrome://messenger/content/messenger.xhtml:1

Worth noting that blocking Bug 1505660 is a topcrash for Thunderbird 102.6.1, ranking #2, and ranks #1 for 109.0b4.

shutdownhang | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads
application

Severity: S3 → S2

So here's another possible clue it might be password manager or OAuth2 related. Today was my last day of work and promptly at 5PM they killed my email account access. Upon arriving home and starting TB, it of course complained that it couldn't log in. The incessant password/OAuth2 prompt kept coming up until I was able to go to Account > Server Settings > and uncheck all options there as well as disabling my calendar.

Until I did so, I kept getting barraged with the incessant password/OAuth2 prompt that wasn't able to be dismissed. As such I crashed twice: https://crash-stats.mozilla.org/report/index/b75cb7cf-7338-4f26-83cb-f68bd0230208
https://crash-stats.mozilla.org/report/index/6fafbe50-b243-49ef-93a8-b66a10230208

(In reply to Arthur K. (he/him) from comment #42)

So here's another possible clue it might be password manager or OAuth2 related.

Very possible.

I just crashed nightly bp-900ad218-a365-4f1b-b64a-2724e0230707 during a short startup that was needed to get an update. And password prompts were happening.

See Also: → 1524247

For 115.0, this is #1 crash. For example Bp-4a193911-3e27-4bd5-8f07-a8b360230714

Flags: needinfo?(m_kato)

Gecko thread is going to shut down. But IMAP thread doesn't finish since OAuth2's monitor isn't signal.

  • nsImapProtocol::AuthLogin should return error immediately if shutdown phase is AppShutdown or something.
  • Use RunOnShutdown or shutdown observer to signal OAuth2's monitor.
  • (optional) GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. It can return error. If error, this lock occurs.
Flags: needinfo?(m_kato)

This is activity after removing all saved PWs: https://share.firefox.dev/458JLWb
(In reply to Wayne Mery (:wsmwk) from comment #43)

(In reply to Arthur K. (he/him) from comment #42)

So here's another possible clue it might be password manager or OAuth2 related.

Very possible.

I just crashed nightly bp-900ad218-a365-4f1b-b64a-2724e0230707 during a short startup that was needed to get an update. And password prompts were happening.

I tested this with 115.1.0 RC and it still crashed but took well close to 5 minutes before crash handler showed up: https://crash-stats.mozilla.org/report/index/a42f3508-e568-4764-bf68-49a600230730

Here's hoping bug 1788599 will help out here. If we do spin a 115.1.1 with bug 1788599 in it, I'll try and remember to come back here and test again.

(In reply to Arthur K. (he/him) from comment #46)

Here's hoping bug 1788599 will help out here. If we do spin a 115.1.1 with bug 1788599 in it, I'll try and remember to come back here and test again.

1788599 may help with the amount of time. But I would not expect it to help with the crash.

Arthur, do you use a smartcard?

Flags: needinfo?(thee.chicago.wolf)

(I wonder if Thunderbird has a third party pkcs#11 module loaded, which might not release some resources on shutdown, this idea is just a shot in the wild.)

(In reply to Kai Engert (:KaiE:) from comment #48)

Arthur, do you use a smartcard?

I do not.

Flags: needinfo?(thee.chicago.wolf)

(In reply to Wayne Mery (:wsmwk) from comment #47)

(In reply to Arthur K. (he/him) from comment #46)

Here's hoping bug 1788599 will help out here. If we do spin a 115.1.1 with bug 1788599 in it, I'll try and remember to come back here and test again.

1788599 (115.1.0) may help with the amount of time. But I would not expect it to help with the crash.

Better?

Flags: needinfo?(thee.chicago.wolf)

Nope. And when it crashes I can't generate a Crash Report. This was on Portable 115.3.1. Waiting on OWL plugin to be updated against 115.3.2 (as it currently doesn't work).

Flags: needinfo?(thee.chicago.wolf)

(In reply to Wayne Mery (:wsmwk) from comment #51)

(In reply to Wayne Mery (:wsmwk) from comment #47)

(In reply to Arthur K. (he/him) from comment #46)

Here's hoping bug 1788599 will help out here. If we do spin a 115.1.1 with bug 1788599 in it, I'll try and remember to come back here and test again.

1788599 (115.1.0) may help with the amount of time. But I would not expect it to help with the crash.

Better?

I was able to cause a crash and get a crash report using 115.4.1: https://crash-stats.mozilla.org/report/index/d5c2439d-a6f3-4541-ab87-ce9f30231026

I was able to cause a crash and get a crash report using 115.4.1: https://crash-stats.mozilla.org/report/index/d5c2439d-a6f3-4541-ab87-ce9f30231026

definitely matches to this bug.

Crash rate for this signature is significantly higher for version 115.

But there may be other reasons for it:

Flags: needinfo?(mkmelin+mozilla)

(In reply to Wayne Mery (:wsmwk) from comment #54)

Created attachment 9360437 [details]
Screenshot 2023-10-26 at 10.51.24 AM.png

I was able to cause a crash and get a crash report using 115.4.1: https://crash-stats.mozilla.org/report/index/d5c2439d-a6f3-4541-ab87-ce9f30231026

definitely matches to this bug.

Crash rate for this signature is significantly higher for version 115.

If not matching, it's in the same orbit or a correlary of bug 1505660 I would think. We shou'dn't go so far as to say a dupe as my STR are at least repeatable but, oddly, only by me thus far. =\

Is it worth it at all to get another perf profile as TB is shutting down after I do my STR? I can if you guys think it will help.

Crash rate for this signature is significantly higher for version 115.

100-fold increase - see https://bugzilla.mozilla.org/attachment.cgi?id=9360437

Other cash signatures mentioning password;

I was able to cause a crash and get a crash report using 115.4.1: https://crash-stats.mozilla.org/report/index/d5c2439d-a6f3-4541-ab87-ce9f30231026

seems to be the same as comment 45.

If not matching, for it's in the same orbit or a correlary of bug 1505660 I would think. We shou'dn't go so far as to say a dupe as my STR are at least repeatable but, oddly, only by me thus far.

Bug 1505660 wants to look at Firefox while this bug wants to examine the Thunderbird specific variants, so no, we should not dupe them and your STR and any additional information fit here , not there, thanks.

Is it worth it at all to get another perf profile as TB is shutting down after I do my STR? I can if you guys think it will help.

I think comment 45 already says it all - the Thunderbird code is lacking a shutdown observer or blocker that ensures this wait is interrupted. From what I see in crash-stats I do not think that a new profile will add much information here, thanks.

I think comment 45 already says it all - the Thunderbird code is lacking a shutdown observer or blocker that ensures this wait is interrupted. From what I see in crash-stats I do not think that a new profile will add much information here, thanks.

Correct. And, we know how to reproduce.

Crash rate for this signature is significantly higher for version 115.

Thunderbird is almost at 2,000 crashes per day

No longer depends on: 1505660
Keywords: reproducible
See Also: → 1505660

The steps to reproduce do not hang for me on linux. But I'll take on addressing comment 45.

Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED
Flags: needinfo?(mkmelin+mozilla)

Will these get backported to ESR?

Flags: needinfo?(mkmelin+mozilla)

Sure, but first reviews, landing on trunk and beta.

Flags: needinfo?(mkmelin+mozilla)

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/68ee42fc2136
nsImapProtocol::AuthLogin should bail if we're shutting down. r=BenC
https://hg.mozilla.org/comm-central/rev/b36435b2d46f
Use RunOnShutdown or shutdown observer to signal OAuth2's monitor. r=BenC
https://hg.mozilla.org/comm-central/rev/72918f80c378
GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. r=BenC

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch

Comment on attachment 9361601 [details]
Bug 1768344 - GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. r=babolivier,benc

[Approval Request Comment]
User impact if declined: may crash
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): Unclear. Should bake on data beta and see how it goes.

Attachment #9361601 - Flags: approval-comm-esr115?
Attachment #9361601 - Flags: approval-comm-beta?

Comment on attachment 9361601 [details]
Bug 1768344 - GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. r=babolivier,benc

[Triage Comment]
Approved for beta

Attachment #9361601 - Flags: approval-comm-beta? → approval-comm-beta+

Take all three patches, if it wasn't clear.

Attachment #9361600 - Flags: approval-comm-esr115?
Attachment #9361600 - Flags: approval-comm-beta+
Attachment #9361598 - Flags: approval-comm-esr115?
Attachment #9361598 - Flags: approval-comm-beta+

Odd - there are no crashes for signatures shutdownhang | mozilla::SpinEventLoopUntil | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads since 120.0b1*, and 102.0b1 predates fixing of this bug on beta. So what happened to the signature?

Should be safe but I feel like this should have a full week of beta, so declining to take for 115.4.3.

Whiteboard: [has str] → [TM 115.4.3+]

Essentially the crash rate for beta dropped by half on Friday Oct 27. I can't explain it.

Arthur, does the crash stop with 120.0b5?

Flags: needinfo?(thee.chicago.wolf)

(In reply to Wayne Mery (:wsmwk) from comment #72)

Arthur, does the crash stop with 120.0b5?

Yup. Wow, that's a huge win. Did Magnus' patches not make it into 120b5 yet but it's magically "fixed"?

Flags: needinfo?(thee.chicago.wolf)

See comment 59, correction comment 69, for the patch landing in 120.0b5.

Earlier today I updated to c-c tip and I now crash when I open any folder of any imap account using oauth2. It's fine when just using normal passwords.
I was able to bisect and see that everything earlier than changeset 40176 doesn't crash on oauth2 accounts. From my hg log -G:

:
o  changeset:   40177:72918f80c378 (crashes)
|  user:        Magnus Melin <mkmelin+mozilla@iki.fi>
|  date:        Mon Nov 06 09:24:37 2023 +0200
|  summary:     Bug 1768344 - GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. r=BenC
|
o  changeset:   40176:b36435b2d46f  (crashes)
|  user:        Magnus Melin <mkmelin+mozilla@iki.fi>
|  date:        Mon Nov 06 09:24:55 2023 +0200
|  summary:     Bug 1768344 - Use RunOnShutdown or shutdown observer to signal OAuth2's monitor. r=BenC
|
@  changeset:   40175:68ee42fc2136 (First one that doesn't crash on oauth2 acc't access)
|  user:        Magnus Melin <mkmelin+mozilla@iki.fi>
|  date:        Mon Nov 06 09:25:06 2023 +0200
|  summary:     Bug 1768344 - nsImapProtocol::AuthLogin should bail if we're shutting down. r=BenC
:

Currently 40175 is checked out and it's not crashing. 40176 and higher always crash on oauth2 login attempts.
Since I have many test accounts in my profile, I always run with "Check for new mail at startup" not selected so I have to manually click a folder to trigger a imap connection and authentication.
Note: There's also a strange delays on initial startup (content of my IMAP:4 log has 20 second or so time with no activity) with c-c tip but I'm not seeing it with above 40175 checked out. I don't think it's related to to this but it might be.

Potential problem with:

https://hg.mozilla.org/comm-central/rev/b36435b2d46f

In matrix tb-developers, Itagagaki reported problems:

Assertion failure: !mRawPtr, at C:/Users/ita/source/repos/Mozilla/obj-x86_64-pc-windows-msvc/dist/include/mozilla/AlreadyAddRefed.h:136
#01: mozilla::mailnews::OAuth2ThreadHelper::GetXOAuth2String (C:\Users\ita\source\repos\Mozilla\comm\mailnews\imap\src\nsSyncRunnableHelpers.cpp:522)

I think the fix is that the capture clause for the inner lambda should be [=] instead of [&]. The inner lambda needs to hold its own copy of the self pointer object, not just a reference to it.
But now I'm also wondering what the code does - isn't NS_NewRunnableFunction() meant to return a Runnable? But in that changeset, any return value is just discarded... or am I missing something?

Obviously whoever reviewed that patch did a very shoddy job. cough

Flags: needinfo?(mkmelin+mozilla)
Attached patch oauth2-crash-fix.diff (obsolete) — Splinter Review

Not really a "fix" but this diff gets rid of (for me) the crash on access of oauth2 account (e.g., gmail, yahoo). I have no idea why this causes a crash for me.
Of the 3 diffs that were committed for this bug, only the one that changed nsImapProtocol.cpp, changeset: 40175:68ee42fc2136, seems to not cause a problem.
Edit: Didn't see Ben's comment above before writing this. Looks like he may have a handle on the problem.

Blocks: 1864747

Yet the patch wasn't quite right. Fixing it in bug 1864747.

Flags: needinfo?(mkmelin+mozilla)

I guess we will want bug 1864747 to go through beta before taking this all on version 115.

Whiteboard: [TM 115.4.3+] → [TM 115.5.1]

Beta crashes end after 119.0b6 (at statistically significant rates), and the last nightly crash was 118.0a1 (not statistically significant).
So v.fixed for 121 and 120.

Status: RESOLVED → VERIFIED

Comment on attachment 9361598 [details]
Bug 1768344 - nsImapProtocol::AuthLogin should bail if we're shutting down. r=babolivier,benc

[Triage Comment]
Approved for esr115

Attachment #9361598 - Flags: approval-comm-esr115? → approval-comm-esr115+

Comment on attachment 9361600 [details]
Bug 1768344 - Use RunOnShutdown or shutdown observer to signal OAuth2's monitor. r=babolivier,benc

[Triage Comment]
Approved for esr115

Attachment #9361600 - Flags: approval-comm-esr115? → approval-comm-esr115+

Comment on attachment 9361601 [details]
Bug 1768344 - GetXOAuth2String and SupportsOAuth2 should check return value of NS_DispatchToMainThread. r=babolivier,benc

[Triage Comment]
Approved for esr115

Attachment #9361601 - Flags: approval-comm-esr115? → approval-comm-esr115+

(In reply to Wayne Mery (:wsmwk) from comment #80)

Beta crashes end after 119.0b6 (at statistically significant rates), and the last nightly crash was 118.0a1 (not statistically significant).
So v.fixed for 121 and 120.

But release crashes continue - still happening for 115.5.2 https://crash-stats.mozilla.org/signature/?signature=shutdownhang%20%7C%20mozilla%3A%3ASpinEventLoopUntil%20%7C%20nsThread%3A%3AShutdown%20%7C%20nsThreadManager%3A%3AShutdownNonMainThreads#summary

See Also: → 1869297

I forgot we have bug 1869297

Summary: Removing all saved passwords & attempting to shut down causes a hang and crash [@ shutdownhang | kernelbase.dll | mozilla::TaskControlleMr::GetRunnableForMTTask | nsThread::Shutdown | nsThreadanager::ShutdownNonMainThreads ] mozilla::SpinEventLoopUntil → Removing all saved passwords & attempting to shut down causes a hang and crash [@ shutdownhang | kernelbase.dll | mozilla::TaskControlleMr::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] mozilla::SpinEventLoopUntil

Not assuming anything has radically changed since I opened this bug but do we need to edit the title from:

@ shutdownhang | kernelbase.dll | mozilla::TaskControlleMr::GetRunnableForMTTask | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ] mozilla::SpinEventLoopUntil

to just

@ shutdownhang | mozilla::SpinEventLoopUntil | nsThread::Shutdown | nsThreadManager::ShutdownNonMainThreads ]

since this is more accurate per 115.5.2 and less "kitchen sink-y" from when I/we bolted on kernelbase.dll and mozilla::TaskControlleMr::GetRunnableForMTTask in the title?

https://crash-stats.mozilla.org/report/index/af232964-e76c-4a72-985f-4bc870231214

(In reply to Wayne Mery (:wsmwk) from comment #81)

Comment on attachment 9361598 [details]
Bug 1768344 - nsImapProtocol::AuthLogin should bail if we're shutting down. r=babolivier,benc

[Triage Comment]
Approved for esr115

This patch never got put into esr115 from what I can tell. It is in daily/c-c (haven't checked beta) that I've been running with and it explains why when I shutdown with "empty trash on exit" or "expunge inbox on exit" nothing happens. (I had thought it was a timing or maybe a win vs. linux issue.) ESR115 works correctly when I shutdown since it doesn't yet have this patch. I think the patch needs to still allow some URLs to run (deleteallmsg, expunge inbox, etc) when shutting down.
The change I'm working on to fix the 115.10.0 shutdown hang includes this patch but modified to still allow the URLs to run that occur at shutdown and are needed by the "clean up on exit" features in imap server settings.

See Also: → 1862111
See Also: → 1896545

(In reply to gene smith from comment #88)

(In reply to Wayne Mery (:wsmwk) from comment #81)

Comment on attachment 9361598 [details]
Bug 1768344 - nsImapProtocol::AuthLogin should bail if we're shutting down. r=babolivier,benc

[Triage Comment]
Approved for esr115

This patch never got put into esr115 from what I can tell. It is in daily/c-c (haven't checked beta) that I've been running with and it explains why when I shutdown with "empty trash on exit" or "expunge inbox on exit" nothing happens. (I had thought it was a timing or maybe a win vs. linux issue.) ESR115 works correctly when I shutdown since it doesn't yet have this patch. I think the patch needs to still allow some URLs to run (deleteallmsg, expunge inbox, etc) when shutting down.
The change I'm working on to fix the 115.10.0 shutdown hang includes this patch but modified to still allow the URLs to run that occur at shutdown and are needed by the "clean up on exit" features in imap server settings.

So bug 1896545. Might this also help with master password issues?

Flags: needinfo?(gds)
Whiteboard: [TM 115.5.1] → [TM 115.5.2]

Not sure what the master password issues are. I thought it was something to do with OSX?
Bug 1896545 suggests a way to allow some URLs to occur at shutdown instead of forbidding them all as patch "attachment 9361598 [details]" does. That patch was never applied to 115 which is good (but don't know if it was intentional).

Flags: needinfo?(gds)
Attachment #9363421 - Attachment is obsolete: true
Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(mkmelin+mozilla)
Regressions: 1920688
Regressions: 1896545
See Also: 1896545
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: