Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Update to CEF 77.1.3 (BETA)

User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.3 (BETA)

Post by salvadordf »

Paulo França wrote: Mon Oct 07, 2019 6:07 pm I was facing so many crashes on app termination that I've decided to stick with CEF v75 and the SingleProcess model. As a result, ALL crashes are gone!
Please, consider using multiple processes. The SingleProcess model is unsuported by CEF and it's intended for debugging purposes only. It's a known cause of unexpected errors.
User avatar
Paulo França
Posts: 17
Joined: Mon Jul 15, 2019 2:22 am
Location: Brazil
Contact:

Re: Update to CEF 77.1.3 (BETA)

Post by Paulo França »

salvadordf wrote: Mon Oct 07, 2019 7:15 pm
Paulo França wrote: Mon Oct 07, 2019 6:07 pm I was facing so many crashes on app termination that I've decided to stick with CEF v75 and the SingleProcess model. As a result, ALL crashes are gone!
...It's a known cause of unexpected errors.
Actually, it's been the contrary from my own experience, as I said.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 77.1.3 (BETA)

Post by thefunkyjoint »

salvadordf wrote: Mon Oct 07, 2019 7:10 pm
thefunkyjoint wrote: Mon Oct 07, 2019 5:35 pm So i'm having this weird bug / crash in some pages, where one of the following things happens :
1 - App crash and closes
2 - The page goes blank and unresponsive after navigating.
The "blank and unresponsive page" error is usually a render process crash. It would be necessary to debug that process to get more clues.
Anyway it would be a CEF problem, not CEF4Delphi right ? In this case , we can consider the problem is on newer CEF builds ?

I never had these kind of problems until recently, maybe since 4 weeks from now.
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.3 (BETA)

Post by salvadordf »

thefunkyjoint wrote: Tue Oct 08, 2019 12:20 am Anyway it would be a CEF problem, not CEF4Delphi right ? In this case , we can consider the problem is on newer CEF builds ?
I never had these kind of problems until recently, maybe since 4 weeks from now.
Chromium and CEF had many changes in the last months. Many bugs were already fixed but some are still unresolved as you can see in the list of issues in the CEF project.

However, I don't rule out that CEF4Delphi could have issues. I'm still trying to understand why the demos crash sometimes since the CEF 77 update.

The CEF issue about that crash was created by a Xilium.CefGlue user months ago :
https://bitbucket.org/chromiumembedded/ ... closing-if

Xilium.CefGlue is another CEF wrapper and they have the same crash issue as CEF4Delphi. This issue has been reproduced in some PCs using the official CEF sample application but the CEF maintainer can't reproduce it in his computer.

While this problem is fixed I've uploaded a new component to the CEF4Delphi beta branch called TCEFSentinel.

Basically, TCEFSentinel is a "timer" that can be used when the application has closed all the browsers. It checks the amount of child processes and triggers TCEFSentinel.OnClose when it's safe to close the application.

I've added it to some demos : MiniBrowser, TabbedBrowser, ToolBoxBrowser and SimpleBrowser2.

Those demos close the browsers and then call TCEFSentinel.Start, usually in the TChromium.OnBeforeClose event or when the main form has closed all the child forms.

TCEFSentinel works like this :
  • TCEFSentinel.Start is called and TCEFSentinel sets an initial delay based on the amount of child processes.
  • After the initial delay it starts checking the child processes a few times to see if most of them are closed. When CEF is initialized it creates 2 subprocesses in CEF 77 and TCEFSentinel compares the child process count with 2 by default.
  • TCEFSentinel.OnClosed is triggered when the child process count is 2 or it has reached the maximum number of child processes checks.
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 77.1.3 (BETA)

Post by thefunkyjoint »

To make some tests about the crashes, I've rolled back to 75.0.8.0.

But GlobalCEFApp.DisableImageLoading does not exist on this version. How can i disable image loading on this version, please ?
User avatar
salvadordf
Posts: 4565
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Update to CEF 77.1.3 (BETA)

Post by salvadordf »

Use this before the GlobalCEFApp.StartMainProcess call :

Code: Select all

GlobalCEFApp.AddCustomCommandLine('--disable-image-loading');
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 77.1.3 (BETA)

Post by thefunkyjoint »

Thank you ! :D
thefunkyjoint
Posts: 513
Joined: Thu Aug 10, 2017 12:40 pm

Re: Update to CEF 77.1.3 (BETA)

Post by thefunkyjoint »

I've been using latest beta (77.1.12) and it seems this version has some improvement about the random crashes. They still happen, but less often.
Post Reply