Page 1 of 1

Crash at LogMessage destructor

PostPosted: Thu Jun 17, 2021 10:02 am
by oglo
Finally, I've build my app with latest stable cef binary for debug mode. But my app crashes when doing
CefInitialize(main_args, settings, app, NULL);
, last function in call stack is ~LogMessage():
Code: Select all
>   libcef.dll!logging::LogMessage::~LogMessage() Line 886   C++
    libcef.dll!logging::LogMessage::~LogMessage() Line 559   C++
    libcef.dll!logging::CheckError::~CheckError() Line 107   C++
    [Inline Frame] libcef.dll!`anonymous namespace'::CefShutdownChecker::~CefShutdownChecker() Line 37   C++
    libcef.dll!`anonymous namespace'::`dynamic atexit destructor for 'g_shutdown_checker'() Line 38   C++
    libcef.dll!_execute_onexit_table::__l2::<lambda>() Line 206   C++
    libcef.dll!__crt_seh_guarded_call<int>::operator()<<lambda_69a2805e680e0e292e8ba93315fe43a8>,int <lambda>(void) &,<lambda_03fcd07e894ec930e3f35da366ca99d6> >(__acrt_lock_and_call::__l2::<lambda_69a2805e680e0e292e8ba93315fe43a8> && setup, _execute_onexit_table::__l2::int <lambda>(void) & action, __acrt_lock_and_call::__l2::<lambda_03fcd07e894ec930e3f35da366ca99d6> && cleanup) Line 204   C++
    [Inline Frame] libcef.dll!__acrt_lock_and_call(const __acrt_lock_id) Line 976   C++
    libcef.dll!_execute_onexit_table(_onexit_table_t * table) Line 231   C++
    libcef.dll!common_exit::__l2::<lambda>() Line 232   C++
    libcef.dll!__crt_seh_guarded_call<void>::operator()<<lambda_03b1d95aef87969028cfba75ccab2455>,void <lambda>(void) &,<lambda_22bdf7517842c4b3e53723af5aa32b9e> >(__acrt_lock_and_call::__l2::<lambda_03b1d95aef87969028cfba75ccab2455> && setup, common_exit::__l2::void <lambda>(void) & action, __acrt_lock_and_call::__l2::<lambda_22bdf7517842c4b3e53723af5aa32b9e> && cleanup) Line 225   C++
    [Inline Frame] libcef.dll!__acrt_lock_and_call(const __acrt_lock_id) Line 976   C++
    libcef.dll!common_exit(const int return_code, const _crt_exit_cleanup_mode cleanup_mode, const _crt_exit_return_mode return_mode) Line 278   C++
    libcef.dll!_cexit() Line 313   C++
    [External Code]   
    [Frames below may be incorrect and/or missing, no symbols loaded for playkit.exe]   Unknown

, lines of destructor are 884-889:
Code: Select all
      // Crash the process to generate a dump.
#if defined(OFFICIAL_BUILD) && defined(NDEBUG)
      IMMEDIATE_CRASH(); // Here

, it happens with NDEBUG macro defined. Without NDEBUG app crashes showing message that
Exception thrown at 0x7744F583 (ntdll.dll) in project.exe: 0xC0000005: Access violation writing location 0x00000014.

What the problem there may be?

Re: Crash at LogMessage destructor

PostPosted: Thu Jun 17, 2021 11:25 am
by magreenblatt
What OS and CEF version? Are you using an official build or your own personal build? Does the problem reproduce with the CEF sample applications?

Re: Crash at LogMessage destructor

PostPosted: Fri Jun 18, 2021 4:43 am
by oglo
I use Win10, MSVC2017 and "06/17/2021 - 91.1.19+ga92e5d5+chromium-91.0.4472.101 / Chromium 91.0.4472.101". I'm not sure about official build - I'm building libcef_dll_wrapper by my own as a subproject of my app. Yes, "cefclient" and "cefsimple" work correctly in both debug and release modes (I build them through a msvc project, generated by cmake).
Also I've tried the following: I created a new msvc solution from cef binary distribution and added my app as a subproject to it. "cefclient" and "cefsimple" still work, but my app is not, throwing the same exception. The code of my app is legacy and I don't known which version of cef it used before, but it's definitly not the latest, may be problem is here and something needs to be remade. Anyway, I'll be appreciate for any help.

Re: Crash at LogMessage destructor

PostPosted: Fri Jun 18, 2021 9:41 am
by magreenblatt
It sounds like an issue with your application. I suggest a careful comparison to the CEF sample application code.