Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 269975

Summary: =media-video/mplayer-1.0_rc2_p20090731 with sys-devel/gcc-4.4.1 crashed when playing mkv file with USE="-debug" or USE="-custom-flags"
Product: Gentoo Linux Reporter: Oschtan <dawnstyle>
Component: Current packagesAssignee: media-video herd <media-video>
Status: RESOLVED FIXED    
Severity: normal CC: anotherbearcatfan, const, EoD, esigra, eXt, gentoo-bugzilla, halcy0n, help, jlp.bugs, johannes.hirte, matrix47, rahul, Reimar.Doeffinger, rhill, rktspm, Sergiy.Borodych, sping, thev00d00
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 249226    
Attachments: test-case .mkv file

Description Oschtan 2009-05-15 18:16:57 UTC
mplayer /mnt/data3/Audio.mkv
MPlayer 29040-4.4.0 (C) 2000-2009 MPlayer Team

Playing /mnt/data3/.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_MPEG/L3), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  672x384  24bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3


MPlayer interrupted by signal 11 in module: init_audio_codec
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.

Reproducible: Always

Actual Results:  
USE="debug" emerge mplayer helping with this problem


Portage 2.2_rc33 (default/linux/amd64/2008.0, gcc-4.4.0, glibc-2.9_p20081201-r2, 2.6.29-gentoo-r3 x86_64)
=================================================================
System uname: Linux-2.6.29-gentoo-r3-x86_64-AMD_Phenom-tm-_8450_Triple-Core_Processor-with-gentoo-2.0.0
Timestamp of tree: Fri, 15 May 2009 15:15:03 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p17-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.6.2
dev-python/pycrypto: 2.0.1-r8
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.4
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r2
sys-apps/sandbox:    1.9
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.29
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10 -mtune=amdfam10"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -pipe -march=amdfam10 -mtune=amdfam10"
DISTDIR="/usr/portage/distfiles"
FEATURES="buildpkg ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch preserve-libs protect-owned sandbox sets sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles http://trumpetti.atm.tut.fi/gentoo ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror http://distfiles.gentoo.org"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,-O1"
LINGUAS="ru"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://mirror.yandex.ru/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac aalib acl acpi additions alsa amd64 amr amrnb amrwb ao apm arts audiofile avahi bdf berkdb bindist branding bzip2 cairo cdparanoia cgi cjk clamav cleartype cli consolekit cracklib crypt dbus djvu dri dv dvd dvdr emerald enca encode exif faac faad fastcgi fbcondecor ffmpeg fontconfig fortran ftp fuse gd gecko gif gimp git glitz gphoto2 gpm gtk hal hddtemp hdri iconv imagemagick imlib isdnlog java jbig jpeg jpeg2k kde kdehiddenvisibility lame latin1 lcms lib32 libnotify lm_sensors lzma mad midi mikmod mjpeg mmx mmxext mng motif mp2 mp3 mp4 mpeg mplayer mudflap multilib multitarget mysql ncurses nls npp nptl nptlonly nsplugin oav objc objc++ objc-gc ogg openexr opengl openmp pam pcre pdf perl php png povray pppd python qt3 quicktime rar rcc readline reflection rtc samba sdl sensord session sndfile source spell spl sqlite sqlite3 srt sse sse2 ssl startup-notification subversion suid svg symlink sysfs syslog tcpd templates theora tidy tiff truetype unicode unsupported usb utempter vcd vorbis webdav-neon wmf x264 xattr xcb xcomposite xine xml xorg xpm xscreensaver xulrunner xvid yv12 zip zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" CAMERAS="adc65 agfa_cl20 aox barbie canon casio_qv clicksmart310 digigr8 digita dimagev dimera3500 directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150 largan lg_gsm mars mustek panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859 pccam300 pccam600 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2 ricoh ricoh_g3 samsung sierra sipix_blink sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 stv0674 stv0680 sx330z template toshiba_pdrm11" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2009-05-19 21:59:50 UTC
Do I understand you correctly? Enabling the debug USE flag fixes this problem?
Comment 2 Oschtan 2009-05-20 05:24:26 UTC
(In reply to comment #1)
> Do I understand you correctly? Enabling the debug USE flag fixes this problem?
> 

Yes. USE="debug" fixed this problem.
Comment 3 EoD 2009-05-23 10:27:12 UTC
The bug only appears if you try to play files with the Matroska file format. It didn't happen with other file types and it seems to be independent from the video-out type (also happens on "vo null").

I've tested it on sparc (64bit kernel/32bit userland) and amd64 and both architectures have exactly the same problem (which is fixed if you enable the debug USE flag).
It can be tested on x86 due to bug 270638...
Comment 4 Daniel V. 2009-05-28 15:21:06 UTC
(In reply to comment #3)
> The bug only appears if you try to play files with the Matroska file format...

That's not true! This just happened to me on amd64 and does the exact same thing with a normal divx .avi, and an .flv from youtube. Emerging with debug to see if it does fix it here also. (-nosound of course works, and -vo null doesn't)
Comment 5 Daniel V. 2009-05-28 15:32:17 UTC
Nope, +debug is a no go here.
The only thing strace gave me was this:

brk(0x27d2000)                          = 0x27d2000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Comment 6 Steve Dibb (RETIRED) gentoo-dev 2009-05-29 16:36:10 UTC
need emerge -pv mplayer

also, try live ebuild

also, try -demuxer lavf
Comment 7 gourichon nicolas 2009-05-29 17:42:20 UTC
it seems it's a problem with the mp3lib library.

i remove the flag mp3 and recompile the package and it works : mplayer uses afm=mp3 instead of mp3lib...
Comment 8 Steve Dibb (RETIRED) gentoo-dev 2009-05-30 23:01:55 UTC
Sounds like we might have two separate bugs here, one with mkv demuxing and the other with mp3 playback.

For mp3 playback, the most recent snapshot should address the issue (20090530).

Or, for a simple workaround, use -ac mad
Comment 9 oopos 2009-05-31 15:10:31 UTC
(In reply to comment #8)
> Sounds like we might have two separate bugs here, one with mkv demuxing and the
> other with mp3 playback.
> 
> For mp3 playback, the most recent snapshot should address the issue (20090530).
> 
> Or, for a simple workaround, use -ac mad
> 

Thank you.

I got this problem,too.
Now,I am sure that it is a bug of mp3lib.
So, just remove mp3lib and recompile or use "-ac mad" options instead.
Comment 10 Ben de Groot (RETIRED) gentoo-dev 2009-06-01 01:22:12 UTC
I have the mkv problem with a52 sound. I can solve it by USE=debug, or USE=custom-cflags with -O2. Tested with the 20090530 version and gcc-4.4.0. Also, ld would choke on a truncated file, so I ended up with:

USE=custom-cflags CFLAGS="-O2 -march=athlon64-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 -w -pipe -floop-interchange -floop-strip-mine -floop-block " CXXFLAGS=$CFLAGS MAKEOPTS=-j1 emerge -a \=mplayer-1.0_rc2_p20090530
Comment 11 Johannes Hirte 2009-06-02 08:47:05 UTC
This seems to be gcc-4.4 related. When mplayer is build with gcc-4.3.3 it works for me. Rebuilding with gcc-4.4, mplayer segfaults on opening mkv-files.
Comment 12 Mark Loeser (RETIRED) gentoo-dev 2009-07-25 02:01:22 UTC
Any simple example files anywhere that cause the segfaults everyone is talking about?  Does this same problem exist with gcc-4.4.1?
Comment 13 Johannes Hirte 2009-07-26 19:04:21 UTC
(In reply to comment #12)
> Any simple example files anywhere that cause the segfaults everyone is talking
> about?  

The crash occours with every mkv-file I've tested.

> Does this same problem exist with gcc-4.4.1?

Yes, mplayer still segfaults. 
Comment 14 Johannes Hirte 2009-08-03 15:56:08 UTC
still occours with mplayer-1.0_rc2_p20090731
Comment 15 Samuli Suominen gentoo-dev 2009-08-03 16:09:06 UTC
Am I missing something or where is the backtrace?
Comment 16 Johannes Hirte 2009-08-03 16:42:42 UTC
With USE="custom-cflags"  it works, even with gcc-4.4.

emerge --info
Portage 2.2_rc33 (default/linux/amd64/2008.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30 x86_64)
=================================================================                       
System uname: Linux-2.6.30-x86_64-AMD_Opteron-tm-_Processor_144-with-gentoo-2.0.1
Timestamp of tree: Mon, 03 Aug 2009 15:30:01 +0000
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.8-r1
dev-lang/python:     2.6.2-r1, 3.1
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r3
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/init.d /etc/initng/daemon /etc/initng/net /etc/initng/system /etc/pam.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="collision-protect distlocks fixpackages metadata-transfer parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc"
LINGUAS="de"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/usr/src/portage"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/x11 /usr/local/portage/layman/kde-testing /usr/local/portage/layman/qting-edge /usr/local/portage/layman/mozilla /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 7zip X a52 aac accessibility acl acpi alsa amd64 amr amrnb amrwb aspell audiofile authfile avi bash-completion berkdb boost bzip2 bzlib cairo calendar caps cdda cdparanoia cdr chipcard chm cisco cleartype cli consolekit cracklib crypt css cups cvs dbus dirac djvu dlloader dri dts dv dvd dvdr dvdread encode enscript exif exiv2 fastcgi ffmpeg fftw flac fortran gcc-libffi gcj gd gdbm gif gimp git glitz gmp gnuplot gpm graphite graphviz hal hbci htmlhandbook http iconv idl idle ieee1394 imagemagick inotify ipv6 isdnlog java java5 java6 jikes jpeg kde kdehiddenvisibility kdepim kipi lame lapack latex lcms ldap libnotify libsamplerate live lm_sensors logrotate lucene lzo mad matroska mjpeg mmap mmx mmxext mng mp2 mp3 mp3tunes mp4 mpeg mplayer mtp mudflap multilib musicbrainz ncurses network networkmanager nfs nls nolvm1 nptl nptlonly nsplugin obex ogg oggvorbis openal openexr opengl openmp pam patch pcre pdf perl pic plasma png pnm podofo posix postscript pppd profiledbootstrap python python3 pyx qt qt3 qt3support qt4 quicktime readline redeyes redland reflection rtc samba samplerate sasl scanner schroedinger sdl semantic-desktop sendfile session silvercity slang smime smp sndfile snmp soundtouch sox speex spell spl sqlite sse sse2 ssl subversion svg sysfs taglib tcpd tetex theora threads thumbnail tiff tk trayicon truetype unicode usb userlocales v4l v4l2 vorbis vorbis-psy webkit x264 xattr xcb xcomposite xext xhtml xine xml xml2 xmp xorg xscreensaver xulrunner xv xvid yv12 zeroconf zlib zvbi" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CAMERAS="canon" ELIBC="glibc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" USERLAND="GNU" VIDEO_CARDS="radeon"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 17 Samuli Suominen gentoo-dev 2009-08-04 16:24:00 UTC
Comment #12 is requesting Matroska test file we can use for reproducing this.
Comment #15 is requesting backtrace, http://www.gentoo.org/proj/en/qa/backtraces.xml

If none is provided, I'll be forced to close this as NEEDINFO.
Comment 18 Johannes Hirte 2009-08-06 07:36:05 UTC
(In reply to comment #17)
> Comment #12 is requesting Matroska test file we can use for reproducing this.

Did you read the comments? Taske any mkv-file you find to reproduce. But if you feel better, I'll provide one.

> Comment #15 is requesting backtrace,
> http://www.gentoo.org/proj/en/qa/backtraces.xml

How do I produce a backtrace without debug-options? If you read the initial bugreport, you'll see that adding "debug" to the use-flags will fix the problem.

> If none is provided, I'll be forced to close this as NEEDINFO.
> 
Comment 19 Petr Behan 2009-08-06 15:02:16 UTC
Created attachment 200395 [details]
test-case .mkv file

(In reply to comment #18)
> Did you read the comments? Taske any mkv-file you find to reproduce. But if you
> feel better, I'll provide one.
Not everyone has mkv files lying around or wants to research how to create one (btw mkvtoolnix is also broken atm so it's not even that easy now)

Attached tiny 2-black-frame .mkv file:
- ffplay seems to work ok
- mplayer works on ~x86 gcc-4.3 system
- mplayer works on ~x86 gcc-4.4 with custom-cflags or debug useflags
- mplayer fails on ~x86 gcc-4.4 with default useflags

FEATURES="nostrip" or "splitdebug" do not produce anything too usefull:

[New Thread 0xb5c6e730 (LWP 1794)]
MPlayer SVN-r29463-4.4.1 (C) 2000-2009 MPlayer Team

Playing x.mkv.
Cache fill:  0.09% (7659 bytes)
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Will play video track 1.
[mkv] No audio track found/wanted.
Matroska file format detected.
VIDEO:  [avc1]  720x576  24bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
dvdsublang...x en eng jp jpn und
dvdsublang...x en eng jp jpn und
(no debugging symbols found)
(no debugging symbols found)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5c6e730 (LWP 1794)]
0x081769d0 in demux_mkv_fill_buffer ()
(gdb) bt
#0  0x081769d0 in demux_mkv_fill_buffer ()
(gdb)
Comment 20 Samuli Suominen gentoo-dev 2009-08-06 19:33:58 UTC
The flag filtering code looks like this at the moment,

if use custom-cflags; then
  if use x86 || use x86-fbsd ; then
    replace-flags -O* -O2
    filter-flags -fPIC -fPIE
    use debug || append-flags -fomit-frame-pointer
  fi
  append-flags -D__STDC_LIMIT_MACROS
else
  unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS YASMFLAGS
fi

And it doesn't really look sane to me; considering it appears at least part of the issues mentioned in this bug (and yes, I suspect there's multiple issues)
seem to be caused by upstream over optimization.

Perhaps a code like this would make more sense (please try it):

  strip-flags
  replace-flags -O* -O2
  filter-flags -fPIC -fPIE
  append-flags -D__STDC_LIMIT_MACROS
  if use x86 || use x86-fbsd; then
    use debug || append-flags -fomit-frame-pointer
  fi

And yes, I mean dropping the entire USE custom-flags from the ebuild, and per default only filter and replace the problematic flags and then appending the missing flag. Keeping the -fomit-frame-pointer for x86 since it free's a register... unless USE debug is called.
Comment 21 Alexis Ballier gentoo-dev 2009-08-06 19:41:52 UTC
(In reply to comment #20)
> And it doesn't really look sane to me; considering it appears at least part of
> the issues mentioned in this bug (and yes, I suspect there's multiple issues)
> seem to be caused by upstream over optimization.

Its not that I like the custom-cflags thing but if a cflag causes a miscompilation then it should be reported to gcc folks.
Comment 22 Ian Whyman (thev00d00) gentoo-dev 2009-08-06 20:31:30 UTC
(In reply to comment #20)

Playing test file works correctly when custom-cflags use removed/replaced:

* Playing test file:

v00d00@hydra ~ $ mplayer ~/Downloads/x.mkv 
MPlayer SVN-r29463-4.4.1 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /home/v00d00/Downloads/x.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Will play video track 1.
[mkv] No audio track found/wanted.
Matroska file format detected.
VIDEO:  [avc1]  720x576  24bpp  25.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 720 x 576 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.25:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 720x576 Planar YV12 
V:   0.0   0/  0 ??% ??% ??,?% 0 0 

Exiting... (End of file)

* Test MKV with AC3 and H264

v00d00@hydra /media/STUFF2/FilmsDone $ mplayer h264.ac3.mkv 
MPlayer SVN-r29463-4.4.1 (C) 2000-2009 MPlayer Team
Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing h264.ac3.mkv.
[mkv] Track ID 1: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Track ID 2: audio (A_AC3), -aid 0, -alang und
[mkv] Will play video track 1.
Matroska file format detected.
VIDEO:  [avc1]  720x304  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 640.0 kbit/41.67% (ratio: 80000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
VDec: vo config request - 720 x 304 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 2.37:1 - prescaling to correct movie aspect.
VO: [xv] 720x304 => 720x304 Planar YV12 
A:  13.0 V:  13.0 A-V:  0.001 ct:  0.001   0/  0  5%  1%  0.7% 4 0 

* Diff:

--- mplayer-1.0_rc2_p20090731-r1.ebuild	2009-08-04 19:36:17.000000000 +0100
+++ mplayer-1.0_rc2_p20090731-r2.ebuild	2009-08-06 21:20:46.777946900 +0100
@@ -8,7 +8,7 @@
 MPLAYER_REVISION=SVN-r29463
 
 IUSE="3dnow 3dnowext +a52 +aac aalib +alsa altivec +ass
-bidi bindist bl +cddb +cdio cdparanoia cpudetection custom-cflags
+bidi bindist bl +cddb +cdio cdparanoia cpudetection 
 custom-cpuopts debug dga +dirac directfb doc +dts +dv dvb +dvd +dvdnav dxr3
 +enca +encode esd +faac +faad fbcon ftp gif ggi -gmplayer +iconv ipv6 jack
 joystick jpeg kernel_linux ladspa libcaca lirc +live lzo mad md5sum +mmx
@@ -348,7 +348,7 @@
 	use lzo || myconf="${myconf} --disable-liblzo"
 	use mp3 || myconf="${myconf} --disable-mp3lame --disable-mp3lame-lavc
 		--disable-mp3lib"
-	use schroedinger || myconf="${myconf} --disable-libschroedinger-lavc"
+	use schroedinger || myconf="${myconf} --disable-libschroedinger-la"
 	use xanim && myconf="${myconf} --xanimcodecsdir=/usr/lib/xanim/mods"
 	! use png && ! use gmplayer && myconf="${myconf} --disable-png"
 	for x in gif jpeg live mad mng pnm speex tga theora xanim; do
@@ -480,18 +480,12 @@
 
 	use debug && myconf="${myconf} --enable-debug=3"
 
-	if use custom-cflags; then
-
-		# ugly optimizations cause MPlayer to cry on x86 systems!
-			if use x86 || use x86-fbsd ; then
-				replace-flags -O* -O2
-				filter-flags -fPIC -fPIE
-
-				use debug || append-flags -fomit-frame-pointer
-			fi
-		append-flags -D__STDC_LIMIT_MACROS
-	else
-		unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS YASMFLAGS
+	strip-flags
+	replace-flags -O* -O2
+	filter-flags -fPIC -fPIE
+	append-flags -D__STDC_LIMIT_MACROS
+	if use x86 || use x86-fbsd; then
+		use debug || append-flags -fomit-frame-pointer
 	fi
 
 	myconf="--cc=$(tc-getCC)

Comment 23 Ian Whyman (thev00d00) gentoo-dev 2009-08-06 20:33:04 UTC
And as I forgot:

Portage 2.2_rc36 (default/linux/amd64/2008.0/desktop, gcc-4.4.1, glibc-2.10.1-r0, 2.6.30-sabayon x86_64)
=================================================================
System uname: Linux-2.6.30-sabayon-x86_64-AMD_Phenom-tm-_II_X4_940_Processor-with-gentoo-2.0.1
Timestamp of tree: Thu, 06 Aug 2009 19:15:01 +0000
app-shells/bash:     4.0_p28
dev-java/java-config: 1.3.7-r1, 2.1.8-r1
dev-lang/python:     2.5.4-r3, 2.6.2-r1
dev-util/cmake:      2.6.4-r2
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.4.3-r5
sys-apps/sandbox:    2.0
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.2, 1.11
sys-devel/binutils:  2.19.1-r1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/entropy /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/skel /etc/splash /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo/ http://mirror.qubenet.net/mirror/gentoo/"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en en_GB"
MAKEOPTS="-s -j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/sabayon /home/v00d00/build/sabayon/overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="7Zip X a52 aac aalib accessibility acl acpi aiglx aim alsa amd64 artswrappersuid audiofile avahi berkdb bidi bluetooth branding bzip2 cairo cdda cddb cdr chm cjk cli config_wizard cpudetection cracklib crypt css cups dbox2 dbus dga dri dts dv dvb dvd dvdr dvdread dvi dxr3 emboss encode extramodules fam fame fat ffmpeg fftw firefox flac flash foomatic-db fortran freetype gcj gdbm gif gimpprint gnome gnutls gpm graphite gs gsm gstreamer gtk hal hfs iconv icq ieee1394 imap inotify ipod ipv6 irc irda isdnlog jabber jack jfs jingle joystick jpeg kde kdeenablefinal kerberos kipi lame lcd ldap libnotify live lj lm_sensors logitech-mouse lzo mad mail mikmod mjpeg mmx mng mozdevelop mp3 mp3rtp mpeg msn mudflap multilib musepack musicbrainz ncurses network new-login nls nptl nptlonly nsplugin ntfs ogg openal openexr opengl openmp pam pcmcia pcre pda pdf perl png povray ppds pppd pulseaudio pulsex264 python qt3support qt4 quicktime quotas rar rdesktop readline reflection reiserfs rss scanner sdl session slp sms speex spell spl sse sse2 ssl startup-notification stream svg sysfs tcpd theora tiff tracker truetype udev unicode usb v4l v4l2 visualization voice vorbis weather wifi wmf x264 xcb xfs xine xinerama xml xorg xpm xprint xulrunner xv xvid xvmc yahoo zeroconf zlib" ALSA_CARDS="emu10k1x darla20 darla24 emu10k1 gina20 gina24 hdsp hdspm ice1712 indigo indigoio layla20 layla24 mia mixart mona pcxhr rme32 rme96 sb16 sbawe sscape usbusx2y vx222 usb-usx2y" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse void" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en en_GB" USERLAND="GNU" VIDEO_CARDS="fbdev vesa nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 24 Risto A. Paju 2009-08-15 20:25:49 UTC
I use a custom script for building mplayer from svn. I also noticed the signal 11 with some files, when mplayer was compiled with gcc-4.4.1 in Gentoo.

Thus I tried --enable-debug, but while compiling it seemed that it also changed mplayer's default CFLAGS from using -O4 to -O2. In fact, the debug option was not necessary. Changing this flag was enough to make mplayer work.
Comment 25 Kenton Groombridge 2009-08-16 00:00:26 UTC
I can confirm that setting -O4 to -O2 works fine.  I added this line right after the src_prepare()

sed -i -e "s/-O4/-O2/" "${S}/configure"

and now all is good.
Comment 26 Vladimir Kokarev 2009-08-24 19:50:56 UTC
I'm not sure if it is helpful, but the "guilty" cflag is -finline-functions
I tracked it down by compiling mplayer with enabled custom-cflags and enabling
different cflags (that was easy, because -O3 has only 3 cflags over -O2)
Comment 27 Steve Dibb (RETIRED) gentoo-dev 2009-09-19 15:50:48 UTC
*** Bug 283015 has been marked as a duplicate of this bug. ***
Comment 28 Steve Dibb (RETIRED) gentoo-dev 2009-09-19 16:13:15 UTC
(In reply to comment #20)
> Perhaps a code like this would make more sense (please try it):
> 
>   strip-flags
>   replace-flags -O* -O2
>   filter-flags -fPIC -fPIE
>   append-flags -D__STDC_LIMIT_MACROS
>   if use x86 || use x86-fbsd; then
>     use debug || append-flags -fomit-frame-pointer
>   fi
> 
> And yes, I mean dropping the entire USE custom-flags from the ebuild, and per
> default only filter and replace the problematic flags and then appending the
> missing flag. Keeping the -fomit-frame-pointer for x86 since it free's a
> register... unless USE debug is called.
> 

Applied in mplayer-1.0_rc4_p20090919-r1.  I'd appreciate feedback.
Comment 29 Rahul Jain 2009-09-20 16:04:59 UTC
(In reply to comment #28)
> 
> Applied in mplayer-1.0_rc4_p20090919-r1.  I'd appreciate feedback.
> 

Fetch failed for this package, filed as #285716.
Comment 30 Rahul Jain 2009-09-20 21:48:21 UTC
Appears to be solved with mplayer-1.0_rc4_p20090919-r1. I can play mkv files with -debug.
Comment 31 Mark Loeser (RETIRED) gentoo-dev 2009-09-20 22:01:39 UTC
Why are you now not accepting custom-cflags at all?  Just strip the problematic flag and assign this to toolchain so we can get the actual bug fixed.  Please add back custom-cflags.
Comment 32 Alexis Ballier gentoo-dev 2009-09-21 05:08:15 UTC
(In reply to comment #31)
> Why are you now not accepting custom-cflags at all?  Just strip the problematic
> flag and assign this to toolchain so we can get the actual bug fixed.  Please
> add back custom-cflags.

That's what is done as far as I can see. "removing" custom-cflags in that case means always using custom-cflags with the problematic cflag filtered.
Comment 33 parafin 2009-09-24 19:17:14 UTC
1.0_rc4_p20090919-r1 seems to fix segfaults with mkv files.
Comment 34 Samuli Suominen gentoo-dev 2009-09-25 08:55:06 UTC
This code:

        strip-flags
        # This version of MPlayer will segfault on Matroska playback
        # w/gcc-4.4.1.  Remove in the future, prefer to keep upstream's
        # optimizations.
        replace-flags -O* -O2

Could possible be changed to:

append-flags -fno-inline-functions

(Does -finline-functions support -fno.. ?)

That'd be more specific on only killing the offending flag.
Comment 35 Reimar Döffinger 2009-09-29 08:30:11 UTC
If the issue exists only with mkv, the Makefile should be change to add -fnoinline-functions to libmpdemux/demux_mkv.c and only for that, using -O2 for everything slows down even the code that works fine.
Particularly using -O2 also causes slowdown on compilers that are not broken, I find it rather unfair that everyone has to suffer just because some people insist on using such obviously broken and non-production-ready compilers as gcc 4.4.x (yes, I use gcc 4.4 too, but not on any system I actually need working).
Comment 36 Ryan Hill (RETIRED) gentoo-dev 2009-09-30 05:24:30 UTC
this is a strict-aliasing bug in mplayer.  Corey Hickey has identified it here:
http://article.gmane.org/gmane.comp.gcc.help/30172
Comment 37 Ryan Hill (RETIRED) gentoo-dev 2009-10-01 01:51:38 UTC
fixed in mplayer rev 29716.
Comment 38 Ryan Hill (RETIRED) gentoo-dev 2009-10-01 02:01:08 UTC
sorry, make that r29740.

Index: demux_mkv.c
===================================================================
--- demux_mkv.c (revision 29739)
+++ demux_mkv.c (revision 29740)
@@ -1578,7 +1578,7 @@
           uint32_t type2;
           unsigned int cnt;

-          src = track->private_data + RVPROPERTIES_SIZE;
+          src = (uint8_t *)track->private_data + RVPROPERTIES_SIZE;

           cnt = track->private_size - RVPROPERTIES_SIZE;
           bih = realloc(bih, sizeof (BITMAPINFOHEADER)+8+cnt);
Comment 39 Reimar Döffinger 2009-10-02 16:54:07 UTC
You got the wrong one, r29733 is the critical one.
Though I recommend to at least consider 29734, 29735, 29736, 29737 and 29738 since I am not 100% sure (as in: I just haven't checked) how serious the issues they fix are.
Comment 40 Samuli Suominen gentoo-dev 2009-10-11 11:39:01 UTC
*** Bug 287995 has been marked as a duplicate of this bug. ***
Comment 41 Samuli Suominen gentoo-dev 2009-10-26 18:48:01 UTC
This should be fixed with mplayer-1.0_rc4_p20091026.