Cef-based app crashes when calls CefInitialize

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.

Cef-based app crashes when calls CefInitialize

Postby charlieq » Tue Jul 17, 2018 9:03 pm

Windows cef-based (CEF 3.3325.1757.gdf2fcc8 / Chromium 65.0.3325) app crashed at the red-colored DCHECK when the app calls CefInitialize. When I debugged, the name parameter passed to the AddServiceManifest function is "pdf-compositor".

The app is linked with delayload libcef.dll and the executable sits in different folder than the cef DLLs and resources.

Answer will be greatly appreciated.

chromium\src\content\browser\service_manager\service_manager_context.cc

void AddServiceManifest(base::StringPiece name, int resource_id) {

std::string contents =

GetContentClient()

->GetDataResource(resource_id, ui::ScaleFactor::SCALE_FACTOR_NONE)

.as_string();

DCHECK(!contents.empty());



std::unique_ptr<base::Value> manifest_value =

base::JSONReader::Read(contents);

DCHECK(manifest_value);



std::unique_ptr<base::Value> overlay_value =

GetContentClient()->browser()->GetServiceManifestOverlay(name);



service_manager::MergeManifestWithOverlay(manifest_value.get(),

overlay_value.get());



base::Optional<catalog::RequiredFileMap> required_files =

catalog::RetrieveRequiredFiles(*manifest_value);

if (required_files) {

ChildProcessLauncher::SetRegisteredFilesForService(

name.as_string(), std::move(*required_files));

}



auto result = manifests_.insert(

std::make_pair(name.as_string(), std::move(manifest_value)));

DCHECK(result.second) << "Duplicate manifest entry: " << name;

}
Last edited by charlieq on Wed Jul 18, 2018 6:46 pm, edited 2 times in total.
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Re: Cef-based app crashes when calls CefInitialize

Postby HarmlessDave » Wed Jul 18, 2018 11:59 am

and the executable sits in different folder than the cef DLLs and resources.


Have you tried copying the DLLs, PAKs, etc. into the EXE folder?
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Cef-based app crashes when calls CefInitialize

Postby charlieq » Wed Jul 18, 2018 6:42 pm

HarmlessDave wrote:
and the executable sits in different folder than the cef DLLs and resources.


Have you tried copying the DLLs, PAKs, etc. into the EXE folder?


I tried. If the executable sits in the same folder as libcef.dll, PAKS, locales sub-folder, other dlls do, it works. However I have to keep the folder structure. The crash happens only one some Windows 10 machines when the whole application package is installed under Program Files (x86). I am wondering if cef is doing some operations that need administrator privilege. The cef app is launched by another application in this case.
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Re: Cef-based app crashes when calls CefInitialize

Postby magreenblatt » Wed Jul 18, 2018 6:56 pm

If you change the directory structure you need to set CefSettings paths. See the README.txt file.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Cef-based app crashes when calls CefInitialize

Postby charlieq » Wed Jul 18, 2018 7:11 pm

magreenblatt wrote:If you change the directory structure you need to set CefSettings paths. See the README.txt file.


No doubt. I did that. As I said, the cef app launches (launched by CreateProcess call from another process) if I install the whole application into a folder that does not need administrator privilege.
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Re: Cef-based app crashes when calls CefInitialize

Postby magreenblatt » Wed Jul 18, 2018 7:49 pm

If the problem only happens on some Windows 10 machines then I would suspect some strange permissions restriction on the user account. Does the program run successfully if it's directly executed by the user?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Cef-based app crashes when calls CefInitialize

Postby charlieq » Wed Jul 18, 2018 8:08 pm

magreenblatt wrote:If the problem only happens on some Windows 10 machines then I would suspect some strange permissions restriction on the user account. Does the program run successfully if it's directly executed by the user?


Good question. I will try that.
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Re: Cef-based app crashes when calls CefInitialize

Postby charlieq » Thu Jul 19, 2018 6:37 pm

charlieq wrote:
magreenblatt wrote:If the problem only happens on some Windows 10 machines then I would suspect some strange permissions restriction on the user account. Does the program run successfully if it's directly executed by the user?


Good question. I will try that.


I tried. The app crashed as well when it ran as standalone. If you look at the debugger screenshot, variable contents has weird value. It is not valid json string and cannot be parsed.
xcw-independent.png
xcw-independent.png (182.72 KiB) Viewed 7223 times
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Re: Cef-based app crashes when calls CefInitialize

Postby magreenblatt » Thu Jul 19, 2018 7:54 pm

Are the pak files that you're loading the same ones that were distributed with the CEF build that you're using?
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: Cef-based app crashes when calls CefInitialize

Postby charlieq » Thu Jul 19, 2018 8:26 pm

magreenblatt wrote:Are the pak files that you're loading the same ones that were distributed with the CEF build that you're using?

I built CEF myself with ffmpeg enabled. pak files are from the zipped package by the build process, BTW, AS I MENTIONED BEFORE, if the executable sits in the same folder as libcef dll, it works.
charlieq
Techie
 
Posts: 40
Joined: Mon Mar 20, 2017 9:50 pm

Next

Return to Support Forum

Who is online

Users browsing this forum: Majestic-12 [Bot] and 73 guests