Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt 5.12.4 QtWebEngine crashes on view->load



  • Hello all,

    I'm trying to run Qt5.12.4 on my IMX6 module.

    A little background, my colleague got it to work on an older version of Qt v5.8 on pretty much the same IMX6 module. We built a custom Linux distro using buildroot, running kernel v4.1.15. All the application does is open up a webpage that we display on a screen. See below for the code snippet.

    #include <QApplication>
    #include <QWebEngineView>
    
    int main(int argc, char *argv[])
    {
        QApplication a (argc, argv);
    
        QWebEngineView* webView = new QWebEngineView();
    
        webView->setAttribute(Qt::WA_TranslucentBackground);
        webView->setStyleSheet("background::transparent");
        webView->page()->setBackgroundColor(Qt::transparent);
        printf("Loading URL...\n");
        webView->load(QUrl("http://localhost:3000"));
        printf("Loading done.\n");
        webView->show();
    
        return a.exec();
    }
    

    The IMX6 module we were previously using became obsolete so we had to upgrade to the vendor's latest module. Because of this change, we had to rebuild the kernel to support the new hardware. We're now running Kernel v4.9.x and Qt was updated to v5.12.4. I used Buildroot again to generate the Linux image and I matched the configuration from the previous build to this new one as best as I could. Because we updated Qt, I went back into Qt Creator and made sure the build environment matches the version of Qt that we built. Everything compiled just fine.

    My issue: Now when executing the code on the target device, I get the error the following error:

    [793:793:0802/122908.447886:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
    

    When I add the --no-sandbox option, I get the following error.:

    # ./qtWebpage_Linux4.9 --no-sandbox
    QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
    QEglFSVivIntegration will set environment variable FB_MULTI_BUFFER=2 to enable double buffering and vsync.
     If this is not desired, you can override this via: export QT_EGLFS_IMX6_NO_FB_MULTI_BUFFER=1
    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
    Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created.
    [0802/123114.716409:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale
    [0802/123114.835285:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale
    Loading URL...
    Unhandled prefetch abort: breakpoint debug exception (0x002) at 0x7250d830
    Process ./qtWebpage_Linux4.9  got signal  5
    stack trace:
      /lib/libc.so.6  :  __default_sa_restorer + 0
      /usr/lib/libQt5WebEngineCore.so.5  :   + 0x2228e88
      /usr/lib/libQt5WebEngineCore.so.5  :   + 0x2228eb8
      /usr/lib/libQt5WebEngineCore.so.5  :   + 0x2220048
      /usr/lib/libQt5WebEngineCore.so.5  :   + 0x17ae9a4
      /usr/lib/libQt5WebEngineCore.so.5  :   + 0x17af668
      /usr/lib/libQt5WebEngineCore.so.5  :  QtWebEngineCore::WebContentsAdapter::initialize(content::SiteInstance*) + 0x2dc
      /usr/lib/libQt5WebEngineCore.so.5  :  QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) + 0x63c
      /usr/lib/libQt5WebEngineCore.so.5  :  QtWebEngineCore::WebContentsAdapter::load(QUrl const&) + 0x34
      ./qtWebpage_Linux4.9() [0x1127c]
      /lib/libc.so.6  :  __libc_start_main + 0x110
    Trace/breakpoint trap
    
    

    It appears to break at the load function. I've contacted the vendor for support, but thought I'd ask here to see if anyone has had any similar issues.

    Thank you all.



  • Update:

    I was missing the font files. I copied my font files into /usr/share/fonts/ and it ran.


Log in to reply