cztomczak / cefpython

Python bindings for the Chromium Embedded Framework (CEF)
Other
3.02k stars 469 forks source link

OnRenderProcessTerminated() is not available. #625

Open Berserker66 opened 2 years ago

Berserker66 commented 2 years ago

Cefpython crashes on certain pages on certain computers (they have in common that they're Windows VMs without GPU). Without OnRenderProcessTerminated() handling of any kind, all we get is [0715/101735.309:ERROR:request_handler.cpp(109)] [Browser process] OnRenderProcessTerminated() with no further debugging info available.

cztomczak commented 2 years ago

You can disable GPU hardware acceleration by adding the "disable-gpu" and "disable-gpu-compositing" command line switches when calling cef.Initialize. If you can detect these specific VM machines then disable it only for them.

If this happens rarely and it's acceptable to just restart renderer process then you can implement RequestHandler.OnRendererProcessTerminated callback and reload page after renderer crashed.

Berserker66 commented 2 years ago

it's a specific page that will crash the renderer on these computers always. Unfortunately, that page is filled with medical records.. so I can't just export one for investigation.

Will let people try the cmd switches.

Berserker66 commented 2 years ago

More info:

  1. having DevTools open makes it automatically pause in debugger. The DevTools then freeze (menu does not respond, resizing the window leaves new areas blank). However the actual page is despite claiming to be "Paused in debugger" continuing to load and display correctly. The non-funktioning devtools window can still be closed and the page be resumed, allowing normal operation of the page. Very awkward workaround, but appears to consistently work.

  2. Rendering the same page in current Firefox and current Chrome works, on the same computers where cefpython does not.

  3. Forcing software rendering on a system that does have working graphics does not cause the same issue. We checked this as we suspected a possible fault in the software renderer.

Preliminary conclusion: We're hitting some corner case that is likely fixed in newer CEF.

Berserker66 commented 2 years ago
  1. image Got a "trace" from the crashing devtools. subprocess.exe is at a bit under 6 GB, main application at 2.5 GB, on a 128 GB RAM machine with half of it still available.

cztomczak commented 2 years ago

GPU acceleration can be problematic on virtual machines, so best to disable it for VMs. It may be fixed in newer CEF. You can open chrome://gpu url in CEF Python browser to see information on GPU and possible issues.