Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 291967 - media-video/flvstreamer needs filter-flags -O3 -O2
Summary: media-video/flvstreamer needs filter-flags -O3 -O2
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Markos Chandras (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-05 11:54 UTC by Bjorn T
Modified: 2009-12-16 13:35 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjorn T 2009-11-05 11:54:35 UTC
Package compiles fine, but refuses to download any rtmp streams when compiled with -O2 or higher. 


Reproducible: Always

Steps to Reproduce:
1. emerge flvstreamer with -O2 or -O3 in your make.conf
2. Attempt to download rtmp stream. 
3. Program sits there doing nothing
Comment 1 Sebastian Luther (few) 2009-11-05 12:13:33 UTC
emerge --info please.
Comment 2 Bjorn T 2009-11-05 12:25:53 UTC
# emerge --info
Portage 2.1.6.13 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.30-gentoo-r5 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r5-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E8500_@_3.16GHz-with-gentoo-1.12.13
Timestamp of tree: Thu, 05 Nov 2009 09:45:02 +0000
ccache version 2.4 [enabled]
app-shells/bash:     4.0_p28
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.5.4-r3, 2.6.2-r1
dev-util/ccache:     2.4-r7
dev-util/cmake:      2.6.4
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /home/mythtv/"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /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="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB"
MAKEOPTS="-j3"
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://rsync.europe.gentoo.org/gentoo-portage"
USE="X aac aalib acl acpi alsa amd64 berkdb bzip2 cddb cdr cli cracklib crypt cups dbus dga dri dvd dvdr dvdread fam flac fontconfig fortran gdbm gif gpm gtk hal iconv java jpeg jpeg2k kerberos ldap libnotify mad mmx modules mp3 mpeg mudflap multilib ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre perl png pppd python qt3 qt3support readline reflection samba sdl session spl sse sse2 sse3 ssl startup-notification svg sysfs tcpd tiff truetype type1 unicode usb vcd vdpau vhosts vorbis wmf x264 xcb xml xorg xprint xv xvid 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" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd 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 dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB" LIRC_DEVICES="imon_lcd" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2009-11-05 13:47:09 UTC
Filtering -O2 and -O3 is not an option. The optimization levels are set of flags, see "man gcc". You need to find the specific flag that's causing the problem, such as (this is only a example):

-findirect-inlining
Inline also indirect calls that are discovered to be known at compile time thanks to previous inlining.  This option has any effect only when inlining itself is turned on by the -finline-functions or -finline-small-functions options.
--> HERE ---> Enabled at level -O2.

Filtering them is only hiding the problem.
Comment 4 Bjorn T 2009-11-05 19:38:16 UTC
OK. Thanks for that. I've been through the list of optimisations on my system at -O2 , and as far as I can tell it's the following flags together  that trigger this bug (either one by itself doesn't trigger it). 

-fstrict-aliasing -fschedule-insns

Appending -fno-strict-aliasing -fno-schedule-insns to the cflags in the ebuild seems to make it work correctly for me. 
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2009-11-05 23:03:39 UTC
(In reply to comment #4)
> OK. Thanks for that. I've been through the list of optimisations on my system
> at -O2 , and as far as I can tell it's the following flags together  that
> trigger this bug (either one by itself doesn't trigger it). 
> 
> -fstrict-aliasing -fschedule-insns
> 
> Appending -fno-strict-aliasing -fno-schedule-insns to the cflags in the ebuild
> seems to make it work correctly for me. 
> 

Nice work :)
So it's a strict aliasing bug, nothing unusual for new gcc's and uncompatible code.
So we should get away by just "append-flags -fno-strict-aliasing" if -fschedule-insns alone doesn't cause it.
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2009-11-09 17:51:23 UTC
Samuli  feel free to fix it anytime cause I wont have time for the next few days. Many thanks
Comment 7 Reinhard Schu 2009-11-29 15:08:32 UTC
(In reply to comment #5)

> So we should get away by just "append-flags -fno-strict-aliasing" if
> -fschedule-insns alone doesn't cause it.

I have tested this with -O2 and it works, but it does not work with -Os.  There must be additional flags that cause the problem.  I will look into it.
Comment 8 Joe Stroller 2009-12-14 10:58:22 UTC
I can reproduce this also.

Previously I had CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer" (no idea why I chose these cflags - my systems have probably all been using this since forever) and flvstreamer was failing with:

ERROR: FillBuffer, recv returned -1. GetSockError(): 11
ERROR: ReadPacket, failed to read RTMP packet header

Simply adding "-fno-strict-aliasing -fno-schedule-insns" to my CFLAGS fixed the problem & I can now download from the BBC in hi-def, baby!

As you can see from the below, I'm using x86.

Thanks everyone who has commented - this bug  report ensured I was able to fix my problem very quickly.



$ emerge --info
Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.3.4, glibc-2.9_p20081201-r2, 2.6.31-gentoo-r6 i686)
=================================================================
System uname: Linux-2.6.31-gentoo-r6-i686-Intel-R-_Celeron-R-_CPU_2.80GHz-with-gentoo-1.12.13
Timestamp of tree: Wed, 02 Dec 2009 03:30:01 +0000
app-shells/bash:     4.0_p28
dev-lang/python:     2.6.2-r1
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.27-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=pentium-m -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -fno-schedule-insns "
CHOST="i686-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"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /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=pentium-m -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -fno-schedule-insns "
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks fixpackages 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="en_GB"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB en"
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="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="a52 aac acl amr berkdb bzip2 cli cracklib crypt css cups curl doc dri dts dvd dvdnav dvdr encode examples exif extra-tools ffmpeg fortran gdbm gif iconv inotify jpeg libssh2 mad matroska md5sum mmx modules mp3 mp4 mpeg mudflap ncurses nethack network-cron nls nptl nptlonly offensive ogg ogm openmp pam pcre perl png pppd python qt3support quicktime rar raw readline reflection samba schroedinger sensord session spell spl sse sse2 ssl sysfs tcpd theora truetype unicode vim-syntax vorbis win32codecs x264 x86 xml xorg xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en_GB en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

$
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2009-12-15 20:18:29 UTC
Could you please verify that the problem still exists on recently committed flvstreamer-1.9?

Thanks
Comment 10 Joe Stroller 2009-12-16 03:48:49 UTC
Yup! That seems to have worked here.  :D
Comment 11 Markos Chandras (RETIRED) gentoo-dev 2009-12-16 13:35:45 UTC
Ok since it works on 1.9, this bug may no close. I wont plan to fix 1.8i. I will try to rush the stabilization on 1.9 instead.
Thanks