Closed Bug 1591353 Opened 5 years ago Closed 4 years ago

Debug build does not start from profile manager (Assertion failure: !IsAcceptingPromises() immediately after selecting profile)

Categories

(Core :: DOM: Service Workers, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla73
Tracking Status
firefox-esr68 --- unaffected
firefox71 --- wontfix
firefox72 --- verified
firefox73 --- verified

People

(Reporter: alice0775, Assigned: perry)

References

(Regression)

Details

(Keywords: nightly-community, regression)

Attachments

(1 file)

Browser does not launch after select a profile from Profile Manager.
.\firefox.exe -no-remote -p

However, it works if specify profile name
.\firefox.exe -no-remote -p profile

Reproducible: always

Steps to reproduce:

  1. download a windows debug build zip

  2. Extract the zip to a folder

  3. Open cmd.exe

  4. Enter <drive letter of the folder>

  5. Enter cd <path to the folder>

  6. Enter .\firefox.exe -no-remote -p

  7. Select a profile and start browser
    --- Browser would not launch.

Actual results:
Borowser would not appear, not launch

Expected results:
Browser should launch

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=720c1e5a8dd3f5bda4ae32137d1c624a1ad55301&tochange=be9a6289486a6f366e431782b84a0c0633f8fec2

Regressed by: Bug 1456995

Has Regression Range: --- → yes
Has STR: --- → yes

The following assertion appears in cmd.exe window.

Assertion failure: !IsAcceptingPromises(), at z:/build/build/src/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp:124

:perry,
Your bunch of patch seems to cause the regression. Can you please look into this?

Flags: needinfo?(perry)
Regressed by: 1456995
Component: Startup and Profile System → DOM: Service Workers
Product: Toolkit → Core

So I think the situation is that in profile manager mode, the ServiceWorkerManager comes into existence somehow and creates the ServiceWorkerShutdownBlocker. Its mState starts out as VariantType<AcceptingPromises>() which causes the destructor's assertion check at https://searchfox.org/mozilla-central/rev/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/dom/serviceworkers/ServiceWorkerShutdownBlocker.cpp#124 to explode.

I presume the profile-manager in this case does not generate profile-do-change or profile-after-change (https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Observer_Notifications) and we should be waiting for those. The control flow is weird in that SWM::Init will always call GetRegistrations at https://searchfox.org/mozilla-central/rev/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/dom/serviceworkers/ServiceWorkerManager.cpp#356 but it will silently be a no-op at https://searchfox.org/mozilla-central/rev/11d9c7b7fa82fdfb8ac2a8f0864e9d8d5fe2b926/dom/serviceworkers/ServiceWorkerRegistrar.cpp#182 if the profile hasn't been started.

It seems like we either want:

  • The SWM to be explicitly aware of the lack of a profile itself directly.
  • Or the registrar to signal to the caller in the case there's no profile so that the SWM can reconfigure itself to not trigger that assertion? (I'm not sure how fancy we want to get. Minimally just not triggering the assertion might be the best way to avoid other surprise breakage.)
Priority: -- → P1
Summary: Windows debug build does not start from profile manager → Windows debug build does not start from profile manager (Assertion failure: !IsAcceptingPromises() immediately after selecting profile)
Assignee: nobody → perry
Blocks: 1588154
Flags: needinfo?(perry)

Looks like this isn't Windows specific.

OS: Windows 10 → All
Hardware: x86_64 → All
Summary: Windows debug build does not start from profile manager (Assertion failure: !IsAcceptingPromises() immediately after selecting profile) → Debug build does not start from profile manager (Assertion failure: !IsAcceptingPromises() immediately after selecting profile)
Pushed by pjiang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/958f25e0cae2
call ServiceWorkerShutdownBlocker::StopAcceptingPromises when ProfileManager exits r=asuth
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73

I think this bug actually bit QA earlier today when trying to test a build on Beta. Please nominate this patch for uplift there as well.

Flags: needinfo?(perry)

Comment on attachment 9113660 [details]
Bug 1591353 - call ServiceWorkerShutdownBlocker::StopAcceptingPromises when ProfileManager exits r?asuth

Beta/Release Uplift Approval Request

  • User impact if declined: Browser will crash when starting up in Profile Manager mode.
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): It performs required cleanup when the browser exits Profile Manager mode that is verified by an assertion later.
  • String changes made/needed:
Flags: needinfo?(perry)
Attachment #9113660 - Flags: approval-mozilla-beta?

Hello! Reproduced the issue using Firefox 72.0a1 (20191025095546) debug build. The build didn't open with a profile manager using "-no-remote -p" or "-p" commands in cmd on Windows 10x64.
The issue is verified fixed with Firefox 73.0a1 (20191206044357) debug build on Windows 10x64, macOS 10.15 and Ubuntu 18.04. The debug build is successfully started using the profile manager ("-p" and "-no-remote -p") commands.

Comment on attachment 9113660 [details]
Bug 1591353 - call ServiceWorkerShutdownBlocker::StopAcceptingPromises when ProfileManager exits r?asuth

serviceworker fix, approved for 72.0b4

Attachment #9113660 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified with Firefox 72.0b5 (20191210230245) on Windows 10x64, macOS 10.15 and Ubuntu 18.04. The debug build is started using the profile manager.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: