Commit Graph

9873 Commits

Author SHA1 Message Date
Julian Seward
bcf0ffc341 is_stack_access: don't iterate over possibly non-existent stmts. This
has been observed to cause the JIT to segfault when using DRD on ARM.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13209
2012-12-27 17:46:10 +00:00
Florian Krohm
1887fb565e Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13208
2012-12-27 17:21:46 +00:00
Florian Krohm
60d31488c0 vbit-tester: In test_ternary_op return number of tests executed.
I don't recall gcc complaining about this. But clang did.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13205
2012-12-27 03:00:49 +00:00
Florian Krohm
22703eb26f Remove a fixme.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13204
2012-12-26 21:12:07 +00:00
Florian Krohm
3df5c8e140 valgrind side changes to support Iop_CmpExpD64 and Iop_CmpExpD128.
VEX buddy patch is r2617.
Enhance testcase for CEDTR and CEXTR. Adapt vbit tester.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
This is part of fixing BZ 307113.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13203
2012-12-26 17:48:46 +00:00
Florian Krohm
2efc27b98a Avoid compiler warning on ppc32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13202
2012-12-24 15:10:19 +00:00
Bart Van Assche
6ec551dd8b none/tests/process_vm_readv_writev: Avoid that compilation of this test program triggers a compiler warning
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13201
2012-12-24 11:14:08 +00:00
Bart Van Assche
ecc22dab2c drd/tests/pth_cond_destroy_busy: Correct expected output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13200
2012-12-24 10:43:15 +00:00
Bart Van Assche
3b50964baa drd/tests/pth_cond_destroy_busy: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13199
2012-12-24 10:23:16 +00:00
Bart Van Assche
7b1a5978c9 drd: Handle pthread_cond_destroy() failure properly
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13198
2012-12-24 10:22:14 +00:00
Florian Krohm
846c955f2a Updated for s390_defs.h.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13197
2012-12-24 00:16:23 +00:00
Florian Krohm
5bdda85fd8 s390: Add testcases for CDTR, CXTR, LDETR. LXDTR, LEDTR, LDXTR.
This is part of fixing BZ 307113.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13196
2012-12-23 16:17:18 +00:00
Florian Krohm
46ee8bb20a Companion patch to VEX r2605. Adds a few testcases and adapts the vbit
tester. This is part of fixing BZ #307113. 
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13195
2012-12-21 18:34:48 +00:00
Florian Krohm
20cee17e87 Fix mc_translate for Iop_D64toD32.
Spotted and fixed by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13193
2012-12-21 04:25:10 +00:00
Petar Jovanovic
b47835232b Minor style improvement over r13190.
Prerequisite should be non existence of a #define (rather than existence of
#undef in the comments).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13192
2012-12-21 02:15:23 +00:00
Petar Jovanovic
b282550dc1 Use different incorrect value in pth_detached3
The test pth_detached3 will crash on MIPS platform if the value passed to
pthread_detach is not correctly aligned. Thus, we change the value to be still
invalid but aligned.

This fixes the failure of drd/tests/pth_detached3 on MIPS32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13191
2012-12-20 19:02:17 +00:00
Petar Jovanovic
40644676b1 Introduce DISABLE_PTHREAD_SPINLOCK_INTERCEPT flag
The flag DISABLE_PTHREAD_SPINLOCK_INTERCEPT is set only for MIPS32, and it is
used in DRD and Helgrind as a workaround for the issue #311690.
In short, pthread_spin_lock implementation has local branches to the start of
the function which interferes with the redirection system in Valgrind that
assumes it has to redirect each call/branch to a particular address.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13190
2012-12-20 18:56:57 +00:00
Florian Krohm
3f257e267c Fix vbit tester for Iop_D32toD64 and Iop_D64toD32.
Spotted and fixed by Maran (maranp@linux.vnet.ibm.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13188
2012-12-19 04:21:09 +00:00
Julian Seward
cc3a364d25 Fix the configure check so that fair-sched works on Android too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13186
2012-12-17 14:46:48 +00:00
Julian Seward
cb9a68c127 With --stats=yes, also print TT/TC stats.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13185
2012-12-17 12:44:03 +00:00
Florian Krohm
056c9dd4d6 Fix an operator precedence error found by BEAM.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13184
2012-12-17 03:04:35 +00:00
Tom Hughes
4c791a86cb Make sure the stack pointer is properly aligned when invoking a
signal on amd64-linux systems.

The amd64 ABI describes the required alignment on function entry
as follows:

  "In other words, the value (%rsp − 8) is always a multiple
   of 16 when control is transferred to the function entry point. 

So we need to 16 byte align and then subtract an extra 8 bytes
to achieve the correct alignment.

Patch from fjgmacc@gmail.com to fix BZ#280114.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13182
2012-12-16 09:52:38 +00:00
Julian Seward
87d6d6fd1c Make memcheck/tests/stpncpy be dependent on the presence/absence of
stpncpy in libc, as determined by a configure test.  n-i-bz.
(Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13180
2012-12-14 10:30:57 +00:00
Julian Seward
4cbf48c509 Valgrind-side changes for new primop Iop_GetMSBs8x16, introduced in
vex r2590.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13179
2012-12-13 18:31:49 +00:00
Julian Seward
aa139347a2 Update somewhat.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13178
2012-12-13 15:26:53 +00:00
Julian Seward
f8919a049c On ARM: Don't be spooked by Puts to the translation-invalidation spec
when doing origin tracking, even though they are completely irrelevant.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13177
2012-12-13 15:17:40 +00:00
Julian Seward
0b16d79838 Add test cases for the UMAAL instruction.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13176
2012-12-12 00:17:33 +00:00
Florian Krohm
1bacf75bb2 Fix cut'n paste error spotted by Mark Wielaard.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13175
2012-12-11 13:21:27 +00:00
Florian Krohm
566b492554 Clean up the code for facility detection.
First, use STFLE whenever possible (i.e. for all facilities that
were introduced at the same time STFLE was or later). Turns out,
that is most facilities we're interesting in probing, except long
displacement.
Secondly, remove magic constants denoting facility bits and use
the definition from libvex_s390x_common.h
Thirdly, build up the debugging message that shows the status of
the probed facilities in a generic way so it won't have to be
changed when facilities are added.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13174
2012-12-09 17:30:45 +00:00
Florian Krohm
176d55867d Stop sending z10-ec nightly build messages to valgrind-developers
for two reasons:
(1) Those build logs appear to never have made it
(2) Sourceforge recently started spamming my inbox with 
    SMTP; 550 This message scored 19.5 points. Congratulations!


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13173
2012-12-09 15:39:43 +00:00
Florian Krohm
dde91ee9d7 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13172
2012-12-09 02:13:46 +00:00
Florian Krohm
8c76e43290 Make sys-openat test conditional upon the existence of AT_FDCWD.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13171
2012-12-08 19:26:03 +00:00
Philippe Waroquiers
1618b44d28 Fix 284540 and 307465
284540 Memcheck shouldn't count suppressions matching still-reachable allocations
307465 --show-possibly-lost=no should bring down the error count / exit code

Using the options --show-leak-kinds=kind1,kind2,.. and
--errors-for-leak-kinds=kind1,kind2,.., each leak kind (definite, indirect,
possible, reachable) can now be individually reported and/or counted as
an error.
In a leak suppression entry, an optional line 'match-leak-kinds:'
controls which leak kinds are suppressed by this entry.
This is a.o. useful to avoid definite leaks being "catched"
by a suppression entry aimed at suppressing possibly lost blocks.
Default behaviour is the same as 3.8.1

Old args (--show-reachable and --show-possibly-lost) are still accepted.

Addition of a new test (memcheck/tests/lks) testing the new args
and the new suppression line.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13170
2012-12-08 17:54:16 +00:00
Julian Seward
bb446d67bb Add documentation for --extra-debuginfo-path=. Relates to #310972.
(Alex Chiang, achiang@canonical.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13169
2012-12-07 08:40:16 +00:00
Florian Krohm
0641c1dded Identify opcodes that are not handled by the decoder in
guest_s390_toIR.c
Identify a few more duplicate mnemonics to avoid false messages
from the checker.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13168
2012-12-07 04:37:53 +00:00
Julian Seward
12a820fcbf Fix some gcc complaints about unused variables in these tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13167
2012-12-06 23:11:19 +00:00
Julian Seward
3e9eadf4b4 The Signedness Police visit a couple of outlying systems in the Delta
Quadrant.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13166
2012-12-06 22:41:47 +00:00
Julian Seward
5e1f44be3a Fix a const issue in r13154.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13165
2012-12-06 18:23:20 +00:00
Julian Seward
f192a5574d Make diagnostics for SIGILL more controllable (Valgrind part).
Fixes #309425.  (Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13164
2012-12-06 18:08:54 +00:00
Julian Seward
5ed1bb6a2f Add an intercept for stpncpy. Fixes #309427.
(Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13163
2012-12-06 17:54:33 +00:00
Julian Seward
8904839e87 Add intercepts for wcscpy, wcscmp, wcsrchr and wcschr on Linux.
Fixes #307828.  (Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13162
2012-12-06 17:16:00 +00:00
Julian Seward
11e11bb17a Use correct %rcx bit in the AVX feature check. Fixes #307285.
(Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13161
2012-12-06 16:38:50 +00:00
Julian Seward
5f8c0ab7ca When looking for a separate debug object, tolerate mismatched phdrs by
instead checking the shdrs:

  The separate .debug file has wrong phdrs. This isn't normally fatal
  since .debug files are never directly loaded. But since valgrind
  uses the phdrs to locate the build-id it will fail. The attached
  patch makes it so that the code falls back to using the shdrs to
  locate the NOTE sections so that the buildid can be matched anyway.

Fixes #305431.  (Mark Wielaard, mjw@redhat.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13160
2012-12-06 16:27:18 +00:00
Julian Seward
36468d9ae2 For sys-openat the dirfd argument should be ignored when the pathname
is absolute.  Fixes #307103.  (Mark Wielaard, mjw@redhat.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13159
2012-12-06 16:05:18 +00:00
Florian Krohm
14d5f7e33f Synch opcode list with <binutils>/opcodes/s390-opc.txt.
Fix some opcode categories (user space vs privileged operation)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13158
2012-12-06 05:04:35 +00:00
Florian Krohm
976cdf3374 Accept blank lines in <binutils>/opcodes/s390-opc.txt.
Bug fix: avoid reading something uninitialised


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13157
2012-12-06 05:03:08 +00:00
Florian Krohm
e83029ca76 Fix golden log.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13156
2012-12-06 03:56:14 +00:00
Julian Seward
29e608d6f9 Update with current bugs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13155
2012-12-05 23:00:02 +00:00
Julian Seward
4180623ef8 Add a new command line flag, --extra-debuginfo-path=path, that allows
specification of an extra directory in which to look for debuginfo
objects.  Fixes #310792.  (Alex Chiang, achiang@canonical.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13154
2012-12-05 22:15:14 +00:00
Philippe Waroquiers
35156f7ede fix 310424 --read-var-info does not properly describe static variables
This patch changes the way static variables are
recorded by readdwarf3.c (when giving --read-var-info=yes),
improving the way such variables are described.

Currently:
A static variable does not have the DW_AT_external tag.
So, readdwarf3.c does not consider it a global variable.
It is rather considered a "local" variable.
When it is recorded, it is associated to a range of program counters
(the functions in the file where it is visible).
However, even if the static variable is only visible
in the source file where it is declared, it can in reality
be used by any range of program counters, typically
by having the address of the local variable passed
to other functions.

Such local variable can then only be described
when the program counter is in the range of program
counters for which it has been recorded.
However, this (local) description is obtained
by a kludge in debuginfo.c (around line 3285).

This kludge then produces a strange description,
telling that the variable has been declared in
frame 0 of a thread (see second example below).

The kludge is not always able to describe
the address (if the IP of the tid is in another file than
where the variable has been declared).

I suspect the kludge can sometimes describe the var as being
declared in an unrelated thread
(e.g. if an error is triggered by tid 5, but tid1 is by
luck in an IP corresponding to the recorded range).


The patch changes the way a static variable is recorded:
if DW_AT_external tag is found, a variable is marked as global.
If a variable is not external, but is seen when level is 1,
then we record the variable as a global variable (i.e.
with a full IP range).
This improves the way such static variable are described:
* they are described even if being accessed by other files.
* their description is not in an artificial "thread frame".




First example:
**************
a variable cannot be described because it is
accessed by a function in another file:

with the trunk:
==20410== ----------------------------------------------------------------
==20410==
==20410== Possible data race during read of size 4 at 0x600F54 by thread #1
==20410== Locks held: none
==20410==    at 0x4007E4: a (abc.c:42)
==20410==    by 0x4006BC: main (mabc.c:24)
==20410==
==20410== This conflicts with a previous write of size 4 by thread #2
==20410== Locks held: none
==20410==    at 0x4007ED: a (abc.c:42)
==20410==    by 0x400651: brussels_fn (mabc.c:9)
==20410==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==20410==    by 0x4E348C9: start_thread (pthread_create.c:300)
==20410==
==20410== ----------------------------------------------------------------


with the patch:
==4515== ----------------------------------------------------------------
==4515==
==4515== Possible data race during read of size 4 at 0x600F54 by thread #1
==4515== Locks held: none
==4515==    at 0x4007E4: a (abc.c:42)
==4515==    by 0x4006BC: main (mabc.c:24)
==4515==
==4515== This conflicts with a previous write of size 4 by thread #2
==4515== Locks held: none
==4515==    at 0x4007ED: a (abc.c:42)
==4515==    by 0x400651: brussels_fn (mabc.c:9)
==4515==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==4515==    by 0x4E348C9: start_thread (pthread_create.c:300)
==4515==
==4515== Location 0x600f54 is 0 bytes inside global var "static_global"
==4515== declared at mabc.c:4
==4515==
==4515== ----------------------------------------------------------------


Second example:
***************
When the kludge can describe the variable, it is strangely described
as being declared in a frame of a thread, while for sure the declaration
has nothing to do with a thread
With the trunk:
==20410== Location 0x600f68 is 0 bytes inside local var "static_global_a"
==20410== declared at abc.c:3, in frame #0 of thread 1

With the patch:
==4515== Location 0x600f68 is 0 bytes inside global var "static_global_a"
==4515== declared at abc.c:3

#include <stdio.h>

static int static_global_a = 0; //// <<<< this is abc.c:3




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13153
2012-12-05 21:08:24 +00:00