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

11 years agoReplace copy/pasted loop of the "range search" by doing a -1 in the loop
Philippe Waroquiers [Sat, 5 Jul 2014 18:37:38 +0000 (18:37 +0000)] 
Replace copy/pasted loop of the "range search" by doing a -1 in the loop
for the "equal" case.

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

11 years agoSmall fixes/improvements post-cfsi_m improvement
Philippe Waroquiers [Sat, 5 Jul 2014 14:07:43 +0000 (14:07 +0000)] 
Small fixes/improvements post-cfsi_m improvement
* Avoid printing the size of a null dedup pool
* Avoid warnings of 2 unused variables on some platforms

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

11 years agoNEWS: Mention #336772, --default-suppressions and the std::thread update in the drd...
Bart Van Assche [Sat, 5 Jul 2014 06:52:48 +0000 (06:52 +0000)] 
NEWS: Mention #336772, --default-suppressions and the std::thread update in the drd manual

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

11 years agoSmall comment fix for the UInt* cfsi_m index : 4 instead of 3
Philippe Waroquiers [Fri, 4 Jul 2014 22:52:01 +0000 (22:52 +0000)] 
Small comment fix for the UInt* cfsi_m index : 4 instead of 3

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

11 years agoThis patch decreases significantly the memory needed to store the cfsi info.
Philippe Waroquiers [Fri, 4 Jul 2014 22:36:38 +0000 (22:36 +0000)] 
This patch decreases significantly the memory needed to store the cfsi info.

On a big executable, the trunk needs:
dinfo: 155844608/106737664  max/curr mmap'd 155572624/102276760 max/curr

With the patch, we have:
dinfo: 134873088/70389760  max/curr mmap'd 134607808/66717512 max/curr

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

The memory decrease is obtained by:

* using a dedup pool to store the machine dependent part (cfsi_m)
  of the cfsi information as this information is highly duplicated.
  For x86 and arm64, the duplication factor of cfsi machine dependent
  part is very high (up to a factor 60).
  For arm64, it is more like a factor 3.
  A 'variable size' (1, 2 or 4 bytes) is automatically used to identify
  the cfsi_m, if there is less than or more than 255/64K different cfsi_m.

* not storing explicitely the length of a range for which a cfsi_m
  is to be used: in a large majority of the cases, ranges are
  consecutive, and so the end of a range is just one byte before
  the start of the next range.
  So, we do not store the length of the ranges.
  If there is a hole between 2 ranges, the hole is stored explicitely
  as a range in which we have no cfsi_m information.
  On x86 and amd64, we have quite some holes (something like one hole
  every 7 cfsi). On arm64, we have very few holes (less than one hole
  every 50 cfsi).
  Even with the nr of holes on x86/amd64, it is more memory efficient
  to store the holes rather than to store the length of each cfsi.

* Merging consecutive ranges that have the same cfsi_m info:
  Many cfsi are "mergeable": there is no hole between 2 cfsi, and their
  machine dependent part is identical
  (I guess the unwind info needed by valgrind is subset of the full
   unwind info, and so, the cfsi entries are not merged by the compiler,
   but can be merged for simple unwind). Depending on the platform
   (x86, amd64, arm64) and of the library/object file, we can have a
   significant nr of mergeable entries.

The patch is not very small, but a lot is mechanical changes.

The patch has been compiled and tested on x86/amd64/ppc32/ppc64
(but ppc does not use cfsi so that just verifies it compiles).
It has been compiled on arm64, and "tested" by launching valgrind on
one executable.
It has not been compiled on s390 and mips.
With some luck, maybe it will compile on these platforms.
And if that uses the whole provision of luck for 2014, it might even work
on these platforms :).
If it does not compile, the fix should be straightforward.
Runtime problems might be more tricky (but arm64 "worked out of the box"
once x86/amd64 were ok).

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@14129

11 years agoShadow registers wronly shown by gdb on avx machine
Philippe Waroquiers [Fri, 4 Jul 2014 21:53:29 +0000 (21:53 +0000)] 
Shadow registers wronly shown by gdb on avx machine
For an unclear reason, the orig_rax register and its shadows are described in the
xml file using a register number.
This register number is correct on non avx machine, but is wrong on
avx machine, as these have more registers, which means that orig_raxs1 and s2
should have different numbers.

As no reason was found to have a register number explicitely give, remove this
regnnr from the xml file, and let gdb calculate it.

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

11 years agoFix a bug in the "numbering" dedup pool: as indicated in
Philippe Waroquiers [Fri, 4 Jul 2014 20:40:02 +0000 (20:40 +0000)] 
Fix a bug in the "numbering" dedup pool: as indicated in
pub_tool_deduppoolalloc.h, for "numbering" pool, there is no guarantee
that the address of an element is stable if a new element is inserted.
But m_deduppoolalloc.c was itself not taking this 'no guarantee' into account.
So, when the addresses of the elements are changed due to reallocation
of the only pool, apply an offset to the element addresses stored in
the dedup hash table.

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

11 years agoSilence a compiler warning as issued by certain versions of GCC.
Florian Krohm [Thu, 3 Jul 2014 08:23:23 +0000 (08:23 +0000)] 
Silence a compiler warning as issued by certain versions of GCC.

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

11 years agoAdd forgotten .exp file. Should have been prt of r14124.
Florian Krohm [Tue, 1 Jul 2014 08:03:16 +0000 (08:03 +0000)] 
Add forgotten .exp file. Should have been prt of r14124.

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

11 years agoUpdate the C++ demangler by importing files from GCC trunk @ 212125.
Florian Krohm [Mon, 30 Jun 2014 21:04:16 +0000 (21:04 +0000)] 
Update the C++ demangler by importing files from GCC trunk @ 212125.
Add a smoke test for the demangler and update the helper script.

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

11 years agoAdd 'numbering identification' to the dedup pool.
Philippe Waroquiers [Mon, 30 Jun 2014 20:58:32 +0000 (20:58 +0000)] 
Add 'numbering identification' to the dedup pool.

The dedup pool can now be used to allocate elements and identify
them with a number rather than an address.

This new feature is not used (yet) but is intended to be used to
decrease the memory needed to store the CFSI information.

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

11 years agoImplement VG_(arena_realloc_shrink) similar to realloc, but can
Philippe Waroquiers [Mon, 30 Jun 2014 19:47:24 +0000 (19:47 +0000)] 
Implement VG_(arena_realloc_shrink) similar to realloc, but can
only decrease the size of a block, does not change the address,
does not need to alloc another block and copy the memory,
and (if big enough) makes the excess memory available for other
allocations.

VG_(arena_realloc_shrink) is then used for debuginfo storage.c
(replacing an allocation + copy).
Also use it in the dedup pool, to recuperate the unused
memory of the last pool.
This also allows to re-increase the string pool size to the original
3.9.0 value of 64Kb. All this slightly decrease the peak and in use
memory of dinfo.

VG_(arena_realloc_shrink) will also be used to implement (in another patch)
a dedup pool which "numbers" the allocated elements.

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

11 years agoarm64:
Julian Seward [Mon, 30 Jun 2014 07:35:19 +0000 (07:35 +0000)] 
arm64:
Add support for checking FPSR.QC effects of each instruction.
Implement: sadalp uadalp saddlp uaddlp saddlv uaddlv saddw{2} uaddw{2}
ssubw{2} usubw{2} shadd uhadd shsub uhsub sqadd uqadd sqsub uqsub
smaxp umaxp sminp uminp

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

11 years agoTrack vex r2894 (representation changes to arm64 FPSR)
Julian Seward [Sat, 28 Jun 2014 22:12:34 +0000 (22:12 +0000)] 
Track vex r2894 (representation changes to arm64 FPSR)

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

11 years agoEnable test cases for: sabal uabal sabdl uabdl saddl uaddl ssubl usubl
Julian Seward [Sat, 28 Jun 2014 12:22:22 +0000 (12:22 +0000)] 
Enable test cases for: sabal uabal sabdl uabdl saddl uaddl ssubl usubl
smlal umlal smlsl umlsl smull umull

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

11 years agoUpdate Subversion ignore lists
Bart Van Assche [Sat, 28 Jun 2014 07:40:20 +0000 (07:40 +0000)] 
Update Subversion ignore lists

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

11 years agoMake none/tests/filter_ioctl_moans executable
Bart Van Assche [Sat, 28 Jun 2014 07:39:47 +0000 (07:39 +0000)] 
Make none/tests/filter_ioctl_moans executable

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