[FFmpeg-devel] ABI break between 3.0 and 3.3 without symvers/SONAME changes

Jan Engelhardt jengelh at inai.de
Sat Jun 3 14:18:30 EEST 2017


I received a user report about ABI breakage between ffmpeg 3.0 and 3.3 
through the distribution commenting system 
https://build.opensuse.org/package/show/multimedia:libs/ffmpeg :

	"""I'm having a library compiled against ffmpeg 3.3 on OBS. It 
	uses the avcodec_{send|receive}packet() functions. On my local 
	machine I still have ffmpeg 3.0 installed. Updating the library 
	doesnt trigger updating libav* since soversion hasnt changed. If 
	the library now attempts to use avcodecsend_packet() I receive 
	SIGBUS."""

I am posting to this list as the "fix" for this problem is not a patch, 
but a change in review process.


Upon closer inspection of the ffmpeg source, the problem the user 
has experienced has two causes:


1.

Failure to properly do ELF versioning. avcodec_receive_packet was added 
in commit 7fc329e2dd6226dfecaa4a1d7adf353bf2773726. This commit bumped 
the minor version number, but completely ignored adding the necessary 
versions into libavcodec/libavcodec.v. What should have been added:

LIBAVCODEC_57.37 {
	global:
	avcodec_receive_packet;
	avcodec_send_packet; /* etc. */
} LIBAVCODEC_57.36;

Instead, all symbols just always get added into a symbol group that 
existed previously (LIBAVCODEC_57). This defeats package management 
utilities like rpm which only look at the symbol groups and not 
individual symbols.

Fixing the .v file with a patch now won't help remedy the situation on 
existing systems; however, on future patch submissions, this action of 
editing the .v file needs to be remembered when functions are 
added or removed.


2.

The layout of struct AVCodec changed. Four function pointers were 
inserted in the middle, shifting void (*flush) to a new address. The 
size of AVCodec also changed, which would have required a full MAJOR 
bump.


More information about the ffmpeg-devel mailing list