CefInitialize fails with wrong cef settings size

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.

CefInitialize fails with wrong cef settings size

Postby miro » Thu Nov 09, 2023 7:10 am

Hi
i didn want to concatenate my issues under my post with include warnings because i dont know if they have something todo together so i decide to make new post.
Used OS is Windows 10 build 19045.3570, VS2019 Prof.
When trying to load CEF to our application the call to CefInitalize fails in libcef_dll.cc in line nr.: 99
[1109/120224.864:FATAL:libcef_dll.cc(99)] Check failed: false. invalid settings->[base.]size


CefSettings:
Code: Select all
CefSettings settings;
settings.size = sizeof(settings);
CefString(&settings.browser_subprocess_path) = csCefFullPath;
// some other settings which works previous
// Call to CefInitialize, sandbox_info is null here
m_bInitialized = CefInitialize(main_args, settings, m_cefApp.get(), sandbox_info);

libcef_dll.cc content:
Code: Select all
if (!template_util::has_valid_size(settings)) {
    DCHECK(false) << "invalid settings->[base.]size";
    return 0;
  }

What can cause that the CefSettings has an invalid size, and how to fix the proper cef settings size?
Any help would be great
miro
Last edited by miro on Thu Nov 09, 2023 10:16 am, edited 1 time in total.
miro
Techie
 
Posts: 31
Joined: Wed Oct 14, 2020 5:48 am

Re: CefInitialize fails with wrong cef settings size

Postby ndesktop » Thu Nov 09, 2023 8:25 am

I don't think CefSettings.size should be set.
Cef structures usually have traits, which initializes like this
Code: Select all
struct CefSettingsTraits {
  using struct_type = cef_settings_t;

  static inline void init(struct_type* s) { s->size = sizeof(struct_type); }
...

but the size is the sizeof of the underlying C structure, in this case cef_settings_t.
So the
Code: Select all
settings.size = sizeof(settings);

line should be removed and I think that will fix the problem.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: CefInitialize fails with wrong cef settings size

Postby miro » Thu Nov 09, 2023 10:23 am

Hi,
thanks for your answer, i didn have this until yet for testing, cause i seen this in another older post and thinking it will help me, i will remove them since it doesn't solve my problem.
I wrote in another post that i have some issues with the distribution build, some of the header files are not included properly when calling :
Code: Select all
make_distrib.bat --output-dir %binary_path% --distrib-subdir %binary_folder% --ninja-build

paths are ok and worked in previous cef builds, im in doubt if this bottom lines can have some impact on the created distributions
C:/cef_builder_scripts/cef/chromium/src/cef/include/wrapper/cef_closure_task.h:55: warning: explicit link request to 'include' could not be resolved
C:/cef_builder_scripts/cef/chromium/src/cef/include/wrapper/cef_closure_task.h:56: warning: explicit link request to 'include' could not be resolved
C:/cef_builder_scripts/cef/chromium/src/cef/include/wrapper/cef_library_loader.h:68: warning: explicit link request to 'include' could not be resolved
C:/cef_builder_scripts/cef/chromium/src/cef/include/wrapper/cef_library_loader.h:83: warning: explicit link request to 'include' could not be resolved
C:/cef_builder_scripts/cef/chromium/src/cef/include/wrapper/cef_library_loader.h:84: warning: explicit link request to 'include' could not be resolved
C:/cef_builder_scripts/cef/chromium/src/cef/include/base/cef_callback_helpers.h:98: warning: Unsupported xml/html tag <typename> found


Anyway thanks for your answer.
Regards
miro
miro
Techie
 
Posts: 31
Joined: Wed Oct 14, 2020 5:48 am


Return to Support Forum

Who is online

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