Issues with QWebEngineView and Chromium Integration: Errors and Crashes in Debug Mode
-
Hello everyone,
I’m experiencing significant issues with my application, which uses QWebEngineView for embedding web pages, when running in debug mode. The application logs multiple warnings and errors related to Chromium, and eventually crashes. Here's a summary of the logs and my setup:
Debug Logs
Here are the full logs I see in the debug console:Warnings :
[2960:17168:0410/160141.937:WARNING:viz_main_impl.cc(85)] VizNullHypothesis is disabled (not a warning) This warning appears multiple times but doesn't seem to affect the application directly.
Errors :
[2960:17168:0410/160149.287:ERROR:direct_composition_support.cc(991)] QueryInterface to IDCompositionDevice4 failed: Cette interface n’est pas prise en charge (0x80004002) Indicates a failure when Chromium tries to use DirectComposition, likely related to rendering.
[2960:17168:0410/160151.095:ERROR:shared_image_factory.cc(880)] Could not find SharedImageBackingFactory with params... This message repeats consistently, and seems tied to GPU-accelerated rendering.
[2960:2040:0410/160152.118:FATAL:cc(222)] Check failed: !base::Contains(root_sink_map_, params->frame_sink_id). This is the fatal error that crashes the application. It seems related to QWebEnginePage::setUrlRequestInterceptor and Chromium's rendering pipeline.
My Code Setup
I’m using QWebEngineView to embed a calendar (calendar.html) and a map (map.html) in my application. Here’s a summary of my code for both views:QWebEngineView Configuration :
Enabled settings like JavascriptCanAccessClipboard, LocalStorageEnabled, Accelerated2dCanvasEnabled, and ErrorPageEnabled.Set HttpCacheType to MemoryHttpCache with a maximum size of 100 MB.
Used QWebChannel for backend communication.
Customized the HttpUserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.5615.138 Safari/537.36".
Environment Variables for Debugging :
Added QTWEBENGINE_CHROMIUM_FLAGS to enable Chromium logging :
qputenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-logging=stderr --v=0");
Important Observations
Calendar and Map Load Progress :Both views report progress through loadProgress and loadFinished signals, confirming that pages attempt to load.
Crashes During Rendering :
The crash appears tied to Accelerated 2D Canvas or GPU rendering.
The message Context lost during MakeCurrent suggests a GPU context issue.
DirectComposition Issues:
Fails with 0x80004002 (interface not supported) for IDCompositionDevice4, a rendering API.
What I've Tried
Updates: Updated Windows, GPU drivers, and Qt (currently on Qt 6.9.0).Debug Logging: Enabled extensive Chromium logs with QTWEBENGINE_CHROMIUM_FLAGS.
Disabling Antivirus/Firewall: Confirmed nothing is blocked externally.
Questions
What could be causing the fatal FrameSinkId error (Check failed: !base::Contains(root_sink_map_, params->frame_sink_id)) in Chromium? Could it be tied to specific settings in QWebEngineView ?Is the IDCompositionDevice4 failure indicative of missing GPU features or a driver issue, and how can I resolve it?
Are there known issues with Qt WebEngine 6.9.0 and QWebEngineView when using accelerated canvas or GPU-based rendering ?
Environment
OS: Windows 10 (64-bit)Qt Version: 6.9.0
GPU: NVIDIA GeForce GTX 1060 6GB
Qt WebEngine: Chromium 112
Any insights or suggestions to fix the crashes and errors would be greatly appreciated. Let me know if you need more details about the setup !
Thank you in advance!
-
-
Hi,
Did you also try with a less recent version of Qt such as 6.8 ?