Closed Bug 1657122 Opened 7 months ago Closed 7 months ago

Compact ObjectGroups

Categories

(Core :: JavaScript: GC, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: jonco, Assigned: jonco)

References

Details

Attachments

(1 file)

For bug 1654853 we have to be able to move all kinds of GC things in non-atoms zone and we don't move ObjectGroups at the moment. I don't think there's anything stopping us from doing this.

Severity: -- → N/A
Priority: -- → P3

Previously we didn't compact ObjectGroups, but doing this would hopfully unlock more memory savings in bug 1654853.

Most of the trickiness here comes from accessing objects whose object group is forwarded, so require special-case handling to get their class, compartment etc.

Duplicate of this bug: 1480772
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/664faa6f72ad
Compact ObjectGroups r=sfink,decoder

Backed out for tsan failures on Cell.h

backout: https://hg.mozilla.org/integration/autoland/rev/e4ac63e4ff762a77c33ebcbb82c7d9b640bc18f5

push: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&searchStr=linux%2C18.04%2Cx64%2Ctsan%2Copt%2C&revision=664faa6f72adbcfaecc7d51d6906a755c9775361&selectedTaskRun=ddPSCCBwQSOq7mF-VCqUkw.0

failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=312242911&repo=autoland&lineNumber=3681

[task 2020-08-06T11:16:34.422Z] 11:16:34 INFO - TEST-START | toolkit/components/extensions/test/mochitest/test_ext_background_page.html
[task 2020-08-06T11:16:36.061Z] 11:16:36 INFO - GECKO(3477) | Console message: [JavaScript Warning: "alert() is not supported in background windows; please use console.log instead." {file: "moz-extension://3da1a20f-442a-47c0-8744-59048bdc6fc7/%7Bf80b783d-75af-4a63-a405-96f0842d9ee1%7D.js" line: 2}]
[task 2020-08-06T11:16:36.061Z] 11:16:36 INFO - GECKO(3477) | Console message: [JavaScript Warning: "I am an alert in the background." {file: "moz-extension://3da1a20f-442a-47c0-8744-59048bdc6fc7/%7Bf80b783d-75af-4a63-a405-96f0842d9ee1%7D.js" line: 2}]
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | ==================
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | WARNING: ThreadSanitizer: data race (pid=3585)
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | Read of size 8 at 0x7f8408379b00 by thread T9:
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | #0 isForwarded /builds/worker/checkouts/gecko/js/src/gc/Cell.h:136:37 (libxul.so+0x6e35fc8)
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | #1 IsForwarded<JSObject> /builds/worker/checkouts/gecko/js/src/gc/Marking-inl.h:82:13 (libxul.so+0x6e35fc8)
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | #2 updateEdge<JSObject> /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2110:53 (libxul.so+0x6e35fc8)
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | #3 js::gc::MovingTracer::onObjectEdge(JSObject**) /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2117:59 (libxul.so+0x6e35fc8)
[task 2020-08-06T11:16:36.750Z] 11:16:36 INFO - GECKO(3477) | #4 dispatchToOnEdge /builds/worker/workspace/obj-build/dist/include/js/TracingAPI.h:259:51 (libxul.so+0x6ea441a)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #5 bool DoCallback<JSObject>(JS::CallbackTracer*, JSObject**, char const*) /builds/worker/checkouts/gecko/js/src/gc/Tracer.cpp:45:15 (libxul.so+0x6ea441a)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #6 TraceEdgeInternal<JSObject > /builds/worker/checkouts/gecko/js/src/gc/Marking.cpp:706:10 (libxul.so+0x6e7519f)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #7 TraceEdge<JSFunction > /builds/worker/checkouts/gecko/js/src/gc/Tracer.h:125:3 (libxul.so+0x6e7519f)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #8 TraceNullableEdge<JSFunction > /builds/worker/checkouts/gecko/js/src/gc/Tracer.h:152:5 (libxul.so+0x6e7519f)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #9 js::FunctionScope::AbstractData<JSAtom>::trace(JSTracer
) /builds/worker/checkouts/gecko/js/src/gc/Marking.cpp:1412:3 (libxul.so+0x6e7519f)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #10 operator()<js::FunctionScope::AbstractData<JSAtom> > /builds/worker/checkouts/gecko/js/src/gc/Marking.cpp:1444:48 (libxul.so+0x6e75933)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #11 applyScopeDataTyped<(lambda at /builds/worker/checkouts/gecko/js/src/gc/Marking.cpp:1444:23)> /builds/worker/checkouts/gecko/js/src/vm/Scope.h:1069:7 (libxul.so+0x6e75933)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #12 js::Scope::traceChildren(JSTracer
) /builds/worker/checkouts/gecko/js/src/gc/Marking.cpp:1444:3 (libxul.so+0x6e75933)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #13 UpdateCellPointers<js::Scope> /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2201:9 (libxul.so+0x6e3899c)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #14 UpdateArenaPointersTyped<js::Scope> /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2207:5 (libxul.so+0x6e3899c)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #15 UpdateArenaPointers /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2236:5 (libxul.so+0x6e3899c)
[task 2020-08-06T11:16:36.751Z] 11:16:36 INFO - GECKO(3477) | #16 UpdateArenaListSegmentPointers(js::gc::GCRuntime
, ArenaListSegment const&) /builds/worker/checkouts/gecko/js/src/gc/GC.cpp:2260:5 (libxul.so+0x6e3899c)
[task 2020-08-06T11:16:36.752Z] 11:16:36 INFO - GECKO(3477) | #17 js::gc::ParallelWorker<ArenaListSegment, ArenasToUpdate>::run() /builds/worker/checkouts/gecko/js/src/gc/ParallelWork.h:55:22 (libxul.so+0x6e6c660)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #18 js::GCParallelTask::runTask() /builds/worker/checkouts/gecko/js/src/gc/GCParallelTask.cpp:146:3 (libxul.so+0x6e5f7af)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #19 js::GCParallelTask::runFromHelperThread(js::AutoLockHelperThreadState&) /builds/worker/checkouts/gecko/js/src/gc/GCParallelTask.cpp:131:5 (libxul.so+0x6e5f63e)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #20 js::HelperThread::handleGCParallelWorkload(js::AutoLockHelperThreadState&) /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:1690:21 (libxul.so+0x68cc142)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #21 js::HelperThread::threadLoop() /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:2448:5 (libxul.so+0x68cdf57)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #22 js::HelperThread::ThreadMain(void
) /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:2019:11 (libxul.so+0x68ca2ad)
[task 2020-08-06T11:16:36.753Z] 11:16:36 INFO - GECKO(3477) | #23 callMain<0> /builds/worker/checkouts/gecko/js/src/threading/Thread.h:217:5 (libxul.so+0x68d6af0)
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | #24 js::detail::ThreadTrampoline<void (&)(void*), js::HelperThread*>::Start(void*) /builds/worker/checkouts/gecko/js/src/threading/Thread.h:206:11 (libxul.so+0x68d6af0)
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | Previous write of size 8 at 0x7f8408379b00 by thread T10:
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | [failed to restore the stack]
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | Thread T9 'JS Helper' (tid=3611, running) created by main thread at:
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | #0 pthread_create /builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:967:3 (firefox+0x584eb)
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | #1 js::Thread::create(void* ()(void), void*) /builds/worker/checkouts/gecko/js/src/threading/posix/PosixThread.cpp:52:7 (libxul.so+0x6831201)
[task 2020-08-06T11:16:36.759Z] 11:16:36 INFO - GECKO(3477) | #2 bool js::Thread::init<void (&)(void*), js::HelperThread*>(void (&)(void*), js::HelperThread*&&) /builds/worker/checkouts/gecko/js/src/threading/Thread.h:90:12 (libxul.so+0x68ca1c2)
[task 2020-08-06T11:16:36.760Z] 11:16:36 INFO - GECKO(3477) | #3 js::GlobalHelperThreadState::ensureInitialized() /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:1124:27 (libxul.so+0x68c533a)
[task 2020-08-06T11:16:36.761Z] 11:16:36 INFO - GECKO(3477) | #4 js::EnsureHelperThreadsInitialized() /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:96:30 (libxul.so+0x68c4f82)
[task 2020-08-06T11:16:36.761Z] 11:16:36 INFO - GECKO(3477) | #5 JSRuntime::init(JSContext*, unsigned int) /builds/worker/checkouts/gecko/js/src/vm/Runtime.cpp:200:32 (libxul.so+0x6a2f5c2)
[task 2020-08-06T11:16:36.761Z] 11:16:36 INFO - GECKO(3477) | #6 js::NewContext(unsigned int, JSRuntime*) /builds/worker/checkouts/gecko/js/src/vm/JSContext.cpp:183:17 (libxul.so+0x69697cf)
[task 2020-08-06T11:16:36.761Z] 11:16:36 INFO - GECKO(3477) | #7 JS_NewContext(unsigned int, JSRuntime*) /builds/worker/checkouts/gecko/js/src/jsapi.cpp:395:10 (libxul.so+0x67cb374)
[task 2020-08-06T11:16:36.763Z] 11:16:36 INFO - GECKO(3477) | #8 mozilla::CycleCollectedJSContext::Initialize(JSRuntime*, unsigned int) /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp:127:16 (libxul.so+0xa2575b)
[task 2020-08-06T11:16:36.764Z] 11:16:36 INFO - GECKO(3477) | #9 XPCJSContext::Initialize() /builds/worker/checkouts/gecko/js/xpconnect/src/XPCJSContext.cpp:1134:32 (libxul.so+0x198e4ca)
[task 2020-08-06T11:16:36.766Z] 11:16:36 INFO - GECKO(3477) | #10 XPCJSContext::NewXPCJSContext() /builds/worker/checkouts/gecko/js/xpconnect/src/XPCJSContext.cpp:1330:23 (libxul.so+0x198f0a7)
[task 2020-08-06T11:16:36.767Z] 11:16:36 INFO - GECKO(3477) | #11 InitJSContext /builds/worker/checkouts/gecko/js/xpconnect/src/nsXPConnect.cpp:80:25 (libxul.so+0x19cadd3)
[task 2020-08-06T11:16:36.768Z] 11:16:36 INFO - GECKO(3477) | #12 xpc::InitializeJSContext() /builds/worker/checkouts/gecko/js/xpconnect/src/nsXPConnect.cpp:95:35 (libxul.so+0x19cadd3)
[task 2020-08-06T11:16:36.769Z] 11:16:36 INFO - GECKO(3477) | #13 NS_InitXPCOM /builds/worker/checkouts/gecko/xpcom/build/XPCOMInit.cpp:491:5 (libxul.so+0xb5c9fe)
[task 2020-08-06T11:16:36.770Z] 11:16:36 INFO - GECKO(3477) | #14 XRE_InitEmbedding2(nsIFile*, nsIFile*, nsIDirectoryServiceProvider*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:197:8 (libxul.so+0x65e97f4)
[task 2020-08-06T11:16:36.773Z] 11:16:36 INFO - GECKO(3477) | #15 mozilla::ipc::ScopedXREEmbed::Start() /builds/worker/checkouts/gecko/ipc/glue/ScopedXREEmbed.cpp (libxul.so+0x14116f3)
[task 2020-08-06T11:16:36.782Z] 11:16:36 INFO - GECKO(3477) | #16 mozilla::dom::ContentProcess::Init(int, char**) /builds/worker/checkouts/gecko/dom/ipc/ContentProcess.cpp:201:13 (libxul.so+0x453f6b2)
[task 2020-08-06T11:16:36.783Z] 11:16:36 INFO - GECKO(3477) | #17 XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:710:21 (libxul.so+0x65ea022)
[task 2020-08-06T11:16:36.784Z] 11:16:36 INFO - GECKO(3477) | #18 mozilla::BootstrapImpl::XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/Bootstrap.cpp:67:12 (libxul.so+0x65f2152)
[task 2020-08-06T11:16:36.784Z] 11:16:36 INFO - GECKO(3477) | #19 content_process_main /builds/worker/checkouts/gecko/browser/app/../../ipc/contentproc/plugin-container.cpp:56:28 (firefox+0xca0d7)
[task 2020-08-06T11:16:36.785Z] 11:16:36 INFO - GECKO(3477) | #20 main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:303:18 (firefox+0xca0d7)
[task 2020-08-06T11:16:36.786Z] 11:16:36 INFO - GECKO(3477) | Thread T10 'JS Helper' (tid=3612, running) created by main thread at:
[task 2020-08-06T11:16:36.787Z] 11:16:36 INFO - GECKO(3477) | #0 pthread_create /builds/worker/fetches/llvm-project/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:967:3 (firefox+0x584eb)
[task 2020-08-06T11:16:36.788Z] 11:16:36 INFO - GECKO(3477) | #1 js::Thread::create(void* ()(void), void*) /builds/worker/checkouts/gecko/js/src/threading/posix/PosixThread.cpp:52:7 (libxul.so+0x6831201)
[task 2020-08-06T11:16:36.789Z] 11:16:36 INFO - GECKO(3477) | #2 bool js::Thread::init<void (&)(void*), js::HelperThread*>(void (&)(void*), js::HelperThread*&&) /builds/worker/checkouts/gecko/js/src/threading/Thread.h:90:12 (libxul.so+0x68ca1c2)
[task 2020-08-06T11:16:36.790Z] 11:16:36 INFO - GECKO(3477) | #3 js::GlobalHelperThreadState::ensureInitialized() /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:1124:27 (libxul.so+0x68c533a)
[task 2020-08-06T11:16:36.790Z] 11:16:36 INFO - GECKO(3477) | #4 js::EnsureHelperThreadsInitialized() /builds/worker/checkouts/gecko/js/src/vm/HelperThreads.cpp:96:30 (libxul.so+0x68c4f82)
[task 2020-08-06T11:16:36.791Z] 11:16:36 INFO - GECKO(3477) | #5 JSRuntime::init(JSContext*, unsigned int) /builds/worker/checkouts/gecko/js/src/vm/Runtime.cpp:200:32 (libxul.so+0x6a2f5c2)
[task 2020-08-06T11:16:36.792Z] 11:16:36 INFO - GECKO(3477) | #6 js::NewContext(unsigned int, JSRuntime*) /builds/worker/checkouts/gecko/js/src/vm/JSContext.cpp:183:17 (libxul.so+0x69697cf)
[task 2020-08-06T11:16:36.793Z] 11:16:36 INFO - GECKO(3477) | #7 JS_NewContext(unsigned int, JSRuntime*) /builds/worker/checkouts/gecko/js/src/jsapi.cpp:395:10 (libxul.so+0x67cb374)
[task 2020-08-06T11:16:36.794Z] 11:16:36 INFO - GECKO(3477) | #8 mozilla::CycleCollectedJSContext::Initialize(JSRuntime*, unsigned int) /builds/worker/checkouts/gecko/xpcom/base/CycleCollectedJSContext.cpp:127:16 (libxul.so+0xa2575b)
[task 2020-08-06T11:16:36.795Z] 11:16:36 INFO - GECKO(3477) | #9 XPCJSContext::Initialize() /builds/worker/checkouts/gecko/js/xpconnect/src/XPCJSContext.cpp:1134:32 (libxul.so+0x198e4ca)
[task 2020-08-06T11:16:36.795Z] 11:16:36 INFO - GECKO(3477) | #10 XPCJSContext::NewXPCJSContext() /builds/worker/checkouts/gecko/js/xpconnect/src/XPCJSContext.cpp:1330:23 (libxul.so+0x198f0a7)
[task 2020-08-06T11:16:36.796Z] 11:16:36 INFO - GECKO(3477) | #11 InitJSContext /builds/worker/checkouts/gecko/js/xpconnect/src/nsXPConnect.cpp:80:25 (libxul.so+0x19cadd3)
[task 2020-08-06T11:16:36.797Z] 11:16:36 INFO - GECKO(3477) | #12 xpc::InitializeJSContext() /builds/worker/checkouts/gecko/js/xpconnect/src/nsXPConnect.cpp:95:35 (libxul.so+0x19cadd3)
[task 2020-08-06T11:16:36.798Z] 11:16:36 INFO - GECKO(3477) | #13 NS_InitXPCOM /builds/worker/checkouts/gecko/xpcom/build/XPCOMInit.cpp:491:5 (libxul.so+0xb5c9fe)
[task 2020-08-06T11:16:36.799Z] 11:16:36 INFO - GECKO(3477) | #14 XRE_InitEmbedding2(nsIFile*, nsIFile*, nsIDirectoryServiceProvider*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:197:8 (libxul.so+0x65e97f4)
[task 2020-08-06T11:16:36.799Z] 11:16:36 INFO - GECKO(3477) | #15 mozilla::ipc::ScopedXREEmbed::Start() /builds/worker/checkouts/gecko/ipc/glue/ScopedXREEmbed.cpp (libxul.so+0x14116f3)
[task 2020-08-06T11:16:36.800Z] 11:16:36 INFO - GECKO(3477) | #16 mozilla::dom::ContentProcess::Init(int, char**) /builds/worker/checkouts/gecko/dom/ipc/ContentProcess.cpp:201:13 (libxul.so+0x453f6b2)
[task 2020-08-06T11:16:36.800Z] 11:16:36 INFO - GECKO(3477) | #17 XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/nsEmbedFunctions.cpp:710:21 (libxul.so+0x65ea022)
[task 2020-08-06T11:16:36.801Z] 11:16:36 INFO - GECKO(3477) | #18 mozilla::BootstrapImpl::XRE_InitChildProcess(int, char**, XREChildData const*) /builds/worker/checkouts/gecko/toolkit/xre/Bootstrap.cpp:67:12 (libxul.so+0x65f2152)
[task 2020-08-06T11:16:36.801Z] 11:16:36 INFO - GECKO(3477) | #19 content_process_main /builds/worker/checkouts/gecko/browser/app/../../ipc/contentproc/plugin-container.cpp:56:28 (firefox+0xca0d7)
[task 2020-08-06T11:16:36.801Z] 11:16:36 INFO - GECKO(3477) | #20 main /builds/worker/checkouts/gecko/browser/app/nsBrowserApp.cpp:303:18 (firefox+0xca0d7)
[task 2020-08-06T11:16:36.801Z] 11:16:36 INFO - GECKO(3477) | SUMMARY: ThreadSanitizer: data race /builds/worker/checkouts/gecko/js/src/gc/Cell.h:136:37 in isForwarded
[task 2020-08-06T11:16:36.801Z] 11:16:36 INFO - GECKO(3477) | ==================

Flags: needinfo?(jcoppeard)
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c2e54aca9d4e
Compact ObjectGroups r=sfink,decoder
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
Flags: needinfo?(jcoppeard)
You need to log in before you can comment on or make changes to this bug.