Closed Bug 840260 Opened 12 years ago Closed 12 years ago

AudioChannelManager remnant in nsDOMClassInfoClasses.h

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: bjacob, Assigned: bjacob)

References

Details

Attachments

(4 files, 1 obsolete file)

B2G + mozilla-central debug build asserts here with the assertion at nsDOMClassInfo.cpp:3647, MOZ_NOT_REACHED("The number of items in sClassInfoData doesn't match the " "number of nsIDOMClassInfo ID's, this is bad! Fix it!"); To debug this, I dumped sClassInfoData and the stuff in nsDOMClassInfoClasses (by redefining DOMCI_CLASS) and get multiple differences. The dumps are attached to this bug. The diff is: --- DOMClassInfoClasses 2013-02-11 16:44:07.121159202 -0500 +++ sClassInfoData 2013-02-11 16:44:11.101159297 -0500 @@ -1,9 +1,9 @@ + AnimationEvent ArchiveReader ArchiveRequest AsyncScrollEventDetail Attr -AudioChannelManager BarProp BeforeUnloadEvent Blob @@ -31,7 +31,6 @@ Comment CompositionEvent ContentFrameMessageManager -ContentList CRMFObject Crypto CSSCharsetRule @@ -68,7 +67,6 @@ DOMConstructor DOMError DOMException -DOMFileHandle DOMPrototype DOMRequest DOMStringList @@ -78,6 +76,7 @@ Event EventListenerInfo File +FileHandle FileList FileReader FileRequest @@ -159,7 +158,6 @@ IDBCursorWithValue IDBDatabase IDBFactory -IDBFileHandle IDBIndex IDBKeyRange IDBObjectStore @@ -172,7 +170,6 @@ LocalMediaStream Location LockedFile -MathMLElement MediaError MediaList MediaQueryList @@ -247,6 +244,7 @@ SVGAnimatedRect SVGAnimatedString SVGDocument +SVGElement SVGEvent SVGFEBlendElement SVGFEColorMatrixElement @@ -281,7 +279,6 @@ SVGRect SVGStringList SVGTitleElement -SVGUnknownElement SVGZoomEvent Telephony TelephonyCall
Attached file sClassInfoData
We should make these crash opt builds if they don't already.
Blocks: 834916
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #3) > We should make these crash opt builds if they don't already. They don't already due to the #ifdef DEBUG at nsDOMClassInfo.cpp:3642. FWIW here is the code used to dump this (at that same location): #ifdef DEBUG { uint32_t i = ArrayLength(sClassInfoData); if (i != eDOMClassInfoIDCount) { for (uint32_t x = 0; x < i; x++) { printf_stderr("sClassInfoData %s\n", sClassInfoData[x].mName); } #define DOMCI_CLASS(X) printf_stderr("domciclass %s\n", #X); #include "nsDOMClassInfoClasses.h" #undef DOMCI_CLASS MOZ_NOT_REACHED("The number of items in sClassInfoData doesn't match the " "number of nsIDOMClassInfo ID's, this is bad! Fix it!"); return NS_ERROR_NOT_INITIALIZED; }
So, most of the differences were just my dumping being fooled by special cases. The only real difference is that AudioChannelManager is not listed on the sClassInfoData side.
Summary: DOMClassInfoClasses and sClassInfoData have multiple differences (B2G) → AudioChannelManager not listed in sClassInfoData
Looks like this regressed in bug 838172.
Blocks: 838172
Summary: AudioChannelManager not listed in sClassInfoData → AudioChannelManager remnant in nsDOMClassInfoClasses.h
This fixes the assertion reported above.
Attachment #712651 - Flags: review?(peterv)
Attached patch assert even in non-DEBUG builds (obsolete) — Splinter Review
This implemented Kyle's suggestion in comment 3. I just only applied this to the first assertion here (which was hit above), not to the for loops below, so that we can at least land that without worrying about performance. We have 320 classes here on B2G, two for loops, so if we enabled them in release builds, that would cost us 640 (cache friendly) memory derefs + comparisons. I have no idea what the perf requirements on this code are.
Attachment #712654 - Flags: review?(peterv)
Blocks: 797526
(In reply to Benoit Jacob [:bjacob] from comment #8) > Created attachment 712654 [details] [diff] [review] > assert even in non-DEBUG builds > > This implemented Kyle's suggestion in comment 3. I just only applied this to > the first assertion here (which was hit above), not to the for loops below, > so that we can at least land that without worrying about performance. Is it impossible to make the first assertion static assert?
(In reply to Masatoshi Kimura [:emk] from comment #9) > Is it impossible to make the first assertion static assert? It is very much possible as it's comparing the size of a static array to an enum value; patch coming.
Assignee: nobody → bjacob
Target Milestone: --- → mozilla21
Attachment #712651 - Flags: review?(peterv)
also some code simplification around there, removed a now-useless {...} scope, and use size_t instead of uint32_t for a generic array index variable.
Attachment #712654 - Attachment is obsolete: true
Attachment #712654 - Flags: review?(peterv)
Attachment #712897 - Flags: review?(peterv)
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Should have been tagged with [leave open]
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: [leave open]
As you wish, but FWIW I intentionally didn't --- the first patch here fixes the bug at hand, the second one is just a follow-up to make sure that this doesn't happen again.
Then I think the second patch should have been a separate bug.
We're running debug tests on the cedar branch and we noticed this assertion. The patch fixed it but now we just hit a new assertion: F/MOZ_Assert( 642): Assertion failure: size_t(data) % sizeof(Value) == 0, at /builds/slave/ced-ics_a7_g-d-000000000000000/build/js/src/jsscript.cpp:1751 Could this be related? Or do you think this is a separate issue? Full log: https://tbpl.mozilla.org/php/getParsedLog.php?id=19742043&tree=Cedar&full=1
This doesn't seem related, from just this log.
Attachment #712897 - Flags: review?(peterv) → review+
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: