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

Issue 25374002: Fixes use after free caused by delete in RootWindowController (Closed)

Created:
7 years, 2 months ago by sky
Modified:
7 years, 2 months ago
Reviewers:
oshima
CC:
chromium-reviews, sadrul, ben+watch_chromium.org
Visibility:
Public.

Description

Fixes use after free caused by delete in RootWindowController RootWindowController::CloseChildWindows() was explicitly deleting windows. It should only do that for windows that are owned by the parent, otherwise the window should be removed. BUG=297028 TEST=covered by test now. R=oshima@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=226347

Patch Set 1 #

Patch Set 2 : order and comments #

Total comments: 2

Patch Set 3 : Simplify #

Patch Set 4 : Merge 2 trunk #

Patch Set 5 : fix FramePainter #

Patch Set 6 : simplify RootWindowController #

Patch Set 7 : Back to explicitly destroying with comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+77 lines, -5 lines) Patch
M ash/root_window_controller.cc View 1 2 3 4 5 6 3 chunks +12 lines, -3 lines 0 comments Download
M ash/root_window_controller_unittest.cc View 1 2 chunks +64 lines, -0 lines 0 comments Download
M ash/wm/frame_painter.cc View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M ui/aura/window.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
sky
7 years, 2 months ago (2013-09-30 22:33:57 UTC) #1
oshima
thanks, I didn't know about owned_by_parent flag! https://codereview.chromium.org/25374002/diff/3001/ash/root_window_controller.cc File ash/root_window_controller.cc (right): https://codereview.chromium.org/25374002/diff/3001/ash/root_window_controller.cc#newcode448 ash/root_window_controller.cc:448: aura::Window* child ...
7 years, 2 months ago (2013-09-30 22:48:57 UTC) #2
sky
New patch uploaded. https://codereview.chromium.org/25374002/diff/3001/ash/root_window_controller.cc File ash/root_window_controller.cc (right): https://codereview.chromium.org/25374002/diff/3001/ash/root_window_controller.cc#newcode448 ash/root_window_controller.cc:448: aura::Window* child = non_toplevel_window->children()[i]; On 2013/09/30 ...
7 years, 2 months ago (2013-09-30 23:14:17 UTC) #3
oshima
lgtm
7 years, 2 months ago (2013-09-30 23:56:32 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/25374002/7001
7 years, 2 months ago (2013-10-01 14:15:49 UTC) #5
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) ash_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=160804
7 years, 2 months ago (2013-10-01 15:24:05 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/25374002/7001
7 years, 2 months ago (2013-10-01 17:23:11 UTC) #7
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 2 months ago (2013-10-01 17:43:49 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/25374002/7001
7 years, 2 months ago (2013-10-01 18:03:09 UTC) #9
commit-bot: I haz the power
Retried try job too often on linux_chromeos for step(s) ash_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos&number=160893
7 years, 2 months ago (2013-10-01 19:01:42 UTC) #10
sky
NoCrashShutdownWithAlwaysOnTopWindow was crashing with my patch. I had to make a slight change to FramePainter ...
7 years, 2 months ago (2013-10-01 20:15:16 UTC) #11
oshima
On 2013/10/01 20:15:16, sky wrote: > NoCrashShutdownWithAlwaysOnTopWindow was crashing with my patch. I had to ...
7 years, 2 months ago (2013-10-01 20:34:27 UTC) #12
sky
Ok, back to a variant of previous patch.
7 years, 2 months ago (2013-10-01 20:47:57 UTC) #13
oshima
lgtm
7 years, 2 months ago (2013-10-01 20:55:10 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sky@chromium.org/25374002/54001
7 years, 2 months ago (2013-10-01 21:02:24 UTC) #15
commit-bot: I haz the power
Change committed as 226347
7 years, 2 months ago (2013-10-01 23:50:16 UTC) #16
dcheng
7 years, 2 months ago (2013-10-02 01:19:53 UTC) #17
Message was sent while issue was closed.
On 2013/10/01 23:50:16, I haz the power (commit-bot) wrote:
> Change committed as 226347

Sorry, it looks like there's a test failure on the win8 aura bot:
[ RUN      ] RootWindowControllerTest.DontDeleteWindowsNotOwnedByParent
Backtrace:
	std::_Iterator_base12::_Adopt [0x01A51825+197]
	std::_Vector_const_iterator<std::_Vector_val<aura::WindowObserver
*,std::allocator<aura::WindowObserver *> >
>::_Vector_const_iterator<std::_Vector_val<aura::WindowObserver
*,std::allocator<aura::WindowObserver *> > > [0x01A90B11+81]
	std::_Vector_iterator<std::_Vector_val<aura::WindowObserver
*,std::allocator<aura::WindowObserver *> >
>::_Vector_iterator<std::_Vector_val<aura::WindowObserver
*,std::allocator<aura::WindowObserver *> > > [0x01A8ED9E+30]
	std::vector<aura::WindowObserver *,std::allocator<aura::WindowObserver *>
>::end [0x01A8A411+49]
	ObserverListBase<aura::WindowObserver>::RemoveObserver [0x01A87222+82]
	aura::Window::RemoveObserver [0x01A7FA90+32]
	ash::test::DestroyedWindowObserver::Shutdown [0x0057C45C+44]
	ash::test::DestroyedWindowObserver::~DestroyedWindowObserver [0x0057C316+70]
	ash::test::RootWindowControllerTest_DontDeleteWindowsNotOwnedByParent_Test::TestBody
[0x0057BFCE+1662]
	testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,void>
[0x007DC92F+319]
	testing::Test::Run [0x007C738E+174]
	testing::TestInfo::Run [0x007C7D5D+221]
	testing::TestCase::Run [0x007C850F+239]
	testing::internal::UnitTestImpl::RunAllTests [0x007CEE5D+701]
	testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool>
[0x007DD557+327]
	testing::UnitTest::Run [0x007CD6C0+192]
	base::TestSuite::Run [0x007A2520+240]
	main [0x006120A7+103]
	__tmainCRTStartup [0x009486AF+447]
(f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:555)
	mainCRTStartup [0x009484DF+15]
(f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:371)
	BaseThreadInitThunk [0x75238543+14]
	RtlInitializeExceptionChain [0x77BFAC69+133]
	RtlInitializeExceptionChain [0x77BFAC3C+88]

I'm going to have to revert

Powered by Google App Engine
This is Rietveld 408576698