Commit Graph

10891 Commits

Author SHA1 Message Date
Florian Krohm
75a8e9d1d4 Remove unused and possibly incorrectly defined macro.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14259
2014-08-11 15:21:11 +00:00
Florian Krohm
01727885d1 Remove unneeded include files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14258
2014-08-11 14:39:28 +00:00
Julian Seward
039cf7d64d 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
2014-08-11 13:59:49 +00:00
Philippe Waroquiers
7200525296 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
2014-08-10 10:42:10 +00:00
Bart Van Assche
c907d5f5a1 drd/tests/free_is_write: Reduce stack usage
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14254
2014-08-10 08:14:55 +00:00
Philippe Waroquiers
a8c13c73e7 arm64 does not implement fork syscall. Use clone instead
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14253
2014-08-09 21:51:45 +00:00
Florian Krohm
0c5d59ca77 Use mkstemp_format in VG_(mkstemp). That way nothing breaks should
the format change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14252
2014-08-09 21:45:56 +00:00
Florian Krohm
bc99780978 Fix type.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14250
2014-08-09 16:55:59 +00:00
Bart Van Assche
4662f1d8cc drd: Move VG_(getenv)("DRD_VERIFY_CONFLICT_SET")
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14249
2014-08-09 12:58:17 +00:00
Bart Van Assche
71c31d1f09 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
2014-08-09 12:47:17 +00:00
Philippe Waroquiers
c160835f7f 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
2014-08-09 11:26:51 +00:00
Carl Love
a63481696f 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
2014-08-08 22:29:10 +00:00
Philippe Waroquiers
0181f813d2 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
2014-08-08 22:11:41 +00:00
Bart Van Assche
8701c89a36 drd: Clear conflict set after fork (#338115)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14244
2014-08-08 16:27:30 +00:00
Bart Van Assche
6a597e577e drd/tests/threaded-fork-vcs: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14243
2014-08-08 16:20:13 +00:00
Bart Van Assche
6822f42ee1 drd: Add command-line option --verify-conflict-set
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14242
2014-08-08 16:17:58 +00:00
Julian Seward
86b5594465 Add missing comment marker.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14241
2014-08-08 08:58:03 +00:00
Carl Love
0689c096e5 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
2014-08-07 23:49:27 +00:00
Carl Love
98908947c7 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
2014-08-07 23:35:54 +00:00
Carl Love
914f75de32 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
2014-08-07 23:17:29 +00:00
Julian Seward
2cb7b2a820 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
2014-08-06 19:52:12 +00:00
Philippe Waroquiers
24e0fbf92a 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
2014-08-05 19:34:35 +00:00
Christian Borntraeger
00a31dd3d1 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
2014-08-05 15:14:52 +00:00
Bart Van Assche
67b975eb93 NEWS: Add #331829 (Unexpected ioctl opcode sign extension)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14234
2014-08-05 12:03:51 +00:00
Bart Van Assche
e7777bc867 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
2014-08-05 12:01:26 +00:00
Bart Van Assche
f47a931b8c 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
2014-08-05 11:35:48 +00:00
Julian Seward
a6f286d17d 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
2014-08-04 08:11:33 +00:00
Philippe Waroquiers
8854f37b63 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
2014-07-31 21:15:42 +00:00
Philippe Waroquiers
8a272f0a1c 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
2014-07-31 20:13:23 +00:00
Philippe Waroquiers
0d94ea9923 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
2014-07-31 19:44:24 +00:00
Philippe Waroquiers
4ab69c6dc7 arm64: fix the conversion from/to VEX fpsr to/from GDB representation
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14219
2014-07-31 17:55:27 +00:00
Philippe Waroquiers
0cc60a627e 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
2014-07-31 16:44:51 +00:00
Julian Seward
fdfada9f35 Add support for stack unwinding using the ARM32 specific EXIDX format.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14217
2014-07-31 14:25:29 +00:00
Philippe Waroquiers
eb2b193943 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
2014-07-30 22:20:29 +00:00
Florian Krohm
53ed8e8b74 Fix copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14211
2014-07-30 18:40:52 +00:00
Philippe Waroquiers
b63e95c189 Announce now in NEWS that now all locks are announced.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14205
2014-07-29 20:19:04 +00:00
Philippe Waroquiers
dd6256c019 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
2014-07-29 20:08:15 +00:00
Florian Krohm
90e7e07d7e Back out r14186 as it was identified to have caused a performance regression.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14201
2014-07-29 08:46:15 +00:00
Petar Jovanovic
2c6514c42f fix comment when calling get_sym_name()
Fix incorrect comment, spotted by Florian K.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14199
2014-07-28 15:52:04 +00:00
Florian Krohm
e15ffd7c60 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
2014-07-27 14:46:52 +00:00
Florian Krohm
1d58be2780 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
2014-07-27 12:24:46 +00:00
Florian Krohm
6b68ff1bdf Remove two unneded include files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14196
2014-07-26 17:26:22 +00:00
Florian Krohm
cc7bc87712 Fix a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14195
2014-07-26 14:51:28 +00:00
Florian Krohm
5866bd2a56 Adapt testcase so it can be compiled with GCC 3.4.6.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14194
2014-07-26 11:36:50 +00:00
Florian Krohm
282aac6b09 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
2014-07-26 11:10:30 +00:00
Philippe Waroquiers
151d27b101 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
2014-07-25 20:46:01 +00:00
Florian Krohm
dbeb165518 Add LIKELY as suggested by Philippe.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14191
2014-07-25 08:38:02 +00:00
Philippe Waroquiers
9a5cacfa97 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
2014-07-24 22:30:08 +00:00
Florian Krohm
1b15a83afa Remove an unneeded function call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14189
2014-07-24 21:14:52 +00:00
Philippe Waroquiers
682b5ddd63 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
2014-07-24 21:00:24 +00:00