Closed
Bug 1122722
Opened 9 years ago
Closed 9 years ago
ImageBridgeParent::RecvUpdate calls layers::Compositor::GetBackend from the wrong thread (e10s)
Categories
(Core :: Graphics: Layers, defect)
Core
Graphics: Layers
Tracking
()
People
(Reporter: bwc, Assigned: milan)
References
Details
(Keywords: sec-high, Whiteboard: [adv-main36-])
Attachments
(3 files, 2 obsolete files)
6.39 KB,
patch
|
milan
:
review+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
6.36 KB,
patch
|
milan
:
review+
abillings
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
5.64 KB,
patch
|
milan
:
review+
abillings
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
Just saw this stack while running some e10s mochitests under linux ASAN: Jan 16 12:40:03 Assertion failure: CompositorParent::CompositorLoop() == MessageLoop::current() (Can only call this from the compositor thread!), at ../../../gfx/layers/Compositor.cpp:49 Jan 16 12:40:04 #01: mozilla::layers::ImageBridgeParent::RecvUpdate(nsTArray<mozilla::layers::CompositableOperation> const&, nsTArray<mozilla::layers::EditReply>*) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/gfx/layers/../../../gfx/layers/ipc/ ImageBridgeParent.cpp:120) Jan 16 12:40:04 #02: mozilla::layers::ImageBridgeParent::RecvUpdateNoSwap(nsTArray<mozilla::layers::CompositableOperation> const&) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/gfx/layers/../../../gfx/layers/ipc/ImageBridgeParent.cpp:150) Jan 16 12:40:04 #03: mozilla::layers::PImageBridgeParent::OnMessageReceived(IPC::Message const&) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/ipdl/./PImageBridgeParent.cpp:384) Jan 16 12:40:04 #04: ~AutoSetValue (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/glue/../../dist/include/mozilla/ipc/MessageChannel.h:490) Jan 16 12:40:04 #05: ~Maybe (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/glue/../../dist/include/mozilla/Maybe.h:95) Jan 16 12:40:04 #06: mozilla::ipc::MessageChannel::OnMaybeDequeueOne() (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/glue/../../../ipc/glue/MessageChannel.cpp:1130) Jan 16 12:40:04 #07: MessageLoop::RunTask(Task*) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_loop.cc:361) Jan 16 12:40:04 #08: MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask const&) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_loop.cc:369) Jan 16 12:40:04 #09: MessageLoop::DoWork() (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_loop.cc:447) Jan 16 12:40:04 #10: base::MessagePumpDefault::Run(base::MessagePump::Delegate*) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_pump_default.cc:34) Jan 16 12:40:04 #11: MessageLoop::RunInternal() (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_loop.cc:234) Jan 16 12:40:04 #12: ~AutoRunState (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/message_loop.cc:508) Jan 16 12:40:04 #13: base::Thread::ThreadMain() (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/thread.cc:173) Jan 16 12:40:04 #14: ThreadFunc(void*) (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/chromium/../../../ipc/chromium/src/base/platform_thread_posix.cc:39) Jan 16 12:40:04 #15: ??? (/lib64/libpthread.so.0) Jan 16 12:40:04 #16: clone (/lib64/libc.so.6) Jan 16 12:40:04 #17: ??? (???:???) Jan 16 12:40:04 ASAN:SIGSEGV Not sure how dangerous this really is, but marking security until the determination can be made.
Updated•9 years ago
|
Component: IPC → Graphics: Layers
Comment 1•9 years ago
|
||
> mozilla::layers::ImageBridgeParent::RecvUpdate(nsTArray<mozilla::layers::
> CompositableOperation> const&, nsTArray<mozilla::layers::EditReply>*)
> (/home/bcampen/checkouts/latest-central/objdir-ff-asan/gfx/layers/../../../
> gfx/layers/ipc/ ImageBridgeParent.cpp:120)
> Jan 16 12:40:04 #02:
> mozilla::layers::ImageBridgeParent::RecvUpdateNoSwap(nsTArray<mozilla::
> layers::CompositableOperation> const&)
> (/home/bcampen/checkouts/latest-central/objdir-ff-asan/gfx/layers/../../../
> gfx/layers/ipc/ImageBridgeParent.cpp:150)
> Jan 16 12:40:04 #03:
> mozilla::layers::PImageBridgeParent::OnMessageReceived(IPC::Message const&)
> (/home/bcampen/checkouts/latest-central/objdir-ff-asan/ipc/ipdl/./
> PImageBridgeParent.cpp:384)
This stuff only ever runs on the compositor thread which is the correct one, so my guess is that this is happening late in the shutdown sequence after a point where the pointer to the compositor thread in CompositorParent.cpp has been de-initialized already (see CompositorParent::ShutDown) which means CompositorParent::CompositorLoop() isn't returning the compositor's message loop.
Updated•9 years ago
|
Whiteboard: [gfx-noted]
Assignee | ||
Comment 2•9 years ago
|
||
So, should we reset the back end to LAYERS_NONE on shutdown?
Attachment #8551907 -
Flags: feedback?(nical.bugzilla)
Updated•9 years ago
|
status-firefox38:
--- → affected
Updated•9 years ago
|
tracking-e10s:
--- → m8+
Comment 3•9 years ago
|
||
Comment on attachment 8551907 [details] [diff] [review] Allow resetting the back end? Review of attachment 8551907 [details] [diff] [review]: ----------------------------------------------------------------- This is fine, though i'd like to understand why recently we got a wave of bugs related to gfx ipc being used after the shutdown of threads. Ideally we would not have sBackend at all (this thing is a ticking bomb on windows where there are popups using basic layers while the rest uses accelerated layers).
Attachment #8551907 -
Flags: feedback?(nical.bugzilla) → feedback+
Comment 4•9 years ago
|
||
Just to increase the awareness: this patch seems to fix the intermittent in bug 1091322. And bug 1117650 needs this bugfix here to land. Here is the test run which I'm basing my statements on: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2cabfcd658a3 Note: as the attached patch doesn't apply to m-c cleanly any more I left out one MOZASSERT for the above try run.
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8551907 [details] [diff] [review] Allow resetting the back end? Since this helps bug 1091322, let's go for the review, rather than feedback, and I'll get a try run going.
Attachment #8551907 -
Flags: review?(nical.bugzilla)
Assignee | ||
Updated•9 years ago
|
Attachment #8551907 -
Attachment description: Allow resetting the back end? (wip) → Allow resetting the back end?
Assignee | ||
Comment 6•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=98496948a2a5
Assignee | ||
Comment 7•9 years ago
|
||
Carry :nical's f+. Rebased, otherwise no changes.
Attachment #8551907 -
Attachment is obsolete: true
Attachment #8551907 -
Flags: review?(nical.bugzilla)
Attachment #8554673 -
Flags: review?(nical.bugzilla)
Attachment #8554673 -
Flags: feedback+
Updated•9 years ago
|
Attachment #8554673 -
Flags: review?(nical.bugzilla) → review+
Comment 8•9 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #6) > https://treeherder.mozilla.org/#/jobs?repo=try&revision=98496948a2a5 WinXP debug looks pretty angry :(
Comment 9•9 years ago
|
||
I'm going to mark this sec-high, because it sounds like it could be bad, but if it is only happening on shut down that will make it harder to exploit. Adjust as desired.
Keywords: sec-high
Assignee | ||
Comment 10•9 years ago
|
||
Before bug 972891 is fixed, we have to (keep) stay(ing) away from asserting that the compositor doesn't change. This just gets us back to where the original code was, only putting out the warning on OS X, and not asserting anywhere. Re-running try on windows only https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec550e006124
Attachment #8554673 -
Attachment is obsolete: true
Attachment #8555461 -
Flags: review+
Assignee | ||
Comment 12•9 years ago
|
||
Comment on attachment 8555461 [details] [diff] [review] Clean up the asserts in the compositor. Carry r=nical [Security approval request comment] How easily could an exploit be constructed based on the patch? Not easily, especially as the most critical part is mixed up with additional debugging changes. It also only applies to the debug build. Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? No. Which older supported branches are affected by this flaw? If not all supported branches, which bug introduced the flaw? 885580. Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be? Not hard, and should just apply, but this is a debug build only issue, so I'm not convinced it's worth it. How likely is this patch to cause regressions; how much testing does it need? Not likely.
Attachment #8555461 -
Flags: sec-approval?
Comment 13•9 years ago
|
||
This goes back forever. I'll give it sec-approval+ but we should take it on Aurora, Beta, and ESR31 as well.
status-firefox35:
--- → wontfix
status-firefox36:
--- → affected
status-firefox37:
--- → affected
status-firefox-esr38:
--- → affected
tracking-firefox36:
--- → +
tracking-firefox37:
--- → +
tracking-firefox38:
--- → +
tracking-firefox-esr38:
--- → 36+
Updated•9 years ago
|
Attachment #8555461 -
Flags: sec-approval? → sec-approval+
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Al Billings [:abillings] from comment #13) > This goes back forever. I'll give it sec-approval+ but we should take it on > Aurora, Beta, and ESR31 as well. Al, this is a debug change only - do we still want it on these other branches? I don't mind, just clarifying what we usually do.
Keywords: checkin-needed
Whiteboard: [gfx-noted]
Comment 15•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/cf5abbbc9f49 Looks like the esr tracking flags got on the wrong version, btw.
status-firefox-esr31:
--- → affected
status-firefox-esr38:
affected → ---
tracking-firefox-esr31:
--- → ?
tracking-firefox-esr38:
36+ → ---
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/cf5abbbc9f49
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
Comment 17•9 years ago
|
||
(In reply to Milan Sreckovic [:milan] from comment #14) > (In reply to Al Billings [:abillings] from comment #13) > > This goes back forever. I'll give it sec-approval+ but we should take it on > > Aurora, Beta, and ESR31 as well. > > Al, this is a debug change only - do we still want it on these other > branches? I don't mind, just clarifying what we usually do. Oh. I missed that. Yeah, if it is debug only, I think it can just ride the trains and we don't need it on ESR31.
Updated•9 years ago
|
Comment 18•9 years ago
|
||
Actually, can we please take this on 36/37? Bug 1091322 has bitten us at inopportune times due to random changes in test chunking and it would be great to get this bug resolved for them as well to avoid issues with other backports.
Assignee | ||
Comment 19•9 years ago
|
||
Approval Request Comment See comment 18. Debug only.
Attachment #8557127 -
Flags: review+
Attachment #8557127 -
Flags: approval-mozilla-aurora?
Assignee | ||
Comment 20•9 years ago
|
||
Approval Request Comment See comment 18. Debug only.
Flags: needinfo?(milan)
Attachment #8557128 -
Flags: review+
Attachment #8557128 -
Flags: approval-mozilla-beta?
Updated•9 years ago
|
Attachment #8557127 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•9 years ago
|
Attachment #8557128 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Comment 21•9 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/af25a4300b47 https://hg.mozilla.org/releases/mozilla-beta/rev/1ec36b2a9775
Updated•9 years ago
|
Whiteboard: [adv-main36-]
Updated•8 years ago
|
Group: core-security → core-security-release
Updated•7 years ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•