Stylo Assertion failure: aNameSpaceID > 0 && (int64_t) aNameSpaceID <= (int64_t) mURIArray.Length() at dom/base/nsNameSpaceManager.h

RESOLVED FIXED in Firefox 51

Status

()

Core
Layout
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: cpeterson, Assigned: bholley)

Tracking

(Blocks: 2 bugs, {assertion})

unspecified
mozilla51
assertion
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 fixed)

Details

(Whiteboard: [stylo:m2])

Attachments

(1 attachment)

(Reporter)

Description

a year ago
To reproduce, run `./mach reftest --disable-e10s <filename>` or replace <filename> with `layout/reftest/reftest.list`.

TEST-UNEXPECTED-FAIL | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/margin-collapsing/block-xhtml-root-1a.xhtml | application terminated with exit code 11
REFTEST PROCESS-CRASH | file:///home/shinglyu/workspace/stylo/gecko-dev/layout/reftests/margin-collapsing/block-xhtml-root-1a.xhtml | application crashed [None]

Assertion failure: aNameSpaceID > 0 && (int64_t) aNameSpaceID <= (int64_t) mURIArray.Length(), at /files/mozilla/stylo/bb/gecko/dom/base/nsNameSpaceManager.h:43
รง      \#01: nsNameSpaceManager::NameSpaceURIAtom(int) (nsNameSpaceManager.h:43, in XUL)
#02: Gecko_Namespace (ServoBindings.cpp:158, in XUL)
#03: _$LT$wrapper..GeckoElement$LT$$u27$le$GT$$u20$as$u20$selectors..Element$GT$::get_namespace::h7a2f0ddcbd2acca7 (wrapper.rs:468, in XUL)
Assignee: nobody → bobbyholley
Created attachment 8778465 [details] [diff] [review]
Zero-index the namespace manager URIs. v1

The current setup here tries to "save" an entry in the list by checking
for the "None" namespace everywhere and special-casing it. We can simplify
this a lot by just adding the empty atom to the beginning of the array,
which is the value that servo uses to represent "namespace none" anyway.
Attachment #8778465 - Flags: review?(bzbarsky)
Comment on attachment 8778465 [details] [diff] [review]
Zero-index the namespace manager URIs. v1

So this has two behavior changes:

1)  GetNameSpaceURI will now happily hand out "" for kNameSpaceID_None.  But calling GetNameSpaceURI for kNameSpaceID_None is arguably an error, and was treated as such by the old code.  Please preserve the old behavior here.

2)  NameSpaceURIAtom will now happily hand out "".  This is the intentional part of this change.  Please document this behavior, and document that this function should really be called only from servo code, where using "" to represent "no namespace" actually makes sense.  If we can assert somehow that it's only called by servo code, that would be even better, but I can't see a way to do that.  :(  Maybe it should be renamed to indicate what it's expected to do?

r=me with both of those things done.
Attachment #8778465 - Flags: review?(bzbarsky) → review+
https://treeherder.mozilla.org/#/jobs?repo=try&revision=accd08f29daf

Comment 4

a year ago
Pushed by bholley@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2629e4786dd8
Zero-index the namespace manager URIs. r=bz

Comment 5

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2629e4786dd8
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox51: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
You need to log in before you can comment on or make changes to this bug.