I am trying to use Cypress (cypress.io) to test a cef based app. The test framework uses remote debugging, it also adds a couple of extensions via command line. The first issue I ran into is that it specifies two extensions in the command line, separated by a '.' but CEF was expecting ';'. I changed that code to separate the extensions via '.' and got a little further. I have not looked at these extensions yet to try to understand what they do, however I will note that Cypress works for testing Chrome and Electron just fine.
My app us based on cefclient with minimal modifications. Running on Mac OSX. I compiled with no sandbox.
cef_binary_81.3.1+gb2b49f1+chromium-81.0.4044.113_macosx64
I've attempted to debug this for a while but a couple of things were elusive. First, I downloaded symbols, and also get the set target.source-map to give me source level debugging.
However, I am seeing this in lldb:
Chromium Embedded Framework was compiled with optimization - stepping may behave oddly; variables may not be available.
how do I compile against a debug cef binary? I thought I was - what can I check to make sure I'm linking with a debug binary? Is there a required argument to cmake I'm missing?
I may be able to reproduce this just by trying to load the extensions. There are two so I'm now going to see if only one or both cause this crash.
Now the app is crashing here:
EXC_BAD_ACCESS (code-1, address=0x0)
#0 0x000000010b53b3b6 in ThemeService::DoSetTheme(extensions::Extension const*, bool) at /Users/johnb/cloudwing/cef_binary/chromium/src/chrome/browser/themes/theme_service.cc:592
#1 0x000000010b53cd46 in ThemeService::ThemeObserver::OnExtensionLoaded(content::BrowserContext*, extensions::Extension const*) at /Users/johnb/cloudwing/cef_binary/chromium/src/chrome/browser/themes/theme_service.cc:126
#2 0x00000001083a1631 in extensions::ExtensionRegistry::TriggerOnLoaded(extensions::Extension const*) at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/extensions/browser/extension_registry.cc:64
#3 0x0000000108f06dac in extensions::CefExtensionSystem::NotifyExtensionLoaded(extensions::Extension const*) at /Users/johnb/cloudwing/cef_binary/chromium/src/cef/libcef/browser/extensions/extension_system.cc:646
#4 0x0000000108f05adc in extensions::CefExtensionSystem::LoadExtension(extensions::CefExtensionSystem::ComponentExtensionInfo const&, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>) at /Users/johnb/cloudwing/cef_binary/chromium/src/cef/libcef/browser/extensions/extension_system.cc:579
#5 0x0000000108f04eea in extensions::CefExtensionSystem::LoadExtension(std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>) at /Users/johnb/cloudwing/cef_binary/chromium/src/cef/libcef/browser/extensions/extension_system.cc:311
#6 0x0000000108f076bf in extensions::(anonymous namespace)::LoadExtensionOnUIThread(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>) at /Users/johnb/cloudwing/cef_binary/chromium/src/cef/libcef/browser/extensions/extension_system.cc:106
#7 0x0000000108f07802 in void base::internal::FunctorTraits<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), void>::Invoke<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >(void (*&&)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>&&, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >&&, base::FilePath&&, bool&&, scoped_refptr<CefRequestContext>&&, scoped_refptr<CefExtensionHandler>&&) at /Users/johnb/cloudwing/cef_binary/chromium/src/base/bind_internal.h:399
#8 0x0000000108f07770 in void base::internal::InvokeHelper<false, void>::MakeItSo<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >(void (*&&)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>&&, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >&&, base::FilePath&&, bool&&, scoped_refptr<CefRequestContext>&&, scoped_refptr<CefExtensionHandler>&&) [inlined] at /Users/johnb/cloudwing/cef_binary/chromium/src/base/bind_internal.h:599
#9 0x0000000108f07764 in void base::internal::Invoker<base::internal::BindState<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >, void ()>::RunImpl<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), std::__1::tuple<base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>(void (*&&)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), std::__1::tuple<base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >&&, std::__1::integer_sequence<unsigned long, 0ul, 1ul, 2ul, 3ul, 4ul, 5ul>) [inlined] at /Users/johnb/cloudwing/cef_binary/chromium/src/base/bind_internal.h:672
#10 0x0000000108f07750 in base::internal::Invoker<base::internal::BindState<void (*)(base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath const&, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler>), base::WeakPtr<extensions::CefExtensionSystem>, std::__1::unique_ptr<base::DictionaryValue, std::__1::default_delete<base::DictionaryValue> >, base::FilePath, bool, scoped_refptr<CefRequestContext>, scoped_refptr<CefExtensionHandler> >, void ()>::RunOnce(base::internal::BindStateBase*) at /Users/johnb/cloudwing/cef_binary/chromium/src/base/bind_internal.h:641
#11 0x000000010926a6e3 in base::OnceCallback<void ()>::Run() && [inlined] at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/callback.h:98
#12 0x000000010926a689 in base::TaskAnnotator::RunTask(char const*, base::PendingTask*) at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/task/common/task_annotator.cc:142
#13 0x0000000109286e54 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::sequence_manager::LazyNow*, bool*) at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:365
#14 0x0000000109286b67 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoSomeWork() at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:219
#15 0x0000000109307cc4 in base::MessagePumpCFRunLoopBase::RunWork() at /Users/johnb/cloudwing/cef_binary/chromium/src/base/message_loop/message_pump_mac.mm:491
#16 0x00000001092ff67a in cef_time_delta ()
#17 0x000000010930762f in base::MessagePumpCFRunLoopBase::RunWorkSource(void*) at /Users/johnb/cloudwing/cef_binary/chromium/src/base/message_loop/message_pump_mac.mm:467
#18 0x00007fff4354de33 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()
#19 0x00007fff4354ddd9 in __CFRunLoopDoSource0 ()
#20 0x00007fff4353179b in __CFRunLoopDoSources0 ()
#21 0x00007fff43530d65 in __CFRunLoopRun ()
#22 0x00007fff4353066e in CFRunLoopRunSpecific ()
#23 0x00007fff4278f1ab in RunCurrentEventLoopInMode ()
#24 0x00007fff4278eee5 in ReceiveNextEventCommon ()
#25 0x00007fff4278ec76 in _BlockUntilNextEventMatchingListInModeWithFilter ()
#26 0x00007fff40b2677d in _DPSNextEvent ()
#27 0x00007fff40b2546b in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
#28 0x00007fff40b1f588 in -[NSApplication run] ()
#29 0x000000010930899c in base::MessagePumpNSApplication::DoRun(base::MessagePump::Delegate*) at /Users/johnb/cloudwing/cef_binary/chromium/src/base/message_loop/message_pump_mac.mm:829
#30 0x0000000109306fd2 in base::MessagePumpCFRunLoopBase::Run(base::MessagePump::Delegate*) at /Users/johnb/cloudwing/cef_binary/chromium/src/base/message_loop/message_pump_mac.mm:186
#31 0x00000001092877db in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:463
#32 0x0000000109245468 in base::RunLoop::Run() at /Users/spotify-buildagent/buildAgent/work/215ce731d4621561/CEF3_git/chromium/src/base/run_loop.cc:155
#33 0x0000000108ee5fe6 in CefRunMessageLoop() at /Users/johnb/cloudwing/cef_binary/chromium/src/cef/libcef/browser/context.cc:307
#34 0x0000000100229a4a in ::cef_run_message_loop() at /Users/johnb/cloudwing/cef/cef-macosx64/cef_binary/libcef_dll/wrapper/libcef_dll_dylib.cc:991
#35 0x000000010022c3a9 in CefRunMessageLoop() at /Users/johnb/cloudwing/cef/cef-macosx64/cef_binary/libcef_dll/wrapper/libcef_dll_wrapper.cc:134
#36 0x000000010009ae01 in client::MainMessageLoopStd::Run() at /Users/johnb/cloudwing/cef/shared/browser/main_message_loop_std.cc:14
#37 0x000000010008ba05 in client::(anonymous namespace)::RunMain(int, char**) at /Users/johnb/cloudwing/cef/client/cefclient_mac.mm:421
#38 0x000000010008af42 in main at /Users/johnb/cloudwing/cef/client/cefclient_mac.mm:443
#39 0x00007fff6f4ba3d5 in start ()
#40 0x00007fff6f4ba3d5 in start ()