3

I'm trying out a simple QWebEngineView example but it keeps crashing and I have no idea why.

Here's the code in main.cpp

#include <QApplication>
#include <QWebEngineView>

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    QApplication app(argc, argv);

    QWebEngineView view;
    view.resize(1024, 750);
    view.load(QUrl("http://www.qt.io"));
    view.show();

    return app.exec();
}

and here's the .pro file

TEMPLATE = app

QT += webenginewidgets

SOURCES += main.cpp

target.path = $$[QT_INSTALL_EXAMPLES]/webenginewidgets/minimal
INSTALLS += target

and this is the error message I get

> nouveau: kernel rejected pushbuf: No such file or directory nouveau:
> ch8: krec 0 pushes 0 bufs 2 relocs 0 nouveau: ch8: buf 00000000
> 00000002 00000004 00000004 00000000 nouveau: ch8: buf 00000001
> 00000006 00000004 00000000 00000004 nouveau: kernel rejected pushbuf:
> No such file or directory nouveau: ch8: krec 0 pushes 0 bufs 2 relocs
> 0 nouveau: ch8: buf 00000000 00000002 00000004 00000004 00000000
> nouveau: ch8: buf 00000001 00000006 00000004 00000000 00000004
> nouveau: kernel rejected pushbuf: No such file or directory nouveau:
> ch8: krec 0 pushes 0 bufs 2 relocs 0 nouveau: ch8: buf 00000000
> 00000002 00000004 00000004 00000000 nouveau: ch8: buf 00000001
> 00000006 00000004 00000000 00000004 nouveau: kernel rejected pushbuf:
> No such file or directory nouveau: ch8: krec 0 pushes 0 bufs 1 relocs
> 0 nouveau: ch8: buf 00000000 00000002 00000004 00000004 00000000 The
> program has unexpectedly finished.

I'm running Qt 5.8 on a korora 25 (based on fedora) machine.

2 Answers 2

3

I had the same problem with Ubuntu, but it worked fine in Windows 10.

I have solved it putting the following line just before the QApplication creation:

  QApplication::setAttribute(Qt::AA_UseSoftwareOpenGL);

The problem is related with OpenGL usage.

2
  • Thanks! This seems to work for me too. I am using Qt5.9 on macOS. When I try to load the same url several times, there is 50% probability to crash. After I set this attribute, it seems to not crash any more. (At least this is my few hours test result.) Sep 7, 2017 at 13:17
  • 1
    I have to take back my previous comment. With this setAttribute() call, the crash still happens but much lower probability than without this call. Sep 14, 2017 at 12:45
0

I had a similar problem with Rstudio (it is quite famous bug on rstudio) It is proposed by someone to run it using the following command in terminal:

QT_XCB_FORCE_SOFTWARE_OPENGL=1 rstudio 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.