]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
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

11 years agoFix pointer qualifier discard warnings in memcheck/tests/varinforestrict.c.
Mark Wielaard [Tue, 15 Jul 2014 21:55:53 +0000 (21:55 +0000)] 
Fix pointer qualifier discard warnings in memcheck/tests/varinforestrict.c.

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

11 years agoproduce cfsi and str dedup pa at the same verbosity level
Philippe Waroquiers [Tue, 15 Jul 2014 19:46:15 +0000 (19:46 +0000)] 
produce cfsi and str dedup pa at the same verbosity level

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

11 years agoBug 336619 valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.
Mark Wielaard [Tue, 15 Jul 2014 15:47:25 +0000 (15:47 +0000)] 
Bug 336619 valgrind --read-var-info=yes doesn't handle DW_TAG_restrict_type.

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

11 years agoarm64: get_Dwarf_Reg: at least handle the case of requesting XSP
Julian Seward [Tue, 15 Jul 2014 15:22:41 +0000 (15:22 +0000)] 
arm64: get_Dwarf_Reg: at least handle the case of requesting XSP
instead of failing.  This makes some of the memcheck/tests/varinfo*
tests work somewhat correctly on arm64-linux.

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

11 years agoBug 337094 ifunc wrapper is broken on ppc64.
Mark Wielaard [Tue, 15 Jul 2014 15:07:01 +0000 (15:07 +0000)] 
Bug 337094 ifunc wrapper is broken on ppc64.

ppc64 uses function descriptors, so we need to get the actual function
entry address for the VG_USERREQ__ADD_IFUNC_TARGET client request, but
we need to return the function descriptor itself from the ifunc_wrapper.

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

11 years agoadd test cases for "LD1/ST1 (multiple 1-elem structs to/from 2 regs,
Julian Seward [Tue, 15 Jul 2014 11:09:51 +0000 (11:09 +0000)] 
add test cases for "LD1/ST1 (multiple 1-elem structs to/from 2 regs,
post index)" (16b only)

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

11 years agoSmall fixes in 'getting started' section of user manual
Philippe Waroquiers [Mon, 14 Jul 2014 22:04:17 +0000 (22:04 +0000)] 
Small fixes in 'getting started' section of user manual

* Mention --read-inline-info=yes as an alternative to compile without inlining.

* Mention that stabs debuginfo reader is not working anymore since 3.9.0

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

11 years agoSlightly refined the NEWS entry for silly/fishy args
Philippe Waroquiers [Mon, 14 Jul 2014 21:39:11 +0000 (21:39 +0000)] 
Slightly refined the NEWS entry for silly/fishy args

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

11 years agoThis patch decreases significantly the memory needed to store the lineloc info.
Philippe Waroquiers [Mon, 14 Jul 2014 21:20:57 +0000 (21:20 +0000)] 
This patch decreases significantly the memory needed to store the lineloc info.

On a big executable, the trunk needs:
dinfo: 134873088/71438336  max/curr mmap'd, 134607808/66717872 max/curr

With the patch, we have:
dinfo: 99065856/56836096  max/curr mmap'd,   97883776/51663656 max/curr

So, peak dinfo memory decreases by about 36Mb, and final by 15Mb.

(for info, valgrind 3.9.0 uses
dinfo: 158941184/109666304  max/curr mmap'd, 156775944/107590656 max/curr
So, compared to 3.9.0, dinfo peak decreases by about 40%, and the final
memory is divided by more than 2).

The memory decrease is obtained by:

* using a dedup pool to store filename/dirname pair for the loctab source/line
  information.
  As typically, there is not a lot of such pairs, typically a UShort is
  good enough to identify a fn/dn pair in a dedup pool.
  To avoid losing memory due to alignment, the fndn indexes are stored
  in a "parallel" array to the DiLoc loctab array, with entries having
  1, or 2 or 4 bytes according to the nr of fn/dn pairs in the dedup pool.
  See priv_storage.h comments for details.

  (there was a extensible WordArray local implementation in readdwarf.c.
   As with this change, we use an xarray, the local implementation was
   removed).

* the memory needed for --read-inline-info is slightly decreased (-2Mb)
  by removing the (unused) dirname from the DiInlLoc struct.
  Handling dirname for inlined function caller implies to rework
  the dwarf3 parser read_filename_table common to the var and inlinfo parser.
  Waiting for this to be done, the dirname component is removed from DiInlLoc.

* the stabs reader (readstabs.c) is broken since 3.9.0.
  For this change, the code has been updated to make it compile with the new
  DiLoc/FnDn dedup pool. As the code is completely broken, a vg_assert(0)
  has been put at the begin of the stabs reader.

* the pdb reader (readpdb.c) has been trivially updated and should still work.
  It has not been tested (how do we test this ?).
  A follow-up patch will be done to avoid doing too many calls to
  ML_(addFnDn) : instead of having one call per ML_(addLineInfo), one
  should have a single call done when reading the filename table.

This has also be tested in an outer/inner setup, to verify no
memory leak/bugs.

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

11 years agoProvide a back trace when a function argument of a known allocation
Florian Krohm [Sun, 13 Jul 2014 14:41:55 +0000 (14:41 +0000)] 
Provide a back trace when a function argument of a known allocation
function is presumably negative. Fixes BZ 79311.

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

11 years agodrd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug
Bart Van Assche [Sat, 12 Jul 2014 09:30:14 +0000 (09:30 +0000)] 
drd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug

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

11 years agoTrack vex r2891 (add Iop_Reverse1sIn8_x16). Unbreak build.
Florian Krohm [Fri, 11 Jul 2014 21:54:33 +0000 (21:54 +0000)] 
Track vex r2891 (add Iop_Reverse1sIn8_x16). Unbreak build.

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

11 years agoAnnounce fix for BZ #336957
Florian Krohm [Fri, 11 Jul 2014 21:32:23 +0000 (21:32 +0000)] 
Announce fix for BZ #336957

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

11 years agoUpdate list of ignored files.
Florian Krohm [Fri, 11 Jul 2014 20:48:30 +0000 (20:48 +0000)] 
Update list of ignored files.

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

11 years agoarm64: enable test cases for:
Julian Seward [Fri, 11 Jul 2014 12:06:24 +0000 (12:06 +0000)] 
arm64: enable test cases for:
{sli,sri} (vector & scalar), sqabs (vector & scalar)

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

11 years agoMove DRM ioctl handlers to the right places. Fixes r13486 breakage.
Tom Hughes [Thu, 10 Jul 2014 14:56:48 +0000 (14:56 +0000)] 
Move DRM ioctl handlers to the right places. Fixes r13486 breakage.

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

11 years agoAdd support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
Tom Hughes [Thu, 10 Jul 2014 14:50:06 +0000 (14:50 +0000)] 
Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.

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

11 years agoAdd support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
Tom Hughes [Thu, 10 Jul 2014 14:48:00 +0000 (14:48 +0000)] 
Add support for the F_OFD_SETLK, F_OFD_SETLKW, and F_OFD_GETLK fcntl
commands. BZ#337285.

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

11 years agoEnable test cases for: shll #imm, shrn #imm, rshrn #imm,
Julian Seward [Thu, 10 Jul 2014 14:23:16 +0000 (14:23 +0000)] 
Enable test cases for: shll #imm, shrn #imm, rshrn #imm,
{smlal,umlal,smlsl,umlsl,smull,umull} (elem)

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

11 years agoRollback the (functional) effect of 13944 and 14134
Philippe Waroquiers [Tue, 8 Jul 2014 22:28:26 +0000 (22:28 +0000)] 
Rollback the (functional) effect of 13944 and 14134
Re-opening the FIFO before closing it gives (difficult to understand)
problems => rollback the change that keeps the FIFO opened.
Rather handle the race condition by retrying at vgdb side.
See extensive comments in remote-utils.c

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

11 years agoApply text_debug_bias to inline IP extracted from dwarf3
Philippe Waroquiers [Tue, 8 Jul 2014 18:56:47 +0000 (18:56 +0000)] 
Apply text_debug_bias to inline IP extracted from dwarf3
Without this biasing, inline info is not correct for shared objects.
Updated test varinfo5 to use --read-inline-info=yes and added
an inline test case.
Note: the varinfo reader does not understand the inlining info, and
so variables in inlined functions are not properly described.

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

11 years agoAdd a 32-bit-process only suppression, for OSX 10.8. Equivalent to
Julian Seward [Tue, 8 Jul 2014 16:59:02 +0000 (16:59 +0000)] 
Add a 32-bit-process only suppression, for OSX 10.8.  Equivalent to
that of r14142 for 10.9.

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

11 years agoChange the default setting --partial-loads-ok from "no" to "yes"
Julian Seward [Tue, 8 Jul 2014 09:36:06 +0000 (09:36 +0000)] 
Change the default setting --partial-loads-ok from "no" to "yes"
for Mac OS only.  All other targets remain at "no".

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

11 years agoOSX 10.8/10.9: remove warning message.
Julian Seward [Tue, 8 Jul 2014 08:18:55 +0000 (08:18 +0000)] 
OSX 10.8/10.9: remove warning message.

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

11 years agoAdd a 32-bit-process-only suppression.
Julian Seward [Tue, 8 Jul 2014 08:10:14 +0000 (08:10 +0000)] 
Add a 32-bit-process-only suppression.

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

11 years agoMake sanity check errors before/after syscalls be fatal.
Julian Seward [Tue, 8 Jul 2014 08:05:02 +0000 (08:05 +0000)] 
Make sanity check errors before/after syscalls be fatal.

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

11 years agoAccuracy improvements to syscall wrappers for OSX 10.8 and 10.9.
Julian Seward [Tue, 8 Jul 2014 08:04:25 +0000 (08:04 +0000)] 
Accuracy improvements to syscall wrappers for OSX 10.8 and 10.9.

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

11 years agoOSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
Julian Seward [Tue, 8 Jul 2014 07:55:44 +0000 (07:55 +0000)] 
OSX 10.9/10.8: Debuginfo reading FSM: enable recording of r-- mappings
so as to enable arrival at acceptance states via calls to
VG_(di_notify_vm_protect).

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

11 years agoImprove debug printing for the should-we-load-debuginfo-now? finite
Julian Seward [Tue, 8 Jul 2014 07:50:19 +0000 (07:50 +0000)] 
Improve debug printing for the should-we-load-debuginfo-now? finite
state machine.  No functional change.

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

11 years agoDarwin only: don't tell aspacemgr about the kernel commpage -- only
Julian Seward [Tue, 8 Jul 2014 07:44:07 +0000 (07:44 +0000)] 
Darwin only: don't tell aspacemgr about the kernel commpage -- only
tell the tool.  This is because telling the aspacemgr about it causes
the sync checker to fail entirely on Darwin.

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

11 years agoAdd -Wno-tautological-compare to the standard compile flags, if that
Julian Seward [Tue, 8 Jul 2014 07:40:56 +0000 (07:40 +0000)] 
Add -Wno-tautological-compare to the standard compile flags, if that
is accepted.  With XCode 5.5.1 -Wtautological-compare appears to come
as standard, and it generates a lot of mostly useless noise.

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

11 years agoMark inline get function in image.c
Philippe Waroquiers [Sun, 6 Jul 2014 18:35:18 +0000 (18:35 +0000)] 
Mark inline get function in image.c
(called very often, and has a fast/slow case)
This slightly improve the performance of reading the image.

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

11 years agoFollow up to rev 13944
Philippe Waroquiers [Sat, 5 Jul 2014 18:43:24 +0000 (18:43 +0000)] 
Follow up to rev  13944
13944 objective was to avoid having a vgdb that connects to a just forked child
that would have the FIFO still opened, while its parent would close it.

However, in case a previous vgdb closed the FIFO, the read FIFO in the parent
is put in 'eof status' by the kernel. So, readchar will then return eof
in the parent unless another vgdb re-opens the FIFO in write.
So, gdbsrv does not stop anymore on error if needed, due to this readchar
giving eof.

The only way to reset this eof condition is to close the fd.
But we must always have the FIFO open (to avoid the race condition that
rev 13944 fixed)
=> in case of error, first re-open the FIFO, before closing the (previous)
FIFO fd (which is in eof state and cannot be properly used anymore).

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