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

[QML] MediaPlayer{}/Video{} crashes when changing the media source right after calling play()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.9, 6.8.3, 6.9.0 Beta3, 6.10.0 FF
    • 6.7.2
    • None
    • Linux/Wayland, Linux/X11
    • d32526ee0 (dev), 421f12c2a (6.9), af572c93c (6.8), 7f2ccc97d (tqtc/lts-6.5)
    • Multimedia wk 51-2, Multimedia wk 5-6

    Description

      Tested on Fedora 40 and Kde Neon.

      Sometimes the program crashes when changing media files when the previous one has just started playing. 
      This does not seem to happen when "audioOutput" is not set or when using a flatpak build or one of the kits (Qt 6.7 as in Neon/Fedora) in QtCreator (not System).

      Steps:

      Prerequisite for the example program:

      In Main.qml you need to write the path to some video file.

      1) Start the program (If you use QtCreator, don't use any kit besides "System")
      2) Repeatedly press one of the shortcut keys  ('A', 'D', 'Left', 'Right') to change the source until it crashes.

      After a while the program should crash.

      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
      Core was generated by `appQtMultimediaBug'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00007dea7200ad47 in std::default_delete<QFFmpegResampler>::operator() (__ptr=0x7dea10007e70, this=<optimized out>)
          at /usr/include/c++/13/bits/unique_ptr.h:93
      93            operator()(_Tp* __ptr) const
      [Current thread is 1 (Thread 0x7dea5cc006c0 (LWP 42816))]
      

      To make it crash more frequently I recommend varying the speed at which the shortcut is activated.
      Faster != more crashes: It seems to have something to do with the audio and it crashes when changing the file at the right time.
      Sometimes it takes almost a minute, other times it happens after a few seconds (Varying the speed is important).
      Note:This also happens with "Video{}"

      I created a small application to reproduce the crash. There are also videos to clarify how it happens.

      Related application: https://invent.kde.org/danagost/Kiview/-/merge_requests/15

       

      > Qt 6.7 (kit for qtcreator) is installed with qt opensource installer or ?

      It was installed with "Qt Maintenance Tool" , the program that gets installed when you use this installer(open source version): https://www.qt.io/download-qt-installer

      The Qt kits I have tried are Desktop Qt 6.7.3 and Desktop Qt 6.6.3.

       

      the crash occurs on Fedora 40 and kde Neon (system Qt), but other distributions may also be affected.

      I couldn't get it to crash using a flatpak build or the libraries that are downloaded from Qt Maintenance Tool.

      That doesn't mean it can't crash with those libraries, maybe I was just unlucky even though I tried many times. 

      Also keep in mind that I couldn't get it to crash unless I set the “audioOutput”.

      Note: There is an installation script (install.sh) in the project folder in case you want to install it.

       

      New test with QT 6.8.1

      pulseaudio --version:

      pulseaudio 16.1

      pipewire --version:

      pipewire
      Compiled with libpipewire 1.2.6
      Linked with libpipewire 1.2.6

      the backend is ffmpeg.

      Attachments

        1. Example-QtMultimediaBug.zip
          5 kB
          danilo agostini
        2. fedora 40-coredump gdb -1.txt
          48 kB
          danilo agostini
        3. Kde-Neon-coredump gdb -1.txt
          20 kB
          danilo agostini
        4. qtmultimediaBug-long.mkv
          7.83 MB
          danilo agostini
        5. qtmultimediaBug-short.mkv
          4.16 MB
          danilo agostini
        6. Screenshot_20241023_020753.png
          89 kB
          danilo agostini
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lars.sutterud Lars Sutterud
            nyre221 danilo agostini
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews