Commit Graph

9852 Commits

Author SHA1 Message Date
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
Philippe Waroquiers
32f5a1eb3a Fix missing in EXTRA_DIST errors reported by check_makefile_consistency
memcheck/tests/amd64/Makefile.am:1: error: insn-bsfl.stderr.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-bsfl.stdout.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-bsfl.vgtest is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pcmpistri.stderr.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pcmpistri.stdout.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pcmpistri.vgtest is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pmovmskb.stderr.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pmovmskb.stdout.exp is missing in EXTRA_DIST
memcheck/tests/amd64/Makefile.am:1: error: insn-pmovmskb.vgtest is missing in EXTRA_DIST
none/tests/s390x/Makefile.am:1: error: dfp-1.stderr.exp is missing in EXTRA_DIST
none/tests/s390x/Makefile.am:1: error: dfp-1.stdout.exp is missing in EXTRA_DIST
none/tests/s390x/Makefile.am:1: error: dfp-1.vgtest is missing in EXTRA_DIST



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13152
2012-12-05 20:20:25 +00:00
Florian Krohm
e4f15fd479 Update opcode table: add new insns for zEC12
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13151
2012-12-05 04:21:41 +00:00
Florian Krohm
d5b0b4d67f Beef up testcase. Announce fix.
Part of fixing BZ 310931.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13150
2012-12-04 04:46:52 +00:00
Florian Krohm
fbf7bb8f00 Probe host for conditional load/store facility.
New hwcaps: VEX_HWCAPS_S390X_LSCOND


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13149
2012-12-03 13:33:03 +00:00
Petar Jovanovic
516de0bcd6 Correctly skip memcheck's getregset for MIPS.
Previous change r13145 incorrectly disables getregset test for all architectures
rather than just for MIPS arch. Issue spotted by Bart Van Assche and reported on
the list.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13148
2012-12-03 00:31:42 +00:00
Florian Krohm
5ac3ca3774 Update opcode status. Announce fix for BZ #306035.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13147
2012-12-02 21:34:57 +00:00
Florian Krohm
7e7f7094d4 Add testcase for LAA insn.
Patch by Divya Vyas (divyvyas@linux.vnet.ibm.com).
Part of fixing BZ #306035.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13146
2012-12-02 20:58:45 +00:00
Petar Jovanovic
a167c7a54d Skip memcheck's getregset for MIPS.
Skip the getregset test for MIPS since we still does not have TRACEHOOK
support in MIPS kernel for it, and that is needed to support PTRACE_GETREGSET.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13145
2012-12-02 03:37:36 +00:00
Philippe Waroquiers
73eaf6f265 Improve FAQ section discussing statically linked lib
Valgrind 3.8.1 can work with statically linked lib or alternative
malloc libs.
Ensure FAQ properly describe this.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13144
2012-11-28 18:12:57 +00:00
Josef Weidendorfer
840c6d8437 Before LL, instrument outstanding helper calls.
Callgrind, Cachegrind, and Lackey call
helpers for memory accesses in bunches, to reduce
register save/restore overhead (and merge load/store
within same instruction into a "modify" event).

The calls should not be done within a RMW section
enclosed by LL/SC instructions, as this reduces the
chance of SC to succeed, and can result in hangs.
For Callgrind, this definitly helped MIPS, and was
committed in r13136. Do the same for Cachegrind/Lackey.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13143
2012-11-26 18:16:58 +00:00
Florian Krohm
e7f4d4f57f Fix some casts that removed const-ness as pointed out by
GCC's -Wcast-qual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13138
2012-11-24 19:41:54 +00:00
Florian Krohm
af66466ce4 Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137
2012-11-23 16:17:43 +00:00
Petar Jovanovic
e2110c0f00 Flush events in Callgrind before enering a RMW region.
On some MIPS platforms, we had an issue in which SC would fail each time
due to some memory access occuring in the RMW region.
If code for simulator events is called before LL, it can help SC to pass.

This change fixes a few LL/SC issues on MIPS arch.

The patch by Josef Weidendorfer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13136
2012-11-23 00:01:36 +00:00
Florian Krohm
392c9a9492 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13135
2012-11-22 18:57:29 +00:00
Julian Seward
8f2861e59b Another signedness fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13134
2012-11-22 11:07:04 +00:00
Julian Seward
831cf1f43b Fix up another char-signedness straggler.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13133
2012-11-22 10:48:20 +00:00
Julian Seward
f971b6f346 Add test cases for definedness propagation through PCMPISTRI $0x3A.
#309921, comment 7.  (Patrick J. LoPresti, lopresti@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13132
2012-11-20 15:25:32 +00:00
Josef Weidendorfer
635fe22514 Remove not-used typedef
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13131
2012-11-19 22:05:08 +00:00
Josef Weidendorfer
39cea8c6da Callgrind: fix Ir cost update for ignored functions
Also without cache simulation, Callgrind maintains Ir cost.
This is done in setup_bbcc by incrementing an execution counter
for last_bbcc (the cost center for the previously executed BB
in current context) and the global cost counter.

However, we forgot to increment any counter if the currently
executing function should be ignored. We need to still update
costs, add attribute this to a not-ignored call site (as
given in CLG_(current_state).nonskipped).

Before this fix, there was a difference in Ir cost with vs. without
cache simulation. This was because ignored functions (e.g. PLT code)
contributed no cost when not doing cache simulation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13130
2012-11-19 22:05:06 +00:00
Julian Seward
0395372b49 Add test cases for dependency tracking through pmovmskb and bsfl.
Part of #308627.  (Patrick J. LoPresti, lopresti@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13129
2012-11-19 15:12:07 +00:00
Julian Seward
6f44cae342 Fix a couple of x86 char-signedness stragglers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13128
2012-11-19 14:55:15 +00:00