Bug 39825 - sigsegv compiling ffmpeg svn
Summary: sigsegv compiling ffmpeg svn
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.3.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: GC, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2009-04-20 20:31 UTC by sergio.roa
Modified: 2011-12-09 09:09 UTC (History)
3 users (show)

See Also:
Host:
Target: powerpc-linux-gnu
Build:
Known to work: 4.5.0
Known to fail: 4.3.3
Last reconfirmed: 2009-04-21 13:55:45


Attachments
preprocessed source file (21.86 KB, text/plain)
2009-04-21 12:47 UTC, sergio.roa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sergio.roa 2009-04-20 20:31:45 UTC
Trying to compile the last svn ffmpeg version in a powerpc machine with Ubuntu 8.10:

$ uname -a
Linux aliena 2.6.25-2-powerpc #1 Tue Sep 30 14:49:00 UTC 2008 ppc GNU/Linux

$ gcc -v
Using built-in specs.
Target: powerpc-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --disable-softfloat --enable-secureplt --enable-targets=powerpc-linux,powerpc64-linux --with-cpu=default32 --with-long-double-128 --enable-checking=release --build=powerpc-linux-gnu --host=powerpc-linux-gnu --target=powerpc-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)

The error is:

gcc -DHAVE_AV_CONFIG_H -I. -I"/home/sergio/ffmpeg" -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -std=c99 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fomit-frame-pointer -maltivec -mabi=altivec -pthread -g -Wdeclaration-after-statement -Wall -Wno-switch -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef -O3 -fno-math-errno -fno-signed-zeros         -c -o libavcodec/bmp.o libavcodec/bmp.c
libavcodec/bmp.c: In function ‘bmp_decode_frame’:
libavcodec/bmp.c:51: warning: ‘rgb[1]’ may be used uninitialized in this function
libavcodec/bmp.c:51: warning: ‘rgb[2]’ may be used uninitialized in this function
libavcodec/bmp.c:307: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
make: *** [libavcodec/bmp.o] Error 1

Using the same gcc version in a 386 Ubuntu 8.10 machine there is no error.
Comment 1 Ben Elliston 2009-04-21 05:03:47 UTC
Thanks for the report.  Could you possibly attach the preprocessed source file that triggers the internal compiler error?
Comment 2 sergio.roa 2009-04-21 12:47:26 UTC
Created attachment 17663 [details]
preprocessed source file
Comment 3 Richard Biener 2009-04-21 12:57:46 UTC
Reducing.
Comment 4 sergio.roa 2009-04-21 13:23:05 UTC
I compiled again disabling Altivec optimizations and it worked :)

$./configure --disable-altivec
[...]
$make
[...]

$ ./ffmpeg
FFmpeg version SVN-r18634, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libxvid --disable-altivec
  libavutil     50. 3. 0 / 50. 3. 0
  libavcodec    52.27. 0 / 52.27. 0
  libavformat   52.32. 0 / 52.32. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Apr 21 2009 15:16:50, gcc: 4.3.2
At least one output file must be specified

I hope there are not so much optimization issues by using this ffmpeg... Anyway, I guess this bug should be solved...
Comment 5 Richard Biener 2009-04-21 13:55:45 UTC
Reducing very slowly ... which makes it sound like a GC issue.

But, confirmed with the original testcase and a cross-compiler.  Fails on
the 4.3 branch with -O3 -fno-math-errno -maltivec -mabi=altivec -g, works
for me on the trunk.
Comment 6 Richard Biener 2009-04-21 14:52:12 UTC
Indeed.  Fails with --param ggc-min-expand=100 --param ggc-min-heapsize=131072,
works with --param ggc-min-expand=100 --param ggc-min-heapsize=0.

Didn't we have a ppc GC problem somewhere?  With always-collect we get

./cc1  -quiet -o /dev/null bmp.i -O3 -fno-math-errno -maltivec -mabi=altivec -g --param ggc-min-expand=0 --param ggc-min-heapsize=0
libavcodec/bmp.c: In function 'bmp_decode_frame':
libavcodec/bmp.c:307: internal compiler error: in tree_node_structure, at tree.c:2241
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

during collecting of

#17 0x00000000005b8f9c in gt_ggc_mx_VEC_rtx_gc (x_p=0x7ffff36fa000)
    at gtype-desc.c:786
786               gt_ggc_m_7rtx_def ((*x).base.vec[i0]);

Comment 7 Sean McGovern 2011-12-08 18:55:21 UTC
GCC 4.3 has not supported for some time now, and FFMPEG currently builds successfully on PPC Linux with GCC 4.5 (see http://fate.ffmpeg.org/).

Please close this bug.
Comment 8 Richard Biener 2011-12-09 09:09:38 UTC
Assuming fixed.