Catch some errors in rendering process

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Catch some errors in rendering process

Postby ValentinNikin » Wed Jun 23, 2021 2:58 pm

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.
ValentinNikin
Techie
 
Posts: 25
Joined: Fri Jun 18, 2021 1:37 am

Re: Catch some errors in rendering process

Postby amaitland » Wed Jun 23, 2021 3:35 pm

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
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Catch some errors in rendering process

Postby ValentinNikin » Thu Jun 24, 2021 2:49 am

amaitland, thank you, very much!

Could you please explain me, how I can emulate critical problem to check my overrided RequestHandler?
ValentinNikin
Techie
 
Posts: 25
Joined: Fri Jun 18, 2021 1:37 am

Re: Catch some errors in rendering process

Postby amaitland » Thu Jun 24, 2021 6:21 am

https://github.com/cefsharp/CefSharp/wi ... -reporting lists a number of different test urls that can be used to simulate crashes.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Catch some errors in rendering process

Postby ValentinNikin » Thu Jun 24, 2021 9:33 am

Thank you amaitland!
ValentinNikin
Techie
 
Posts: 25
Joined: Fri Jun 18, 2021 1:37 am

Re: Catch some errors in rendering process

Postby ValentinNikin » Thu Jun 24, 2021 9:41 am

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?
ValentinNikin
Techie
 
Posts: 25
Joined: Fri Jun 18, 2021 1:37 am

Re: Catch some errors in rendering process

Postby amaitland » Thu Jun 24, 2021 3:40 pm

Short answer, no.

Enable crash pad to create mini dumps for later analysis is the option I'd suggest.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am

Re: Catch some errors in rendering process

Postby ValentinNikin » Fri Jun 25, 2021 3:24 am

Ok, I see. Thank you
ValentinNikin
Techie
 
Posts: 25
Joined: Fri Jun 18, 2021 1:37 am

Re: Catch some errors in rendering process

Postby amaitland » Fri Jun 25, 2021 4:35 am

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.
Maintainer of the CefSharp project.
amaitland
Master
 
Posts: 969
Joined: Wed Jan 14, 2015 2:35 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 1 guest