[FFmpeg-devel] [PATCH v2 0/3] hwcontext_vaapi: dlopen libva-x11 and libva-drm

Timo Rothenpieler timo at rothenpieler.org
Wed Jul 27 23:00:01 EEST 2022


On 27/07/2022 21:51, Emil Velikov wrote:
> On Thu, 21 Jul 2022 at 21:47, Mark Thompson <sw at jkqxz.net> wrote:
>>
>> On 20/07/2022 17:41, Emil Velikov wrote:
>>> On Tue, 19 Jul 2022 at 19:16, Nicolas George <george at nsup.org> wrote:
>>>>
>>>> Emil Velikov (12022-07-19):
>>>>> As you may know the libva* set of libraries share an internal ABI
>>>>> between them. In a resent libva commit, the va_fool API was removed.
>>>>>
>>>>> Thus if one is to mix different versions of libva.so and libva-x11.so
>>>>> they will get an error, leading to a crash of the whole stack.
>>>>>
>>>>> The simple solution is
>>>>
>>>> ... a configure check.
>>>>
>>>> If the person who installs replaces a library with another, it is their
>>>> responsibility to check they are compatible.
>>>>
>>>
>>> While I wholeheartedly agree, it's not so easy to enforce compile time
>>> decisions at runtime. In the past, I have debugged and reported issues
>>> where Linux distributions do not enforce the above.
>>>
>>> We do have the typical Linux distribution model (where we have dozens
>>> upon distros) and other distribution models. IMHO checking each
>>> instance and combination doesn't scale. We could bring awareness to
>>> the issue in say distribution/workflow X, which sadly may come as
>>> finger-pointing and thus alienating.
>>>
>>> Hope that makes sense and the team is willing to consider the extra 90
>>> lines worth of code.
>>
>> The argument "libfoo can be broken in some particular configuration, so lets use dlopen() to make errors happen later" seems like it applies to every library.  Why is this case so special?  Who are the users running into this specific problem and who are stuck with broken versions they can't update?
>>
> It's a long story, hope I don't bore you to death :-P
> 
> Even though I've been itching to hack on ffmpeg for a while, the bug
> that allowed me to do that is
> https://github.com/ValveSoftware/steam-for-linux/issues/8673
> 
> As a background, steam as well as some of the programs/games shipped
> use libraries provided by ffmpeg. In addition, steam ships with a
> steam runtime, which is effectively a partial chroot of an old Ubuntu.
> For various compatibility reasons, one cannot simply update it, so the
> startup scripting will try and promote a set of the host libraries (if
> newer) so that they're used instead of the bundled Ubuntu ones.

That sounds incredibly broken and will of course cause stuff to break.
I see the issue lies with that magic script, not with ffmpeg.

You could make that exact argument for literally every single external 
library, and we don't dlopen() most of them.


More information about the ffmpeg-devel mailing list