Bug#811921: ffmpeg: FTBFS with GCC 6: misc errors

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Thu Jan 21 01:39:41 UTC 2016


Control: reassign -1 gcc-6 6-20160117-1
Control: affects -1 ffmpeg

Hi Martin,

On 20.01.2016 04:44, Martin Michlmayr wrote:
> This package fails to build with GCC 6.  GCC 6 has not been released
> yet, but it's expected that GCC 6 will become the default compiler for
> stretch.
> 
> Note that only the first error is reported; there might be more.  You
> can find a snapshot of GCC 6 in experimental.  To build with GCC 6,
> you can set CC=gcc-6 CXX=g++-6 explicitly.
> 
> You may be able to find out more about this issue at
> https://gcc.gnu.org/gcc-6/changes.html
> 
>> sbuild (Debian sbuild) 0.67.0 (26 Dec 2015) on dl580gen9-02.hlinux
> ...
>> cc -I. -I/<<PKGBUILDDIR>>/ -Wdate-time -D_FORTIFY_SOURCE=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-overflow -fstack-protector-all   -std=c99 -fomit-frame-pointer -fPIC -pthread -I/usr/include/p11-kit-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/freetype2  -I/usr/include/bs2b  -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/fribidi  -I/usr/include/opencv -I/usr/include/opus -D_REENTRANT -I/usr/include/p11-kit-1 -I/usr/include/schroedinger-1.0 -I/usr/include/orc-0.4             -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/include/SDL  -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes
>>  -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized    -c -o ffmpeg_opt.o /<<PKGBUILDDIR>>/ffmpeg_opt.c
>> /<<PKGBUILDDIR>>/ffplay.c:3217:46: error: missing binary operator before token "("
>>  #if defined(__APPLE__) && SDL_VERSION_ATLEAST(1, 2, 14)
>>                                               ^
>> cc -I. -I/<<PKGBUILDDIR>>/ -Wdate-time -D_FORTIFY_SOURCE=2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST -DHAVE_AV_CONFIG_H -MM /<<PKGBUILDDIR>>/libavfilter/avf_showvolume.c | sed -e "/^#.*/d" -e "s,^[[:space:]]*avf_showvolume\\.o,libavfilter/avf_showvolume.o," > libavfilter/avf_showvolume.d
>> /<<PKGBUILDDIR>>/libavfilter/avf_showcqt.c:38:10: error: #include expects "FILENAME" or <FILENAME>
>>  #include FT_FREETYPE_H
>>           ^~~~~~~~~~~~~
> ...
>> -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized   -c -o libavfilter/vf_drawbox.o /<<PKGBUILDDIR>>/libavfilter/vf_drawbox.c
>> /<<PKGBUILDDIR>>/libavfilter/vf_drawtext.c:69:10: error: #include expects "FILENAME" or <FILENAME>
>>  #include FT_FREETYPE_H
>>           ^~~~~~~~~~~~~
>>
>> /<<PKGBUILDDIR>>/libavfilter/vf_drawtext.c:70:10: error: #include expects "FILENAME" or <FILENAME>
>>  #include FT_GLYPH_H
>>           ^~~~~~~~~~
>>
>> /<<PKGBUILDDIR>>/libavfilter/vf_drawtext.c:71:10: error: #include expects "FILENAME" or <FILENAME>
>>  #include FT_STROKER_H
>>           ^~~~~~~~~~~~
>>
>> /<<PKGBUILDDIR>>/libavfilter/vf_drawtext.c:275:10: error: #include expects "FILENAME" or <FILENAME>
>>  #include FT_ERRORS_H
>>           ^~~~~~~~~~~

These "errors" are a red herring: they happen during dependency
generation and are thus harmless. They can also be seen when building
in unstable. (They now get suppressed upstream.)

The real problems are test failures:
[...]
Test vsynth1-svq1 failed. Look at tests/data/fate/vsynth1-svq1.err for details.
[...]
Test vsynth3-svq1 failed. Look at tests/data/fate/vsynth3-svq1.err for details.
[...]
Test vsynth2-svq1 failed. Look at tests/data/fate/vsynth2-svq1.err for details.

These worked fine when I tested building with gcc-6 6-20151211-1.
So this seems to be a regression introduced during the last month.

Interestingly these tests pass upstream [1] when building with
"gcc 6.0.0 (GCC) 20160119 (experimental)".
So this either got fixed between 17. and 19. January, or it is a
Debian specific problem.

The problem is in svq1_encode_plane in libavcodec/svq1enc.c.
For P-frames, the decoded_plane buffer gets overwritten with wrong
values:
$ cd debian/standard
$ export LD_LIBRARY_PATH="libavcodec:libavdevice:libavfilter:libavformat:libavresample:libavutil:libpostproc:libswresample:libswscale"
$ gdb --args ./ffmpeg -nostdin -nostats -cpuflags all -f rawvideo -s 352x288 -pix_fmt yuv420p -threads 1 -idct simple -flags +bitexact -sws_flags +accurate_rnd+bitexact -fflags +bitexact -hwaccel none -threads 1 -thread_type frame+slice -i ./tests/data/vsynth1.yuv -threads 1 -idct simple -dct fastint -c svq1 -qscale 3 -pix_fmt yuv410p -flags +bitexact -sws_flags +accurate_rnd+bitexact -fflags +bitexact -f framecrc -
GNU gdb (Debian 7.10-1+b1) 7.10
[...]
(gdb) br svq1_encode_plane
[...]
(gdb) r
[...]
ffmpeg version 2.8.5-1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 6.0.0 (Debian 6-20160117-1) 20160117 (experimental) [trunk revision 232481]
[...]
Breakpoint 1, svq1_encode_plane (s=s at entry=0x697620, plane=plane at entry=0, src_plane=0x6deb00 "[...]"...,
    ref_plane=0x6fae80 "", decoded_plane=0x71cb60 "", width=352, height=288, src_stride=352, stride=384)
    at libavcodec/svq1enc.c:248
248 {
(gdb) c
Continuing.

Breakpoint 1, svq1_encode_plane (s=s at entry=0x697620, plane=plane at entry=1, src_plane=0x6f7780 "[...]",
    ref_plane=0x718ee0 "", decoded_plane=0x73aba0 "", width=88, height=72, src_stride=96, stride=96)
    at libavcodec/svq1enc.c:248
248 {
(gdb) 
Continuing.

Breakpoint 1, svq1_encode_plane (s=s at entry=0x697620, plane=plane at entry=2, src_plane=0x6f9300 "[...]",
    ref_plane=0x71ad20 "", decoded_plane=0x73c9e0 "", width=88, height=72, src_stride=96, stride=96)
    at libavcodec/svq1enc.c:248
248 {
(gdb) 
Continuing.
0,          0,          0,        1,    36508, 0xb057df97, S=1,        8, 0x031b0064

Breakpoint 1, svq1_encode_plane (s=s at entry=0x697620, plane=plane at entry=0, src_plane=0x768dc0 "[...]"...,
    decoded_plane=0x6fae80 "", width=352, height=288, src_stride=352, stride=384)
    at libavcodec/svq1enc.c:248
248 {
(gdb) advance 456
svq1_encode_plane (s=s at entry=0x697620, plane=plane at entry=0, src_plane=0x768dc0 "[...]"...,
    ref_plane=0x71cb60 "[...]"..., decoded_plane=0x6fae80 "[...]", width=352, height=288, src_stride=352, stride=384)
    at libavcodec/svq1enc.c:456
456                     if (score[2] < score[best] && mx == 0 && my == 0) {
(gdb) p score
$1 = {2147483647, 26545, 0, 0}
(gdb) # best = score[1] <= score[0];
(gdb) p best
$2 = 1
(gdb) n 34
480             s->rd_total += score[best];
(gdb) p s->rd_total
$3 = 7095940
(gdb) p best
$4 = <optimized out>
(gdb) n
463                 if (best == 1) {
(gdb) p s->rd_total - 7095940
$5 = 26545
(gdb) p score
$6 = {2147483647, 26545, 624803, 0}
(gdb) # So best was still 1 on line 480, as it should be.
(gdb) p best
$7 = 0
(gdb) # This is wrong, nothing should have changed best.
(gdb) n
484                 avpriv_copy_bits(&s->pb, reorder_buffer[best][i],
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
483             for (i = 5; i >= 0; i--)
(gdb) 
487                 s->hdsp.put_pixels_tab[0][0](decoded, temp, stride, 16);
(gdb) # This only happens if (best == 0), which should not be the case here, but:
(gdb) p best
$8 = 0
(gdb) # Thus wrong values get written to decoded_plane:
(gdb) p/x *(uint64_t*)decoded_plane at 2
$9 = {0x756f68615c55524d, 0xa09d9a9691878079}
(gdb) n
375         for (x = 0; x < block_width; x++) {
(gdb) p/x *(uint64_t*)decoded_plane at 2
$10 = {0x8ac9d9d8d6d6d6d6, 0x8b8b8a898a8b8a8a}

As this is a compiler bug in gcc-6, I'm reassigning accordingly.

Best regards,
Andreas


1: http://fate.ffmpeg.org/report.cgi?time=20160119133541&slot=x86_64-archlinux-gcc-experimental



More information about the pkg-multimedia-maintainers mailing list