JS shell module loader is not initialized for additional globals
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | affected |
People
(Reporter: decoder, Assigned: decoder)
Details
Attachments
(1 obsolete file)
The JS shell module loader is only initialized once for the main global by an InitModuleLoader call. Any additional globals created e.g. with newGlobal() lack the module loader and this seems to cause leaks/lifetime issues when running code in another global that would require the module loader.
This can be fixed easily by adding a global to the InitModuleLoader parameters and calling it again in NewGlobal. I have a patch for this coming up later.
Updated•6 years ago
|
| Assignee | ||
Comment 1•6 years ago
|
||
Comment 2•6 years ago
|
||
(In reply to Christian Holler (:decoder) from comment #0)
Any additional globals created e.g. with
newGlobal()lack the module loader and this seems to cause leaks/lifetime issues when running code in another global that would require the module loader.
We can add the module loader for new globals but I don't think this will address the root case of the leak.
| Assignee | ||
Comment 3•6 years ago
|
||
(In reply to Jon Coppeard (:jonco) from comment #2)
(In reply to Christian Holler (:decoder) from comment #0)
Any additional globals created e.g. with
newGlobal()lack the module loader and this seems to cause leaks/lifetime issues when running code in another global that would require the module loader.We can add the module loader for new globals but I don't think this will address the root case of the leak.
I totally agree, but so far, the module loader seems to be the only source causing this to happen at all. This also means that the root cause might be shell-only, making it even less likely to be tracked down in a timely manner. With the attached patch, testing is unblocked.
Comment 5•6 years ago
|
||
Backed out changeset 928ee6869299 (Bug 1628279) for sm bustages at script-filename-validation-1.js.
https://hg.mozilla.org/integration/autoland/rev/b824a66c9fe6ee51eda56e98b3729f3fdbc5f961
Failure log:
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=297888160&repo=autoland&lineNumber=15598
| Assignee | ||
Comment 6•6 years ago
|
||
Jon, I don't understand exactly what these failures mean or how these tests interact with my newGlobal change. Could you take a look and let me know how I should fix these? Thanks!
Comment 7•6 years ago
|
||
Looks like this is falling foul of a script filename validation check that Jan added. I think you can add options.setSkipFilenameValidation(true) when setting the compile options in InitModuleLoader to fix this.
Comment 8•6 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:decoder, could you have a look please?
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 9•6 years ago
|
||
Jon, I saw that you made significant changes to the module loader a while ago already in bug 1637529. With these new changes, do we still need this bug or is the module loader now working in all globals in the JS shell? If not, is it easy for me to make the change using the new C++ module loader?
Comment 10•6 years ago
|
||
Oh, I forgot to comment here. Yes, with the changes the module loader should now work in all globals. Can you check it's working as you expect?
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Wanted to see if we could close this bug out, have we confirmed that with Jon's rewrite fixed the globals issue?
| Assignee | ||
Comment 12•4 years ago
|
||
Yes, so far I think everything is working as expected, I'll open a new bug if anything related becomes visible again in parser fuzzing. Thanks!
Description
•