[FFmpeg-devel] ABI break in 4.3

Tomas Härdin tjoppen at acc.umu.se
Sun Jul 5 14:39:54 EEST 2020


sön 2020-07-05 klockan 12:54 +0200 skrev Jan Engelhardt:
> On Sunday 2020-07-05 12:06, Tomas Härdin wrote:
> > > Or, summarized: A program may have been built with 4.3 but is
> > > combined
> > > with 4.2.3 at runtime, then this can happen:
> > > 
> > > 	a = avcodec_dct_alloc(); // allocates 896
> > > #ifdef HAVE_STRUCT_AVDCT_GET_PIXELS_UNALIGNED
> > > 	a->get_pixels_unaligned = ffunc; // boom accessing byte ~952
> > > #endif
> > 
> > "Doctor it hurts when I do this!"
> 
> The application of this saying is short-sighted. It confounds basic
> exercise of features with overuse of said features. For lack of a
> better analogy, moving a leg normally _ought_ not to hurt in healthy
> humans. What is seen as "normal" is indeed situation-dependent, but
> the only other way to look at it is that ffmpeg is a disabled entity
> with special needs.

We can certainly change the API to make this sort of break harder, with
a major bump. But given what the documentation says about the current
API it is not a break. It might not be the most user-friendly API, but
it is right there in the headers. There's quite a bit of inertia
involved too.

This makes me wonder if there's a way to prevent AVCodecContext from
being allocated anywhere but the heap, without having it and similar
structs just be opaque pointers on the user side.

> > Downgrading to a .so file with a lower minor version number than
> > the
> > program is built against can never be expected to work. Else we
> > couldn't add new functions without a major bump.
> 
> Then you are doing it wrong. If one tries to run a contemporary
> program on an older distribution, which certainly has an older glibc,
> it refuses to run - which is much preferable to a crash at an
> arbitrary point down the line.
> 
> It requires the use ELF symbol versions -- which ffmpeg fails to
> do properly. Between 4.2.3 and 4.3,
> 
> 	avpriv_mpeg4audio_get_config2@@LIBAVCODEC_58
> 
> which is wrong. It should have been
> 
> 	avpriv_mpeg4audio_get_config2@@LIBAVCODEC_58.91
> 
> Then the runtime linker ld-linux.so would have caught the problem
> at startup, because then, a program built with 4.3 would have a
> minimum requirement on elfsymver "58.91", and *not just* "58".

This is a fair point. I didn't actually know the loader can do stuff
like this, sounds super handy. How hard would it be to get that going?

/Tomas



More information about the ffmpeg-devel mailing list