MOZ_ASSERT failure in mozJSSubScriptLoader::ReadStencil
Categories
(Core :: XPConnect, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox98 | --- | fixed |
People
(Reporter: mtigley, Assigned: mtigley)
References
Details
Attachments
(1 file)
Found this while trying to load a subscript with a "moz-extension" URL into a child actor. I'm getting the following failure on a recent try push.
This is caused by this assertion failing: https://searchfox.org/mozilla-central/rev/83e67336083df9f9a3d1e0c33f2ba19703d57161/js/xpconnect/loader/mozJSSubScriptLoader.cpp#264. This seems to suggests the channel somehow isn't being updated with the new content length by NS_ReadInputStreamToString().
It's not clear to me where the update should happen in NS_ReadInputStreamToString() though.
| Assignee | ||
Comment 1•4 years ago
|
||
Depends on D109073
Updated•4 years ago
|
Updated•4 years ago
|
Comment 2•4 years ago
|
||
Minimal test case based on the original test case:
./mach run --temp-profile.- Visit example.com and open the Browser Content Toolbox.
- Run the following snippet:
{
let { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
let { WebExtensionPolicy } = Cu.getGlobalForObject(Services);
let url = WebExtensionPolicy.getByID("pictureinpicture@mozilla.org").getURL("run.js");
Services.scriptloader.loadSubScript(url, sandbox);
}
Expected output:
Uncaught ReferenceError: PictureInPictureOverrides is not defined
Actual result:
- content process crashes with the following:
Assertion failure: currentLength == len, at /builds/worker/checkouts/gecko/js/xpconnect/loader/mozJSSubScriptLoader.cpp:264
#01: mozJSSubScriptLoader::ReadStencil(js::frontend::CompilationStencil**, nsIURI*, JSContext*, JS::ReadOnlyCompileOptions const&, nsIIOService*, bool)[/path/to/dist/NightlyDebug.app/Contents/MacOS/XUL +0x109f405]
#02: mozJSSubScriptLoader::DoLoadSubScriptWithOptions(nsTSubstring<char16_t> const&, LoadSubScriptOptions&, JSContext*, JS::MutableHandle<JS::Value>)[/path/to/dist/NightlyDebug.app/Contents/MacOS/XUL +0x10a03bc]
#03: mozJSSubScriptLoader::LoadSubScript(nsTSubstring<char16_t> const&, JS::Handle<JS::Value>, JSContext*, JS::MutableHandle<JS::Value>)[/path/to/dist/NightlyDebug.app/Contents/MacOS/XUL +0x109f78e]
#04: NS_InvokeByIndex[/path/to/dist/NightlyDebug.app/Contents/MacOS/XUL +0x33c30e]
This only happens in the content process; the moz-extension:-protocol handler uses a SimpleChannel to retrieve the actual content from the parent.
Updated•4 years ago
|
Comment 4•4 years ago
|
||
| bugherder | ||
Description
•