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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Zeyad Obaia
  • 686
  • 1
  • 6
  • 21

2 Answers2

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.

  • 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 07 '17 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 '17 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 
Estatistics
  • 874
  • 9
  • 24