Render thread crashes after notifying hidden

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Render thread crashes after notifying hidden

Postby codelimit » Wed Jun 01, 2022 7:16 am

Good day, community

I use cef 76 prebuild binaries and libraries with offscreen-rendering enabled.

I have an issue where render thread crashes after several resizes and CefBrowser->GetHost()->WasHidden() call.
In my application I can reproduce the issue only while loading the specific url. The steps are the following:
1) I load the specific page. It loads successfully.
2) Then I clicked the link on the page which leads to internal app screen (using deep linking mechanics).
3) Webview navigation is cancelled in OnBeforeBrowse() returning "true" and url is processed via internal app api. Also cef browser is set hidden using CefBrowser->GetHost()->WasHidden(true) call. While browser screen is hidden, I resize the screen which calls CefBrowser->GetHost()->WasResized() several time. Then after I return from deep link processing back to web view, I am trying to restore last page. Thus, while browser is hidden, I call LoadUrl, then resize screen and in the end I set CefBrowser->GetHost()->WasHidden(false). In a moment I can observe that the render thread was crashed with the following callstack:
Code: Select all
    libcef.dll!blink::LayoutObject::HasDistortingVisualEffects() Line 1414   C++
    libcef.dll!blink::IntersectionGeometry::ComputeGeometry(blink::Element * root_element, blink::Element & target_element, const WTF::Vector<blink::Length,0,WTF::PartitionAllocator> & root_margin, const WTF::Vector<float,0,WTF::PartitionAllocator> & thresholds) Line 188   C++
    libcef.dll!blink::IntersectionGeometry::IntersectionGeometry(blink::Element * root_element, blink::Element & target_element, const WTF::Vector<blink::Length,0,WTF::PartitionAllocator> & root_margin, const WTF::Vector<float,0,WTF::PartitionAllocator> & thresholds, unsigned int flags) Line 102   C++
    libcef.dll!blink::IntersectionObservation::Compute(unsigned int flags) Line 85   C++
    libcef.dll!blink::ElementIntersectionObserverData::ComputeObservations(unsigned int flags) Line 39   C++
    libcef.dll!blink::IntersectionObserverController::ComputeTrackedIntersectionObservations(unsigned int flags) Line 80   C++
    libcef.dll!blink::LocalFrameView::UpdateViewportIntersectionsForSubtree(unsigned int parent_flags) Line 3979   C++
    libcef.dll!blink::LocalFrameView::ForceUpdateViewportIntersections() Line 1032   C++
    libcef.dll!content::RenderFrameImpl::WasHidden() Line 5758   C++
>   libcef.dll!content::RenderWidget::OnWasHidden() Line 936   C++
    libcef.dll!IPC::MessageT<WidgetMsg_WasHidden_Meta,std::__1::tuple<>,void>::Dispatch<content::RenderWidget,content::RenderWidget,void,void (content::RenderWidget::*)() __attribute__((thiscall))>(const IPC::Message * msg, content::RenderWidget * obj, content::RenderWidget * sender, void * parameter, void(content::RenderWidget::*)() func) Line 146   C++
    libcef.dll!content::RenderWidget::OnMessageReceived(const IPC::Message & message) Line 634   C++
    libcef.dll!IPC::ChannelProxy::Context::OnDispatchMessage(const IPC::Message & message) Line 327   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (media::AudioInputController::*)(const std::__1::basic_string<char> &) __attribute__((thiscall)),scoped_refptr<media::AudioInputController>,std::__1::basic_string<char>>,void ()>::RunOnce(base::internal::BindStateBase * base) Line 645   C++
    libcef.dll!base::TaskAnnotator::RunTask(const char * trace_event_name, base::PendingTask * pending_task) Line 142   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow * continuation_lazy_now, bool * ran_task) Line 369   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() Line 221   C++
    libcef.dll!base::MessagePumpDefault::Run(base::MessagePump::Delegate * delegate) Line 41   C++
    libcef.dll!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool application_tasks_allowed, base::TimeDelta timeout) Line 466   C++
    libcef.dll!base::RunLoop::RunWithTimeout(base::TimeDelta timeout) Line 161   C++
    libcef.dll!base::RunLoop::Run() Line 130   C++
    libcef.dll!content::RendererMain(const content::MainFunctionParams & parameters) Line 209   C++
    libcef.dll!content::RunOtherNamedProcessTypeMain(const std::__1::basic_string<char,std::__1::char_traits<char>,std::__1::allocator<char>> & process_type, const content::MainFunctionParams & main_function_params, content::ContentMainDelegate * delegate) Line 576   C++
    libcef.dll!content::ContentMainRunnerImpl::Run(bool start_service_manager_only) Line 873   C++
    libcef.dll!content::ContentServiceManagerMainDelegate::RunEmbedderProcess() Line 52   C++
    libcef.dll!service_manager::MainRun(service_manager::MainParams & params) Line 0   C++
    libcef.dll!service_manager::Main(service_manager::MainParams & params) Line 476   C++
    libcef.dll!content::ContentMain(const content::ContentMainParams & params) Line 19   C++
    libcef.dll!CefExecuteProcess(const CefMainArgs & args, scoped_refptr<CefApp> application, void * windows_sandbox_info) Line 214   C++
    libcef.dll!cef_execute_process(const _cef_main_args_t * args, _cef_app_t * application, void * windows_sandbox_info) Line 78   C++


Does anyone have an idea what goes wrong? Is it permitted to call LoadUrl or WasResized() while is hidden?

I am unable to reproduce the issue using cefclient.

Any hints are highly appreciated.
codelimit
Techie
 
Posts: 30
Joined: Mon Nov 04, 2019 11:48 am

Re: Render thread crashes after notifying hidden

Postby amaitland » Wed Jun 01, 2022 2:29 pm

102 is the current supported version, I'd suggest upgrading.
Maintainer of the CefSharp project.
amaitland
Virtuoso
 
Posts: 1290
Joined: Wed Jan 14, 2015 2:35 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 31 guests