Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Issue 2764433002: Fix destruction order in mus_demo (Closed)

Created:
3 years, 9 months ago by msisov
Modified:
3 years, 9 months ago
Reviewers:
kylechar, fwang, tonikitoo
CC:
chromium-reviews, rjkroege, dpranke
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix destruction order in mus_demo Problem: Unique pointers are deleted from the bottom to the upwards as they are defined in a class definition. Before this CL, WindowTreeClient was destroyed after WNState had its destructor called, which led to segfault. Solution: WindowTreeClient must be deleted before Env and WNState, otherwise signal 11 occurs. It happens because Env and WNState are singletons, which are owned by MusDemo. Once WindowTreeClient goes into its destructor, it uses them to remove itself as an observer. This fix is mainly aimed for https://build.chromium.org/p/chromium.fyi/builders/Ozone%20Linux Call stack- Received signal 11 SEGV_MAPERR 000000000000 #0 0x7f501a7b83fb base::debug::StackTrace::StackTrace() #1 0x7f501a7b6a8c base::debug::StackTrace::StackTrace() #2 0x7f501a7b7f0f base::debug::(anonymous namespace)::StackDumpSignalHandler() #3 0x7f501ac3e390 <unknown> #4 0x7f50179b46fb aura::WindowTreeClient::~WindowTreeClient() #5 0x7f50179b4d69 aura::WindowTreeClient::~WindowTreeClient() #6 0x000000431f9f std::default_delete<>::operator()() #7 0x00000043198c std::unique_ptr<>::reset() #8 0x000000430b59 std::unique_ptr<>::~unique_ptr() #9 0x00000042f85c ui::demo::MusDemo::~MusDemo() #10 0x00000043852f ui::demo::MusDemoExternal::~MusDemoExternal() #11 0x000000438579 ui::demo::MusDemoExternal::~MusDemoExternal() #12 0x000000431f9f std::default_delete<>::operator()() #13 0x00000063080c std::unique_ptr<>::reset() #14 0x00000062ece9 std::unique_ptr<>::~unique_ptr() #15 0x00000062db7b service_manager::ServiceContext::~ServiceContext() #16 0x00000062dbc9 service_manager::ServiceContext::~ServiceContext() BUG=666958 Review-Url: https://codereview.chromium.org/2764433002 Cr-Commit-Position: refs/heads/master@{#458388} Committed: https://chromium.googlesource.com/chromium/src/+/9ca8fc91927b335661ab095f925b1337486e64d0

Patch Set 1 #

Total comments: 3

Patch Set 2 : add comment #

Total comments: 3

Patch Set 3 : add more extended comment. destroy env and wm_state explicitly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -0 lines) Patch
M services/ui/demo/mus_demo.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (30 generated)
msisov
ptal
3 years, 9 months ago (2017-03-20 11:40:17 UTC) #8
fwang
informal l g t m https://codereview.chromium.org/2764433002/diff/1/services/ui/demo/mus_demo.cc File services/ui/demo/mus_demo.cc (right): https://codereview.chromium.org/2764433002/diff/1/services/ui/demo/mus_demo.cc#newcode28 services/ui/demo/mus_demo.cc:28: window_tree_client_.reset(); Maybe add a ...
3 years, 9 months ago (2017-03-20 11:45:39 UTC) #9
kylechar
https://codereview.chromium.org/2764433002/diff/1/services/ui/demo/mus_demo.cc File services/ui/demo/mus_demo.cc (right): https://codereview.chromium.org/2764433002/diff/1/services/ui/demo/mus_demo.cc#newcode28 services/ui/demo/mus_demo.cc:28: window_tree_client_.reset(); On 2017/03/20 11:45:39, fwang wrote: > Maybe add ...
3 years, 9 months ago (2017-03-20 13:27:42 UTC) #17
fwang
Can you please update the desc to link to bug 666958 and maybe explaining/pasting the ...
3 years, 9 months ago (2017-03-20 13:30:59 UTC) #18
msisov
There is still another error in linux. XOpenDisplay returns nullptr and DCHECK happens. [19450:19450:0320/051016.340929:1138878197:FATAL:x11_event_source.cc(106)] Check ...
3 years, 9 months ago (2017-03-20 14:04:01 UTC) #19
fwang
> Can it be due to the fact that bots are headless? Bots are compiled ...
3 years, 9 months ago (2017-03-20 14:13:51 UTC) #26
kylechar
On 2017/03/20 14:13:51, fwang wrote: > > Can it be due to the fact that ...
3 years, 9 months ago (2017-03-20 14:14:52 UTC) #27
kylechar
On 2017/03/20 14:14:52, kylechar wrote: > On 2017/03/20 14:13:51, fwang wrote: > > > Can ...
3 years, 9 months ago (2017-03-20 14:16:45 UTC) #28
msisov
On 2017/03/20 14:16:45, kylechar wrote: > On 2017/03/20 14:14:52, kylechar wrote: > > On 2017/03/20 ...
3 years, 9 months ago (2017-03-20 14:19:36 UTC) #29
fwang
https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc File services/ui/demo/mus_demo.cc (right): https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc#newcode32 services/ui/demo/mus_demo.cc:32: window_tree_client_.reset(); Two points: 1) I think you should explain ...
3 years, 9 months ago (2017-03-21 07:12:02 UTC) #33
msisov
https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc File services/ui/demo/mus_demo.cc (right): https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc#newcode32 services/ui/demo/mus_demo.cc:32: window_tree_client_.reset(); On 2017/03/21 07:12:02, fwang wrote: > Two points: ...
3 years, 9 months ago (2017-03-21 07:16:56 UTC) #34
msisov
kelychar@, any more comments?
3 years, 9 months ago (2017-03-21 11:02:12 UTC) #39
kylechar
lgtm https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc File services/ui/demo/mus_demo.cc (right): https://codereview.chromium.org/2764433002/diff/20001/services/ui/demo/mus_demo.cc#newcode30 services/ui/demo/mus_demo.cc:30: // dtor. s/dtor/destructor
3 years, 9 months ago (2017-03-21 12:44:45 UTC) #40
kylechar
Ignore that comment, you had already fixed it :)
3 years, 9 months ago (2017-03-21 12:45:59 UTC) #41
kylechar
Ignore that comment, you had already fixed it :)
3 years, 9 months ago (2017-03-21 12:45:59 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2764433002/40001
3 years, 9 months ago (2017-03-21 13:21:36 UTC) #44
commit-bot: I haz the power
3 years, 9 months ago (2017-03-21 13:25:48 UTC) #47
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/9ca8fc91927b335661ab095f925b...

Powered by Google App Engine
This is Rietveld 408576698