Closed
Bug 934889
Opened 11 years ago
Closed 9 years ago
JS_InitStandardClasses fails intermittently on a web worker due to the Intl API
Categories
(Core :: JavaScript: Internationalization API, defect)
Core
JavaScript: Internationalization API
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: khuey, Assigned: khuey)
References
Details
Attachments
(1 file)
2.24 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Web workers currently do not call JS_InitStandardClasses. I added code to call it but the function fails intermittently. When it does fail, it fails in IntlInitialize (http://hg.mozilla.org/mozilla-central/annotate/770de5942471/js/src/builtin/Intl.cpp#l396).
Filing this for a bug number to put in my comment.
![]() |
||
Comment 1•11 years ago
|
||
Is it possible that intl init is somehow racy/unsafe off the main thread?
Assignee | ||
Comment 2•11 years ago
|
||
Absolutely.
Comment 3•11 years ago
|
||
Intl init is basically plain old JS operations, plus some ICU calls. ICU is supposed to be threadsafe such that the ICU calls will be okay. (There are some things you have to do before using ICU at all, in u_init -- which we call at startup well before any sorts of racing things could happen.)
Catching this in a debugger is really what's desired here, at this point, because there's definitely too much under IntlInitialize to eyeball what's wrong. :-\
Assignee | ||
Comment 4•11 years ago
|
||
Also because not everything is hooked up to JS_ResolveStandardClass, workers are missing some builtins. e.g. bug 935165.
Assignee | ||
Comment 5•11 years ago
|
||
Anybody interested in looking into this?
Flags: needinfo?(mozillabugs)
Flags: needinfo?(jwalden+bmo)
Comment 7•11 years ago
|
||
Mass-moving existing Intl-related bugs to the new Core :: JavaScript: Internationalization API component.
If you think this bug has been moved in error, feel free to move it back to Core :: JavaScript Engine.
[Mass change filter: core-js-intl-api-move]
Component: JavaScript Engine → JavaScript: Internationalization API
Comment 8•11 years ago
|
||
Kyle claims that workers resolve standard classes now, everywhere. They didn't when this bug was filed, but since then with WebIDL progress that's changed, and now everyone does resolve them. And if everyone's resolving them, that's enough for observably correct semantics. Getting the properties via init, just means they show up earlier, but there's not really much reason to care about that if nobody's looking for them.
And indeed, this all comports with my testing demonstrating that Intl stuff works just fine on workers. For example, this:
http://whereswalden.com/files/mozilla/intl-in-workers/intl-worker.html
So I am going to claim this is fine now. There's still the code that http://mxr.mozilla.org/mozilla-central/search?string=bug%20934889 refers to, that should be cleaned up, to be sure. But that's a much lesser concern than the one originally expressed here.
Flags: needinfo?(jwalden+bmo)
Assignee | ||
Comment 9•9 years ago
|
||
This seems to work now (at least on my machine).
![]() |
||
Comment 10•9 years ago
|
||
Comment on attachment 8736376 [details] [diff] [review]
Patch
r=me
Do we still need resolve standard classes stuff?
Attachment #8736376 -
Flags: review?(bzbarsky) → review+
Comment 11•9 years ago
|
||
Comment 12•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•