<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>113396</bug_id>
          
          <creation_ts>2005-11-23 14:19 0000</creation_ts>
          <short_desc>-fforce-addr breaks mkvtoolnix 1.5.5, 1.6.0, 1.7.0</short_desc>
          <delta_ts>2006-08-30 11:22:22 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>crusaderky@gmail.com</reporter>
          <assigned_to>media-video@gentoo.org</assigned_to>
          <cc>rockoo@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2005-11-23 14:19:08 0000</bug_when>
            <thetext>All binaried in mkvtoolnix, both version 1.5.5 and 1.6.0, built with either
libmatroska 0.7.6 and 0.8.0, segfault on startup (with no arguments).

This is the backtrace for mmg-1.6.0 (using matroska 0.8.0):

#0  0xb7dee927 in uw_frame_state_for (context=0xbffcec28, fs=0xbffceb68) at
/var/tmp/portage/gcc-3.3.6/work/gcc-3.3.6/gcc/unwind-dw2.c:954
#1  0xb7deefb8 in _Unwind_RaiseException (exc=0x81f06b0) at unwind.inc:95
#2  0xb7eacd89 in __cxa_throw () from
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/libstdc++.so.5
#3  0x080d1bc7 in
std::__uninitialized_copy_aux&lt;__gnu_cxx::__normal_iterator&lt;std::string*,
std::vector&lt;std::string, std::allocator&lt;std::string&gt; &gt; &gt;,
__gnu_cxx::__normal_iterator&lt;std::string*, std::vector&lt;std::string,
std::allocator&lt;std::string&gt; &gt; &gt; &gt; ()
#4  0xb7f96cc0 in libmatroska::KaxChapterProcessData::ClassInfos () from
/usr/lib/libmatroska.so.0
(gdb) quit

I&apos;ve compiled it with CFLAGS=&quot;-g -pipe&quot; FEATURES=&quot;nostrip debug&quot;


$ emerge info
Portage 2.0.51.22-r3 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r2,
2.6.14-gentoo-r2 i686)
=================================================================
System uname: 2.6.14-gentoo-r2 i686 AMD Athlon(TM) XP 2000+
Gentoo Base System version 1.6.13
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer
-falign-functions=4 -mfpmath=sse&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control&quot;
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot;
CXXFLAGS=&quot;-Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer
-falign-functions=4 -mfpmath=sse&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoconfig digest distcc distlocks sandbox sfperms strict&quot;
GENTOO_MIRRORS=&quot;http://gentoo.gg3.net/ ftp://ftp.ecc.u-tokyo.ac.jp/GENTOO
http://gentoo.channelx.biz/ http://ftp.isu.edu.tw/pub/Linux/Gentoo
ftp://ftp.isu.edu.tw/pub/Linux/Gentoo&quot;
LANG=&quot;it_IT@euro&quot;
LINGUAS=&quot;it&quot;
MAKEOPTS=&quot;-j2&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.europe.gentoo.org/gentoo-portage&quot;
USE=&quot;x86 3dnow 3dnowex X X509 a52 aac aaca52 aad adns alsa apache2 audiofile avi
berkdb bitmap-fonts bzip2 cdparanoia cdr chroot crypt cscope cups curl dga dts
dvb dvd dvdr dvdread emboss encode erandom ethereal exif expat fam fbcon ffmpeg
firefox flac flash foomaticdb fortran freetype gd gdbm ggi gif gimpprint ginac
glut gmp gnutls gpm gtk gtk2 guile hal idn imagemagick imap imlib innodb ipv6
jack java javascript jikes jpeg junit kerberos krb4 lcms ldap libcaca libg++
libwww live lzo mad matroska mcal md5sum memlimit mhash mikmod ming mmx mmxext
mng motif mozilla mozsvg mp3 mpeg mpi mysql ncurses network nls nptl nvidia odbc
offensive ogg oggvorbis opengl pam parse-clocks pcre pdflib perl pic plotutils
png ppds prelude python qhull qt quicktime readline real recode rtc samba
scanner sdl skey slang slp sndfile snmp socks5 speex spell sqlite sse ssl stream
svg tcltk tcpd tetex tga theora tiff truetype truetype-fonts type1-fonts udev
usb v4l v4l2 vcd vorbis win32codecs wmf wxwindows xine xml xml2 xosd xprint xv
xvid xvmc yaz zlib linguas_it userland_GNU kernel_linux elibc_glibc&quot;
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2005-11-23 14:19:58 0000</bug_when>
            <thetext>in case someone wondered, mplayer and xine work just fine instead.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2005-12-06 16:51:34 0000</bug_when>
            <thetext>uh-oh... gotcha!
it&apos;s a HeisenBug or, to say it less romantically, a CFLAGS fragility :(

the previous backtrace is useless since I didn&apos;t notice that overriding CFLAGS
does not override CXXFLAGS, too, so the packages were compiled as normal.

I found a CXXFLAGS configuration where the bug does NOT appear and everything
works smoothly. There are the test conditions:

1)libmatroska-0.8.0 and libebml-0.7.6 compiled normally
(CXXFLAGS=&quot;-Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer
-falign-functions=4 -mfpmath=sse&quot;)
2)gcc-3.4.4-r1, glibc-2.3.5-r2
3)mkvtoolnix-1.6.0 compiled with the following CXXFLAGS:

DOESN&apos;T WORK: -Os -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer
-falign-functions=4 -mfpmath=sse
WORKS:        -Os -fomit-frame-pointer -march=athlon-xp
WORKS:        -g

*yaaaawn* sleepy.... more tests tomorrow</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>flameeyes@gentoo.org</who>
            <bug_when>2005-12-08 04:54:36 0000</bug_when>
            <thetext>Changing fpmath is known to break. That&apos;s your problem. 
 </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2005-12-08 15:15:56 0000</bug_when>
            <thetext>Since I&apos;ve been using -mfpmath=sse for about two years and I&apos;ve never had a
single problem until now, I think the best choice would be to filter it out for
this particular package.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2006-07-14 09:43:01 0000</bug_when>
            <thetext>after so many months, the bug is still there. *sigh*
the actual culprit is not -mfpmath, but -fforce-addr. removing it fixes the problem.

src_compile() {
    strip-flags -fforce-addr
    ...

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>flameeyes@gentoo.org</who>
            <bug_when>2006-07-14 09:56:57 0000</bug_when>
            <thetext>strip-flags does not filter only -fforce-addr so make sure you actually use filter-flag and check if it&apos;s -fforce-addr the problem or something else that is stripped by strip-flags.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>crusaderky@gmail.com</who>
            <bug_when>2006-07-14 10:10:24 0000</bug_when>
            <thetext>Yes, you&apos;re right.

src_compile() {
    filter-flags -fforce-addr
    ...

fixes the problem, too.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2006-08-30 11:22:22 0000</bug_when>
            <thetext>Added filtering this flag out of CFLAGS.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>