WebRenderBridgeParent can be destroyed on scene builder thread, violating WeakPtr threading assertions
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
People
(Reporter: kats, Assigned: nical)
References
Details
Attachments
(2 obsolete files)
Seen on a try push:
[task 2020-07-07T11:46:51.251Z] 11:46:51 INFO - REFTEST TEST-LOAD | http://localhost:50186/1594122129537/4/579808-1.html | 1499 / 2052 (73%)
[task 2020-07-07T11:46:51.252Z] 11:46:51 INFO - [Child 1543, Main Thread] WARNING: NS_ENSURE_TRUE(browserChrome) failed: file /builds/worker/checkouts/gecko/docshell/base/nsDocShell.cpp, line 11384
[task 2020-07-07T11:46:51.283Z] 11:46:51 INFO - Assertion failure: false (WeakPtr accessed from multiple threads), at /builds/worker/workspace/obj-build/dist/include/mozilla/WeakPtr.h:167
[task 2020-07-07T11:46:51.283Z] 11:46:51 INFO - #01: mozilla::layers::WebRenderBridgeParent::~WebRenderBridgeParent() [gfx/layers/wr/WebRenderBridgeParent.cpp:382]
[task 2020-07-07T11:46:51.284Z] 11:46:51 INFO - #02: non-virtual thunk to mozilla::layers::WebRenderBridgeParent::~WebRenderBridgeParent() [gfx/layers/wr/WebRenderBridgeParent.cpp:0]
[task 2020-07-07T11:46:51.285Z] 11:46:51 INFO - #03: mozilla::layers::SceneBuiltNotification::~SceneBuiltNotification() [gfx/layers/wr/WebRenderBridgeParent.cpp:212]
[task 2020-07-07T11:46:51.285Z] 11:46:51 INFO - #04: webrender_api::api::NotificationRequest::notify [gfx/wr/webrender_api/src/api.rs:2063]
[task 2020-07-07T11:46:51.285Z] 11:46:51 INFO - #05: webrender::scene_builder_thread::SceneBuilderThread::process_transaction [gfx/wr/webrender/src/scene_builder_thread.rs:744]
[task 2020-07-07T11:46:51.285Z] 11:46:51 INFO - #06: webrender::scene_builder_thread::SceneBuilderThread::run [gfx/wr/webrender/src/scene_builder_thread.rs:342]
[task 2020-07-07T11:46:51.293Z] 11:46:51 INFO - #07: std::sys_common::backtrace::__rust_begin_short_backtrace [git:github.com/rust-lang/rust:src/libstd/sys_common/backtrace.rs:4fb7144ed159f94491249e86d5bbd033b5d60550:130]
[task 2020-07-07T11:46:51.294Z] 11:46:51 INFO - #08: std::panicking::try::do_call [git:github.com/rust-lang/rust:src/libstd/panicking.rs:4fb7144ed159f94491249e86d5bbd033b5d60550:305]
[task 2020-07-07T11:46:51.588Z] 11:46:51 INFO - [GFX1-]: Receive IPC close with reason=AbnormalShutdown
Looks like the SceneBuiltNotification
holds a refptr to the WRBP, and that ends up being the last strong pointer to it, so when the scene builder thread unwinds it deletes the WRBP. Which doesn't play well with WeakPtrs, because apparently that is not threadsafe.
As far as I can tell WRBP itself doesn't hold WeakPtrs to anything, but there is a WeakPtr to the WRBP, here.
Updated•4 years ago
|
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
This tastes more like a workaround than a satisfying fix for having strong references to webrender WRBP moving around threads but a better fix would probably need to be quite a bit more involved.
Updated•4 years ago
|
Comment 3•4 years ago
|
||
I think we should make the IPC actor inherit from the now available ThreadSafeWeakPtr. This artificial limitation on where an actor must be destroyed or referenced from is not particularly useful.
Nika, do you have an opinion on the matter?
Comment 4•4 years ago
|
||
That seems fine, especially if the type is already generally threadsafe.
Give PWebRenderBridge
is already reference counted, it would be nice to mark it as a refcounted
actor in IPDL as well.
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•