Open Bug 1495659 Opened 5 years ago Updated 1 year ago

LSAN leaks when creating nsDocShell

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

People

(Reporter: farre, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug XXX is going to remove the do_CreateInstance("@mozilla.org/docshell;1"); constructor for nsDocShell in favor of nsDocShell::Create(BrowsingContext*).

This exposes two leaks in ASAN builds running wpt that have been hidden since nsComponentManagerImpl is supressed as a source of leaks for LSAN.

The leaks appears to be related to data that nsLoadGroup handles.
That should've said Bug 1480198.
Depends on: 1480198
Priority: -- → P2
Oh, that's an interesting find. At some point we should look into freeing those data structures in leak checking builds to avoid that.
Blocks: LSan
Attachment #9013529 - Attachment mime type: text/x-log → text/plain
The supression of this leak is done by adding an exception for nsDocShell::Create in testing/web-platform/meta/websockets/__dir__.ini and testing/web-platform/meta/service-workers/service-worker/__dir__.ini

The stacks where nsDocShell::Create are supressed are:

First stack:
===============================================================
[task 2018-09-26T14:06:58.598Z] 14:06:58     INFO - PID 21136 |     #0 0x55736179c263 in malloc /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88:3
[task 2018-09-26T14:06:58.599Z] 14:06:58     INFO - PID 21136 |     #1 0x5573617cd5ed in moz_xmalloc /builds/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:70:17
[task 2018-09-26T14:06:58.599Z] 14:06:58     INFO - PID 21136 |     #2 0x7fbb95dfd6b3 in operator new /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:139:12
[task 2018-09-26T14:06:58.600Z] 14:06:58     INFO - PID 21136 |     #3 0x7fbb95dfd6b3 in nsSupportsWeakReference::GetWeakReference(nsIWeakReference**) /builds/worker/workspace/build/src/xpcom/base/nsWeakReference.cpp:122
[task 2018-09-26T14:06:58.601Z] 14:06:58     INFO - PID 21136 |     #4 0x7fbb95dfd3c6 in NS_GetWeakReference(nsISupports*, nsresult*) /builds/worker/workspace/build/src/xpcom/base/nsWeakReference.cpp:101:28
[task 2018-09-26T14:06:58.601Z] 14:06:58     INFO - PID 21136 |     #5 0x7fbb961638f5 in do_GetWeakReference /builds/worker/workspace/build/src/obj-firefox/dist/include/nsIWeakReferenceUtils.h:58:22
[task 2018-09-26T14:06:58.602Z] 14:06:58     INFO - PID 21136 |     #6 0x7fbb961638f5 in mozilla::net::nsLoadGroup::SetGroupObserver(nsIRequestObserver*) /builds/worker/workspace/build/src/netwerk/base/nsLoadGroup.cpp:663
[task 2018-09-26T14:06:58.603Z] 14:06:58     INFO - PID 21136 |     #7 0x7fbb96176c9f in NS_NewLoadGroup(nsILoadGroup**, nsIRequestObserver*) /builds/worker/workspace/build/src/netwerk/base/nsNetUtil.cpp:967:21
[task 2018-09-26T14:06:58.604Z] 14:06:58     INFO - PID 21136 |     #8 0x7fbb97e1e4e7 in nsDocLoader::Init() /builds/worker/workspace/build/src/uriloader/base/nsDocLoader.cpp:134:17
[task 2018-09-26T14:06:58.604Z] 14:06:58     INFO - PID 21136 |     #9 0x7fbba0f7bfdb in nsDocShell::Create(mozilla::dom::BrowsingContext*) /builds/worker/workspace/build/src/docshell/base/nsDocShell.cpp:459:25
[task 2018-09-26T14:06:58.605Z] 14:06:58     INFO - PID 21136 |     #10 0x7fbb993184aa in nsFrameLoader::MaybeCreateDocShell() /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:2059:15
[task 2018-09-26T14:06:58.606Z] 14:06:58     INFO - PID 21136 |     #11 0x7fbb9931c028 in nsFrameLoader::CheckForRecursiveLoad(nsIURI*) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:2298:8
[task 2018-09-26T14:06:58.607Z] 14:06:58     INFO - PID 21136 |     #12 0x7fbb993128b9 in CheckURILoad /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:596:10
[task 2018-09-26T14:06:58.607Z] 14:06:58     INFO - PID 21136 |     #13 0x7fbb993128b9 in nsFrameLoader::LoadURI(nsIURI*, nsIPrincipal*, bool) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:335
[task 2018-09-26T14:06:58.608Z] 14:06:58     INFO - PID 21136 |     #14 0x7fbb99311d01 in nsFrameLoader::LoadFrame(bool) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:289:10
[task 2018-09-26T14:06:58.608Z] 14:06:58     INFO - PID 21136 |     #15 0x7fbb9c4752d1 in LoadSrc /builds/worker/workspace/build/src/dom/html/nsGenericHTMLFrameElement.cpp:228:17
[task 2018-09-26T14:06:58.609Z] 14:06:58     INFO - PID 21136 |     #16 0x7fbb9c4752d1 in nsGenericHTMLFrameElement::BindToTree(nsIDocument*, nsIContent*, nsIContent*) /builds/worker/workspace/build/src/dom/html/nsGenericHTMLFrameElement.cpp:247
[task 2018-09-26T14:06:58.609Z] 14:06:58     INFO - PID 21136 |     #17 0x7fbb9926ed16 in nsINode::InsertChildBefore(nsIContent*, nsIContent*, bool) /builds/worker/workspace/build/src/dom/base/nsINode.cpp:1443:23
[task 2018-09-26T14:06:58.610Z] 14:06:58     INFO - PID 21136 |     #18 0x7fbb99354321 in nsINode::ReplaceOrInsertBefore(bool, nsINode*, nsINode*, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/base/nsINode.cpp:2603:14
[task 2018-09-26T14:06:58.610Z] 14:06:58     INFO - PID 21136 |     #19 0x7fbb99cb76fa in InsertBefore /builds/worker/workspace/build/src/obj-firefox/dist/include/nsINode.h:1798:12
[task 2018-09-26T14:06:58.611Z] 14:06:58     INFO - PID 21136 |     #20 0x7fbb99cb76fa in AppendChild /builds/worker/workspace/build/src/obj-firefox/dist/include/nsINode.h:1802
[task 2018-09-26T14:06:58.611Z] 14:06:58     INFO - PID 21136 |     #21 0x7fbb99cb76fa in mozilla::dom::Node_Binding::appendChild(JSContext*, JS::Handle<JSObject*>, nsINode*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings


Second stack:
===============================================================
[task 2018-09-26T14:06:58.670Z] 14:06:58     INFO - PID 21136 |     #0 0x55736179c263 in malloc /builds/worker/workspace/moz-toolchain/src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88:3
[task 2018-09-26T14:06:58.670Z] 14:06:58     INFO - PID 21136 |     #1 0x5573617cd5ed in moz_xmalloc /builds/worker/workspace/build/src/memory/mozalloc/mozalloc.cpp:70:17
[task 2018-09-26T14:06:58.672Z] 14:06:58     INFO - PID 21136 |     #2 0x7fbba0f7c299 in operator new /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/mozalloc.h:139:12
[task 2018-09-26T14:06:58.672Z] 14:06:58     INFO - PID 21136 |     #3 0x7fbba0f7c299 in nsDocShell::Create(mozilla::dom::BrowsingContext*) /builds/worker/workspace/build/src/docshell/base/nsDocShell.cpp:480
[task 2018-09-26T14:06:58.672Z] 14:06:58     INFO - PID 21136 |     #4 0x7fbb993184aa in nsFrameLoader::MaybeCreateDocShell() /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:2059:15
[task 2018-09-26T14:06:58.674Z] 14:06:58     INFO - PID 21136 |     #5 0x7fbb9931c028 in nsFrameLoader::CheckForRecursiveLoad(nsIURI*) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:2298:8
[task 2018-09-26T14:06:58.674Z] 14:06:58     INFO - PID 21136 |     #6 0x7fbb993128b9 in CheckURILoad /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:596:10
[task 2018-09-26T14:06:58.676Z] 14:06:58     INFO - PID 21136 |     #7 0x7fbb993128b9 in nsFrameLoader::LoadURI(nsIURI*, nsIPrincipal*, bool) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:335
[task 2018-09-26T14:06:58.676Z] 14:06:58     INFO - PID 21136 |     #8 0x7fbb99311d01 in nsFrameLoader::LoadFrame(bool) /builds/worker/workspace/build/src/dom/base/nsFrameLoader.cpp:289:10
[task 2018-09-26T14:06:58.678Z] 14:06:58     INFO - PID 21136 |     #9 0x7fbb9c4752d1 in LoadSrc /builds/worker/workspace/build/src/dom/html/nsGenericHTMLFrameElement.cpp:228:17
[task 2018-09-26T14:06:58.678Z] 14:06:58     INFO - PID 21136 |     #10 0x7fbb9c4752d1 in nsGenericHTMLFrameElement::BindToTree(nsIDocument*, nsIContent*, nsIContent*) /builds/worker/workspace/build/src/dom/html/nsGenericHTMLFrameElement.cpp:247
[task 2018-09-26T14:06:58.679Z] 14:06:58     INFO - PID 21136 |     #11 0x7fbb9926ed16 in nsINode::InsertChildBefore(nsIContent*, nsIContent*, bool) /builds/worker/workspace/build/src/dom/base/nsINode.cpp:1443:23
[task 2018-09-26T14:06:58.681Z] 14:06:58     INFO - PID 21136 |     #12 0x7fbb99354321 in nsINode::ReplaceOrInsertBefore(bool, nsINode*, nsINode*, mozilla::ErrorResult&) /builds/worker/workspace/build/src/dom/base/nsINode.cpp:2603:14
[task 2018-09-26T14:06:58.681Z] 14:06:58     INFO - PID 21136 |     #13 0x7fbb99cb76fa in InsertBefore /builds/worker/workspace/build/src/obj-firefox/dist/include/nsINode.h:1798:12
[task 2018-09-26T14:06:58.682Z] 14:06:58     INFO - PID 21136 |     #14 0x7fbb99cb76fa in AppendChild /builds/worker/workspace/build/src/obj-firefox/dist/include/nsINode.h:1802
[task 2018-09-26T14:06:58.683Z] 14:06:58     INFO - PID 21136 |     #15 0x7fbb99cb76fa in mozilla::dom::Node_Binding::appendChild(JSContext*, JS::Handle<JSObject*>, nsINode*, JSJitMethodCallArgs const&) /builds/worker/workspace/build/src/obj-firefox/dom/bindings

See try https://treeherder.mozilla.org/#/jobs?repo=try&revision=e45e950c73e72fdb909261fedbe7de601c897929&selectedJob=201688045 linux64-asan w-e10s(wpt7) and w-e10s(wpt8)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.