Creating browser failed - race condition?

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: Creating browser failed - race condition?

Postby Czarek » Sat Feb 15, 2014 9:38 am

Can't reproduce this issue anymore on Linux, after some changes to the code (providing non-NULL app/client handlers when calling cef_execute_process and cef_initialize).

Though the problem still persists on OS X.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Creating browser failed - race condition?

Postby Czarek » Thu Aug 28, 2014 1:44 am

I have found a workaround for this problem. This isn't really an issue during browser creation, it occurs even when no browser is being created, so it's CEF initialization problem. This issue appears more often when application is heavy overloaded during startup. CEF initialization failures can be resolved by offloading CPU after Initialize() was called. CEF is still running some stuff in its thread after CefInitialize returned, such as launching GPU process. If application is under heavy load during that initialization, it results in some race condition in CEF that ends with segmentation fault. The solution is to sleep application for half a second after Initialize. I have performed thousands of app launching tests and segmentation faults completely disappeared after adding the sleep call. Without that sleep it was reproducible on average every 100 runs. In CEF Python the solution was to add such code:

Code: Select all
 
cefpython.Initialize()
if platform.system() == "Linux":
      time.sleep(0.5)


This initialization failure issue was observed in CEF branches 1650 and 1750, on both Linux and OSX. It was reproducible in both CEF Python and CEF2go projects. In CEF tracker there is Issue 1207 to provide script for stress testing application launch. It would be nice if these race conditions were fixed in CEF.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: Creating browser failed - race condition?

Postby magreenblatt » Thu Aug 28, 2014 5:10 pm

Can you file a bug for this? I agree that it would be good to fix.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Creating browser failed - race condition?

Postby Czarek » Fri Aug 29, 2014 12:21 am

magreenblatt wrote:Can you file a bug for this? I agree that it would be good to fix.

Created Issue 1362:
https://code.google.com/p/chromiumembed ... il?id=1362
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Previous

Return to Support Forum

Who is online

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