TL;DR The crash is caused by
await searchInitialized; at https://searchfox.org/mozilla-central/rev/cb7faaf6b4ad2528390186f1ce64618dea71031e/browser/components/extensions/parent/ext-chrome-settings-overrides.js#193
onManifestEntry handler of ext-chrome-settings-overrides.js has several
await calls, each of which could be responsible for this crash. I'm only looking at
await because these block the promise. I'm not considering synchronous API calls because it's unlikely for those to block the promise for a minute.
I fetched all add-ons that were reported in the 1630 crash reports from this year until yesterday, and checked the content of the extensions'
There are some crashes where the responsible add-on does not have
chrome_settings_override.search_provider.is_default. This allows us to eliminate the majority of
await uses, leaving only three potential causes of the hang:
From the reports, 2 of the add-ons involved in a crash have only set a
homepage_url. This rules out the first option (because then we should have seen significantly more crashes from add-ons that had only set
chrome_settings_override.homepage, and we should also also have seen a similar volume of crashes for addons that use
chrome_url_overrides, because it also uses similar code).
addSearchEngine currently has many
awaits, but most of these were recently added. The crashes already happened before that, so that leaves the only cause in
addSearchEngine to be
await ExtensionSettingsStore.addSetting (https://searchfox.org/mozilla-central/rev/10ed8acc81f55dd9a7b0a2330447592a3e5c5027/browser/components/extensions/parent/ext-chrome-settings-overrides.js#286).
ExtensionSettingsStore.addSetting is also used by ext-url-overrides.js, for we have only 23 crash reports in the same time frame as the this bug (87 crash reports in the past six months) (reports with
ExtensionSettingsStore.addSetting were to be the cause of this bug, then the crash rates for
chrome_url_overrides should also have been higher.
This leaves us with one possible cause for this crash,
await searchInitialized;, which is defined at https://searchfox.org/mozilla-central/rev/01b4b3830ea3cae2e9e431019afa6391b471c6da/browser/components/extensions/parent/ext-browser.js#249-254
searchInitialized promise is only fulfilled when the "browser-search-service" notification has been triggered. Coincidentally, the
defaultSearchEngineData fields in the telemetry environment are only set up once the notification has been triggered.
These fields are missing from the telemetry environment in the crash reports of this bug, which offers conclusive evidence that this crash is caused by the