Closed Bug 1059020 Opened 5 years ago Closed 5 years ago

"ASSERTION: bad size recorded" with accessibility, Notification

Categories

(Core :: Disability Access APIs, defect)

x86_64
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: jruderman, Assigned: jruderman)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, regression, testcase)

Attachments

(4 files)

Attached file testcase
1. Run a debug build of Firefox with XPCOM_MEM_LEAK_LOG=2
     (to enable trace-refcnt code)

2. Set:
     user_pref("devtools.chrome.enabled", true);
 
3. Enable accessibility by pasting the following into the Browser Console:

Components.classes["@mozilla.org/accessibilityService;1"].getService(Components.interfaces.nsIAccessibleRetrieval);

4. Load the testcase.
Attached file stack+
###!!! ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize', file xpcom/base/nsTraceRefcnt.cpp, line 549
Attached file the other stack
(sometimes I get one, sometimes I get the other?)
Like in bug 998706, the problem is two classes reporting the same name to trace-refcnt:

* mozilla::dom::Notification   (since 2014: bug 899585)
* mozilla::a11y::Notification  (since 2011: bug 498015)
Blocks: 899585, 498015
Keywords: regression
Attached patch patchSplinter Review
Seems easier to change the a11y side, mostly because I have no idea what I'm doing.

This compiles and makes the assertion go away for me.
Attachment #8479506 - Flags: review?(surkov.alexander)
Comment on attachment 8479506 [details] [diff] [review]
patch

Review of attachment 8479506 [details] [diff] [review]:
-----------------------------------------------------------------

::: accessible/base/NotificationController.h
@@ +25,5 @@
>   */
>  class Notification
>  {
>  public:
> +  NS_INLINE_DECL_REFCOUNTING(mozilla::a11y::Notification)

interesting, not sure how it can be resolved to dom::Notification.
perhaps shorter version a11y::Notification works too
Attachment #8479506 - Flags: review?(surkov.alexander) → review+
cc'ing Neil, it might be he has some explanation
(In reply to alexander :surkov from comment #5)
> Comment on attachment 8479506 [details] [diff] [review]
> patch
> 
> Review of attachment 8479506 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: accessible/base/NotificationController.h
> @@ +25,5 @@
> >   */
> >  class Notification
> >  {
> >  public:
> > +  NS_INLINE_DECL_REFCOUNTING(mozilla::a11y::Notification)
> 
> interesting, not sure how it can be resolved to dom::Notification.
> perhaps shorter version a11y::Notification works too

the macro argument is just stringified and then fed to the leak logging stuff, so if you want things to not conflict you need to pass different strings.
https://hg.mozilla.org/mozilla-central/rev/165007d06d73
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.