]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
10 years agoFix a typo.
Florian Krohm [Tue, 19 Aug 2014 16:53:02 +0000 (16:53 +0000)] 
Fix a typo.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14312

10 years agoRemove a few unused macro definitions.
Florian Krohm [Mon, 18 Aug 2014 15:36:29 +0000 (15:36 +0000)] 
Remove a few unused macro definitions.
Move exported global variables to the proper section
in the header file.
No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14306

10 years agoarm64: enable test cases for
Julian Seward [Mon, 18 Aug 2014 12:29:03 +0000 (12:29 +0000)] 
arm64: enable test cases for
srhadd, urhadd (vector)
suqadd, usqadd (scalar)
suqadd, usqadd (vector)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14303

10 years agoAnnounce in NEWS the change of behaviour (i.e. validity checking)
Philippe Waroquiers [Sun, 17 Aug 2014 20:07:36 +0000 (20:07 +0000)] 
Announce in NEWS the change of behaviour (i.e. validity checking)
for the clo options --kernel-variant and --sim-hints

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14302

10 years agoThe attached patch cleanups the clo processing
Philippe Waroquiers [Sun, 17 Aug 2014 20:03:51 +0000 (20:03 +0000)] 
The attached patch cleanups the clo processing
of clo which are (or should be) 'enum set'.

* pub_tool_options.h : add new macrox VG_USET_CLO and VG_USETX_CLO to
  parse an 'enum set' command line option (with or without "all" keyword).

* use VG_USET_CLO for existing enum set clo options:
   memcheck --errors-for-leak-kinds, --show-leak-kinds, --leak-check-heuristics
   coregrind --vgdb-stop-at

* change --sim-hints and --kernel-variants to enum set
  (this allows to detect user typos: currently, a typo in a sim-hint
   or kernel variant is silently ignored. Now, an error will be given
   to the user)

* The 2 new sets (--sim-hints and --kernel-variants) should not make
  use of the 'all' keyword => VG_(parse_enum_set) has a new argument
  to enable/disable the use of the "all" keyword.

* The macros defining an 'all enum' set definition was duplicating
  all enum values (so addition of a new enum value could easily
  give a bug). Removing these macros as they are unused
  (to the exception of the leak-kind set).
  For this set, the 'all macro' has been replaced by an 'all function',
  coded using parse_enum_set parsing the "all" keyword.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14301

10 years agoarm64: enable test cases for
Julian Seward [Sun, 17 Aug 2014 18:34:08 +0000 (18:34 +0000)] 
arm64: enable test cases for
  sshr, ushr, ssra, usra (scalar, imm)
  srshr, urshr, srsra, ursra (scalar, imm)
  srshr, urshr, srsra, ursra (vector, imm)
  sshl, srshl, ushl, urshl (scalar, imm)
  sshl, srshl, ushl, urshl (vector, vector)
  ssra, usra (vector, imm)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14300

10 years agoAdd comments in getoff.c to clarify its intended usage.
Philippe Waroquiers [Sun, 17 Aug 2014 13:33:57 +0000 (13:33 +0000)] 
Add comments in getoff.c to clarify its intended usage.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14299

10 years agoFix build problems on MacOSX pertaining to r14283.
Julian Seward [Sun, 17 Aug 2014 12:23:56 +0000 (12:23 +0000)] 
Fix build problems on MacOSX pertaining to r14283.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14298

10 years ago* Unbreak build on macos (and on other platforms) that do not have
Philippe Waroquiers [Sat, 16 Aug 2014 21:00:15 +0000 (21:00 +0000)] 
* Unbreak build on macos (and on other platforms) that do not have
HAVE_DLINFO_RTLD_DI_TLS_MODID.
* add the copyright notice in auxprogs/getoff.c
* add more prereq to hgtls.vgtest

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14297

10 years agocreating the lind from none/tests/ppc64/round.c to none/tests/ppc32/round.c
Carl Love [Fri, 15 Aug 2014 16:44:32 +0000 (16:44 +0000)] 
creating the lind from none/tests/ppc64/round.c to none/tests/ppc32/round.c

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14291

10 years agoRemoving the file none/tests/ppc64/round.c so I can change it to a link.
Carl Love [Fri, 15 Aug 2014 16:40:03 +0000 (16:40 +0000)] 
Removing the file none/tests/ppc64/round.c so I can change it to a link.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14290

10 years agoSome cleanup post QGetTlsAddr commit
Philippe Waroquiers [Fri, 15 Aug 2014 13:03:24 +0000 (13:03 +0000)] 
Some cleanup post QGetTlsAddr commit
* remove useless commented line in hgtls.vgtest
* avoid some #ifdef in arch specific code, hoping to discover more compile
  time errors.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14287

10 years agofix 338160: Implement QGetTlsAddr query so that GDB+V gdbsrv can print __thread varia...
Philippe Waroquiers [Fri, 15 Aug 2014 10:27:52 +0000 (10:27 +0000)] 
fix 338160: Implement QGetTlsAddr query so that GDB+V gdbsrv can print __thread variables.

To implement QGetTlsAddr, gdbsrv has to know how to get the glibc dtv
address and the module id from the link_map.
These 2 things are dependent on the internals of glibc.
The dependency is mostly isolated in a few lines of arch dependent
code or in an external utility that used a hack + -ldl lib to find
the offset of the modid in the link_map structure.

Tested on x86/amd64/ppc64/s390x. Somewhat tested on ppc32 and arm64.
Untested/a few #ifdef-ed lines not compiled on arm/mips32/mips64
and darwin.

For more background info about thread local storage handling, see
'ELF Handling For Thread-Local Storage' http://www.akkadia.org/drepper/tls.pdf

Changes:
* auxprogs/getoff.c new auxilliary program to get platform specific offsets
  (currently only the offset for the module id in struct link_map).
* configure.ac : check for dlinfo(RTLD_DI_TLS_MODID) needed for getoff.c
* new gdbserver_tests/hgtls, testing various types of __thread variables
* various m_gdbserver files:
  - implement decoding of the QGetTlsAddr query
  - for each platform: platform specific code to get the dtv
  - call to external program getoff-<platform> the first time an
    __thread variable is printed.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14283

10 years agoTrack vex r2924 (Renaming of Iop_QSalN*, Iop_QShlN* and Iop_QShlN*S)
Julian Seward [Fri, 15 Aug 2014 09:12:28 +0000 (09:12 +0000)] 
Track vex r2924 (Renaming of Iop_QSalN*, Iop_QShlN* and Iop_QShlN*S)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14282

10 years agoarm64: enable test cases for:
Julian Seward [Fri, 15 Aug 2014 05:39:42 +0000 (05:39 +0000)] 
arm64: enable test cases for:
{uqshl, sqshl, sqshlu} (vector, imm)
{uqshl, sqshl, sqshlu} (scalar, imm)
{uqshrn, sqrshrun, sqshrun} (scalar, imm)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14281

10 years agoChoose some floating point numbers that are hopefully easier to write out.
Florian Krohm [Thu, 14 Aug 2014 17:32:26 +0000 (17:32 +0000)] 
Choose some floating point numbers that are hopefully easier to write out.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14279

10 years agoThis commit is an update to Bugzilla 334836
Carl Love [Thu, 14 Aug 2014 16:54:48 +0000 (16:54 +0000)] 
This commit is an update to Bugzilla 334836

There are two copies of the round test in none/tests/ppc32/round.c
and none/tests/ppc64/round.c.  The two source files should be
identical. The LE functional test commit updated the round.c test for
ppc64 but was missing the ppc32 round updates.  The round.c test was
updated to fix an issue where we were getting different outputs
depending on the compiler.  The output is now consistent for the
compilers allowing the removal of the additional expect files for
ppc32 and ppc64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14278

10 years agoUpdate list of ignored files.
Florian Krohm [Thu, 14 Aug 2014 14:14:55 +0000 (14:14 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14277

10 years agoMake suppression more flexible.
Florian Krohm [Thu, 14 Aug 2014 14:12:38 +0000 (14:12 +0000)] 
Make suppression more flexible.
Needed for s390 running Fedora 20.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14276

10 years agoAdd a couple more OSX109 libc leak suppressions.
Julian Seward [Thu, 14 Aug 2014 09:46:52 +0000 (09:46 +0000)] 
Add a couple more OSX109 libc leak suppressions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14275

10 years agoUnbreak the MacOS port following recent r14273 (further reduction
Julian Seward [Thu, 14 Aug 2014 09:38:19 +0000 (09:38 +0000)] 
Unbreak the MacOS port following recent r14273 (further reduction
in symbol table storage requirements for non-ppc64 targets).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14274

10 years agoReduce memory needed for symbols, by having the tocptr and local_ep
Philippe Waroquiers [Wed, 13 Aug 2014 21:25:45 +0000 (21:25 +0000)] 
Reduce memory needed for symbols, by having the tocptr and local_ep
(used for ppc64 platforms) #ifdef-ed and accessed by macros
that becomes NOP on non ppc64 platforms.
This decreases the debuginfo memory by about 2.5 Mb on a big 32 bit application.

Note : doing that, some questions were encountered in the way
tocptr and local_ep have (or do not have) to be copied/maintained
in storage.c canonicaliseSymtab

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14273

10 years agoRemove benign macro redefinition.
Florian Krohm [Wed, 13 Aug 2014 14:31:04 +0000 (14:31 +0000)] 
Remove benign macro redefinition.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14269

10 years agoFix some comments
Philippe Waroquiers [Wed, 13 Aug 2014 09:53:18 +0000 (09:53 +0000)] 
Fix some comments

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14267

10 years agoUnbreak the MacOS port following the recent ppc64le port merge.
Julian Seward [Wed, 13 Aug 2014 09:04:02 +0000 (09:04 +0000)] 
Unbreak the MacOS port following the recent ppc64le port merge.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14266

10 years agoFollowup to r14264: Fix VG_(sysnum_string) for Darwin.
Florian Krohm [Tue, 12 Aug 2014 21:11:44 +0000 (21:11 +0000)] 
Followup to r14264: Fix VG_(sysnum_string) for Darwin.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14265

11 years agoRemove function VG_(sysnum_string_extra) as it was just a wrapper
Florian Krohm [Tue, 12 Aug 2014 11:43:17 +0000 (11:43 +0000)] 
Remove function VG_(sysnum_string_extra) as it was just a wrapper
around VG_(sysnum_string). Also remove associated macro
VG_SYSNUM_STRING_EXTRA.
The VG_SYSNUM_STRING macro returned a pointer to a variable which
is out of scope. Using that value may cause undefined behaviour.
Change VG_(sysnum_string) to return pointer to static buffer instead.
Fix call sites.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14264

11 years agocoregrind/m_syswrap/priv_syswrap-xen.h: Add copyright header
Bart Van Assche [Tue, 12 Aug 2014 09:53:32 +0000 (09:53 +0000)] 
coregrind/m_syswrap/priv_syswrap-xen.h: Add copyright header

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14263

11 years agoCorrect a comment. We really should not specify the default values
Florian Krohm [Mon, 11 Aug 2014 15:48:51 +0000 (15:48 +0000)] 
Correct a comment. We really should not specify the default values
here. Double maintenance.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14262

11 years agoGive static variable function scope.
Florian Krohm [Mon, 11 Aug 2014 15:21:44 +0000 (15:21 +0000)] 
Give static variable function scope.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14260

11 years agoRemove unused and possibly incorrectly defined macro.
Florian Krohm [Mon, 11 Aug 2014 15:21:11 +0000 (15:21 +0000)] 
Remove unused and possibly incorrectly defined macro.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14259

11 years agoRemove unneeded include files.
Florian Krohm [Mon, 11 Aug 2014 14:39:28 +0000 (14:39 +0000)] 
Remove unneeded include files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14258

11 years agoarm64: enable test cases for:
Julian Seward [Mon, 11 Aug 2014 13:59:49 +0000 (13:59 +0000)] 
arm64: enable test cases for:
uqshrn{2}, sqrshrun{2}, sqshrun{2} (vector, imm)
sqxtn{2}, uqxtn{2}, sqxtun{2} (vector and scalar)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14257

11 years agoarm64 Improve fpsr gdbsrv handling.
Philippe Waroquiers [Sun, 10 Aug 2014 10:42:10 +0000 (10:42 +0000)] 
arm64 Improve fpsr gdbsrv handling.
let the compiler handle the ULong to UInt conversion rather than
play with addresses.

Tested manually GDB+vgdb that reading and setting fpsr works, using
code such as (provided by Julian, I cannot write a single line of
arm64 asm :)
 void set_fpsr ( uint32_t val ) {
     __asm__ __volatile__( "msr fpsr, %0" : : "r"(val) : "cc" );
  }

  uint32_t get_fpsr ( void ) {
     uint32_t res;
     __asm__ __volatile__( "mrs %0, fpsr" : "=r"(res) : : "cc" );
     return res;
  }

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14256

11 years agodrd/tests/free_is_write: Reduce stack usage
Bart Van Assche [Sun, 10 Aug 2014 08:14:55 +0000 (08:14 +0000)] 
drd/tests/free_is_write: Reduce stack usage

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14254

11 years agoarm64 does not implement fork syscall. Use clone instead
Philippe Waroquiers [Sat, 9 Aug 2014 21:51:45 +0000 (21:51 +0000)] 
arm64 does not implement fork syscall. Use clone instead

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14253

11 years agoUse mkstemp_format in VG_(mkstemp). That way nothing breaks should
Florian Krohm [Sat, 9 Aug 2014 21:45:56 +0000 (21:45 +0000)] 
Use mkstemp_format in VG_(mkstemp). That way nothing breaks should
the format change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14252

11 years agoFix type.
Florian Krohm [Sat, 9 Aug 2014 16:55:59 +0000 (16:55 +0000)] 
Fix type.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14250

11 years agodrd: Move VG_(getenv)("DRD_VERIFY_CONFLICT_SET")
Bart Van Assche [Sat, 9 Aug 2014 12:58:17 +0000 (12:58 +0000)] 
drd: Move VG_(getenv)("DRD_VERIFY_CONFLICT_SET")

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14249

11 years agodrd/Testing.txt: Document how to run all regression tests with conflict set verificat...
Bart Van Assche [Sat, 9 Aug 2014 12:47:17 +0000 (12:47 +0000)] 
drd/Testing.txt: Document how to run all regression tests with conflict set verification enabled

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14248

11 years agoMark argument of VG_(mkstemp) as const.
Philippe Waroquiers [Sat, 9 Aug 2014 11:26:51 +0000 (11:26 +0000)] 
Mark argument of VG_(mkstemp) as const.
Fix comment in pub_core_libcfile.h (and make it the only copy)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14247

11 years agoThis commit is for Bugzilla 334834.
Carl Love [Fri, 8 Aug 2014 22:29:10 +0000 (22:29 +0000)] 
This commit is for Bugzilla 334834.

A performance regression was found due to the
-02 -m64 flags not being included when compiling
the VEX PPC64 code.  This commit fixes the Makefile
to pass the needed flags when compiling VEX PPC64
code.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14246

11 years agoThis patch implements reading the directory information for source
Philippe Waroquiers [Fri, 8 Aug 2014 22:11:41 +0000 (22:11 +0000)] 
This patch implements reading the directory information for source
files in the dwarf3 reader.
Basically, the change consists in replacing in the DiInlLoc struct
      const HChar* filename;     /* caller source filename */
by
      UInt   fndn_ix;            /* index in di->fndnpool of caller source
                                    dirname/filename */

A similar change is done in  DiVariable struct, as the
read_filename_Table code is shared between the inline info reader
and the varinfo reader.
Note however that outputting dirname in variable description
is not done. Unclear if that is desired or not.
It should be trivially doable however.
Replacing filename by fndn_ix implies a bunch of semi-mechanical
changes.

The code to read the directory names is in the new function
static
XArray* read_dirname_xa (struct _DebugInfo* di, const HChar *compdir,
                         Cursor *c,
                         Bool td3 )

Note that readdwarf.c and readdwarf3.c have significant duplicated
logic. Would be nice to integrate these 2 dwarf readers in one
single reader. This function is directly inspired from
an equivalent piece of code in readdwarf.c.

Modified memcheck/tests/varinfo5.vgtest to test the dirname appears
in the inlined functions.

Impact on memory is neglectable (a few Kb on a big executable).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14245

11 years agodrd: Clear conflict set after fork (#338115)
Bart Van Assche [Fri, 8 Aug 2014 16:27:30 +0000 (16:27 +0000)] 
drd: Clear conflict set after fork (#338115)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14244

11 years agodrd/tests/threaded-fork-vcs: Add
Bart Van Assche [Fri, 8 Aug 2014 16:20:13 +0000 (16:20 +0000)] 
drd/tests/threaded-fork-vcs: Add

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14243

11 years agodrd: Add command-line option --verify-conflict-set
Bart Van Assche [Fri, 8 Aug 2014 16:17:58 +0000 (16:17 +0000)] 
drd: Add command-line option --verify-conflict-set

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14242

11 years agoAdd missing comment marker.
Julian Seward [Fri, 8 Aug 2014 08:58:03 +0000 (08:58 +0000)] 
Add missing comment marker.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14241

11 years agoThis commit is for Bugzilla 334836. The Bugzilla contains patch 3 of 3
Carl Love [Thu, 7 Aug 2014 23:49:27 +0000 (23:49 +0000)] 
This commit is for Bugzilla 334836.  The Bugzilla contains patch 3 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334834.  Note, there are no VEX changes in this patch.

PP64 Little Endian test case fixes.

This patch adds new LE and BE expect files where needed.  In other
cases, the test was fixed to run correctly on LE and BE using based on
testing to see which platform is being used.

Where practical, the test cases have been changed so that the output
produced for BE  and LE will be identical.  The test cases that require
a major rewrite to make the output identical for BE and LE simply
had an additional expect file added.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14240

11 years agoThis commit is for Bugzilla 334834. The Bugzilla contains patch 2 of 3
Carl Love [Thu, 7 Aug 2014 23:35:54 +0000 (23:35 +0000)] 
This commit is for Bugzilla 334834.  The Bugzilla contains patch 2 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334384 and 334836.

POWER PC, add the functional Little Endian support, patch 2

The IBM POWER processor now supports both Big Endian and Little Endian.
The ABI for Little Endian also changes.  Specifically, the function
descriptor is not used, the stack size changed, accessing the TOC
changed.  Functions now have a local and a global entry point.  Register
r2 contains the TOC for local calls and register r12 contains the TOC
for global calls.  This patch makes the functional changes to the
Valgrind tool.  The patch makes the changes needed for the
none/tests/ppc32 and none/tests/ppc64 Makefile.am.  A number of the
ppc specific tests have Endian dependencies that are not fixed in
this patch.  They are fixed in the next patch.

Per Julian's comments renamed coregrind/m_dispatch/dispatch-ppc64-linux.S
to coregrind/m_dispatch/dispatch-ppc64be-linux.S  Created new file for LE
coregrind/m_dispatch/dispatch-ppc64le-linux.S.  The same was done for
coregrind/m_syswrap/syscall-ppc-linux.S.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14239

11 years agoThis commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
Carl Love [Thu, 7 Aug 2014 23:17:29 +0000 (23:17 +0000)] 
This commit is for Bugzilla 334384.  The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238

11 years agopre_mem_read_sockaddr: properly handle the NETLINK address family
Julian Seward [Wed, 6 Aug 2014 19:52:12 +0000 (19:52 +0000)] 
pre_mem_read_sockaddr: properly handle the NETLINK address family
rather than throwing to the default case.  This stops Memcheck
reporting false positives for the NETLINK case.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14237

11 years agofix 338024 inlined functions are not shown if DW_AT_ranges is used
Philippe Waroquiers [Tue, 5 Aug 2014 19:34:35 +0000 (19:34 +0000)] 
fix 338024  inlined functions are not shown if DW_AT_ranges is used
Based on investigation and patch by Matthias Schwarzott.
(no small test found that reproduced the problem,
but the equivalent patch given in bug 338024 fixed the inlined stack
trace  in a big shared lib).
Would be nice however to have a small test case ...

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14236

11 years agoadd support for VKI_BLKDISCARDZEROES
Christian Borntraeger [Tue, 5 Aug 2014 15:14:52 +0000 (15:14 +0000)] 
add support for VKI_BLKDISCARDZEROES

this is used in some newer QEMU versions and other tools

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14235

11 years agoNEWS: Add #331829 (Unexpected ioctl opcode sign extension)
Bart Van Assche [Tue, 5 Aug 2014 12:03:51 +0000 (12:03 +0000)] 
NEWS: Add #331829 (Unexpected ioctl opcode sign extension)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14234

11 years agoLinux: Add support for Lustre FID2PATH ioctl (#331829)
Bart Van Assche [Tue, 5 Aug 2014 12:01:26 +0000 (12:01 +0000)] 
Linux: Add support for Lustre FID2PATH ioctl (#331829)

This is a modified version of a patch provided by Frank Zago (fzago@cray.com).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14233

11 years agoLinux system call wrappers: truncate ioctl request number to 32 bits
Bart Van Assche [Tue, 5 Aug 2014 11:35:48 +0000 (11:35 +0000)] 
Linux system call wrappers: truncate ioctl request number to 32 bits

As explained in https://bugs.kde.org/show_bug.cgi?id=331829, when passing
an ioctl request number as an int to a function the request number will
be sign-extended to 64 bits on 64-bit systems. Avoid that this causes
Valgrind to fail to recognize an ioctl by truncating the request number
to 32 bits.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14232

11 years agoEnable tests for: sq{r}dmulh (scalar vs elem, vector vs elem),
Julian Seward [Mon, 4 Aug 2014 08:11:33 +0000 (08:11 +0000)] 
Enable tests for: sq{r}dmulh (scalar vs elem, vector vs elem),
sqshl, uqshl, sqrshl, uqrshl (reg) (vector and scalar).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14231

11 years agoAllow no debuginfo to be found when (trying to) produce the help msg
Philippe Waroquiers [Thu, 31 Jul 2014 21:15:42 +0000 (21:15 +0000)] 
Allow no debuginfo to be found when (trying to) produce the help msg
for activating the host visibility in gdbsrv

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14227

11 years agoensure the regcache is in sync with the fpsr part VEX represents
Philippe Waroquiers [Thu, 31 Jul 2014 20:13:23 +0000 (20:13 +0000)] 
ensure the regcache is in sync with the fpsr part VEX represents
when fpsr is modified from gdb

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14225

11 years agotake endianness into account in arm64 fpsr xfer,
Philippe Waroquiers [Thu, 31 Jul 2014 19:44:24 +0000 (19:44 +0000)] 
take endianness into account in arm64 fpsr xfer,
use VKI_LITTLE_ENDIAN to decide to reverse or not bytes in image function

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14223

11 years agoarm64: fix the conversion from/to VEX fpsr to/from GDB representation
Philippe Waroquiers [Thu, 31 Jul 2014 17:55:27 +0000 (17:55 +0000)] 
arm64: fix the conversion from/to VEX fpsr to/from GDB representation

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14219

11 years agocfsi_m_ix array should only be indexed according to sizeof_m_ix,
Philippe Waroquiers [Thu, 31 Jul 2014 16:44:51 +0000 (16:44 +0000)] 
cfsi_m_ix array should only be indexed according to sizeof_m_ix,
so decalre as a void*.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14218

11 years agoAdd support for stack unwinding using the ARM32 specific EXIDX format.
Julian Seward [Thu, 31 Jul 2014 14:25:29 +0000 (14:25 +0000)] 
Add support for stack unwinding using the ARM32 specific EXIDX format.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14217

11 years agoFix dangling ref in m_errormgr.c + report all uninit fields in a syscall param
Philippe Waroquiers [Wed, 30 Jul 2014 22:20:29 +0000 (22:20 +0000)] 
Fix dangling ref in m_errormgr.c + report all uninit fields in a syscall param

Some syscall verification code is allocating memory to generate
the string used to build an error, e.g. syswrap-generic.c verifying fields of
e.g socket addresses (pre_mem_read_sockaddr) or sendmsg/recvmsg args
(msghdr_foreachfield)

The allocated pointer was copied in the error created by VG_(maybe_record_error).

This was wrong for 2 reasons:
1. If the error is a new error, it is stored in a list of errors,
   but the string memory was freed by pre_mem_read_sockaddr, msghdr_foreachfield, ...
   This causes a dangling reference. Was at least visible when giving -v, which
   re-prints all errors at the end of execution.
   Probably this could have some consequences during run while generating new errors,
   and comparing for equality with a recorded error having a dangling reference.
2. the same allocated string is re-used for each piece/field of the verified struct.
   The code in mc_errors.c that checks that 2 errors are identical was then wrongly
   considereing that 2 successive errors for 2 different fields for the same syscall
   arg are identical, just because the error string happened to be produced at
   the same address.
(it is believed that initially, the error string was assumed to be a static
string, which is not the case anymore, causing the above 2 problems).

Changes:
* The fix consists in duplicating in m_errormgr.c the given error string when
  the error is recorded. In other words, the error string is now duplicated similarly
  to the (optional) extra component of the error.

* memcheck/tests/linux/rfcomm.c test modified as now an error is reported
  for each uninit field.

* socketaddr unknown family is also better reported (using sa_data field name,
  rather than an empty field name.

* minor reformatting in m_errormgr.c, to be below 80 characters.

Some notes:
1. the string is only duplicated if the error is recorded
   (ie. printed or the first time an error matches a suppression).
   The string is not duplicated for duplicated errors or following errors
   matching the first (suppressed) error.
   The string is also not duplicated for 'unique errors' (that are printed
   and then not recorded).
2. duplicating the string for each recorded error is not deemed to
   use a lot of memory:
     * error strings are usually NULL or short (often 10 bytes or so).
     * we expect no program has a huge number of errors
   If ever this string duplicate would be significant, having a DedupPoolAlloc
   in m_errormgr.c for these strings would reduce this memory (as we expect to
   have very few different strings, even with millions of errors).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14214

11 years agoFix copyright years.
Florian Krohm [Wed, 30 Jul 2014 18:40:52 +0000 (18:40 +0000)] 
Fix copyright years.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14211

11 years agoAnnounce now in NEWS that now all locks are announced.
Philippe Waroquiers [Tue, 29 Jul 2014 20:19:04 +0000 (20:19 +0000)] 
Announce now in NEWS that now all locks are announced.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14205

11 years agoHelgrind lock related error msg improvements.
Philippe Waroquiers [Tue, 29 Jul 2014 20:08:15 +0000 (20:08 +0000)] 
Helgrind lock related error msg improvements.

* Add lock announcements in various helgrind errors that were not
  announcing the locks
* ensure locks are also announced in xml (note that this is compatible
  with xml protocol version 4, so no impact on GUI which properly
  implement the protocol)

Changes done:
* Like other HG record_error functions, HG_(record_error_LockOrder) is
  now passing Lock* rather than lock guest addresses.
* update exp files for tests that were showing locks without announcing them
* change tc14_laog_dinphils.c and tc15_laog_lockdel.c so as to
  have same sizes on 32 and 64 bits systems for allocated or symbol sizes.
* factorise all code that was announcing first lock observation
* enable xml lock announcement

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14204

11 years agoBack out r14186 as it was identified to have caused a performance regression.
Florian Krohm [Tue, 29 Jul 2014 08:46:15 +0000 (08:46 +0000)] 
Back out r14186 as it was identified to have caused a performance regression.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14201

11 years agofix comment when calling get_sym_name()
Petar Jovanovic [Mon, 28 Jul 2014 15:52:04 +0000 (15:52 +0000)] 
fix comment when calling get_sym_name()

Fix incorrect comment, spotted by Florian K.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14199

11 years agoNo need to write the offset into a buffer when that
Florian Krohm [Sun, 27 Jul 2014 14:46:52 +0000 (14:46 +0000)] 
No need to write the offset into a buffer when that
buffer is not used.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14198

11 years agoglibc 2.3.4 does not appear to define PTRACE_GETSIGINFO. This was
Florian Krohm [Sun, 27 Jul 2014 12:24:46 +0000 (12:24 +0000)] 
glibc 2.3.4 does not appear to define PTRACE_GETSIGINFO. This was
observed on a RHEL5 system on s390. Provide a suitable definition.
Tweak gdbserver_tests/filter_stderr to ignore messages related to
interrupted poll system calls.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14197

11 years agoRemove two unneded include files.
Florian Krohm [Sat, 26 Jul 2014 17:26:22 +0000 (17:26 +0000)] 
Remove two unneded include files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14196

11 years agoFix a comment.
Florian Krohm [Sat, 26 Jul 2014 14:51:28 +0000 (14:51 +0000)] 
Fix a comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14195

11 years agoAdapt testcase so it can be compiled with GCC 3.4.6.
Florian Krohm [Sat, 26 Jul 2014 11:36:50 +0000 (11:36 +0000)] 
Adapt testcase so it can be compiled with GCC 3.4.6.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14194

11 years agoAdapt testcase so it can be compiled with GCC 3.4.6 against glibc 2.3.4
Florian Krohm [Sat, 26 Jul 2014 11:10:30 +0000 (11:10 +0000)] 
Adapt testcase so it can be compiled with GCC 3.4.6 against glibc 2.3.4

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14193

11 years agoHave m_addrinfo.c giving more details about an address in a text segment
Philippe Waroquiers [Fri, 25 Jul 2014 20:46:01 +0000 (20:46 +0000)] 
Have m_addrinfo.c giving more details about an address in a text segment
(using a fake 'one address' stack trace).

This a.o. can be used with the gdbsrv 'monitor v.info location 0x.....'
to compare gdb and valgrind address to source mapping.

Any tool that use pub_tool_addrinfo.h will also better descrive
text addresses.

No impact on tests, as there is no test testing 'segment' address
description :(

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14192

11 years agoAdd LIKELY as suggested by Philippe.
Florian Krohm [Fri, 25 Jul 2014 08:38:02 +0000 (08:38 +0000)] 
Add LIKELY as suggested by Philippe.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14191

11 years agoSmall follow up to lock address description: now that we describe
Philippe Waroquiers [Thu, 24 Jul 2014 22:30:08 +0000 (22:30 +0000)] 
Small follow up to lock address description: now that we describe
lock address, we can print something even if the lock observation
has no stacktrace.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14190

11 years agoRemove an unneeded function call.
Florian Krohm [Thu, 24 Jul 2014 21:14:52 +0000 (21:14 +0000)] 
Remove an unneeded function call.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14189

11 years agoDescribe the lock address in a lock announcement message.
Philippe Waroquiers [Thu, 24 Jul 2014 21:00:24 +0000 (21:00 +0000)] 
Describe the lock address in a lock announcement message.

(note that some error messages are not announcing the lock,
which is not that nice).
At least the lock order violation message do not announce locks.
That should be improved/fixed

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14188

11 years agoUpdate a comment so it won't need updating in the future.
Florian Krohm [Thu, 24 Jul 2014 19:26:32 +0000 (19:26 +0000)] 
Update a comment so it won't need updating in the future.
No functional change.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14187

11 years agoChange VG_(strncpy_safely) to use VG_(strncpy) to get the same padding
Florian Krohm [Thu, 24 Jul 2014 12:50:03 +0000 (12:50 +0000)] 
Change VG_(strncpy_safely) to use VG_(strncpy) to get the same padding
behaviour.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14186

11 years agoFactor out VG_(exit_now) to contain the syscall incantation to terminate
Florian Krohm [Thu, 24 Jul 2014 12:46:28 +0000 (12:46 +0000)] 
Factor out VG_(exit_now) to contain the syscall incantation to terminate
the process. Make ML_(am_exit) and VG_(exit) use it, thereby avoiding
double maintenance.
Introduce libcbase_assert macro and use it in VG_(strncpy_safely) to
document the case that function cannot handle.
Add stub functions to memcheck/tests/unit_libcbase.c to satisfy new
dependencies.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14185

11 years agoTrack vex r2910 (infrastructural improvements in representation of
Julian Seward [Thu, 24 Jul 2014 12:45:24 +0000 (12:45 +0000)] 
Track vex r2910 (infrastructural improvements in representation of
endianness in VEX).

In short: in m_machine.c, VG_(machine_get_hwcaps), get the endianness
of the host, and pass it through to all places (in VEX) where it is
required.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14184

11 years agooptimise readpdb.c filename and dirname handling, following r14158
Philippe Waroquiers [Wed, 23 Jul 2014 20:28:11 +0000 (20:28 +0000)] 
optimise readpdb.c filename and dirname handling, following r14158

r14158 introduced a dedup pool to store pairs (filename,dirname).
The windows debug info reader (readpdb.c) performance was still to be
improved, as calls to ML_(addFnDn) were done for each line loc to add.

With this patch, the nr of calls to ML_(addFnDn) should be reduced
significantly.

Code has been compiled and regtested on linux, but no windows/wine test
was done.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14183

11 years agoDocument fix of BZ#315199.
Tom Hughes [Wed, 23 Jul 2014 07:54:41 +0000 (07:54 +0000)] 
Document fix of  BZ#315199.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14182

11 years agoOutput details for the faulting thread first in a core dump.
Tom Hughes [Wed, 23 Jul 2014 07:54:19 +0000 (07:54 +0000)] 
Output details for the faulting thread first in a core dump.

Patch from Matthias Schwarzott via BZ#315199.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14181

11 years agoEnable test cases for:
Julian Seward [Tue, 22 Jul 2014 09:28:52 +0000 (09:28 +0000)] 
Enable test cases for:
{sqdmlal,sqdmlsl,sqdmull}{d_s_s[],s_h_h[]}
{sqdmlal,sqdmlsl,sqdmull}{d_s_s,s_h_h}
{sqdmlal,sqdmlsl,sqdmull}{2d_(2s_2s)/(4s_4s), 4s_(4h_4h)/(8h_8h)}
sqrdmulh 4s,2s,8h,4h (vector)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14180

11 years agoAdd a new heuristic 'length64' to detect interior pointers
Philippe Waroquiers [Mon, 21 Jul 2014 19:55:11 +0000 (19:55 +0000)] 
Add a new heuristic 'length64' to detect interior pointers
pointing at offset 64bit of a block, when the first 8 bytes contains
the block size - 8. This is e.g. used by sqlite3MemMalloc.

Patch by Matthias Schwarzott (with small modif)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14179

11 years agoTrack vex r2907, which amongst other things, renamed Iop_QDMulLong* to
Julian Seward [Mon, 21 Jul 2014 09:21:57 +0000 (09:21 +0000)] 
Track vex r2907, which amongst other things, renamed Iop_QDMulLong* to
Iop_QDMull*.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14178

11 years agoEnable tests for: sqneg, {u,s}q{add,sub} (scalar),
Julian Seward [Mon, 21 Jul 2014 09:20:53 +0000 (09:20 +0000)] 
Enable tests for: sqneg, {u,s}q{add,sub} (scalar),
{sqdmlal,sqdmlsl,sqdmull} (vector x element).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14177

11 years agoAdd configure check for arm64 user_regs_struct.
Mark Wielaard [Fri, 18 Jul 2014 20:45:37 +0000 (20:45 +0000)] 
Add configure check for arm64 user_regs_struct.

old glibc defined kernel user_pt_regs, but newer glibc instead
define user_regs_struct. Add a configure test to see what we need.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14176

11 years agoPatch adding (or showing the proper/not confusing) helgrind thread nr for block
Philippe Waroquiers [Fri, 18 Jul 2014 00:03:58 +0000 (00:03 +0000)] 
Patch adding (or showing the proper/not confusing) helgrind thread nr for block
and stack address description.

* A race condition on an allocated block shows the stacktrace, but
  does not show the thread # that allocated the block.
  This patch adds the output of the thread # that allocated the block.

*  The patch also fixes the confusion that might appear between
  the core threadid and the helgrind thread nr in Stack address description:
  A printed stack addrinfo was containing a thread id, while all other helgrind
  messages are using (supposed to use) an 'helgrind thread #' which
  is used in the thread announcement.

    Basically, the idea is to let a tool set a "tool specific thread nr'
    in an addrinfo.
    The pretty printing of the addrinfo is then by preference showing this
    thread nr (if it was set, i.e. different of 0).
    Currently, only helgrind uses this addrinfo tnr.

    Note: in xml mode, the output is matching the protocol description.
    I.e., GUI should not be impacted by this change, if they properly implement
    the xml protocol.

* Also, make the output produced by m_addrinfo consistent:
  The  message 'block was alloc'd at'  is changed to be like all other
  output : one character indent, and starting with an uppercase

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14175

11 years agoSimplify the code to get the function entry + avoids too many casts
Philippe Waroquiers [Thu, 17 Jul 2014 21:23:09 +0000 (21:23 +0000)] 
Simplify the code to get the function entry + avoids too many casts

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14174

11 years agoOmit frame pointer also for main in ppc ldst_multiple test.
Mark Wielaard [Thu, 17 Jul 2014 13:29:43 +0000 (13:29 +0000)] 
Omit frame pointer also for main in ppc ldst_multiple test.

Other functions already explicitly omitted the frame pointer. Also
do that for main to prevent gcc 4.8.2 complaining:

 ldst_multiple.c: In function ‘main’:
 ldst_multiple.c:180:5: error: frame pointer required, but reserved
  int main(void)
      ^
 ldst_multiple.c:31:18: note: for ‘r31’
  register HWord_t r31 asm("r31");

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14173

11 years agoppc64 ifunc_wrapper add casts suggested by gcc warning.
Mark Wielaard [Thu, 17 Jul 2014 10:56:26 +0000 (10:56 +0000)] 
ppc64 ifunc_wrapper add casts suggested by gcc warning.

vg_preloaded.c: In function ‘_vgnU_ifunc_wrapper’:
vg_preloaded.c:91:13: warning: assignment makes integer from pointer without a cast [enabled by default]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14172

11 years agoUnbreak ppc32 compilation (remove last usage of host_ppc32_regalign_int64_args)
Philippe Waroquiers [Thu, 17 Jul 2014 05:22:06 +0000 (05:22 +0000)] 
Unbreak ppc32 compilation (remove last usage of host_ppc32_regalign_int64_args)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14171

11 years agoFix name of the file in the header comment
Philippe Waroquiers [Wed, 16 Jul 2014 21:16:10 +0000 (21:16 +0000)] 
Fix name of the file in the header comment

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14170

11 years agoUpdate list of ignored files.
Florian Krohm [Wed, 16 Jul 2014 08:20:54 +0000 (08:20 +0000)] 
Update list of ignored files.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14169

11 years agoAdd testcase from BZ #324149 which was forgotten in r13641.
Florian Krohm [Wed, 16 Jul 2014 08:18:17 +0000 (08:18 +0000)] 
Add testcase from BZ #324149 which was forgotten in r13641.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14168