Closed Bug 696039 Opened 13 years ago Closed 13 years ago

Assertion failure: !js_PrototypeHasIndexedProperties(f.cx, obj), at jsarray.cpp:2605

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla11

People

(Reporter: decoder, Assigned: bhackett1024)

Details

(Keywords: assertion, testcase, Whiteboard: js-triage-done)

Attachments

(2 files)

The following test asserts on mozilla-central revision 67673422f7d2 (options -m -n -a):


gczeal(2);
var lfcode = new Array();
lfcode.push("");
lfcode.push("");
while (lfcode.length > 0) {
        var file = lfcode.shift();
        loadFile(file);
}
function loadFile(lfVarx) {
        try {
                eval("\
                        Array.prototype[30] = 'B';\
                        delete Array.prototype[30];\
                        assertEquals('edcba', a.join(''));\
                ");
        } catch (lfVare) {}
}



S-s because this is possibly gc-related (gczeal required). A less minimized version of the test also showed valgrind errors (see attachment). Let me know if these errors are related or expected.
Forgot to mention that the test does not show any signs of crashes/memory corruptions besides the attached valgrind log from the less-reduced test. Remove s-s if this is confirmed to be harmless.
Attachment #568362 - Attachment mime type: text/x-log → text/plain
David, guessing sg:critical here based on the valgrind log. Please reassign appropriately.
Assignee: general → dmandelin
Whiteboard: js-triage-needed → [sg:critical] js-triage-needed
I'm pretty sure this is a TI bug. It doesn't look sg:critical to me, though. Brian, could you have a look?
Assignee: dmandelin → bhackett1024
Not critical because web content can never trigger this bug, it's js-shell only?

decoder: please attach the "less minimal" version of the testcase (or file a separate bug if you think it's a separate problem).
(In reply to Daniel Veditz from comment #4)
> Not critical because web content can never trigger this bug, it's js-shell
> only?
> 
> decoder: please attach the "less minimal" version of the testcase (or file a
> separate bug if you think it's a separate problem).

I think web content could hit this if a GC came at the right time. I guess it wouldn't be reproducible, though.
Attached patch patchSplinter Review
Bogus assert.  When compiling a fast version of Array.shift we check statically that the array prototype does not have indexed properties, and after updating the object call a stub which wraps a memmove().  The stub asserts that the prototype does not have indexed properties, but the assert is inaccurate --- it checks the INDEXED flag on the object, which is, interestingly, less precise than the type information.  When adding an indexed property to an object and deleting it later, the indexed bit sticks to the object but the resulting type information will not have any types in the indexed type set, provided that the compiler nor inference did not query the type information until after the indexed property was deleted.

The valgrind log is separate from this bug, and the involved code looks fine to me.  An array of uint32s with an odd length is being accessed, and I suspect that GCC generated code which used the cell after the end of the array in some way.
Attachment #575378 - Flags: review?(dvander)
Group: core-security
Whiteboard: [sg:critical] js-triage-needed → js-triage-needed
Whiteboard: js-triage-needed → js-triage-done
Attachment #575378 - Flags: review?(dvander) → review+
https://hg.mozilla.org/mozilla-central/rev/4abbb8b11ffd
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
Automatically extracted testcase for this bug was committed:

https://hg.mozilla.org/mozilla-central/rev/efaf8960a929
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: