Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-78049

QML Camera segfault on linux when VideoOutput is initialized via Loader

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P2: Important P2: Important
    • None
    • 5.13.0
    • Multimedia
    • None
    • Linux/X11

      If create component Camera, and then ondemand create VideoOutput application got segfault

       

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtMultimedia 5.5
      
      
      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
          id: main
      
          Camera
          {
              id: camera
              viewfinder {
                  resolution: "640x480"
              }
      
              focus {
                  focusMode: CameraFocus.FocusContinuous
                  focusPointMode: CameraFocus.FocusPointAuto
              }
          }
      
          Component {
              id: component
      
              VideoOutput
              {
                  id: videoOutput
                  source: camera
                  height: parent.height
                  width: parent.width
      
                  autoOrientation: true
                  fillMode: VideoOutput.PreserveAspectCrop
              }
          }
      
          Loader {
              id: loader
              sourceComponent: component
              active: false
          }
      
          Timer {
              running: true
              repeat: false
              interval: 1500
              onTriggered: loader.active = true;
          }
      }
      

       

      GDB output

       

      QML debugging is enabled. Only use this in a safe environment.
      
      [New Thread 0x7ffff2164700 (LWP 30865)]
      
      [New Thread 0x7fffeb444700 (LWP 30866)]
      
      [New Thread 0x7fffe882d700 (LWP 30867)]
      
      [New Thread 0x7fffe3893700 (LWP 30868)]
      
      [Thread 0x7fffe3893700 (LWP 30868) exited]
      
      [New Thread 0x7fffe3893700 (LWP 30869)]
      
      [Thread 0x7fffe3893700 (LWP 30869) exited]
      
      Focus mode selection is not supported
      
      Starting camera without viewfinder available
      
      [New Thread 0x7fffe3893700 (LWP 30870)]
      
      [New Thread 0x7fffe1c27700 (LWP 30871)]
      
      [New Thread 0x7fffe1426700 (LWP 30872)]
      
      [New Thread 0x7fffe0c25700 (LWP 30873)]
      
      [New Thread 0x7fffcffff700 (LWP 30874)]
      
      [New Thread 0x7fffcf7fe700 (LWP 30875)]
      
      [New Thread 0x7fffceffd700 (LWP 30876)]
      
      [New Thread 0x7fffce7fc700 (LWP 30877)]
      
      [New Thread 0x7fffcdffb700 (LWP 30878)]
      
      [New Thread 0x7fffcd7fa700 (LWP 30879)]
      
      [New Thread 0x7fffccff9700 (LWP 30880)]
      
      [New Thread 0x7fffabfff700 (LWP 30881)]
      
      
      
      Thread 1 "CameraQmlCrashT" received signal SIGSEGV, Segmentation fault.
      
      0x00007ffff54f5475 in g_mutex_lock () from /usr/lib/libglib-2.0.so.0
      
      (gdb) bt
      
      #0  0x00007ffff54f5475 in g_mutex_lock () at /usr/lib/libglib-2.0.so.0
      
      #1  0x00007fffe3c6f6ed in gst_element_get_static_pad () at /usr/lib/libgstreamer-1.0.so.0
      
      #2  0x00007fffe3c27031 in gst_element_link_pads_full () at /usr/lib/libgstreamer-1.0.so.0
      
      #3  0x00007fffe3f63b1a in  () at /usr/lib/gstreamer-1.0/libgstcamerabin.so
      
      #4  0x00007fffe3c71355 in gst_element_change_state () at /usr/lib/libgstreamer-1.0.so.0
      
      #5  0x00007fffe3c719ed in  () at /usr/lib/libgstreamer-1.0.so.0
      
      #6  0x00007fffe3c8cb6d in  () at /usr/lib/libgstreamer-1.0.so.0
      
      #7  0x00007fffe3c71355 in gst_element_change_state () at /usr/lib/libgstreamer-1.0.so.0
      
      #8  0x00007fffe3c719ed in  () at /usr/lib/libgstreamer-1.0.so.0
      
      #9  0x00007fffe3fbba30 in CameraBinSession::load() (this=0x555555990230)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:865
      
      #10 0x00007fffe3fbb81e in CameraBinSession::setStateHelper(QCamera::State) (this=0x555555990230, state=QCamera::ActiveState)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:823
      
      #11 0x00007fffe3fbb6df in CameraBinSession::setStatus(QCamera::Status) (this=0x555555990230, status=QCamera::LoadingStatus)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:778
      
      #12 0x00007fffe3fbb92a in CameraBinSession::load() (this=0x555555990230)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:843
      
      #13 0x00007fffe3fbb81e in CameraBinSession::setStateHelper(QCamera::State) (this=0x555555990230, state=QCamera::ActiveState)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:823
      
      #14 0x00007fffe3fbb753 in CameraBinSession::setState(QCamera::State) (this=0x555555990230, newState=QCamera::ActiveState)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabinsession.cpp:803
      
      #15 0x00007fffe3fc60e3 in CameraBinControl::delayedReload() (this=0x555555a3f9c0)
      
          at /tmp/qt5-multimedia/src/qtmultimedia-everywhere-src-5.13.0/src/plugins/gstreamer/camerabin/camerabincontrol.cpp:249
      
      #16 0x00007fffe3fdfc60 in CameraBinControl::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)
      
          (_o=0x555555a3f9c0, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x555555bc42a0) at .moc/moc_camerabincontrol.cpp:104
      
      #17 0x00007ffff6be044a in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
      
      #18 0x00007ffff6bb39c2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
      
      #19 0x00007ffff6bb6739 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
      
      #20 0x00007ffff6c0c3a4 in  () at /usr/lib/libQt5Core.so.5
      
      #21 0x00007ffff5542cf4 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
      
      #22 0x00007ffff5544b11 in  () at /usr/lib/libglib-2.0.so.0
      
      #23 0x00007ffff5544b51 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
      
      #24 0x00007ffff6c0b9a3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
      
      #25 0x00007ffff6bb25ec in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
      
      #26 0x00007ffff6bba326 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
      
      #27 0x00005555555564d0 in main(int, char**) (argc=1, argv=0x7fffffffe298) at ../CameraQmlCrashTest/main.cpp:19
      
      

       

      BTW, can multiple VideoOutput use one Camera source? It's would be great, and by the logic it should work, but: 

       

      Focus mode selection is not supported
      bool QDeclarativeVideoOutput::createBackend(QMediaService*) Media service has neither renderer nor window control available.
      

       

      Linux 5.12.11

      gstreamer: 1.16.0-2

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            valentyn.doroshchuk Valentyn Doroshchuk
            zvova7890 Vova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes