CEF crashes at run time

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.

Re: CEF crashes at run time

Postby magreenblatt » Fri Jul 20, 2018 10:26 am

octavian wrote:Another option would be to disable support for H.264 (the same as what oficial Cef build does) which would mean not including these two flags:
proprietary_codecs=true ffmpeg_branding=Chrome
and build & give it a try.

That would be a good idea to eliminate the flags as the cause of the problem.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 7:17 am

I also built latest Cef without H264 (i.e. not using the 2 args mentioned above) but still it crashes.

But if I try the official build from http://opensource.spotify.com/cefbuilds/index.html
, like the last one (or any or the official ones) :
cef_binary_3.3396.1786.gd3e36d0_linux32.tar.bz2
then it works fine.
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 8:17 am

I'm thinking some of the build params are not set correctly before generating the Cef binary.
I looked at this site: https://gn.googlesource.com/gn/+/master ... k_start.md
and there is a command to list all the GN-related params used in building the Cef:
gn args --list out/my_build

In my case, the 'out/my_build' folder is: out/Debug_GN_x86 or out/Release_GN_x86
(since I was building for 32-bit target on the 64-bit Ubuntu host).

It is interesting that the build process also created folders for x64 as well. For example, under ~code/chromium_git/chromium/src/out/ folder
I have 4 sub-folders:

Debug_GN_x86
Debug_GN_x64
Release_GN_x86
Release_GN_x64

Is that expected ?

Anyways, I run this command from within Debug_GN_x86 folder:

~/code/chromium_git/depot-tools/gn args --list . > gn_args.txt

It saves a lot of output into the txt file. Is there something i would need to closely examine in this file that would give me a clue on what gn params might be the reason my Cef build did not work ?
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby ndesktop » Mon Jul 23, 2018 8:21 am

Yes, the build script generates all the Debug|Release_GN_x86|x64 subfolders, but it will build only the configuration/platform specified.
ndesktop
Master
 
Posts: 756
Joined: Thu Dec 03, 2015 10:10 am

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 8:24 am

Could I get a generated txt file (using the gn command listed above) from the official Cef build, so I can compare with my generated gn_args.txt ?

because we know the official Cef build works on our 32-bit Linux we have
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Mon Jul 23, 2018 9:09 am

The official build settings are documented here: https://bitbucket.org/chromiumembedded/ ... figuration

You can see the args that will be used first setting the GN_DEFINES environment variable and then running:

Code: Select all
cd /path/to/chromium/src/cef/tools
python gn_args.py linux
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 9:23 am

yes I use same GN_DEFINES pretty much the same:

env | grep GN
GN_DEFINES=is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 target_cpu=x86

So I cd to ~/code/chromium_git/chromium/src/cef/tools
when I ran the command : python gn_args.py linux, it returns the following output (below).

NOTE: I ran it this time in the terminal where I triggered the Cef build:

======== output ============
Platform: linux
NOTE: Not generating arm configuration due to missing sysroot directory


out/Debug_GN_x86:

clang_use_chrome_plugins=false
dcheck_always_on=true
enable_basic_printing=true
enable_linux_installer=false
enable_nacl=false
enable_print_preview=false
enable_vulkan=false
enable_widevine=true
fatal_linker_warnings=false
is_component_build=false
is_debug=false
is_official_build=true
symbol_level=1
target_cpu="x86"
use_allocator="none"
use_bundled_fontconfig=false
use_gtk3=false
use_sysroot=true


out/Release_GN_x86:

clang_use_chrome_plugins=false
enable_basic_printing=true
enable_linux_installer=false
enable_nacl=false
enable_print_preview=false
enable_vulkan=false
enable_widevine=true
fatal_linker_warnings=false
is_component_build=false
is_debug=false
is_official_build=true
symbol_level=1
target_cpu="x86"
use_allocator="none"
use_bundled_fontconfig=false
use_gtk3=false
use_sysroot=true


out/Release_GN_x64:

clang_use_chrome_plugins=false
enable_basic_printing=true
enable_linux_installer=false
enable_nacl=false
enable_print_preview=false
enable_vulkan=false
enable_widevine=true
fatal_linker_warnings=false
is_component_build=false
is_debug=false
is_official_build=true
symbol_level=1
target_cpu="x64"
use_allocator="none"
use_bundled_fontconfig=false
use_gtk3=false
use_sysroot=true


out/Debug_GN_x64:

clang_use_chrome_plugins=false
dcheck_always_on=true
enable_basic_printing=true
enable_linux_installer=false
enable_nacl=false
enable_print_preview=false
enable_vulkan=false
enable_widevine=true
fatal_linker_warnings=false
is_component_build=false
is_debug=false
is_official_build=true
symbol_level=1
target_cpu="x64"
use_allocator="none"
use_bundled_fontconfig=false
use_gtk3=false
use_sysroot=true
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 12:39 pm

getting back to the error I saw in the log:

ERROR:sandbox_linux.cc(351)] InitializeSandbox() called with multiple threads in process gpu-process

i see this issue being reported here:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=884173

and the solution reported at the bottom of page says to disable extensions.
When I look at my args, I have enable_extensions set to: true.

------
enable_extensions
Current value (from the default) = true
From //extensions/buildflags/buildflags.gni:8
------

Should I set this to false, when I set GN_DEFINES ?

like this: export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 proprietary_codecs=true ffmpeg_branding=Chrome target_cpu=x86 enable_extensions=false"
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Mon Jul 23, 2018 12:42 pm

octavian wrote:Should I set this to false, when I set GN_DEFINES ?

like this: export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 proprietary_codecs=true ffmpeg_branding=Chrome target_cpu=x86 enable_extensions=false"

No. CEF will not build with enable_extensions=false. You can disable extensions at runtime using the `--disable-extensions` command-line flag.
magreenblatt
Site Admin
 
Posts: 12408
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Mon Jul 23, 2018 1:07 pm

I tried, but same error I get.

This is what I used to pass at runtime to browser as well as browser settings:

void SimpleApp::OnBeforeCommandLineProcessing(const CefString& process_type, CefRefPtr<CefCommandLine> command_line){
if (process_type.empty()) {
command_line->AppendSwitch("enable-media-stream");
command_line->AppendSwitch("disable-gpu-shader-disk-cache");
command_line->AppendSwitch("disable-application-cache");
command_line->AppendSwitch("disable-cache");
command_line->AppendSwitch("disable-gpu-program-cache");
command_line->AppendSwitch("disable-extensions");

command_line->AppendSwitch("disable-webgl");

}
}

void SimpleApp::createCefBrowser() {
// Specify CEF browser settings here.
CefBrowserSettings browser_settings;

browser_settings.javascript = STATE_ENABLED;
browser_settings.file_access_from_file_urls = STATE_ENABLED;
browser_settings.universal_access_from_file_urls = STATE_ENABLED;
browser_settings.webgl = STATE_DISABLED;
browser_settings.local_storage = STATE_ENABLED;
browser_settings.application_cache = STATE_ENABLED;


std::string url;
url = (initialUrl_.length() > 0) ? initialUrl_ : DEFAULT_URL;

// Information used when creating the native window.
CefWindowInfo window_info;
const CefRect windowSize(0, 0, WIDTH, HEIGHT);

window_info.SetAsChild(parent_id, windowSize);
bool rc = CefBrowserHost::CreateBrowser(window_info, simple_handler_.get(), url, browser_settings, NULL);
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

PreviousNext

Return to Support Forum

Who is online

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