<?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>87598</bug_id>
          
          <creation_ts>2005-04-01 13:51 0000</creation_ts>
          <short_desc>valgrind-2.4.0 segfaults no matter what I do</short_desc>
          <delta_ts>2005-05-11 02:54:26 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>Unspecified</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>aaron@cs.tu-berlin.de</reporter>
          <assigned_to>griffon26@gentoo.org</assigned_to>
          <cc>7words.sg@gmail.com</cc>
    
    <cc>battousai@gentoo.org</cc>
    
    <cc>solar@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>aaron@cs.tu-berlin.de</who>
            <bug_when>2005-04-01 13:51:46 0000</bug_when>
            <thetext>I haven&apos;t found the cause yet, but whatever I do, my valgrind segfaults...

aaron@therion ~ $ valgrind
Segmentation fault


Reproducible: Always
Steps to Reproduce:

Actual Results:  
valgrind segfaulting... 

Expected Results:  
valgrind supporting me in finding possible bugs in my code 

therion aaron # emerge info 
Portage 2.0.51.19 (default-linux/x86/2004.3, gcc-3.4.3-20050110, 
glibc-2.3.4.20050125-r1, 2.6.11-gentoo-r4 i686) 
================================================================= 
System uname: 2.6.11-gentoo-r4 i686 AMD Athlon(tm) XP 2000+ 
Gentoo Base System version 1.6.10 
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, Mar 29 2005, 23:58:21)] 
dev-lang/python:     2.3.5 
sys-devel/autoconf:  2.13, 2.59-r6 
sys-devel/automake:  1.5, 1.8.5-r3, 1.7.9-r1, 1.6.3, 1.4_p6, 1.9.5 
sys-devel/binutils:  2.15.92.0.2-r7 
sys-devel/libtool:   1.5.14 
virtual/os-headers:  2.6.8.1-r4 
ACCEPT_KEYWORDS=&quot;x86 ~x86&quot; 
AUTOCLEAN=&quot;yes&quot; 
CFLAGS=&quot;-O2 -march=athlon-xp -fomit-frame-pointer&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/share/config /var/qmail/control&quot; 
CONFIG_PROTECT_MASK=&quot;/etc/gconf /etc/terminfo /etc/env.d&quot; 
CXXFLAGS=&quot;-O2 -march=athlon-xp -fomit-frame-pointer&quot; 
DISTDIR=&quot;/usr/portage/distfiles&quot; 
FEATURES=&quot;autoaddcvs autoconfig ccache distlocks sandbox sfperms&quot; 
GENTOO_MIRRORS=&quot;ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo 
ftp://pandemonium.tiscali.de/pub/gentoo/&quot; 
MAKEOPTS=&quot;-j2&quot; 
PKGDIR=&quot;/usr/portage/packages&quot; 
PORTAGE_TMPDIR=&quot;/var/tmp&quot; 
PORTDIR=&quot;/usr/portage&quot; 
SYNC=&quot;rsync://rsync.de.gentoo.org/gentoo-portage&quot; 
USE=&quot;x86 3dnow 3dnowex X aac aalib acpi acpi4linux alsa apache2 apm arts avi 
bash-completion berkdb bitmap-fonts cdr chroot codecs crypt cups curl dba dga 
directfb divx4linux dlloader dts dvd dvdread emboss encode erandom faac faad 
fam fbcon ffmpeg flac font-server foomaticdb fortran freetype gd gdbm gif 
gphoto2 gpm graphviz gtk2 hal imagemagick imlib ipv6 java jpeg jpeg2k junit kde 
libcaca libg++ libwww mad matroska mikmod mime mjpegmpeg mmx mmxext mng motif 
mp3 mpeg mpeg4 mplayer ncurses network nls nptl nvidia oggvorbis opengl oss pam 
pdflib perl php pic pie png python qt quicktime readline real rtc samba sdl 
slang spell sqlite sse ssl stencil-buffer svga sysfs tcpd tga theora tiff 
toolbari truetype truetype-fonts type1 type1-fonts unicode usb userlocales 
vim-with-x vorbis xine xml2 xmms xv xvid xvmc zlib linguas_de&quot; 
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2005-04-02 04:10:58 0000</bug_when>
            <thetext>I&apos;ll look into it in a few days. For now, I have masked 2.4.0.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aaron@cs.tu-berlin.de</who>
            <bug_when>2005-04-02 10:49:34 0000</bug_when>
            <thetext>ok... today I have played arround with this ebuild a bit....
even if I do: CFLAGS=&quot;&quot; emerge valgrind
the resulting valgrind segfaults for me...

BUT if I remove the line from the valgrind-2.4.0 ebuild where we force it to respect $CFLAGS,  I get a version working just fine. So I presume the sed-magic messes up something in the configure file...

so concluding I can say: removing 
    sed -i -e &apos;s:CFLAGS=&quot;-Wno-long-long&quot;:CFLAGS=&quot;$CFLAGS -Wno-long-long&quot;:&apos; configure
from the ebuild made me have a working valgrind....</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2005-04-05 10:44:07 0000</bug_when>
            <thetext>Just to log here what we know: adding --disable-pie to configure will also result in a working build of valgrind.

I&apos;ll be looking into the CFLAGS thing you mentioned.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2005-04-05 13:42:23 0000</bug_when>
            <thetext>Battousai, I added you to the cc because you may be interested in this one.

Solar, you&apos;ve helped me before when I expressed my cluelessness when it comes to PIE. I could use your help again if that&apos;s ok. 

The thing is that the valgrind developers are trying to use PIE (iirc because they want valgrind to be able to run itself). Unfortunately, valgrind&apos;s tests do not run with hardened gcc (see http://bugs.kde.org/show_bug.cgi?id=96321), so I filter -fPIC, causing -fnopie to be added to CFLAGS. This in turn makes it impossible for valgrind to use PIE, so I have to configure it with --disable-pie (otherwise it will segfault).

Is there a way to get around the reserved BREG without completely disabling PIE? 
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2005-04-12 11:40:58 0000</bug_when>
            <thetext>I just checked in a version that should work fine even with PIE.
Thanks for the report Olaf.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aaron@cs.tu-berlin.de</who>
            <bug_when>2005-04-12 12:23:25 0000</bug_when>
            <thetext>thanks for your efforts..
just tested it and it works perfect!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>greg_g@gentoo.org</who>
            <bug_when>2005-05-11 02:54:26 0000</bug_when>
            <thetext>*** Bug 88138 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
    </bug>

</bugzilla>