<?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>74716</bug_id>
          
          <creation_ts>2004-12-16 19:52 0000</creation_ts>
          <short_desc>valgrind 2.2.0 makes nptl threaded programs segfault</short_desc>
          <delta_ts>2005-02-10 08:57:45 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>Development</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>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>pedratan@gmail.com</reporter>
          <assigned_to>griffon26@gentoo.org</assigned_to>
          <cc>trapni@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>pedratan@gmail.com</who>
            <bug_when>2004-12-16 19:52:06 0000</bug_when>
            <thetext>When running programs that are linked against /lib/libpthread.so.0, valgrind uses its compiled libpthread, which results always in:
[some messages]
error while loading shared libraries: libpthread.so.0: cannot enable executable stack as shared object requires: Invalid argument
[many lines later]
Segmentation fault

Reproducible: Always
Steps to Reproduce:
1. valgrind --tool=memcheck /bin/ls
2.
3.

Actual Results:  
% valgrind --tool=memcheck /bin/ls
==16579== Memcheck, a memory error detector for x86-linux.
==16579== Copyright (C) 2002-2004, and GNU GPL&apos;d, by Julian Seward et al.
==16579== Using valgrind-2.2.0, a program supervision framework for x86-linux.
==16579== Copyright (C) 2000-2004, and GNU GPL&apos;d, by Julian Seward et al.
==16579== For more details, rerun with: -v
==16579==
/bin/ls: error while loading shared libraries: libpthread.so.0: cannot enable
executable stack as shared object requires: Invalid argument
==16579== Jump to the invalid address stated on the next line
==16579==    at 0x78E: ???
==16579==    by 0x1B8EF5FE: (within /lib/ld-2.3.4.so)
==16579==    by 0x1B8EF037: (within /lib/ld-2.3.4.so)
==16579==    by 0x1B8E63C5: (within /lib/ld-2.3.4.so)
==16579==  Address 0x78E is not stack&apos;d, malloc&apos;d or (recently) free&apos;d
==16579==
==16579== Process terminating with default action of signal 11 (SIGSEGV)
==16579==  Access not within mapped region at address 0x78E
==16579==    at 0x78E: ???
==16579==    by 0x1B8EF5FE: (within /lib/ld-2.3.4.so)
==16579==    by 0x1B8EF037: (within /lib/ld-2.3.4.so)
==16579==    by 0x1B8E63C5: (within /lib/ld-2.3.4.so)
==16579==
==16579== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
==16579== malloc/free: in use at exit: 0 bytes in 0 blocks.
==16579== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==16579== For a detailed leak analysis,  rerun with: --leak-check=yes
==16579== For counts of detected errors, rerun with: -v
Segmentation fault


Expected Results:  
give info about running program

System compiled with USE=&quot;nptl nptlonly&quot;
It works in non nptl environments (tested)

CFLAGS=&quot;-march=athlon-xp -O2 -pipe -fomit-frame-pointer&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2004-12-17 16:56:09 0000</bug_when>
            <thetext>Thought this one might interest you, Christian. And any additional information
you may have on this would be appreciated.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>trapni@gentoo.org</who>
            <bug_when>2004-12-18 07:41:02 0000</bug_when>
            <thetext>interesting, yeah, but able to fix? well.... I gonna take a closer look tonight on it, too...

thx ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>trapni@gentoo.org</who>
            <bug_when>2004-12-18 07:41:49 0000</bug_when>
            <thetext>ah, btw, you can workaround this by remerging glibc without nptlonly useflag! - so much for now, cya ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2004-12-19 10:38:44 0000</bug_when>
            <thetext>I added valgrind-2.2.0-r1 that includes a fix.
If it doesn&apos;t fix the problem, please reopen this bug.

Thanks for reporting the problem.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pedratan@gmail.com</who>
            <bug_when>2004-12-19 12:51:17 0000</bug_when>
            <thetext>Excellent. Thanks a lot.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>janus@rtfm.org.ar</who>
            <bug_when>2005-02-09 16:48:38 0000</bug_when>
            <thetext>&gt; I added valgrind-2.2.0-r1 that includes a fix.
&gt; If it doesn&apos;t fix the problem, please reopen this bug.

Don&apos;t work:

$valgrind --tool=memcheck -q --leak-check=yes ./cliente
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC9A4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5CE7: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC961: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5CE7: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC82A: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5CE7: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC832: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5CE7: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC82A: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5D63: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC832: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5D63: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC9A4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E5D63: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8F23B4: (within /lib/ld-2.3.4.so)
==379==    by 0x1B8E4B43: (within /lib/ld-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC961: (within /lib/ld-2.3.4.so)
==379==    by 0x4D9C8A09: (within /lib/libc-2.3.4.so)
==379==    by 0x1B8EF0D7: (within /lib/ld-2.3.4.so)
==379==    by 0x4D9C8D46: _dl_open (in /lib/libc-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x1B8EC9A4: (within /lib/ld-2.3.4.so)
==379==    by 0x4D9C8A09: (within /lib/libc-2.3.4.so)
==379==    by 0x1B8EF0D7: (within /lib/ld-2.3.4.so)
==379==    by 0x4D9C8D46: _dl_open (in /lib/libc-2.3.4.so)
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x4DA998B2: store_to_database (in /usr/lib/libX11.so.6.2)
==379==    by 0x1BCB53CF: ???
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x4DA998B8: store_to_database (in /usr/lib/libX11.so.6.2)
==379==    by 0x1BCB53CF: ???
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x4DA998F2: store_to_database (in /usr/lib/libX11.so.6.2)
==379==    by 0x1BCB53CF: ???
==379==
==379== Conditional jump or move depends on uninitialised value(s)
==379==    at 0x4DA998F8: store_to_database (in /usr/lib/libX11.so.6.2)
==379==    by 0x1BCB53CF: ???
==379==
valgrind: vg_libpthread.c:2334 (open64): Assertion `open64_ptr != ((void *)0) &amp;&amp; open64_ptr != open64&apos; failed.

==379== Please report this bug at: valgrind.kde.org


==379==
==379== Invalid free() / delete / delete[]
==379==    at 0x1B9021D0: free (vg_replace_malloc.c:153)
==379==    by 0x4D9D19BB: (within /lib/libc-2.3.4.so)
==379==    by 0x4D9D1579: __libc_freeres (in /lib/libc-2.3.4.so)
==379==    by 0x1B8FBA90: _vgw(float, long double,...)(...)(long double,...)(short) (vg_intercept.c:117)
==379==  Address 0x1B9252D0 is not stack&apos;d, malloc&apos;d or (recently) free&apos;d

emerge info:
Portage 2.0.51-r15 (default-linux/x86/2004.3, gcc-3.3.5, glibc-2.3.4.20040808-r1, 2.6.9-gentoo-r9 i686)
=================================================================
System uname: 2.6.9-gentoo-r9 i686 AMD Duron(tm)
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.4 [2.3.4 (#1, Oct 21 2004, 09:18:58)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.4
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.10-r4
virtual/os-headers:  2.6.8.1-r1, 2.6.8.1-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
AUTOCLEAN=&quot;yes&quot;
CFLAGS=&quot;-O2 -march=athlon -pipe -fomit-frame-pointer -funroll-loops&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /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;-O2 -march=athlon -pipe -fomit-frame-pointer -funroll-loops&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;autoaddcvs autoconfig ccache distlocks fixpackages sandbox sfperms&quot;
GENTOO_MIRRORS=&quot;http://mirror.datapipe.net/gentoo http://mirror.datapipe.net/gentoo ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo http://open-systems.ufl.edu/mirrors/gentoo&quot;
LANG=&quot;es_ES&quot;
LC_ALL=&quot;es_ES&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.gentoo.org/gentoo-portage&quot;
USE=&quot;3dnow 3dnowex X aalib acpi alsa arts audiofile avi bitmap-fonts caps cdparanoia cdr chm crypt cscope cups dga directfb divx4linux doc dvd dvdread encodeesd ethereal f77 fam fbcon fdftk fftw flac flash font-server foomaticdb fortran gd ggi gif ginac gphoto2 gpm gstreamer guile icq imagemagick imap imlib ipv6 jabber java jpeg junit kde lcms ldap libmatroska live mad maildir mbox memlimitmikmod mmx motif mozilla mpeg msn ncurses network nls nocardbus nptl offensiveoggvorbis opengl oscar oss pam pdflib perl pic plotutils png qt quicktime readline real sdl slang snmp speex spell ssl svg svga szip tcltk tetex theora tiff truetype truetype-fonts type1-fonts unicode usb userlocales wmf x86 xine xmms xv xvid yahoo zlib linguas_es&quot;
Unset:  ASFLAGS, CBUILD, CTARGET, LDFLAGS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griffon26@gentoo.org</who>
            <bug_when>2005-02-10 08:57:45 0000</bug_when>
            <thetext>This is a completely different problem. Please open a separate bug report for it.

Did this problem first occur with -r1? I doubt it.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>