Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671

Bug #2042743 reported by LAZA
72
This bug affects 14 people
Affects Status Importance Assigned to Milestone
ffmpeg (Ubuntu)
Fix Released
Undecided
Nick Galanis
Bionic
Fix Released
Undecided
Nick Galanis
Focal
Fix Released
Undecided
Nick Galanis
Jammy
Fix Released
Undecided
Nick Galanis

Bug Description

VLC crashes permanently when I try to jump inside a MKV media file

~$ vlc
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000563682b03580] main libvlc: VLC wird mit dem Standard-Interface ausgeführt. Benutzen Sie 'cvlc', um VLC ohne Interface zu verwenden.
[0000563682bac910] main playlist: playlist is empty
[0000563682bdd2c0] main audio output error: too low audio sample frequency (0)
[00007f1a7cd456e0] main decoder error: failed to create audio output
[0000563682bdd2c0] vlcpulse audio output error: digital pass-through stream connection failure: Nicht unterstützt
[0000563682bdd2c0] main audio output error: module not functional
[00007f1a7cd456e0] main decoder error: failed to create audio output
[00007f1a60003e90] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[00007f1a7c013ae0] avcodec decoder: Using Mesa Gallium driver 23.0.4-0ubuntu1~22.04.1 for RENOIR (renoir, LLVM 15.0.7, DRM 3.42, 5.15.0-88-generic) for hardware decoding
[h264 @ 0x7f1a7c03ca80] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7f1a7c03ca80] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007f1a7c013ae0] avcodec decoder error: existing hardware acceleration cannot be reused
[00007f1a6100a4e0] gl gl: Initialized libplacebo v4.192.1 (API v192)
[00007f1a7c013ae0] avcodec decoder: Using G3DVL VDPAU Driver Shared Library version 1.0 for hardware decoding
Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671
Abgebrochen (Speicherabzug geschrieben)

Tags: jammy crash

CVE References

LAZA (laza74)
tags: added: jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in vlc (Ubuntu):
status: New → Confirmed
Revision history for this message
John Ubuntu (user597489) wrote :
Download full text (4.4 KiB)

I have the same issue.
Running "raw" (not snap) vlc under Ubuntu 22.04
vlc/jammy-apps-security,now 3.0.16-1ubuntu0.1~esm1 amd64 [installed]

$ vlc
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[0000555be8b125a0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000555be8bb27b0] main playlist: playlist is empty
[00007f7578005110] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
[00007f7592382af0] avcodec decoder: Using Intel i965 driver for Intel(R) Haswell Desktop - 2.4.1 for hardware decoding
[h264 @ 0x7f7592397800] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7f7592397800] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007f7592382af0] avcodec decoder error: existing hardware acceleration cannot be reused
[00007f75787fa680] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory
[00007f757847d1f0] gl gl: Initialized libplacebo v4.192.1 (API v192)
Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671
Aborted (core dumped)

Note #1: disabling hardware acceleration works around the issue.
`vlc --avcodec-hw=none` does not abort when seeking.

Note #2: I was not able to get a proper call stack because libavcodec.so.58 symbols are not available.
https://ubuntu.com/server/docs/service-debuginfod

[00007fff98006b30] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_10
libva info: va_openDriver() returns 0
[00007fff923de020] avcodec decoder: Using Intel i965 driver for Intel(R) Haswell Desktop - 2.4.1 for hardware decoding
[Thread 0x7fff7bfff640 (LWP 208405) exited]
[h264 @ 0x7fff92458300] get_buffer() failed
[h264 @ 0x7fff92458300] thread_get_buffer() failed
[h264 @ 0x7fff92458300] decode_slice_header error
[h264 @ 0x7fff92458300] no frame!
[h264 @ 0x7fff923f2d40] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7fff923f2d40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007fff923de020] avcodec decoder error: existing hardware acceleration cannot be reused
[Thread 0x7fff677fe640 (LWP 208429) exited]
[Thread 0x7fff67fff640 (LWP 208428) exited]
[New Thread 0x7fff67fff640 (LWP 208430)]
[New Thread 0x7fff677fe640 (LWP 208431)]
[00007fff987ff6e0] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory
[Thread 0x7fff677fe640 (LWP 208431) exited]
[Thread 0x7fff67fff640 (LWP 208430) exited]
[New Thread 0x7fff67fff640 (LWP 208432)]
[New Thread 0x7fff677fe640 (LWP 208433)]
[00007fff983b65a0] gl gl: Initialized libplacebo v4.192.1 (API v192)
Assertion !p->parent->stash_h...

Read more...

Revision history for this message
John Ubuntu (user597489) wrote :
Revision history for this message
Ammar Faizi (ammarfaizi2) wrote :

I hit the same issue when moving the video timeframe; it started happening today. The bug probably came after the recent update because I didn't have this issue before.

ammarfaizi2@integral2:~/Videos$ vlc zaf-2023-09-07_02.27.20.mp4
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000055e23867c580] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[00007f67c0001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[00007f67d502b000] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 () for hardware decoding
[00007f67d502b000] main decoder error: Timestamp conversion failed for 2300001: no reference clock
[00007f67d502b000] main decoder error: Could not convert timestamp 0 for FFmpeg
[h264 @ 0x7f67d50db9c0] get_buffer() failed
[h264 @ 0x7f67d50db9c0] thread_get_buffer() failed
[h264 @ 0x7f67d50db9c0] decode_slice_header error
[h264 @ 0x7f67d50db9c0] no frame!
[h264 @ 0x7f67d503c480] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7f67d503c480] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007f67d502b000] avcodec decoder error: existing hardware acceleration cannot be reused
[00007f67c0001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory
[00007f67c0001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671
Aborted (core dumped)

Revision history for this message
Sander Jonkers (jonkers) wrote :

Me too, with /usr/bin/vlc (so not snap), when skipping to a different part in the mkv

Startup

sander@brixit:~$
sander@brixit:~$ vlc blabla07.mkv
VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000055c631f8d640] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[000055c63223d8f0] main audio output error: too low audio sample frequency (0)
[00007f3a40e2b4a0] main decoder error: failed to create audio output
[000055c63223d8f0] vlcpulse audio output error: digital pass-through stream connection failure: Not supported
[000055c63223d8f0] main audio output error: module not functional
[00007f3a40e2b4a0] main decoder error: failed to create audio output
[00007f3a2c001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[00007f3a2c001810] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[00007f3a40c6f220] avcodec decoder: Using Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 () for hardware decoding

So far VLC works. Then skipping to a different point:

[h264 @ 0x7f3a40c9f600] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7f3a40c9f600] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007f3a40c6f220] avcodec decoder error: existing hardware acceleration cannot be reused
[00007f3a2c001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
[00007f3a2c001810] gl gl: Initialized libplacebo v4.192.1 (API v192)
Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671
Aborted (core dumped)
sander@brixit:~$
sander@brixit:~$

Nothing in /var/crash.

Note: Intel GPU. So I don't understand the nvidia stuff.

Revision history for this message
Sander Jonkers (jonkers) wrote :

Ah, the `vlc --avcodec-hw=none` workaround does solve it for me!

Thanks, @user597489

Revision history for this message
John Ubuntu (user597489) wrote :

Hello everyone,
Are you using Ubuntu Pro?
ffmpeg was recently (24 October 2023) upgraded in Expanded Security Maintenance (ESM)
https://ubuntu.com/security/notices/USN-6449-1
Did you have the issue a month ago?
Regards

Revision history for this message
John Ubuntu (user597489) wrote :

$ apt list --installed | grep 7.4.4.2
ffmpeg/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed]
libavcodec58/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libavdevice58/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libavfilter7/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libavformat58/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libavutil56/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libpostproc55/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libswresample3/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]
libswscale5/jammy-apps-security,now 7:4.4.2-0ubuntu0.22.04.1+esm2 amd64 [installed,automatic]

Revision history for this message
Ammar Faizi (ammarfaizi2) wrote :

John Ubuntu (user597489) wrote:
> ffmpeg was recently (24 October 2023) upgraded in Expanded Security Maintenance (ESM)
> https://ubuntu.com/security/notices/USN-6449-1
> Did you have the issue a month ago?

Quoted from that link:

  "It was discovered that FFmpeg incorrectly managed memory resulting in a memory leak"

What does that issue have something to do with the vlc assert() error?

I don't think that is relevant.

Revision history for this message
John Ubuntu (user597489) wrote :

The failing assert is in libavcodec.so.58 from ffmpeg

Revision history for this message
John Ubuntu (user597489) wrote :

I confirm that the regression is in libavcodec58 7:4.4.2-0ubuntu0.22.04.1+esm2
since vlc *does not* abort with the non-esm libavcodec58.

wget http://launchpadlibrarian.net/605867723/libavcodec58_4.4.2-0ubuntu0.22.04.1_amd64.deb
dpkg -x libavcodec58_4.4.2-0ubuntu0.22.04.1_amd64.deb /tmp
LD_PRELOAD=/tmp/usr/lib/x86_64-linux-gnu/libavcodec.so.58 vlc foo.mp4

How does one report issues in ESM versions?

affects: vlc (Ubuntu) → ffmpeg (Ubuntu)
Revision history for this message
JORGETECH (jorgetech) wrote :

Same issue with 22.04 LTS, it crashes when I move the playhead in any video file.

(Log is in Spanish but has the same errors)

VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
[000055ad93113580] main libvlc: Ejecutar vlc con la interfaz predeterminada. Use «cvlc» para usar vlc sin interfaz.
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
uint DBusMenuExporterDBus::GetLayout(int, int, const QStringList&, DBusMenuLayoutItem&): Condition failed: menu
[00007fbc600048d0] gl gl: Initialized libplacebo v4.192.1 (API v192)
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
[00007fbcd8c0bfd0] avcodec decoder: Using Mesa Gallium driver 23.2.1 - kisak-mesa PPA for AMD Radeon Vega 11 Graphics (raven, LLVM 15.0.7, DRM 3.42, 5.15.0-88-generic) for hardware decoding
[h264 @ 0x7fbcd8c3ae40] A hardware frames or device context is required for hardware accelerated decoding.
[h264 @ 0x7fbcd8c3ae40] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[00007fbcd8c0bfd0] avcodec decoder error: existing hardware acceleration cannot be reused
[00007fbc60374d00] gl gl: Initialized libplacebo v4.192.1 (API v192)
[00007fbcd8c0bfd0] avcodec decoder: Using G3DVL VDPAU Driver Shared Library version 1.0 for hardware decoding
Assertion !p->parent->stash_hwaccel failed at src/libavcodec/pthread_frame.c:671
Abortado (`core' generado)

I should note that I'm using Kisak's Mesa PPA but other people have the same issue with other GPUs and/or Mesa versions. I'm using integrated AMD Vega graphics from a Ryzen 3400G.

Revision history for this message
Nick Galanis (nickgalanis) wrote :

I can confirm that this bug is a result of the recent ESM update for ffmpeg. We are currently working on resolving the issue as soon as possible.

Changed in ffmpeg (Ubuntu):
assignee: nobody → Nick Galanis (nickgalanis)
status: Confirmed → In Progress
Changed in ffmpeg (Ubuntu Bionic):
status: New → In Progress
Changed in ffmpeg (Ubuntu Focal):
status: New → In Progress
Changed in ffmpeg (Ubuntu Jammy):
status: New → In Progress
Changed in ffmpeg (Ubuntu Bionic):
assignee: nobody → Nick Galanis (nickgalanis)
Changed in ffmpeg (Ubuntu Focal):
assignee: nobody → Nick Galanis (nickgalanis)
Changed in ffmpeg (Ubuntu Jammy):
assignee: nobody → Nick Galanis (nickgalanis)
Revision history for this message
Nick Galanis (nickgalanis) wrote :

This bug was fixed the latest ffmpeg package update for:
  - bionic (7:3.4.11-0ubuntu0.1+esm4)
  - focal (7:4.2.7-0ubuntu0.1+esm4)
  - jammy (7:4.4.2-0ubuntu0.22.04.1+esm3)

--
  * SECURITY REGRESSION: Assertion error after avcodec_flush_buffers()
     - debian/patches/CVE-2022-48434-2.patch: Fixes assertion error, always
       transfer stashed hwaccel state
     - CVE-2022-48434.patch

 -- Nick Galanis <email address hidden> Tue, 14 Nov 2023 12:20:29 +0000

Revision history for this message
Nick Galanis (nickgalanis) wrote :

I have released the update that should fix this issue:

https://ubuntu.com/security/notices/USN-6449-2

Please comment in this bug if it still isn't fixed in your environment.

Thanks, and sorry for any inconvenience.

Changed in ffmpeg (Ubuntu):
status: In Progress → Fix Released
Changed in ffmpeg (Ubuntu Bionic):
status: In Progress → Fix Released
Changed in ffmpeg (Ubuntu Focal):
status: In Progress → Fix Released
Changed in ffmpeg (Ubuntu Jammy):
status: In Progress → Fix Released
Revision history for this message
John Ubuntu (user597489) wrote :

Hello Nick,

As far as I can tell, the issue has been solved in jammy.

Regards

Revision history for this message
John Ubuntu (user597489) wrote :

For the future: it was not clear to me how to report issues to the ESM team.

Revision history for this message
Nick Galanis (nickgalanis) wrote (last edit ):

There are many ways to communicate with the Seucrity team regarding ESM updates. You could either email us at <email address hidden>, or subscribe to the ubuntu-security mailing list. Opening a new bug in LP is also sufficient, since each member of the team actively monitors the bugs section in a package they recently released an update for (this was the way I was notified for this bug).

Revision history for this message
Alex Murray (alexmurray) wrote :

Just a quick correction - the email address for the security team is <email address hidden> - if you send it to the canonical.com one then it goes to the team that manages Canonical's infrastructure and we will not see it.

Revision history for this message
JORGETECH (jorgetech) wrote (last edit ):

I can also confirm the issue has been solved in Jammy, I tested using VLC version 3.0.16-1ubuntu0.1~esm1 and ffmpeg version 7:4.4.2-0ubuntu0.22.04.1+esm3 .

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.