Open
Bug 1398816
Opened 8 years ago
Updated 1 year ago
Function.prototype.caller leaks replacement function from asm.js HandleInstantiationFailure to content
Categories
(Core :: JavaScript Engine: JIT, defect, P5)
Core
JavaScript Engine: JIT
Tracking
()
REOPENED
| Tracking | Status | |
|---|---|---|
| firefox57 | --- | wontfix |
People
(Reporter: anba, Unassigned)
References
(Blocks 1 open bug)
Details
Test case:
---
function fn(stdlib, foreign, buffer){
"use asm";
var values = new stdlib.Float64Array(buffer);
function main() {
return 0;
}
return {main: main};
};
var badstdlib = {
Float64Array: function f() {
var clonedFn = f.caller;
print(clonedFn === fn);
}
};
var foreign = {};
var buffer = new ArrayBuffer(2**16);
fn(badstdlib, foreign, buffer);
---
Expected: Prints "true"
Actual: Prints "false"
When asm.js linking fails, [1] creates a replacement function to proceed the call (or construct). This replacement function is an implementation detail and should probably not be accessible to content code.
[1] http://searchfox.org/mozilla-central/rev/00fa5dacedb925022f53d025121f1a919508e7ce/js/src/wasm/AsmJS.cpp#8074-8076
Comment 1•8 years ago
|
||
Heh, yeah, this bug goes back to 2013; probably the 'fix' will be the removal of the asm.js optimization. On the bright side, iirc, f.caller is not specified?
| Reporter | ||
Comment 2•8 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #1)
> Heh, yeah, this bug goes back to 2013; probably the 'fix' will be the
> removal of the asm.js optimization.
Agreed, I don't think it's worthwhile to spend time fixing this issue. :-)
> On the bright side, iirc, f.caller is not specified?
Yes, it's not specified.
Updated•8 years ago
|
Priority: -- → P5
Updated•3 years ago
|
Severity: normal → S3
Comment 3•1 year ago
|
||
This seems to be working now.
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
| Reporter | ||
Comment 4•1 year ago
|
||
It still prints false for me. Is my shell build too old?
Flags: needinfo?(mgaudet)
Comment 5•1 year ago
|
||
... Oh, I missed a warning message when I tested in devtools (no available wasm compiler); I too get false in the shell.
You need to log in
before you can comment on or make changes to this bug.
Description
•