Qt World Summit: Register Today!

Crash when using qml webengineview

  • Re: Can't use WebEngineView.

    I am getting random crashes when I use webengineview in debug mode

    [10980:14076:0114/163619.937:FATAL:com_init_util.cc(71)] Check failed: false. CoCreateInstance calls in Chromium require explicit COM initialization via base::CreateCOMSTATaskRunnerWithTraits() or ScopedCOMInitializer. See the comment in DCheckedCoCreateInstance for more details.

    My environment: windows10, msvc2017 32 bit, qt 5.12.0
    I also use axcontainer module to load an ActiveX object, this is a must for my application. I use these libraries
    QT += qml quick quickcontrols2
    QT += widgets
    QT += multimedia
    QT += core
    QT += webengine
    QT += axcontainer

    Is there any caveat when using together with other COM components?

    Please let me know if this is known error or give me any clue. I can post most information if required.

  • I wrote to chromium developers, so, here is the summary

    • It is not a crash, it is a failed debug assertion
    • It happens if:
      • you use webview's chromium backend (recent versions, old versions don't have this assertion)
      • some part of you code consumes COM and
      • that code's thread is not explicitly initializing COM via CoInitialize or CoInitializeEx

    My code uses a library that was not properly initializing COM in its threads before calling CoCreateInstance. Calling CoInitialize should fix my issue, but I cannot prove it until I have access to that libraries source code.

    What is left to be done by qt/webview team is to fix the failed assertion on "Chrome_InProcGpuThread" which is not created by user.