Page 1 of 1

Catch some errors in rendering process

PostPosted: Wed Jun 23, 2021 2:58 pm
by ValentinNikin
Hello!

Short description of my use case of CefSharp:
I have an URL of the some site. I need render the frames of this site with constant predefined frame rate and send this stream of frames by NDI (https://www.ndi.tv/sdk/) to the some clients.
I use Offscreen CefSharp to solve my task.

Question:
How can I understand that the rendering is successful and the source is still available.
I know the ChromiumWebBrowser contain some events such as "LoadError", "StatusMessage" and other. Maybe I need to use one of them. I need to catch critical errors which stop the rendering process.

Re: Catch some errors in rendering process

PostPosted: Wed Jun 23, 2021 3:35 pm
by amaitland
You can be notified of render process crashes using OnRenderProcessTerminated

http://cefsharp.github.io/api/91.1.x/se ... Terminated

If you are seeing frequent crashes you may wish to enable crash pad.

https://github.com/cefsharp/CefSharp/wi ... -reporting

Re: Catch some errors in rendering process

PostPosted: Thu Jun 24, 2021 2:49 am
by ValentinNikin
amaitland, thank you, very much!

Could you please explain me, how I can emulate critical problem to check my overrided RequestHandler?

Re: Catch some errors in rendering process

PostPosted: Thu Jun 24, 2021 6:21 am
by amaitland
https://github.com/cefsharp/CefSharp/wi ... -reporting lists a number of different test urls that can be used to simulate crashes.

Re: Catch some errors in rendering process

PostPosted: Thu Jun 24, 2021 9:33 am
by ValentinNikin
Thank you amaitland!

Re: Catch some errors in rendering process

PostPosted: Thu Jun 24, 2021 9:41 am
by ValentinNikin
With overriding OnRenderProcessTerminated I can catch only chrome://crash event. Are there other ways to catch "chrome://inducebrowsercrashforrealz" and "chrome://gpucrash" from code?

Main (browser) process crash: chrome://inducebrowsercrashforrealz
Renderer process crash: chrome://crash
GPU process crash: chrome://gpucrash

In the debug.log file I see this crash events, are there any way to catch information written to debug.log?

Re: Catch some errors in rendering process

PostPosted: Thu Jun 24, 2021 3:40 pm
by amaitland
Short answer, no.

Enable crash pad to create mini dumps for later analysis is the option I'd suggest.

Re: Catch some errors in rendering process

PostPosted: Fri Jun 25, 2021 3:24 am
by ValentinNikin
Ok, I see. Thank you

Re: Catch some errors in rendering process

PostPosted: Fri Jun 25, 2021 4:35 am
by amaitland
When the GPU crashes it should automatically spawn an instance, if it crashes frequently in a short space of time then GPU rendering should be automatically disabled. Generally there isn't any intervention required.

If you are seeing the default windows error dialog when CEF crashes you can try https://docs.microsoft.com/en-us/window ... terrormode to change the process wide behaviour.