Closed magreenblatt closed 1 month ago
Testing at M130 and running with cefclient --url=about:blank
the Observer notifications looks correct:
[5353:259:0927/123510.891273:WARNING:render_process_host_impl.cc(5309)] RenderProcessHostImpl::OnProcessLaunched host=0x11c0234cb00 deleting_soon=0
[5353:259:0927/123510.894783:WARNING:render_process_host_task_provider.cc(102)] RenderProcessHostTaskProvider::OnRenderProcessHostCreated is_updating=1 host=0x11c0234cb00
[5353:259:0927/123510.895210:WARNING:render_process_host_impl.cc(5309)] RenderProcessHostImpl::OnProcessLaunched host=0x11c02349e00 deleting_soon=0
[5353:259:0927/123510.898150:WARNING:render_process_host_task_provider.cc(102)] RenderProcessHostTaskProvider::OnRenderProcessHostCreated is_updating=1 host=0x11c02349e00
(close window)
[5353:259:0927/123527.346431:WARNING:render_process_host_impl.cc(3904)] RenderProcessHostImpl::Cleanup host=0x11c02349e00
[5353:259:0927/123527.347088:WARNING:render_process_host_impl.cc(3904)] RenderProcessHostImpl::Cleanup host=0x11c02349e00
[5353:259:0927/123527.347825:WARNING:render_process_host_task_provider.cc(115)] RenderProcessHostTaskProvider::RenderProcessExited is_updating=0 host=0x11c02349e00
[5353:259:0927/123527.348145:WARNING:render_process_host_task_provider.cc(125)] RenderProcessHostTaskProvider::RenderProcessHostDestroyed is_updating=0 host=0x11c02349e00
[5353:259:0927/123527.471382:WARNING:render_process_host_impl.cc(3904)] RenderProcessHostImpl::Cleanup host=0x11c0234cb00
[5353:259:0927/123527.471679:WARNING:render_process_host_task_provider.cc(115)] RenderProcessHostTaskProvider::RenderProcessExited is_updating=0 host=0x11c0234cb00
[5353:259:0927/123527.471810:WARNING:render_process_host_task_provider.cc(125)] RenderProcessHostTaskProvider::RenderProcessHostDestroyed is_updating=0 host=0x11c0234cb00
It's just the |isupdating==false| that keeps it from actually removing the observation in RenderProcessHostTaskProvider.
No RenderProcessHostTaskProvider is created with cefsimple
.
The RenderProcessHostTaskProvider with cefclient
is created via:
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = breakpoint 2.2
* frame #0: 0x00000003d76d8950 Chromium Embedded Framework`task_manager::RenderProcessHostTaskProvider::RenderProcessHostTaskProvider(this=0x0000010c1c056720) at render_process_host_task_provider.cc:26:62
frame #1: 0x00000003d770d904 Chromium Embedded Framework`std::__Cr::__unique_if<task_manager::RenderProcessHostTaskProvider>::__unique_single std::__Cr::make_unique<task_manager::RenderProcessHostTaskProvider>() at unique_ptr.h:623:30
frame #2: 0x00000003d770cfd8 Chromium Embedded Framework`task_manager::TaskManagerImpl::TaskManagerImpl(this=0x00000003f46e9db0) at task_manager_impl.cc:88:7
frame #3: 0x00000003d770da1c Chromium Embedded Framework`task_manager::TaskManagerImpl::TaskManagerImpl(this=0x00000003f46e9db0) at task_manager_impl.cc:71:39
frame #4: 0x00000003d77281a4 Chromium Embedded Framework`base::LazyInstanceTraitsBase<task_manager::TaskManagerImpl>::New(instance=0x00000003f46e9db0) at lazy_instance.h:70:27
frame #5: 0x00000003d77280f8 Chromium Embedded Framework`base::internal::LeakyLazyInstanceTraits<task_manager::TaskManagerImpl>::New(instance=0x00000003f46e9db0) at lazy_instance.h:119:12
frame #6: 0x00000003d7728010 Chromium Embedded Framework`task_manager::TaskManagerImpl* base::subtle::GetOrCreateLazyPointer<task_manager::TaskManagerImpl>(state=0x00000003f46e9da8, creator_func=(Chromium Embedded Framework`base::internal::LeakyLazyInstanceTraits<task_manager::TaskManagerImpl>::New(void*) at lazy_instance.h:117), creator_arg=0x00000003f46e9db0, destructor=0x0000000000000000, destructor_arg=0x00000003f46e9da8) at lazy_instance_helpers.h:82:46
frame #7: 0x00000003d770dcd8 Chromium Embedded Framework`base::LazyInstance<task_manager::TaskManagerImpl, base::internal::LeakyLazyInstanceTraits<task_manager::TaskManagerImpl>>::Pointer(this=0x00000003f46e9da8) at lazy_instance.h:159:12
frame #8: 0x00000003d770dc68 Chromium Embedded Framework`task_manager::TaskManagerImpl::GetInstance() at task_manager_impl.cc:113:37
frame #9: 0x00000003d77359a4 Chromium Embedded Framework`task_manager::TaskManagerInterface::GetTaskManager() at task_manager_interface.cc:50:10
frame #10: 0x00000003c44d3280 Chromium Embedded Framework`CefTaskManager::GetTaskManager() at task_manager_impl.cc:182:7
frame #11: 0x00000003c4173a7c Chromium Embedded Framework`::cef_task_manager_get() at task_manager_cpptoc.cc:30:39
frame #12: 0x000000010036c56c cefclient`::cef_task_manager_get() at libcef_dll_dylib.cc:1055:10
frame #13: 0x000000010032e7d8 cefclient`CefTaskManager::GetTaskManager() at task_manager_ctocpp.cc:30:33
frame #14: 0x0000000100092344 cefclient`(anonymous namespace)::Handler::Handler(this=0x0000010c1ce58d00) at task_manager_test.cc:84:38
frame #15: 0x0000000100092300 cefclient`(anonymous namespace)::Handler::Handler(this=0x0000010c1ce58d00) at task_manager_test.cc:84:72
frame #16: 0x000000010009229c cefclient`client::task_manager_test::CreateMessageHandlers(handlers=size=8) at task_manager_test.cc:132:23
frame #17: 0x0000000100099118 cefclient`client::test_runner::CreateMessageHandlers(handlers=size=8) at test_runner.cc:882:3
frame #18: 0x000000010000f5a0 cefclient`client::BaseClientHandler::OnAfterCreated(this=0x0000010c1ba49240, browser=(ptr_ = 0x0000010c1d102b50)) at base_client_handler.cc:47:5
frame #19: 0x0000000100027410 cefclient`client::ClientHandler::OnAfterCreated(this=0x0000010c1ba49240, browser=(ptr_ = 0x0000010c1d102b50)) at client_handler.cc:976:22
And RenderProcessHostTaskProvider::StopUpdating
is called via:
* thread #1, name = 'CrBrowserMain', queue = 'com.apple.main-thread', stop reason = breakpoint 3.1
* frame #0: 0x00000003d76d8ed8 Chromium Embedded Framework`task_manager::RenderProcessHostTaskProvider::StopUpdating(this=0x0000010c1c056720) at render_process_host_task_provider.cc:58:3
frame #1: 0x00000003d76dbd0c Chromium Embedded Framework`task_manager::TaskProvider::ClearObserver(this=0x0000010c1c056720) at task_provider.cc:25:3
frame #2: 0x00000003d76bbd98 Chromium Embedded Framework`task_manager::FallbackTaskProvider::StopUpdating(this=0x0000010c1cb2bf40) at fallback_task_provider.cc:92:37
frame #3: 0x00000003d76dbd0c Chromium Embedded Framework`task_manager::TaskProvider::ClearObserver(this=0x0000010c1cb2bf40) at task_provider.cc:25:3
frame #4: 0x00000003d7711ffc Chromium Embedded Framework`task_manager::TaskManagerImpl::StopUpdating(this=0x00000003f46e9db0) at task_manager_impl.cc:675:15
frame #5: 0x00000003d7736158 Chromium Embedded Framework`task_manager::TaskManagerInterface::RemoveObserver(this=0x00000003f46e9db0, observer=0x0000010c1d082000) at task_manager_interface.cc:105:5
frame #6: 0x00000003c44d21fc Chromium Embedded Framework`CefTaskManagerImpl::~CefTaskManagerImpl(this=0x0000010c1d082000, vtt=0x00000003f39e4b38) at task_manager_impl.cc:80:18
frame #7: 0x00000003c44d22a8 Chromium Embedded Framework`CefTaskManagerImpl::~CefTaskManagerImpl(this=0x0000010c1d082000) at task_manager_impl.cc:79:43
frame #8: 0x00000003c44d2324 Chromium Embedded Framework`CefTaskManagerImpl::~CefTaskManagerImpl(this=0x0000010c1d082000) at task_manager_impl.cc:79:43
frame #9: 0x00000003c44d5158 Chromium Embedded Framework`void content::BrowserThread::DeleteOnThread<(content::BrowserThread::ID)0>::Destruct<CefTaskManagerImpl>(x=0x0000010c1d082000) at browser_thread.h:174:9
frame #10: 0x00000003c44d33ac Chromium Embedded Framework`CefTaskManagerImpl::Release(this=0x0000010c1d082000) const at task_manager_impl.h:45:3
frame #11: 0x00000003c4176b30 Chromium Embedded Framework`CefCppToCRefCounted<CefTaskManagerCppToC, CefTaskManager, _cef_task_manager_t>::UnderlyingRelease(this=0x0000010c1ab72130) const at cpptoc_ref_counted.h:139:61
frame #12: 0x00000003c4174944 Chromium Embedded Framework`CefCppToCRefCounted<CefTaskManagerCppToC, CefTaskManager, _cef_task_manager_t>::Release(this=0x0000010c1ab72130) const at cpptoc_ref_counted.h:88:5
frame #13: 0x00000003c4176750 Chromium Embedded Framework`CefCppToCRefCounted<CefTaskManagerCppToC, CefTaskManager, _cef_task_manager_t>::struct_release(base=0x0000010c1ab72150) at cpptoc_ref_counted.h:172:37
frame #14: 0x0000000100330540 cefclient`CefCToCppRefCounted<CefTaskManagerCToCpp, CefTaskManager, _cef_task_manager_t>::UnderlyingRelease(this=0x0000010c1d1032d0) const at ctocpp_ref_counted.h:80:12
frame #15: 0x000000010032f500 cefclient`CefCToCppRefCounted<CefTaskManagerCToCpp, CefTaskManager, _cef_task_manager_t>::Release(this=0x0000010c1d1032d0) const at ctocpp_ref_counted.h:160:3
frame #16: 0x00000001000952d8 cefclient`scoped_refptr<CefTaskManager>::Release(ptr=0x0000010c1d1032d0) at cef_scoped_refptr.h:365:8
frame #17: 0x0000000100095298 cefclient`scoped_refptr<CefTaskManager>::~scoped_refptr(this=0x0000010c1ce58d08) at cef_scoped_refptr.h:266:7
frame #18: 0x0000000100095250 cefclient`scoped_refptr<CefTaskManager>::~scoped_refptr(this=0x0000010c1ce58d08) at cef_scoped_refptr.h:259:20
frame #19: 0x000000010009521c cefclient`(anonymous namespace)::Handler::~Handler(this=0x0000010c1ce58d00) at task_manager_test.cc:82:7
frame #20: 0x00000001000927b0 cefclient`(anonymous namespace)::Handler::~Handler(this=0x0000010c1ce58d00) at task_manager_test.cc:82:7
frame #21: 0x00000001000927dc cefclient`(anonymous namespace)::Handler::~Handler(this=0x0000010c1ce58d00) at task_manager_test.cc:82:7
frame #22: 0x000000010000fa60 cefclient`client::BaseClientHandler::OnBeforeClose(this=0x0000010c1ba49240, browser=(ptr_ = 0x0000010c1cfd16d0)) at base_client_handler.cc:61:7
frame #23: 0x000000010002798c cefclient`client::ClientHandler::OnBeforeClose(this=0x0000010c1ba49240, browser=(ptr_ = 0x0000010c1cfd16d0)) at client_handler.cc:998:22
And then the leaks are checked during RenderProcessHostImpl cleanup. The RenderProcessHostTaskProvider
is not destroyed until process exit because it's owned by the singleton TaskManagerImpl object.
I think RenderProcessHostTaskProvider::RenderProcessExited and RenderProcessHostDestroyed should be changed to not require |isupdating==true|, as those methods will only be called if AddObservation was called (and then RemoveObservation must also be called).
Proposed Chromium fix: https://chromium-review.googlesource.com/c/chromium/src/+/5894650
To Reproduce Steps to reproduce the behavior:
cefclient
Expected behavior Application should exit cleanly. Instead, it shows the following shutdown error:
Versions (please complete the following information):
Additional context Reproduces with
cefclient
using Alloy and Chrome style. Does not reproduce withcefsimple
.