Crash during exit

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.

Crash during exit

Postby lolovo » Fri May 18, 2018 8:44 am

Hi,

CEF 3202, Win7x64, msvc2015u3.

During program exit (close program in panel bar with right click -> close all windows) with settings.multi_threaded_message_loop = true; very often crash occured in same place (in SendCommand() response_manager_ is null but there is a try to call func in it):
Code: Select all
   libcef.dll!CefResponseManager::RegisterHandler(scoped_refptr<CefResponseManager::Handler> handler)Line 19   C++
    libcef.dll!CefBrowserHostImpl::SendCommand(__int64 frame_id, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & command, scoped_refptr<CefResponseManager::Handler> responseHandler)Line 1716   C++
    libcef.dll!base::internal::FunctorTraits<void (__cdecl CefBrowserHostImpl::*)(__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const & __ptr64,scoped_refptr<CefResponseManager::Handler>) __ptr64,void>::Invoke<scoped_refptr<CefBrowserHostImpl> const & __ptr64,__int64 const & __ptr64,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const & __ptr64,scoped_refptr<CefResponseManager::Handler> const & __ptr64>(void(CefBrowserHostImpl::*)(__int64, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &, scoped_refptr<CefResponseManager::Handler>) method, const scoped_refptr<CefBrowserHostImpl> & receiver_ptr, const __int64 & <args_0>, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & <args_1>, const scoped_refptr<CefResponseManager::Handler> & <args_2>)Line 195   C++
    libcef.dll!base::internal::Invoker<base::internal::BindState<void (__cdecl CefBrowserHostImpl::*)(__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const & __ptr64,scoped_refptr<CefResponseManager::Handler>) __ptr64,scoped_refptr<CefBrowserHostImpl>,__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,scoped_refptr<CefResponseManager::Handler> >,void __cdecl(void)>::RunImpl<void (__cdecl CefBrowserHostImpl::*const & __ptr64)(__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const & __ptr64,scoped_refptr<CefResponseManager::Handler>) __ptr64,std::tuple<scoped_refptr<CefBrowserHostImpl>,__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,scoped_refptr<CefResponseManager::Handler> > const & __ptr64,0,1,2,3>(void(CefBrowserHostImpl::*)(__int64, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > &, scoped_refptr<CefResponseManager::Handler>) & functor, const std::tuple<scoped_refptr<CefBrowserHostImpl>,__int64,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,scoped_refptr<CefResponseManager::Handler> > & bound, std::integer_sequence<unsigned __int64,0,1,2,3> __formal)Line 353   C++
    libcef.dll!base::debug::TaskAnnotator::RunTask(const char * queue_function, base::PendingTask * pending_task)Line 65   C++
    libcef.dll!base::MessageLoop::RunTask(base::PendingTask * pending_task)Line 407   C++
    libcef.dll!base::MessageLoop::DoWork()Line 524   C++
    libcef.dll!base::MessagePumpForUI::DoRunLoop()Line 174   C++
    libcef.dll!base::MessagePumpWin::Run(base::MessagePump::Delegate * delegate)Line 58   C++
    libcef.dll!base::RunLoop::Run()Line 124   C++
    libcef.dll!base::Thread::ThreadMain()Line 341   C++
    libcef.dll!base::`anonymous namespace'::ThreadFunc(void * params)Line 91   C++


void CefBrowserHostImpl::SendCommand(
    int64 frame_id,
    const std::string & command,
        CefRefPtr < CefResponseManager::Handler > responseHandler) {
    // Only known frame ids are supported.
    DCHECK(frame_id > CefFrameHostImpl::kMainFrameId);
    DCHECK(!command.empty());

    // Execute on the UI thread because CefResponseManager is not thread safe.
    if (CEF_CURRENTLY_ON_UIT()) {
        TRACE_EVENT2("libcef", "CefBrowserHostImpl::SendCommand", "frame_id",
            frame_id, "needsResponse", responseHandler.get() ? 1 : 0);
        Cef_Request_Params params;
        params.name = "execute-command";
        params.frame_id = frame_id;
        params.user_initiated = false;

        if (responseHandler.get()) {
            params.request_id = response_manager_->RegisterHandler(responseHandler); /// <------ response_manager_ = null
            params.expect_response = true;
        } else {
            params.request_id = -1;
            params.expect_response = false;
        }

        params.arguments.AppendString(command);

        Send(new CefMsg_Request(routing_id(), params));
    } else {
        CEF_POST_TASK(CEF_UIT, base::Bind( & CefBrowserHostImpl::SendCommand, this,
            frame_id, command, responseHandler));
    }
}
lolovo
Mentor
 
Posts: 67
Joined: Fri Aug 12, 2016 6:11 am

Re: Crash during exit

Postby magreenblatt » Fri May 18, 2018 9:10 am

Does the crash reproduce with the cefclient sample application at currently supported versions? https://bitbucket.org/chromiumembedded/ ... -supported
magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

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