Open Bug 1563486 Opened 4 months ago Updated 4 months ago

Intermittent Assertion failure: aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize (Mismatched sizes were recorded in the memory leak logging table. The usual cause of this is having a templated class that uses MOZ_COUNT_{C,D}TOR

Categories

(Core :: XPCOM, defect, P5)

69 Branch
defect

Tracking

()

Tracking Status
firefox69 --- affected

People

(Reporter: whimboo, Unassigned)

References

Details

(Keywords: assertion)

Even originally fixed on bug 1457606 about a year ago I can still see this when running the gTests locally:

[ RUN ] TestSlicedInputStream.AsyncInputStream
Assertion failure: aInstanceSize == 0 || entry->GetClassSize() == aInstanceSize (Mismatched sizes were recorded in the memory leak logging table. The usual cause of this is having a templated class that uses MOZ_COUNT_{C,D}TOR in the constructor or destructor, respectively. As a workaround, the MOZ_COUNT_{C,D}TOR calls can be moved to a non-templated base class. Another possible cause is a runnable with an mName that matches another refcounted class.), at /Users/henrik/code/gecko/xpcom/base/nsTraceRefcnt.cpp:346
#01: GetBloatEntry(char const*, unsigned int)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x142f1e]
#02: NS_LogAddRef[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x1325c7]
#03: InputStreamCallback::AddRef()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x91c085d]
#04: mozilla::RefPtrTraits<InputStreamCallback>::AddRef(InputStreamCallback*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9218455]
#05: RefPtr<InputStreamCallback>::ConstRemovingRefPtrTraits<InputStreamCallback>::AddRef(InputStreamCallback*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9218435]
#06: RefPtr<InputStreamCallback>::RefPtr(InputStreamCallback*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9218415]
#07: RefPtr<InputStreamCallback>::RefPtr(InputStreamCallback*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x92182fd]
#08: NonSeekableStringStream::AsyncWait(nsIInputStreamCallback*, unsigned int, unsigned int, nsIEventTarget*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x91f446a]
#09: mozilla::SlicedInputStream::AsyncWait(nsIInputStreamCallback*, unsigned int, unsigned int, nsIEventTarget*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x1bce07]
#10: TestSlicedInputStream_AsyncInputStream_Test::TestBody()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x91c78a8]
#11: void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x97337fe]
#12: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::)(), char const)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9710492]
#13: testing::Test::Run()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x97103c6]
#14: testing::TestInfo::Run()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9710fb5]
#15: testing::TestCase::Run()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x9711adf]
#16: testing::internal::UnitTestImpl::RunAllTests()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x971aac4]
#17: bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x973736e]
#18: bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::)(), char const)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x971a792]
#19: testing::UnitTest::Run()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x971a672]
#20: RUN_ALL_TESTS()[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x973e5e1]
#21: mozilla::RunGTestFunc(int*, char**)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x973e394]
#22: XREMain::XRE_mainStartup(bool*)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x8e67fae]
#23: XREMain::XRE_main(int, char**, mozilla::BootstrapConfig const&)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x8e6ff1a]
#24: XRE_main(int, char**, mozilla::BootstrapConfig const&)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x8e708b9]
#25: mozilla::BootstrapImpl::XRE_main(int, char**, mozilla::BootstrapConfig const&)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/gtest/XUL +0x8e87ac7]
#26: do_main(int, char**, char**)[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/firefox +0x13bd]
#27: main[/Users/henrik/code/gecko/obj/debug-full/dist/NightlyDebug.app/Contents/MacOS/firefox +0xd89]

Nathan, any idea why this could be back now, or is it just something different which your patch didn't fix?

Flags: needinfo?(nfroyd)

This is a different bug. Probably we have a refcounted InputStreamCallback in two different places:

https://searchfox.org/mozilla-central/source/xpcom/tests/gtest/Helpers.h#54
https://searchfox.org/mozilla-central/source/xpcom/tests/gtest/TestSlicedInputStream.cpp#16

and that is causing problems when instances of both of them are going through refcount logging at the same time.

Flags: needinfo?(nfroyd)
You need to log in before you can comment on or make changes to this bug.