In debug build of DRT, it crashes randomly at shutdown. I think it's due to a race condition. I can trigger the crash easily by this test: out/Debug/DumpRenderTree /usr/local/code/webkit.git/LayoutTests/compositing/iframes/overlapped-nested-iframes.html The stacktrace: ASSERTION FAILED: !CCLayerTreeHost::anyLayerTreeHostInstanceExists() Source/WebKit/chromium/src/WebCompositorImpl.cpp(78) : static void WebKit::WebCompositorImpl::shutdown() 1 0x48fd50 2 0x48fbbf 3 0x46cc36 4 0x4378d3 5 0x7fb676dcac4d __libc_start_main 6 0x422fd9 [30647:30647:19876206991:ERROR:process_util_posix.cc(142)] Received signal 11 base::debug::StackTrace::StackTrace() [0x7315c6] base::(anonymous namespace)::StackDumpSignalHandler() [0x6ec18d] 0x7fb676ddfaf0 WebKit::WebCompositorImpl::shutdown() [0x48fd5a] WebKit::WebCompositor::shutdown() [0x48fbbf] TestShell::~TestShell() [0x46cc36] main [0x4378d3] 0x7fb676dcac4d 0x422fd9
Created attachment 132574 [details] Patch
I'm wrong in the first comment. This is not random; it definitely happens after compositing.
This looks sane to me, but I'm not familiar with this code. Adding people who are.
I think we have to shut down WebKit::WebCompositor before we stop threading - when does that happen in DRT?
(In reply to comment #4) > I think we have to shut down WebKit::WebCompositor before we stop threading - when does that happen in DRT? When exiting main(), we ~WebKitSupportTestEnvironment gets run, which calls webkit_support::TearDownTestEnvironment(), which calls WebKit::shutdown(). I believe that's when threading is stopped. So, it's still after the new location of WebCompositor::shutdown().
Comment on attachment 132574 [details] Patch OK, that should be fine then! We definitely should be shutting down after all WebViews are gone
Comment on attachment 132574 [details] Patch Clearing flags on attachment: 132574 Committed r111220: <http://trac.webkit.org/changeset/111220>
All reviewed patches have been landed. Closing bug.
(In reply to comment #5) > (In reply to comment #4) > > I think we have to shut down WebKit::WebCompositor before we stop threading - when does that happen in DRT? > > When exiting main(), we ~WebKitSupportTestEnvironment gets run, which calls webkit_support::TearDownTestEnvironment(), which calls WebKit::shutdown(). I believe that's when threading is stopped. So, it's still after the new location of WebCompositor::shutdown(). Thanks for your explanation, Tony. I found it kind of tricky to load a blank page in ~WebViewHost, which is called by ~TestShell. Howerver, loading a page results in some function calls eventually going back into TestShell again, which is at the state of destruction then. This is kind of dangerous to me.