Philippe Waroquiers e4c6d8b5ab on ppc64, pthread_create_WRK is not (always) produced in the stacktrace
showing where a thread was created.
This makes many tests fail => use sed to delete pthread_create_WRK
from the stacktrace to let tests succeed on ppc64.
With this change, on ppc64 gcc110 (fedora 18), helgrind failures
goes from 28 tests failing to 4, with following reasons:
helgrind/tests/pth_cond_destroy_busy     (stderr)
    (6 errors instead of 3 in the summary line ???)
helgrind/tests/tc06_two_races_xml        (stderr)
    similar change needed in filter_xml to del pthread_create_WRK
helgrind/tests/tc18_semabuse             (stderr)
   -   with error code 22 (EINVAL: Invalid argument)
   +   with error code 38 (ENOSYS: Function not implemented)
helgrind/tests/tc20_verifywrap           (stderr)
   -   with error code 22 (EINVAL: Invalid argument)
   +   with error code 38 (ENOSYS: Function not implemented)


More details about the stacktrace not containing pthread_create_WRK:
--------------------------------------------------------------------
Here is the stacktrace obtained by GDB+vgdb:
(gdb) bt
#0  0x0000008074f7ac5c in .__clone () from /lib64/libc.so.6
#1  0x000000807517b1ec in do_clone (pd=0x4c6f200, attr=0x8075189c90 <default_attr>, stackaddr=<optimized out>, stopped=<optimized out>, 
    fct=@0x80751a01e0: 0x807517c500 <start_thread>, clone_flags=4001536) at ../nptl/sysdeps/pthread/createthread.c:74
#2  0x000000000403ed0c in pthread_create_WRK (thread=<error reading variable: value has been optimized out>, 
    attr=<error reading variable: value has been optimized out>, start=<error reading variable: value has been optimized out>, 
    arg=0xfff00ee18) at hg_intercepts.c:269
#3  0x000000000403ef1c in _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucreateZAZa (thread=<optimized out>, attr=<optimized out>, 
    start=<optimized out>, arg=<optimized out>) at hg_intercepts.c:300
#4  0x000000003806f1d8 in ?? ()
#5  0x0000008074e9fb94 in generic_start_main (main=@0x100200d8: 0x100013a0 <main>, argc=<optimized out>, ubp_av=0xfff00f2d8, 
    auxvec=0xfff00f408, init=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>, fini=<optimized out>)
    at ../csu/libc-start.c:225
#6  0x0000008074e9fd90 in __libc_start_main (argc=<optimized out>, ubp_av=<optimized out>, ubp_ev=<optimized out>, 
    auxvec=<optimized out>, rtld_fini=<optimized out>, stinfo=<optimized out>, stack_on_entry=<optimized out>)
    at ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:91
#7  0x0000000000000000 in ?? ()
(gdb) 


and here is the stacktrace produced by Valgrind unwinder:
Thread 1: status = VgTs_Runnable
==41687==    at 0x8074F7AC5C: clone (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517B1EB: do_clone.constprop.3 (createthread.c:74)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x10001597: main (tc19_shadowmem.c:172)
valgrind stack top usage: 15328 of 1048576


When the 2nd clone break is encountered (in the child thread), here is 
the GDB stacktraces:

Thread 2 (Thread 6028):
#0  0x0000008074f75fb0 in .madvise () from /lib64/libc.so.6
#1  0x000000807517c700 in start_thread (arg=0x4c6f200) at pthread_create.c:402
#2  0x0000008074f7acf0 in .__clone () from /lib64/libc.so.6

Thread 1 (Thread 41687):
#0  pthread_create_WRK (thread=0xfff00ee10, attr=0x0, start=@0x100200e8: 0x10001dd0 <steer>, arg=0xfff00ee18) at hg_intercepts.c:248
#1  0x000000000403ef1c in _vgw00000ZZ_libpthreadZdsoZd0_pthreadZucreateZAZa (thread=<optimized out>, attr=<optimized out>, 
    start=<optimized out>, arg=<optimized out>) at hg_intercepts.c:300
#2  0x000000003806f1d8 in ?? ()
#3  0x0000008074e9fb94 in generic_start_main (main=@0x100200d8: 0x100013a0 <main>, argc=<optimized out>, ubp_av=0xfff00f2d8, 
    auxvec=0xfff00f408, init=<optimized out>, rtld_fini=<optimized out>, stack_end=<optimized out>, fini=<optimized out>)
    at ../csu/libc-start.c:225
#4  0x0000008074e9fd90 in __libc_start_main (argc=<optimized out>, ubp_av=<optimized out>, ubp_ev=<optimized out>, 
    auxvec=<optimized out>, rtld_fini=<optimized out>, stinfo=<optimized out>, stack_on_entry=<optimized out>)
    at ../sysdeps/unix/sysv/linux/powerpc/libc-start.c:91
#5  0x0000000000000000 in ?? ()
(gdb) 


Here are the valgrind stacktraces:
Thread 1: status = VgTs_Runnable
==41687==    at 0x403EBE0: pthread_create_WRK (hg_intercepts.c:248)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x8074E9FB93: generic_start_main.isra.0 (libc-start.c:225)
==41687==    by 0x8074E9FD8F: (below main) (libc-start.c:91)
valgrind stack top usage: 15328 of 1048576

Thread 2: status = VgTs_WaitSys
==41687==    at 0x8074F75FB0: madvise (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517C6FF: start_thread (pthread_create.c:402)
valgrind stack top usage: 10320 of 1048576


And then after a few more next/breaks:
Thread 1: status = VgTs_Runnable
==41687==    at 0x8074F7AC5C: clone (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517B1EB: do_clone.constprop.3 (createthread.c:74)
==41687==    by 0x403EF1B: pthread_create@* (hg_intercepts.c:300)
==41687==    by 0x100015BB: main (tc19_shadowmem.c:173)
valgrind stack top usage: 15328 of 1048576

Thread 2: status = VgTs_WaitSys
==41687==    at 0x8074F75FB0: madvise (in /usr/lib64/libc-2.16.so)
==41687==    by 0x807517C6FF: start_thread (pthread_create.c:402)
valgrind stack top usage: 10320 of 1048576


So, pthread_create_WRK is not in the stacktrace anymore.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13983
2014-05-18 17:09:44 +00:00
2014-05-17 10:44:00 +00:00
2010-08-31 13:43:06 +00:00
2014-05-13 09:29:33 +00:00

Release notes for Valgrind
~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are building a binary package of Valgrind for distribution,
please read README_PACKAGERS.  It contains some important information.

If you are developing Valgrind, please read README_DEVELOPERS.  It contains
some useful information.

For instructions on how to build/install, see the end of this file.

If you have problems, consult the FAQ to see if there are workarounds.


Executive Summary
~~~~~~~~~~~~~~~~~
Valgrind is a framework for building dynamic analysis tools. There are
Valgrind tools that can automatically detect many memory management
and threading bugs, and profile your programs in detail. You can also
use Valgrind to build new tools.

The Valgrind distribution currently includes six production-quality
tools: a memory error detector, two thread error detectors, a cache
and branch-prediction profiler, a call-graph generating cache abd
branch-prediction profiler, and a heap profiler. It also includes
three experimental tools: a heap/stack/global array overrun detector,
a different kind of heap profiler, and a SimPoint basic block vector
generator.

Valgrind is closely tied to details of the CPU, operating system and to
a lesser extent, compiler and basic C libraries. This makes it difficult
to make it portable.  Nonetheless, it is available for the following
platforms: 

- X86/Linux
- AMD64/Linux
- PPC32/Linux
- PPC64/Linux
- ARM/Linux
- x86/MacOSX
- AMD64/MacOSX
- S390X/Linux
- MIPS32/Linux
- MIPS64/Linux

Note that AMD64 is just another name for x86_64, and Valgrind runs fine
on Intel processors.  Also note that the core of MacOSX is called
"Darwin" and this name is used sometimes.

Valgrind is licensed under the GNU General Public License, version 2. 
Read the file COPYING in the source distribution for details.

However: if you contribute code, you need to make it available as GPL
version 2 or later, and not 2-only.


Documentation
~~~~~~~~~~~~~
A comprehensive user guide is supplied.  Point your browser at
$PREFIX/share/doc/valgrind/manual.html, where $PREFIX is whatever you
specified with --prefix= when building.


Building and installing it
~~~~~~~~~~~~~~~~~~~~~~~~~~
To install from the Subversion repository :

  0. Check out the code from SVN, following the instructions at
     http://www.valgrind.org/downloads/repository.html.

  1. cd into the source directory.

  2. Run ./autogen.sh to setup the environment (you need the standard
     autoconf tools to do so).

  3. Continue with the following instructions...

To install from a tar.bz2 distribution:

  4. Run ./configure, with some options if you wish.  The only interesting
     one is the usual --prefix=/where/you/want/it/installed.

  5. Run "make".

  6. Run "make install", possibly as root if the destination permissions
     require that.

  7. See if it works.  Try "valgrind ls -l".  Either this works, or it
     bombs out with some complaint.  In that case, please let us know
     (see www.valgrind.org).

Important!  Do not move the valgrind installation into a place
different from that specified by --prefix at build time.  This will
cause things to break in subtle ways, mostly when Valgrind handles
fork/exec calls.


The Valgrind Developers
Description
No description provided
Readme 51 MiB
Languages
C 94.6%
Assembly 1.7%
C++ 1.1%
Makefile 0.6%
Perl 0.5%
Other 1.4%