Getting "Segmentation Fault" if QML application started without monitor attached



  • My QML application (no ui, does offscreen rendering) fails on start with "Segmentation fault", if no monitor attached. Runs fine if monitor is attached before app startup.

    Sy setup is QT 5.9.3. or 5.10 on Asus Tinkerboard with latest OS (Latest version v2.0.4 - Debian stretch based. 2017/11/15, Thread: https://tinkerboarding.co.uk/forum/thread-839.html)

    Any ideas why, how to fix, how to bypass monitor detection, ... any hints ?

    Thanks


  • Moderators

    Run your application with offscreen plugin:

    ./appName -platform offscreen
    


  • @sierdzio
    Thanks for response.

    Already tried few platform plugins (offscreen, minimalegl, minimal). no luck

    root@tinkerboard:/home/linaro/qt5build/qt5/tests/appTest4# ./appTest4 -platform offscreen
    This plugin does not support createPlatformOpenGLContext!
    QQuickRenderControl::initialize called with incorrect current context
    Segmentation fault
    
    
    root@tinkerboard:/home/linaro/qt5build/qt5/tests/appTest4# ./appTest4 -platform minimalegl
    Opened display 0x7fcc6f60
    
    Could not initialize egl display
    
    EGL error
    Aborted
    
    
    root@tinkerboard:/home/linaro/qt5build/qt5/tests/appTest4# ./appTest4 -platform minimal
    This plugin does not support createPlatformOpenGLContext!
    QQuickRenderControl::initialize called with incorrect current context
    Segmentation fault
    

  • Moderators

    hm, and your QML has graphical components, right? For command line mode, are you able to disable the graphical stuff? For example: do not construct QApplication (but QGui* or QCoreApplication), don't run the QML engine etc.



  • @sierdzio
    uf ... no easy answer.

    My application is console application (no gui), that runs QQmlEngine, plays qml file, does offscreen rendering (QOffscreenSurface / QOpenGLFramebufferObject) to capture frames to files (every n'th frame).
    Implementation is very similar to https://github.com/qtquickvcp/qml-oled-renderer.
    I was hoping that fact that my app is doing offscreeen rendering I would not need monitor attached.

    I am not that much familiar with inner QT workings.

    Where does dependency on monitor being attached comes from (QPA plugin selected, QT build, ..., base class used to initialize app ) ?

    Is there any documentation, books, where I can read more on

    Thanks


  • Qt Champions 2016

    @nlazovic Could you run glxinfo command before and after unattached the monitor, any different between the result?


  • Moderators

    @nlazovic said in Getting "Segmentation Fault" if QML application started without monitor attached:

    Where does dependency on monitor being attached comes from (QPA plugin selected, QT build, ..., base class used to initialize app ) ?

    I'm pretty sure the monitor requirement comes (probably indirectly) from QPA plugin. As you can see in minimal plugin output, for example - no complaints about the monitor there.

    I recommend asking on Qt Interest list - that's where Qt core developers are active, they should know how to help.

    Alternatively, there are some dummy monitors available, for example here or here.



  • @sierdzio
    thanks. i will post there too.
    thanks a lot for response.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.