Crash/error handling

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.

Crash/error handling

Postby cfrolik » Wed Sep 15, 2021 1:38 pm

I'm trying to make a kiosk-style application using CEF (it's basically the cefsimple example application with a few tweaks).

I'm looking for a way to handle errors/crashes, e.g. out of memory, that would typically lead to an "Aw Snap" page in regular Chrome.

Is there handler I can implement this? When testing my application with these types of errors, the screen goes blank (all white) and the following is printed to the terminal.

Code: Select all
<--- Last few GCs --->

[1:0x55a30aea5ed0]     8357 ms: Scavenge 1883.3 (2057.5) -> 1883.2 (2062.5) MB, 3.2 / 0.0 ms  (average mu = 0.798, current mu = 0.668) allocation failure
[1:0x55a30aea5ed0]     8363 ms: Scavenge 1886.1 (2062.5) -> 1886.0 (2063.5) MB, 4.0 / 0.0 ms  (average mu = 0.798, current mu = 0.668) allocation failure
[1:0x55a30aea5ed0]     8396 ms: Scavenge 1887.0 (2063.5) -> 1886.9 (2074.5) MB, 32.3 / 0.0 ms  (average mu = 0.798, current mu = 0.668) allocation failure


<--- JS stacktrace --->


However, I'm not sure where that output is coming from. Ideally I'd like to either run my own code in this scenario, or if that is not possible, have the application exit with a non-zero exit code.
cfrolik
Newbie
 
Posts: 2
Joined: Wed Sep 15, 2021 1:35 pm

Re: Crash/error handling

Postby magreenblatt » Wed Sep 15, 2021 2:05 pm

You can implement CefRequestHandler::OnRenderProcessTerminated.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: Crash/error handling

Postby cfrolik » Wed Sep 15, 2021 2:15 pm

Thank you, that is exactly what I was looking for.
cfrolik
Newbie
 
Posts: 2
Joined: Wed Sep 15, 2021 1:35 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 21 guests