cztomczak / cef2go

Go lang bindings for the Chromium Embedded Framework (CEF)
https://groups.google.com/d/forum/cef2go
Other
882 stars 127 forks source link

Linux/OSX: browser creation fails once in a while #8

Open cztomczak opened 10 years ago

cztomczak commented 10 years ago

It happened only once. Couldn't reproduce anymore.

Was it CEF fault? or GTK fault?

From the logs, compared to other successful launches, I see that there was one message missing, about the sandbox missing "Running renderer without sandbox". So it seems that the call to cef_create_browser_sync() failed. Did it return a null pointer? Need to add a check for that.

It would be a good idea to do some stress testing. Do 1000 launches of application and see if we can reproduce the problem.

cztomczak commented 10 years ago

Added commit 1a7d8697d0fddcf64fb4e8a14e035323ae74196a to check whether browser failed.

cztomczak commented 10 years ago

Reported problem on CEF Forum: http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=11470

cztomczak commented 10 years ago

Marshall says that there were numerous reports of problems when using the synchronous version of browser creation function. The solution will be to create browser asynchronously. A minor fix for windows is required to call WindowResized() after some delay.

Fix commited in revision f95b131047067afb7ee08caef0f20983d407c889.

cztomczak commented 10 years ago

Unfortunately the problem still persists. Browser creation fails. But this time I don't see an empty window. When browser creation fails in CEF, then CEF sends a signal to destroy window. Thus cef_quit_message_loop() is called and application quits.

Happens about 1/40 launches of application.

cztomczak commented 10 years ago

Same problem noticed also on OSX, branch 1750.

It seems that branch 1750 is just unstable. Latest Google Chrome stable is 32 / branch 1700. We will have to wait for until 1750 makes it into mainstream.

Still it would be good to create an example that can reproduce the issue, using cefsimple C++ example. See the topic on the CEF Forum from third post.

cztomczak commented 10 years ago

After applying some fixes to CEF structures initialization, and by providing app and client handlers to cef_execute_process/cef_initialize (see Issue #10 ), I can't reproduce this issue anymore on Linux.

The issue still persists on OS X.

jhvst commented 10 years ago

Same bug noticed on Ubuntu 12.04. I'm using the resources you've linked in the latest readme.

cztomczak commented 10 years ago

There is an Issue created in CEF to stress test application launching, to detect and fix this problem: https://code.google.com/p/chromiumembedded/issues/detail?id=1207

The crash may not necessarily be happening during browser creation. I've observed similar issues in branch 1650 on Linux when using CEF C++ API in CEF Python. The crash occurs during launch of a subprocess after a call to CefInitialize, no browser is being created. See this post for more details: http://www.magpcss.org/ceforum/viewtopic.php?p=22227#p22227

cztomczak commented 10 years ago

In Issue #13 quirkey states that this issue disappeared after implementing CefLifespanHandler. He also made some other changes to code that could affect CEF execution, see quirkey's fork for details.

EDIT. I meant Issue 13.

cztomczak commented 10 years ago

After creating some tests the issue was still reproducible in quirkey's fork.

I have some good news. By offloading CPU during CEF initialization I was able to get rid of segmentation faults in CEF Python. This should work for CEF2go as well. See: https://code.google.com/p/cefpython/issues/detail?id=131#c2

EDIT: quirkey confirmed that this fixed the issue in cef2go. See https://github.com/CzarekTomczak/cef2go/issues/13#issuecomment-53619901

cztomczak commented 10 years ago

A corresponding issue in CEF tracker (star it so that it gets more attention): https://code.google.com/p/chromiumembedded/issues/detail?id=1362