Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Getting "Segmentation Fault" if QML application started without monitor attached
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 3 Posters 2.7k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nlazovic
    wrote on last edited by
    #1

    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

    benlauB 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Run your application with offscreen plugin:

      ./appName -platform offscreen
      

      (Z(:^

      N 1 Reply Last reply
      1
      • sierdzioS sierdzio

        Run your application with offscreen plugin:

        ./appName -platform offscreen
        
        N Offline
        N Offline
        nlazovic
        wrote on last edited by
        #3

        @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
        
        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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.

          (Z(:^

          N 1 Reply Last reply
          0
          • sierdzioS sierdzio

            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.

            N Offline
            N Offline
            nlazovic
            wrote on last edited by
            #5

            @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

            1 Reply Last reply
            0
            • N nlazovic

              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

              benlauB Offline
              benlauB Offline
              benlau
              Qt Champions 2016
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                @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.

                (Z(:^

                N 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  @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.

                  N Offline
                  N Offline
                  nlazovic
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved