Closed Bug 829813 Opened 12 years ago Closed 12 years ago

Crash [@ js::Shape::attributes] or [@ js::baseops::GetAttributes]

Categories

(Core :: JavaScript Engine, defect)

x86_64
All
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla21
Tracking Status
firefox18 --- unaffected
firefox19 --- unaffected
firefox20 --- unaffected
firefox21 + fixed
firefox-esr10 --- unaffected
firefox-esr17 --- unaffected
b2g18 --- unaffected

People

(Reporter: gkw, Assigned: bhackett1024)

References

Details

(4 keywords, Whiteboard: [jsbugmon:update])

Crash Data

Attachments

(3 files)

Attached file stack
for (x in [0]) { (function() { return Object.propertyIsEnumerable })().call([0], x) } crashes js debug shell on m-c changeset 44dcffe8792b without any CLI arguments at js::Shape::attributes Seems like an obvious null-deref but I'll leave it to the devs to open this up. autoBisect shows this is probably related to the following changeset: The first bad revision is: changeset: 118493:f4671ccc4502 user: Brian Hackett date: Thu Jan 10 17:53:11 2013 -0700 summary: Bug 827490 - Allow native objects to have both slots and dense elements, rm dense/slow array distinction, r=billm, dvander.
Related to bug 829795?
Flags: needinfo?(bhackett1024)
OS: Mac OS X → All
NULL deref, not s-s.
Group: core-security
Flags: needinfo?(bhackett1024)
Crash Signature: [@ js::Shape::attributes] [@ js::baseops::GetAttributes] → [@ js::Shape::attributes] [@ js::baseops::GetAttributes] [@ js::baseops::GetAttributes(JSContext*, JS::Handle<JSObject*>, JS::Handle<long>, unsigned int*)] [@ js::baseops::GetAttributes(JSContext*, JS::Handle<JSObject*>, JS::Handle<int> unsigned int*)]
Keywords: topcrash
Attached patch patchSplinter Review
This was caused by missing checks for element properties, the attached patch also fixes several similar bugs. Also, I forgot to fix IsImplicitProperty per your comments in bug 827490, do you still want that? (I'm neutral about this, it seems kind of weird to have two different methods to mark properties found which don't have shapes, but could still help code clarity.)
Attachment #701570 - Flags: review?(wmccloskey)
Comment on attachment 701570 [details] [diff] [review] patch Yes, please do fix the IsImplicitProperty thing. Also, it would be nice if you could assert in these functions that the object is native or non-native, so that we always call the right one. Also, please add a helper function GetShapeAttributes or something that would work for indexed properties. Then all the calls where you do this: IsImplicitProperty(prop) ? JSPROP_ENUMERATE : prop->attributes() could be replaced by the helper function.
Attachment #701570 - Flags: review?(wmccloskey) → review+
I hate to be such a stickler, but you forgot to fix the one in jsiter.cpp.
Attached patch cleanupSplinter Review
Cleanup IsImplicitProperty. I wasn't able to assert isNative vs. !isNative on the affected objects as they aren't passed to the implicit property functions, and adding more arguments to the functions just junks up the source while not actually helping anything (the wrong object can be passed in).
Attachment #701964 - Flags: review?(wmccloskey)
Comment on attachment 701964 [details] [diff] [review] cleanup Thanks. I was thinking that IsImplicitDenseElement could assert that, if the shape isn't 0x1, then it must be native.
Attachment #701964 - Flags: review?(wmccloskey) → review+
Assignee: general → bhackett1024
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Automatically extracted testcase for this bug was committed: https://hg.mozilla.org/mozilla-central/rev/2e891e0db397
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: