- Code: Select all
chrome_pgo_phase=0
clang_use_chrome_plugins=false
enable_background_mode=false
enable_basic_printing=true
enable_nacl=false
enable_print_preview=true
enable_resource_allowlist_generation=false
enable_widevine=true
is_component_build=false
is_debug=false
optimize_webui=true
target_cpu="x64"
use_debug_fission=true
ffmpeg_branding="Chrome"
proprietary_codecs=true
use_allocator_shim=false
use_allocator="none"
adobe_lib_runtime=true
is_official_build=true
use_thin_lto=false
While trying to integrate above CEF build in windows, I am experiencing a crash when calling CefExecuteProcess and I can't figure out the reason by myself.
Code to Reproduce:
- Code: Select all
CefMainArgs main_args(hInstance);
CefRefPtr<ClientApp> cefApp(new ClientApp());
int exit_code = CefExecuteProcess(main_args, cefApp.get(), NULL);
if (exit_code >= 0)
{
return exit_code;
}
I am using Visual Studio 2019 and C++ 17 to
My ClientApp looks like below and implement CefApp, CefBrowserProcessHandler and CefRenderProcessHandler methods:
- Code: Select all
class ClientApp : public CefApp, public CefBrowserProcessHandler,public CefRenderProcessHandler
In this situation I expect CefExecuteProcess() to either succeed or return a non-zero code. However in practice it crashes with Access violation reading location error.
While debugging, I can see CefApp address pointer what I am passing in CefExecuteProcess is getting changed inside libcef_dll_wrapper.cc.
Call stack looks like below:
- Code: Select all
[Inline Frame] CEPHtmlEngine.exe!scoped_refptr<CefApp>::AddRef(CefApp * ptr) Line 350
[Inline Frame] CEPHtmlEngine.exe!scoped_refptr<CefApp>::scoped_refptr(CefApp * p) Line 226
[Inline Frame] CEPHtmlEngine.exe!scoped_refptr<CefApp>::scoped_refptr(const scoped_refptr<CefApp> & r) Line 231
CEPHtmlEngine.exe!CefExecuteProcess(const CefMainArgs & args, scoped_refptr<CefApp> application, void * windows_sandbox_info) Line 82
CEPHtmlEngine.exe!wWinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, wchar_t * lpCmdLine, int nCmdShow) Line 300
I’ve spent a lot of time on this, and I don’t think this is a bug in CEF, but rather me using it incorrectly or building CEF incorrectly. However I have no clue about where to go now, so I’m seeking for your advice, hoping you’re seeing something I’m not.