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

[ffmpeg] player crash in libavcodec if libnvidia-decode is not installed

    XMLWordPrintable

Details

    • Linux/X11
    • 3bec392c1 (dev), bea094bd3 (6.7), 5381ec958 (6.6), 167a3d854 (tqtc/lts-6.5)

    Description

      `player` demo crashes with h264/h265 files on linux (ubuntu 22.04) when using the nvidia driver if the libnvidia-decode package is not installed

      output at startup:

      Available HW decoding frameworks:
      Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
           cuda
      Available HW encoding frameworks:
           cuda
      

      then it crashes with:

      (lldb) bt
      * thread #1, name = 'player', stop reason = signal SIGSEGV: address not mapped to object (fault address: 0x8)
          frame #0: 0x00007fffea690af4 libavcodec.so.58`___lldb_unnamed_symbol1833 + 38
          frame #1: 0x00007fffea691ad5 libavcodec.so.58`___lldb_unnamed_symbol1834 + 3887
          frame #2: 0x00007fffea7c7583 libavcodec.so.58`avcodec_open2 + 1939
        * frame #3: 0x00007ffff03c685b libffmpegmediaplugin.so`QFFmpeg::Codec::create(stream=0x00007fff98006b40, formatContext=0x00007fff98005500) at qffmpegcodec.cpp:73:24
          frame #4: 0x00007ffff0397a8c libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::codecForTrack(this=0x00005555557df730, trackType=VideoStream) at qffmpegplaybackengine.cpp:376:93
          frame #5: 0x00007ffff03973d2 libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::createStreamAndRenderer(this=0x00005555557df730, trackType=VideoStream) at qffmpegplaybackengine.cpp:325:41
          frame #6: 0x00007ffff039732f libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::createObjectsIfNeeded(this=0x00005555557df730) at qffmpegplaybackengine.cpp:311:32
          frame #7: 0x00007ffff03972bb libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::recreateObjects(this=0x00005555557df730) at qffmpegplaybackengine.cpp:302:26
          frame #8: 0x00007ffff0396866 libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::setState(this=0x00005555557df730, state=PlayingState) at qffmpegplaybackengine.cpp:134:24
          frame #9: 0x00007ffff0350b47 libffmpegmediaplugin.so`QFFmpeg::PlaybackEngine::play(this=0x00005555557df730) at qffmpegplaybackengine_p.h:87:17
          frame #10: 0x00007ffff034f11c libffmpegmediaplugin.so`QFFmpegMediaPlayer::runPlayback(this=0x00005555558ec370) at qffmpegmediaplayer.cpp:275:27
          frame #11: 0x00007ffff034f0e2 libffmpegmediaplugin.so`QFFmpegMediaPlayer::play(this=0x00005555558ec370) at qffmpegmediaplayer.cpp:270:16
          frame #12: 0x00007ffff7f0a91a libQt6Multimedia.so.6`QMediaPlayer::play(this=0x0000555555640d10) at qmediaplayer.cpp:509:21
          frame #13: 0x00005555555794d7 player`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QMediaPlayer::*)()>::call(__closure=0x00007fffffffbed0)(), QMediaPlayer*, void**)::'lambda'()::operator()() const at qobjectdefs_impl.h:153:31
          frame #14: 0x000055555557aa71 player`void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QMediaPlayer::*)()>::call(void (QMediaPlayer::*)(), QMediaPlayer*, void**)::'lambda'()>(args=0x00007fffffffc088, fn=0x00007fffffffbed0) at qobjectdefs_impl.h:72:15
          frame #15: 0x000055555557954b player`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (QMediaPlayer::*)()>::call(f=(libQt6Multimedia.so.6`QMediaPlayer::play() at qmediaplayer.cpp:500:1), o=0x0000555555640d10, arg=0x00007fffffffc088) at qobjectdefs_impl.h:152:29
          frame #16: 0x000055555557781a player`void QtPrivate::FunctionPointer<void (QMediaPlayer::*)()>::call<QtPrivate::List<>, void>(f=(libQt6Multimedia.so.6`QMediaPlayer::play() at qmediaplayer.cpp:500:1), o=0x0000555555640d10, arg=0x00007fffffffc088) at qobjectdefs_impl.h:200:95
          frame #17: 0x0000555555575f87 player`QtPrivate::QCallableObject<void (QMediaPlayer::*)(), QtPrivate::List<>, void>::impl(which=1, this_=0x00005555556e14f0, r=0x0000555555640d10, a=0x00007fffffffc088, ret=0x0000000000000000) at qobjectdefs_impl.h:571:53
          frame #18: 0x00007ffff5c0b471 libQt6Core.so.6`QtPrivate::QSlotObjectBase::call(this=0x00005555556e14f0, r=0x0000555555640d10, a=0x00007fffffffc088) at qobjectdefs_impl.h:487:57
          frame #19: 0x00007ffff5e0f39e libQt6Core.so.6`void doActivate<false>(sender=0x0000555555cb8360, signal_index=7, argv=0x00007fffffffc088) at qobject.cpp:4116:30
          frame #20: 0x00007ffff5dd6df3 libQt6Core.so.6`QMetaObject::activate(sender=0x0000555555cb8360, m=0x00005555555a8680, local_signal_index=0, argv=0x0000000000000000) at qobject.cpp:4176:26
          frame #21: 0x000055555557cca5 player`PlayerControls::play(this=0x0000555555cb8360) at moc_playercontrols.cpp:295:26
          frame #22: 0x000055555557c214 player`PlayerControls::playClicked(this=0x0000555555cb8360) at playercontrols.cpp:135:18
          frame #23: 0x000055555557d72b player`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (PlayerControls::*)()>::call(__closure=0x00007fffffffc1a0)(), PlayerControls*, void**)::'lambda'()::operator()() const at qobjectdefs_impl.h:153:31
          frame #24: 0x000055555557d7d6 player`void QtPrivate::FunctorCallBase::call_internal<void, QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (PlayerControls::*)()>::call(void (PlayerControls::*)(), PlayerControls*, void**)::'lambda'()>(args=0x00007fffffffc3e0, fn=0x00007fffffffc1a0) at qobjectdefs_impl.h:72:15
          frame #25: 0x000055555557d79f player`QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (PlayerControls::*)()>::call(f=(player`PlayerControls::playClicked() at playercontrols.cpp:131:1), o=0x0000555555cb8360, arg=0x00007fffffffc3e0) at qobjectdefs_impl.h:152:29
          frame #26: 0x000055555557d6a8 player`void QtPrivate::FunctionPointer<void (PlayerControls::*)()>::call<QtPrivate::List<>, void>(f=(player`PlayerControls::playClicked() at playercontrols.cpp:131:1), o=0x0000555555cb8360, arg=0x00007fffffffc3e0) at qobjectdefs_impl.h:200:95
          frame #27: 0x000055555557d5ef player`QtPrivate::QCallableObject<void (PlayerControls::*)(), QtPrivate::List<>, void>::impl(which=1, this_=0x0000555555c9dcf0, r=0x0000555555cb8360, a=0x00007fffffffc3e0, ret=0x0000000000000000) at qobjectdefs_impl.h:571:53
          frame #28: 0x00007ffff5c0b471 libQt6Core.so.6`QtPrivate::QSlotObjectBase::call(this=0x0000555555c9dcf0, r=0x0000555555cb8360, a=0x00007fffffffc3e0) at qobjectdefs_impl.h:487:57
          frame #29: 0x00007ffff5e0f39e libQt6Core.so.6`void doActivate<false>(sender=0x0000555555cb8550, signal_index=9, argv=0x00007fffffffc3e0) at qobject.cpp:4116:30
          frame #30: 0x00007ffff5dd6df3 libQt6Core.so.6`QMetaObject::activate(sender=0x0000555555cb8550, m=0x00007ffff79d0ea0, local_signal_index=2, argv=0x00007fffffffc3e0) at qobject.cpp:4176:26
          frame #31: 0x00007ffff7757dbf libQt6Widgets.so.6`QAbstractButton::clicked(this=0x0000555555cb8550, _t1=false) at moc_qabstractbutton.cpp:327:26
          frame #32: 0x00007ffff77551f9 libQt6Widgets.so.6`QAbstractButtonPrivate::emitClicked(this=0x00005555556429d0) at qabstractbutton.cpp:381:20
          frame #33: 0x00007ffff7755163 libQt6Widgets.so.6`QAbstractButtonPrivate::click(this=0x00005555556429d0) at qabstractbutton.cpp:374:20
          frame #34: 0x00007ffff775690a libQt6Widgets.so.6`QAbstractButton::mouseReleaseEvent(this=0x0000555555cb8550, e=0x00007fffffffcca0) at qabstractbutton.cpp:976:17
          frame #35: 0x00007ffff7575771 libQt6Widgets.so.6`QToolButton::mouseReleaseEvent(this=0x0000555555cb8550, e=0x00007fffffffcca0) at qtoolbutton.cpp:587:39
          frame #36: 0x00007ffff7939e62 libQt6Widgets.so.6`QWidget::event(this=0x0000555555cb8550, event=0x00007fffffffcca0) at qwidget.cpp:8996:26
          frame #37: 0x00007ffff77566d6 libQt6Widgets.so.6`QAbstractButton::event(this=0x0000555555cb8550, e=0x00007fffffffcca0) at qabstractbutton.cpp:933:26
          frame #38: 0x00007ffff7576ecc libQt6Widgets.so.6`QToolButton::event(this=0x0000555555cb8550, event=0x00007fffffffcca0) at qtoolbutton.cpp:996:34
          frame #39: 0x00007ffff78fbdf6 libQt6Widgets.so.6`QApplicationPrivate::notify_helper(this=0x00005555555d5330, receiver=0x0000555555cb8550, e=0x00007fffffffcca0) at qapplication.cpp:3298:31
          frame #40: 0x00007ffff78f99e7 libQt6Widgets.so.6`QApplication::notify(this=0x00007fffffffd7a0, receiver=0x0000555555cb8550, e=0x00007fffffffcca0) at qapplication.cpp:2776:43
          frame #41: 0x00007ffff5e5bc67 libQt6Core.so.6`QCoreApplication::notifyInternal2(receiver=0x0000555555cb8550, event=0x00007fffffffcca0) at qcoreapplication.cpp:1138:24
          frame #42: 0x00007ffff5e5c9cf libQt6Core.so.6`QCoreApplication::sendSpontaneousEvent(receiver=0x0000555555cb8550, event=0x00007fffffffcca0) at qcoreapplication.cpp:1595:27
          frame #43: 0x00007ffff78f8492 libQt6Widgets.so.6`QApplicationPrivate::sendMouseEvent(receiver=0x0000555555cb8550, event=0x00007fffffffcca0, alienWidget=0x0000555555cb8550, nativeWidget=0x00007fffffffd810, buttonDown=0x00007ffff79f2a10, lastMouseReceiver=0x00007ffff79f2a30, spontaneous=true, onlyDispatchEnterLeave=false) at qapplication.cpp:2360:56
          frame #44: 0x00007ffff7831e3f libQt6Widgets.so.6`QWidgetWindow::handleMouseEvent(this=0x0000555555816e40, event=0x00007fffffffd220) at qwidgetwindow.cpp:662:44
          frame #45: 0x00007ffff7830273 libQt6Widgets.so.6`QWidgetWindow::event(this=0x0000555555816e40, event=0x00007fffffffd220) at qwidgetwindow.cpp:276:25
          frame #46: 0x00007ffff78fbdf6 libQt6Widgets.so.6`QApplicationPrivate::notify_helper(this=0x00005555555d5330, receiver=0x0000555555816e40, e=0x00007fffffffd220) at qapplication.cpp:3298:31
          frame #47: 0x00007ffff78fbbe9 libQt6Widgets.so.6`QApplication::notify(this=0x00007fffffffd7a0, receiver=0x0000555555816e40, e=0x00007fffffffd220) at qapplication.cpp:3249:31
          frame #48: 0x00007ffff5e5bc67 libQt6Core.so.6`QCoreApplication::notifyInternal2(receiver=0x0000555555816e40, event=0x00007fffffffd220) at qcoreapplication.cpp:1138:24
          frame #49: 0x00007ffff5e5c9cf libQt6Core.so.6`QCoreApplication::sendSpontaneousEvent(receiver=0x0000555555816e40, event=0x00007fffffffd220) at qcoreapplication.cpp:1595:27
          frame #50: 0x00007ffff657e1a9 libQt6Gui.so.6`QGuiApplicationPrivate::processMouseEvent(e=0x00007fff9800a2c0) at qguiapplication.cpp:2324:42
          frame #51: 0x00007ffff657d4aa libQt6Gui.so.6`QGuiApplicationPrivate::processWindowSystemEvent(e=0x00007fff9800a2c0) at qguiapplication.cpp:2068:50
          frame #52: 0x00007ffff6642b5c libQt6Gui.so.6`QWindowSystemInterface::sendWindowSystemEvents(flags=(i = 164)) at qwindowsysteminterface.cpp:1114:61
          frame #53: 0x00007ffff1771d70 libQt6XcbQpa.so.6`xcbSourceDispatch(source=0x00005555556395e0, (null)=0x0000000000000000, (null)=0x0000000000000000) at qxcbeventdispatcher.cpp:57:51
          frame #54: 0x00007ffff4bdbd3b libglib-2.0.so.0`g_main_context_dispatch + 619
          frame #55: 0x00007ffff4c31258 libglib-2.0.so.0`___lldb_unnamed_symbol2709 + 488
          frame #56: 0x00007ffff4bd93e3 libglib-2.0.so.0`g_main_context_iteration + 51
          frame #57: 0x00007ffff5a1bdd4 libQt6Core.so.6`QEventDispatcherGlib::processEvents(this=0x000055555563a4e0, flags=(i = 164)) at qeventdispatcher_glib.cpp:394:43
          frame #58: 0x00007ffff1771fce libQt6XcbQpa.so.6`QXcbGlibEventDispatcher::processEvents(this=0x000055555563a4e0, flags=(i = 164)) at qxcbeventdispatcher.cpp:96:47
          frame #59: 0x00007ffff5e6377b libQt6Core.so.6`QEventLoop::processEvents(this=0x00007fffffffd6e0, flags=(i = 164)) at qeventloop.cpp:100:68
          frame #60: 0x00007ffff5e63e9c libQt6Core.so.6`QEventLoop::exec(this=0x00007fffffffd6e0, flags=(i = 128)) at qeventloop.cpp:191:22
          frame #61: 0x00007ffff5e5c62a libQt6Core.so.6`QCoreApplication::exec() at qcoreapplication.cpp:1482:36
          frame #62: 0x00007ffff657cdda libQt6Gui.so.6`QGuiApplication::exec() at qguiapplication.cpp:1924:34
          frame #63: 0x00007ffff78f8d99 libQt6Widgets.so.6`QApplication::exec() at qapplication.cpp:2568:33
          frame #64: 0x0000555555563bca player`main(argc=1, argv=0x00007fffffffdbd8) at main.cpp:36:20
          frame #65: 0x00007ffff4e29d90 libc.so.6`__libc_start_call_main(main=(player`main at main.cpp:13:1), argc=1, argv=0x00007fffffffdbd8) at libc_start_call_main.h:58:16
          frame #66: 0x00007ffff4e29e40 libc.so.6`__libc_start_main_impl(main=(player`main at main.cpp:13:1), argc=1, argv=0x00007fffffffdbd8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffdbc8) at libc-start.c:392:3
          frame #67: 0x00005555555636b5 player`_start + 37
      (lldb) f 3
      frame #3: 0x00007ffff03c685b libffmpegmediaplugin.so`QFFmpeg::Codec::create(stream=0x00007fff98006b40, formatContext=0x00007fff98005500) at qffmpegcodec.cpp:73:24
         70       av_dict_set(opts, "threads", "auto", 0);
         71       applyExperimentalCodecOptions(decoder, opts);
         72  
      -> 73       ret = avcodec_open2(context.get(), decoder, opts);
         74       if (ret < 0)
         75           return QString("Failed to open FFmpeg codec context " + err2str(ret));
         76  
      (lldb) print context
      (QFFmpeg::AVCodecContextUPtr) 0x555556cb97c0 {
        pointer = 0x0000555556cb97c0
      }
      (lldb) print *decoder
      (const AVCodec) {
        name = 0x00007fffeb0fa3fe "hevc_cuvid"
        long_name = 0x00007fffeb0fa409 "Nvidia CUVID HEVC decoder"
        type = AVMEDIA_TYPE_VIDEO
        id = AV_CODEC_ID_HEVC
        capabilities = 393248
        supported_framerates = nullptr
        pix_fmts = 0x00007fffeb0fadf0
        supported_samplerates = 0x0000000000000000
        sample_fmts = 0x0000000000000000
        channel_layouts = 0x0000000000000000
        max_lowres = '\0'
        priv_class = 0x00007fffeb3fb040
        profiles = nullptr
        wrapper_name = 0x00007fffeb0fa2fd "cuvid"
        priv_data_size = 576
        next = nullptr
        update_thread_context = 0x0000000000000000
        defaults = nullptr
        init_static_data = 0x0000000000000000
        init = 0x00007fffea690ba6 (libavcodec.so.58`___lldb_unnamed_symbol1834)
        encode_sub = 0x0000000000000000
        encode2 = 0x0000000000000000
        decode = 0x00007fffea84d670 (libavcodec.so.58`___lldb_unnamed_symbol3881)
        close = 0x00007fffea690ace (libavcodec.so.58`___lldb_unnamed_symbol1833)
        receive_packet = 0x0000000000000000
        receive_frame = 0x00007fffea84cb10 (libavcodec.so.58`___lldb_unnamed_symbol3880)
        flush = 0x00007fffea84c810 (libavcodec.so.58`___lldb_unnamed_symbol3879)
        caps_internal = 256
        bsfs = 0x00007fffeb0fa423 "hevc_mp4toannexb"
        hw_configs = 0x00007fffeb3bf7e0
        codec_tags = 0x0000000000000000
      }
      (lldb) print opts
      (QFFmpeg::AVDictionaryHolder)  (opts = 0x0000555556cb0e40)
      

      installing the `libnvidia-decode` package prevents the crash from happening, though i wonder if there's a way to prevent the crash in the first place ...

      Attachments

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

        Activity

          People

            inho Inho Lee
            timblechmann tim blechmann
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes