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.

CEF crashes at run time

Postby octavian » Thu Jul 19, 2018 10:12 am

Hi,

I wanted to build CEF from source code , since the latest official build (i.e. cef_binary_3.3396.1785.ga27bbfa_linux32.tar.bz2) from:
http://opensource.spotify.com/cefbuilds/index.html
does not contain support for H.264 video codec.

I want to build CEF for Linux 32-bit architecture.

For this, I was following the steps outlined here:
1- https://bitbucket.org/chromiumembedded/ ... ldSetup.md (see ‘Linux Configuration’ section)
but also looking at the instructions on how to build it in such a way to include H.264 codec, here:
2- https://stackoverflow.com/questions/438 ... st-version)

So combining the info from those web sites, I did following steps (see below)
So I end up producing this output: cef_binary_3.3483.1810.g8e9d736_linux32_client.tar.bz2

I then used this generated Cef by unzipping it in my project as a dependency and then built my project.
NOTE: My project is being built within a 32-bit VM (which is based on Ubuntu 13.10), not in the 64-bit Vm where I built the Cef source code, of course...
At run time, I see the following in a log file it generates:

INFO:GrGLInterface.cpp(453)] ../../third_party/skia/src/gpu/gl/GrGLInterface.cpp:453 GrGLInterface::validate() failed.
ERROR:sandbox_linux.cc(378)] InitializeSandbox() called with multiple threads in process gpu-process.

.. and my VM freezes. it seems to be a Open GL issue (i.e. graphics related)..

I noticed that if I were to use the latest official Cef binary downloaded, i.e.: cef_binary_3.3396.1785.ga27bbfa_linux32.tar.bz2
then things work out, no longer see the crash, but then I don't have H.264 support...

Also noticed that my tar file is 37 megs larger then the official tar file.
There are three .so files generated in both Debug & Release folders: libEGL.so , libGLESv2.so & libcef.so
If I just replace the 2 dependencies: libEGL.so , libGLESv2.so from the official Cef build, still I get the same error.

A- Could it be the way I built CEF source code -- see below--- (maybe instructions lack something) ?
B- Could it be that the source code version I was building (i.e. 3.3483.1810) has some GL issues as opposed to 3.3396.1785 (which works fine) ?

Thank you so much,
Octavian


=========== Steps I performed for building CEF to include H.264 codec =============

- I first created an ubuntu VM, by installing: Ubuntu version: 14.04, 64-bit.

Step 1:

In VM, open a terminal and run:

mkdir ~/code
mkdir ~/code/automate
mkdir ~/code/chromium_git

Step 2:

sudo dpkg --add-architecture i386
sudo apt update
NOTE: I did NOT install & use 'aptitude' tool (to install dependencies), as suggested in the Wiki page, but rather I used apt-get as shown below
(i.e. the 'DEBIAN_FRONTEND' command from the Wiki page #1, seems to crashed our VM).

So instead, i used apt-get, like this:

sudo apt-get install bison build-essential cdbs curl devscripts dpkg-dev elfutils fakeroot flex g++ git-core git-svn gperf libapache2-mod-php5 libasound2-dev libav-tools libbrlapi-dev libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev libdrm-dev libelf-dev libexif-dev libffi-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev openbox patch perl php5-cgi pkg-config python python-cherrypy3 python-crypto python-dev python-psutil python-numpy python-opencv python-openssl python-yaml rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho fonts-thai-tlwg wdiff wget zip lib32gcc1 lib32stdc++6 libc6-i386 linux-libc-dev:i386 libasound2:i386 libcap2:i386 libelf-dev:i386 libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386 libgtk2.0-0:i386 libgtk-3-0:i386 libncurses5:i386 libnss3:i386 libpango1.0-0:i386 libssl1.0.0:i386 libtinfo-dev:i386 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386 libxrandr2:i386 libxss1:i386 libxtst6:i386

NOTE: Specify proprietary-codes to include H.264 , in this export, here:

export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 proprietary_codecs=true ffmpeg_branding=Chrome"

export CEF_ARCHIVE_FORMAT=tar.bz2

export GN_ARGUMENTS="--ide=vs2015 --sln=cef --filters=//cef/*"

export CEF_USE_GN=1

verify that GN-related variables were properly set: env | grep GN

cd ~/code/automate/

Download the script that will download all CEF source code and do the build:

wget https://bitbucket.org/chromiumembedded/ ... ate-git.py

There seems to be an issue while building for the video codec H.264, in particular when it tries to build file:
obj/third_party/ffmpeg/ffmpeg_internal/h264_cabac.o

Solution to fix this is described here:
https://groups.google.com/a/chromium.or ... BlimAzVDbY
So to fix this issue, modify BUILD.gn located at ~/code/chromium_git/chromium/src/third_party/ffmpeg/
by commenting out the following 4 lines, so that HAVE_EBP_AVAILABLE is now off:

if (target_cpu == "x86") {
#if (using sanitizer || is_win) {
defines += [ "HAVE_EBP_AVAILABLE=0" ]
#} else {
# defines += [ "HAVE_EBP_AVAILABLE=1" ]
#}
}

Then save it & copy the modified script to a safe location (e.g. ~/code/):

cp ~/code/chromium_git/chromium/src/third_party/ffmpeg/BUILD.gn ~/code/

Add an instruction into automate-git.py script to copy back this BUILD.md, right before it's triggering the CEF build, by adding this os.system instruction:

##
# Build CEF
##

os.system("cp ~/code/BUILD.gn ~/code/chromium_git/chromium/src/third_party/ffmpeg/")

- Now save automate-git.py

Finally run the master script:

python automate-git.py --download-dir=/home/sdkbuild/code/chromium_git --minimal-distrib --client-distrib --force-clean --build-target=cefsimple

NOTE: This master script will download the CEF source code and perform the build.
It will take hours to build, even on the fast host machine.

When is done, terminal output should end with something displayed like this:
Creating tar.bz2 archive for cef_binary_3.3483.1810.g8e9d736_linux32_client...

There should be 3 output tar files located under: ~code/chromium_git/chromium/src/cef/binary_distrib/
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Thu Jul 19, 2018 10:21 am

octavian wrote:At run time, I see the following in a log file it generates:

INFO:GrGLInterface.cpp(453)] ../../third_party/skia/src/gpu/gl/GrGLInterface.cpp:453 GrGLInterface::validate() failed.
ERROR:sandbox_linux.cc(378)] InitializeSandbox() called with multiple threads in process gpu-process.

Could be a configuration issue on your system. See for example https://forums.gentoo.org/viewtopic-t-1 ... art-0.html
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Thu Jul 19, 2018 12:32 pm

I was looking at this export:
export GN_ARGUMENTS="--ide=vs2015 --sln=cef --filters=//cef/*"

and it seems to me that I don't need this VisualStudio-related argument, since I'm building for Linux..
Could that be a cause ?

I should have set:
export GN_ARGUMENTS="--sln=cef --filters=//cef/*"
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Thu Jul 19, 2018 12:44 pm

octavian wrote:I was looking at this export:
export GN_ARGUMENTS="--ide=vs2015 --sln=cef --filters=//cef/*"

and it seems to me that I don't need this VisualStudio-related argument, since I'm building for Linux..
Could that be a cause ?

I should have set:
export GN_ARGUMENTS="--sln=cef --filters=//cef/*"

These GN_ARGUMENTS are for Windows only. They're probably ignored on Linux.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Thu Jul 19, 2018 12:47 pm

ok, I will remove that environment variable and re-run :

python automate-git.py --download-dir=/home/sdkbuild/code/chromium_git --minimal-distrib --client-distrib --force-clean --build-target=cefsimple

--force-clean should re-build from scratch I take it..

Also, is this parameter ok: is_official_build=true
for building Cef ??
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Thu Jul 19, 2018 12:51 pm

octavian wrote:ok, I will remove that environment variable and re-run :

python automate-git.py --download-dir=/home/sdkbuild/code/chromium_git --minimal-distrib --client-distrib --force-clean --build-target=cefsimple

--force-clean should re-build from scratch I take it..

You can do that, but your problem likely isn't the GN_ARGUMENTS value.

octavian wrote:Also, is this parameter ok: is_official_build=true
for building Cef ??

Yes.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Thu Jul 19, 2018 12:59 pm

Also, I see here:https://www.chromium.org/developers/gn-build-configuration

that it mentions:
For 32-bit official builds, append this arg to the above set:
target_cpu = "x86"

I don't have that so maybe I need to set that too !
(But I thought that by running command: sudo dpkg --add-architecture i386
took care of setting the target architecture.)


How about : is_chrome_branded = true ??
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby magreenblatt » Thu Jul 19, 2018 1:07 pm

octavian wrote:that it mentions:
For 32-bit official builds, append this arg to the above set:
target_cpu = "x86"

I don't have that so maybe I need to set that too !

The automate-git.py script will build the out/[Debug|Release]_GN_x86 targets by default, and this value is already set. See the args.gn file in those directories.

octavian wrote:How about : is_chrome_branded = true ??

No, don't set that.
magreenblatt
Site Admin
 
Posts: 12383
Joined: Fri May 29, 2009 6:57 pm

Re: CEF crashes at run time

Postby octavian » Thu Jul 19, 2018 1:09 pm

ok, so no need to set them..

so the only culprit was: GN_ARGUMENTS, but you say it may be ignored anyways.. I try to rebuild anyways without that GN_ARGUMENTS and see..

Other then that, I don't see what could be wrong ..

You were also mentioning to look at some web link. In there I see people talk about disabling CONFIG_COMPAT_VDSO.
You mean export CONFIG_COMPAT_VDSO=false ?
I don't see how this variable is related to the GL error I got in the log file..
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Re: CEF crashes at run time

Postby octavian » Fri Jul 20, 2018 9:44 am

is there a way to see what environment variables are used in the official build of cef (for 32-bit arch) ?
- i.e. how those official builds were generated: http://opensource.spotify.com/cefbuilds/index.html

I think it is a configuration issue on my end, on how I build it, since if I use official Cef build, it works ok.

NOTE: This is what I currently use, but it may be missing something:

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"

export CEF_ARCHIVE_FORMAT=tar.bz2

export CEF_USE_GN=1

... 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.
Last edited by octavian on Fri Jul 20, 2018 2:12 pm, edited 1 time in total.
octavian
Techie
 
Posts: 36
Joined: Thu Jul 19, 2018 9:35 am

Next

Return to Support Forum

Who is online

Users browsing this forum: No registered users and 37 guests