Open Bug 1604732 Opened 5 years ago Updated 4 years ago

Runtime service loads wrong intl.accept_language when custom langpack in use

Categories

(Core :: DOM: Workers, defect, P3)

defect

Tracking

()

People

(Reporter: jhorak, Unassigned)

Details

This is a followup from: https://bugzilla.mozilla.org/show_bug.cgi?id=1603112#c9

The runtime service require the intl.accept_language. As bug 1603112 shows the intl.properties is stored to the shared cache of string bundles there. It happens before the user installed langpack is loaded and used, therefore the intl.accept_language is not updated according to new langpack.

The workaround in bug 1603112 removes the intl.properties from the list of shared cache string bundles. In order to keep it in shared cache we need to eliminate early callers which loads wrong intl.properties.

#0  0x00007fffd7d5fc09 in nsStringBundleService::getStringBundle(char const*, nsIStringBundle**) (this=0x60d000035f20, aURLSpec=0x6060001dc9c8 "chrome://global/locale/intl.properties", aResult=0x7ffffff76ac0)
at /home/jhorak/f/firefox/firefox-71.0/intl/strres/nsStringBundle.cpp:819
#1  0x00007fffd7d61b15 in nsStringBundleService::CreateBundle(char const*, nsIStringBundle**) (this=0x60d000035f20, aURLSpec=0x6060001dc9c8 "chrome://global/locale/intl.properties", aResult=0x7ffffff76ac0)
at /home/jhorak/f/firefox/firefox-71.0/intl/strres/nsStringBundle.cpp:910
#2  0x00007fffd7c50478 in nsPrefBranch::GetDefaultFromPropertiesFile(char const*, nsTSubstring<char16_t>&) (this=0x60800002a820, aPrefName=0x60300026e308 "intl.accept_languages", aReturn=...)
at /home/jhorak/f/firefox/firefox-71.0/modules/libpref/Preferences.cpp:2840
#3  0x00007fffd7c4e64f in nsPrefBranch::GetComplexValue(char const*, nsID const&, void**) (this=0x60800002a820, aPrefName=0x7fffed843b60 <str> "intl.accept_languages", aType=..., aRetVal=0x7ffffff776e0)
at /home/jhorak/f/firefox/firefox-71.0/modules/libpref/Preferences.cpp:2325
#4  0x00007fffd7cc84c1 in mozilla::Preferences::GetLocalizedString(char const*, nsTSubstring<char16_t>&, mozilla::PrefValueKind)
(aPrefName=0x7fffed843b60 <str> "intl.accept_languages", aResult=..., aKind=mozilla::PrefValueKind::User) at /home/jhorak/f/firefox/firefox-71.0/modules/libpref/Preferences.cpp:4695
#5  0x00007fffdc8e43f8 in mozilla::dom::Navigator::GetAcceptLanguages(nsTArray<nsTString<char16_t> >&) (aLanguages=...) at /home/jhorak/f/firefox/firefox-71.0/dom/base/Navigator.cpp:330
#6  0x00007fffe206027f in mozilla::dom::workerinternals::(anonymous namespace)::PrefLanguagesChanged(char const*, void*) () at /home/jhorak/f/firefox/firefox-71.0/dom/workers/RuntimeService.cpp:1080
#7  0x00007fffd7ccd239 in mozilla::Preferences::RegisterCallbackAndCall(void (*)(char const*, void*), nsTSubstring<char> const&, void*, mozilla::Preferences::MatchKind)
(aCallback=0x7fffe2060180 <mozilla::dom::workerinternals::(anonymous namespace)::PrefLanguagesChanged(char const*, void*)>, aPref=..., aClosure=0x0, aMatchKind=mozilla::Preferences::ExactMatch)
at /home/jhorak/f/firefox/firefox-71.0/modules/libpref/Preferences.cpp:5046
#8  0x00007fffe206010f in mozilla::Preferences::RegisterCallbackAndCall<22, void>(mozilla::TypedPrefChangeFunc<void>::Type, char const (&) [22], void*) (aCallback=..., aPref=..., aClosure=0x0)
at /home/jhorak/f/firefox/firefox-71.0/objdir/dist/include/mozilla/Preferences.h:437
#9  0x00007fffe2058154 in mozilla::dom::workerinternals::RuntimeService::Init() (this=0x6110001a3780) at /home/jhorak/f/firefox/firefox-71.0/dom/workers/RuntimeService.cpp:1590
#10 0x00007fffe205707f in mozilla::dom::workerinternals::RuntimeService::GetOrCreateService() () at /home/jhorak/f/firefox/firefox-71.0/dom/workers/RuntimeService.cpp:1162
#11 0x00007fffe20d0353 in mozilla::dom::WorkerPrivate::Constructor(JSContext*, nsTSubstring<char16_t> const&, bool, mozilla::dom::WorkerType, nsTSubstring<char16_t> const&, nsTSubstring<char> const&, mozilla::dom::WorkerLoadInfo*, mozilla::ErrorResult&, nsTString<char16_t>)                                                                                                                                                    
(aCx=0x61d000085280, aScriptURL=..., aIsChromeWorker=true, aWorkerType=mozilla::dom::WorkerTypeDedicated, aWorkerName=..., aServiceWorkerScope=..., aLoadInfo=0x7ffffff78600, aRv=..., aId=...)
at /home/jhorak/f/firefox/firefox-71.0/dom/workers/WorkerPrivate.cpp:2308
#12 0x00007fffe2052214 in mozilla::dom::ChromeWorker::Constructor(mozilla::dom::GlobalObject const&, nsTSubstring<char16_t> const&, mozilla::ErrorResult&) (aGlobal=..., aScriptURL=..., aRv=...)
at /home/jhorak/f/firefox/firefox-71.0/dom/workers/ChromeWorker.cpp:22
#13 0x00007fffde9a6cb2 in mozilla::dom::ChromeWorker_Binding::_constructor(JSContext*, unsigned int, JS::Value*) (cx=0x61d000085280, argc=1, vp=0x621000123eb0) at WorkerBinding.cpp:284
#14 0x00007fffe92d3f00 in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&)
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.