"ASSERTION: bad size recorded" with mozVibrate

RESOLVED FIXED in mozilla11

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: Justin Lebar (not reading bugmail))

Tracking

(Blocks: 1 bug, {assertion, testcase})

Trunk
mozilla11
x86_64
Mac OS X
assertion, testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

5 years ago
Created attachment 582380 [details]
testcase

###!!! ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize', file /builds/slave/m-cen-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 473

NS_LogAddRef_P [xpcom/base/nsTraceRefcntImpl.cpp:998]
mozilla::ClearOnShutdown_Internal::ShutdownObserver<nsAutoPtr<InfallibleTArray<long long unsigned int> > >::AddRef [down.h:79]
nsObserverList::AddObserver [nsCOMPtr.h:889]
mozilla::ClearOnShutdown<nsAutoPtr<InfallibleTArray<long long unsigned int> > > [:519]
mozilla::hal::Vibrate [hal/Hal.cpp:115]
mozilla::dom::Navigator::MozVibrate [nsCOMPtr.h:519]
NS_InvokeByIndex_P [xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_unix.cpp:197]

###!!! ASSERTION: bad size recorded: 'aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize', file /builds/slave/m-cen-osx64-dbg/build/xpcom/base/nsTraceRefcntImpl.cpp, line 473

NS_LogAddRef_P [xpcom/base/nsTraceRefcntImpl.cpp:998]
mozilla::ClearOnShutdown_Internal::ShutdownObserver<nsRefPtr<mozilla::dom::<unnamed>::VibrateWindowListener> >::AddRef [ClearOnShutdown.h:79]
nsObserverList::FillObserverArray [nsCOMPtr.h:880]
nsObserverList::NotifyObservers [xpcom/ds/nsObserverList.cpp:127]
nsObserverService::NotifyObservers [nsTHashtable.h:163]
mozilla::ShutdownXPCOM [xpcom/glue/nsCOMPtr.h:519]
ScopedXPCOMStartup::~ScopedXPCOMStartup [toolkit/xre/nsAppRunner.cpp:1115]
XRE_main [nsCOMPtr.h:807]
main [browser/app/nsBrowserApp.cpp:201]

Tested with http://hg.mozilla.org/mozilla-central/rev/7cc472108eb4
(Assignee)

Updated

5 years ago
Blocks: 706958
No longer blocks: 694862
(Assignee)

Comment 1

5 years ago
This is almost surely a result of the NS_ISUPPORTS implementation hack I have for ClearOnShutdown<T>.  Sigh.
Assignee: nobody → justin.lebar+bug
(Assignee)

Comment 2

5 years ago
Hm, I can't reproduce with a local debug, trace-malloc build, rev 7ccc472.  I verified that ClearOnShutdown is being called.
(Assignee)

Comment 3

5 years ago
I do see this in the mochitest-3 logs, however.
(Assignee)

Comment 4

5 years ago
Created attachment 582899 [details]
Assertions from mochitest logs

Not the same stacks as in comment 0, strangely.
(Assignee)

Comment 5

5 years ago
Maybe the trace refcnt assertions just aren't on when I run dist/bin/firefox?  I see the assertions when I run the vibrator mochitest locally.
(Assignee)

Comment 6

5 years ago
Created attachment 582902 [details] [diff] [review]
Patch v1

Reading through the implementation of INLINE_REFCOUNTING and DECL_{ADDREF,RELEASE}, it's not entirely clear to me why this works.  But it does seem to work.
Attachment #582902 - Flags: review?(benjamin)
Comment on attachment 582902 [details] [diff] [review]
Patch v1

This turns out to just be a name collision with the other ShutdownObserver in gfx-land.
Attachment #582902 - Flags: review?(benjamin) → review+
(Assignee)

Comment 8

5 years ago
I'll fully qualify the class name in the NS_IMPL macros.
(Assignee)

Comment 9

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd2f9236b591
(Assignee)

Comment 10

5 years ago
Verified that there's no assertion in https://tbpl.mozilla.org/php/getParsedLog.php?id=8039971&tree=Mozilla-Inbound
https://hg.mozilla.org/mozilla-central/rev/dd2f9236b591
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla11
(Reporter)

Comment 12

5 years ago
(In reply to Justin Lebar [:jlebar] from comment #5)
> Maybe the trace refcnt assertions just aren't on when I run
> dist/bin/firefox?  I see the assertions when I run the vibrator mochitest
> locally.

I see the assertion (in an old build) if I run with XPCOM_MEM_LEAK_LOG=2.
Yes, refcnt logging isn't enabled by default, you have to set an environment variable to enable it. Mochitest does this by default:
http://mxr.mozilla.org/mozilla-central/source/testing/mochitest/runtests.py#543
You need to log in before you can comment on or make changes to this bug.