Win64 crashes in media memory reporters when trying to generate an about:memory report

RESOLVED FIXED in mozilla32

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: RyanVM, Assigned: erahm)

Tracking

({crash})

unspecified
mozilla32
x86_64
Windows 7
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink:P2])

Attachments

(1 attachment)

When try to debug high memory usage, I was getting frequent crashes with the stack below:

xul.dll!nsACString_internal::SizeOfIncludingThisIfUnshared(unsigned __int64 (const void *) * mallocSizeOf) Line 1006	C++
xul.dll!mozilla::ChannelMediaResource::SizeOfExcludingThis(unsigned __int64 (const void *) * aMallocSizeOf) Line 595	C++
xul.dll!mozilla::MediaSourceResource::SizeOfIncludingThis(unsigned __int64 (const void *) * aMallocSizeOf) Line 401	C++
xul.dll!mozilla::MediaMemoryTracker::CollectReports(nsIMemoryReporterCallback * aHandleReport, nsISupports * aData) Line 1752	C++
xul.dll!nsMemoryReporterManager::GetReportsForThisProcessExtended(nsIMemoryReporterCallback * aHandleReport, nsISupports * aHandleReportData, const nsAString_internal & aDMDDumpIdent) Line 1113	C++
xul.dll!nsMemoryReporterManager::StartGettingReports() Line 1055	C++
xul.dll!nsMemoryReporterManager::GetReportsExtended(nsIMemoryReporterCallback * aHandleReport, nsISupports * aHandleReportData, nsIFinishReportingCallback * aFinishReporting, nsISupports * aFinishReportingData, bool aMinimize, const nsAString_internal & aDMDDumpIdent) Line 1037	C++
xul.dll!nsMemoryReporterManager::GetReports(nsIMemoryReporterCallback * aHandleReport, nsISupports * aHandleReportData, nsIFinishReportingCallback * aFinishReporting, nsISupports * aFinishReportingData) Line 959	C++

mallocSizeOf	0x000007fed3042550 {xul.dll!CategoryManagerMallocSizeOf(const void *)}	unsigned __int64 (const void *) *

this	0x0000000038db0600 {mData=0x000007fed4aac2d0 "`è:Ôþ\a" mLength=3567846048 mFlags=2046 }	nsACString_internal *
	mData	0x000007fed4aac2d0 "`è:Ôþ\a"	char *
		96 '`'	char
	mLength	3567846048	unsigned int
	mFlags	2046	unsigned int
Whiteboard: [MemShrink]
Component: Web Audio → Video/Audio
Ryan, do you have media.mediasource.enabled set to true in your prefs?  I'm not sure how you'd end up with a MediaSourceResource otherwise, unless the stack is bogus... which I'm suspicious of, because MediaSourceResource is-a MediaResource, not a ChannelMediaResource.
media.mediasource.enabled;false
Ryan, what version of Firefox was this on? I'm assuming this is a 32-bit build on 64-bit Windows 7 right?

I agree with Matthew, that stack looks bogus although I think I might know what's going on. We're doing a |blah.SizeOfIncludingThis| measurement where we should really be doing |blah.SizeOfExcludingThis|.

http://mxr.mozilla.org/mozilla-central/source/content/media/MediaResource.h#425
Home-brew 64bit build on Win7.
This should hopefully fix the crash, Ryan do you mind testing this for me?
Attachment #8414797 - Flags: feedback?(ryanvm)
Assignee: nobody → erahm
Status: NEW → ASSIGNED
Whiteboard: [MemShrink] → [MemShrink:P2]
Blocks: 1003479
Comment on attachment 8414797 [details] [diff] [review]
Use SizeOfExcludingThis for non-heap allocated member variable

Working well!
Attachment #8414797 - Flags: feedback?(ryanvm) → feedback+
Attachment #8414797 - Flags: review?(n.nethercote)
Comment on attachment 8414797 [details] [diff] [review]
Use SizeOfExcludingThis for non-heap allocated member variable

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

Bring on bug 1003479!
Attachment #8414797 - Flags: review?(n.nethercote) → review+
https://hg.mozilla.org/mozilla-central/rev/e0b5e968c38f
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
You need to log in before you can comment on or make changes to this bug.