1612 Commits

Author SHA1 Message Date
Julian Seward
97b2e2d175 * rename the memcheck/tests/amd64/sh-mem-vec128*stderr.exp* files
so as to specify an endianness
* add two missing symlinks


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13492
2013-08-12 11:47:52 +00:00
Julian Seward
2666efe140 Add test cases for 128-bit shadow loads with --partial-loads-ok={yes,no}
in such a way that they can be shared across targets that support 128 bit
loads, as required.  amd64 only right now.  Adds memcheck/tests/common
to hold this stuff.  Bug #294285.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13491
2013-08-12 10:42:49 +00:00
Carl Love
2313dbf69e The following instructions were introduced in the Power ISA 2.05
(i.e., POWER6) - lfdp - stfdp - lfdpx - stfdpx These instructions were promptly
deprecated (phased out) in ISA 2.06 (i.e., POWER7). Recent updates in binutils
no longer supports these instructions unless the assembler is invoked with
'-mpower6'. When 'make check' is run on valgrind when using such a newer
binutils and running on a ppc64 system newer than POWER6, you get the
following build error:
y
pc64_linux=1 -DVGPV_ppc64_linux_vanilla=1 -DVGA_SEC_ppc32=1 -DVGP_SEC_ppc64_linux=1 -Winline -Wall -Wshadow -g -Winline -Wall -Wshadow -g -I../../../include -m64 -Wno-long-long -Wwrite-strings -fno-stack-protector -Wno-write-strings -MT power_ISA2_05-power_ISA2_05.o -MD -MP -MF .deps/power_ISA2_05-power_ISA2_05.Tpo -c -o power_ISA2_05-power_ISA2_05.o `test -f 'power_ISA2_05.c' || echo './'`power_ISA2_05.c
/tmp/cciGIkGG.s:Assembler messages:
/tmp/cciGIkGG.s:387: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:387: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:387: Error: junk at end of line: `,9'
/tmp/cciGIkGG.s:478: Error: operand out of domain (31 is not a multiple of 4)
/tmp/cciGIkGG.s:478: Error: syntax error; found `,', expected `('
/tmp/cciGIkGG.s:478: Error: junk at end of line: `,9'
make[2]: *** [power_ISA2_05-power_ISA2_05.o] Error 1
make[2]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/tmp/Valgrind_review/valgrind_ISA2_05/memcheck/tests/ppc64' make: *** [check-recursive] Error 1

This patch fixes the problem by adding a configure check to determine if these
phased out instructions are supported by the binutils, and the result of that
configure check is used to decide whether or not to compile in the source for
testing these instructions.

Bugzilla 323116

committed by Carl Love, carll@us.ibm.com

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13490
2013-08-09 21:55:45 +00:00
Julian Seward
9ae14ce848 A comprehensive test case for 128 bit shadow vector loads in the case
of partial addressibility, for --shadow-loads-ok=yes and =no.  Not
portable and not hooked up to the test/build system yet.

Pertains to #294285.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13489
2013-08-08 10:56:08 +00:00
Julian Seward
f865a853ee Fix # 294285: --partial-loads-ok does not work for 16-byte SSE loads
(core fixes for the memcheck handling of 128 bit loads)
(Patrick J. LoPresti, lopresti@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13488
2013-08-08 10:41:46 +00:00
Dejan Jevtic
78ae0356c4 mips32: Add support for mips32 DSP instruction set.
Add support for mips32 DSP and DSP revision 2 ASE.
More details about the mips32 DSP(r2) ASE:
http://www.mips.com/media/files/MD00566-2B-MIPSDSP-QRC-01.00.pdf
Applied patch provided by Maja Gagic <maja.gagic@rt-rk.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13470
2013-07-25 08:22:08 +00:00
Philippe Waroquiers
4c9052b4d6 fix incorrect lineno in supp error msgs+ -v give filename+lineno of used supp.
If a suppression file contains an error, the lineno reported could be wrong.
Also, give filename and lineno of the used suppressions in -v debugging output.

The fix consists in ensuring that tool specific read_extra function gets
the Int* lineno pointer, together with other VG_(get_line) parameters.






git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13469
2013-07-22 22:00:13 +00:00
Philippe Waroquiers
3168fa1e2a fix 321960 pthread_create() then alloca() causing invalid stack write errors
Problem created by a discrepancy between the initial main stack
anon segment, and the main stack registered in m_stacks.c

Looking at some tracing; we see that there are two pages of stack:
--9078:2:main       tell tool about 0ffefff000-0fff000fff rw-
The stack between the base and the current sp is marked as not accessible:
--9078:2:main       mark stack inaccessible 0ffefff000-0fff0004bf

This is matching the aspacemgr view:
--9078:1:aspacem   22: RSVN 0ffe801000-0ffeffefff 8380416 ----- SmUpper
--9078:1:aspacem   23: anon 0ffefff000-0fff000fff    8192 rw---
(all the above is normal/as expected)


However, the main stack is registered in m_stacks.c as having only one page:
--9078:2:stacks     register 0xFFF000000-0xFFF000FFF as stack 0

When the main stack is grown, m_stacks.c is informed by m_signals.c
that the stack is grown. This is done by trapping the signal 11
when a not mapped page is accessed.
However, the 2nd page does not cause a signal (as it is mapped).
So, m_stacks.c still believes the main has one page stack.
This then gives problems in the tracking of the SP and current_stack
in m_stacks.c.

Only one page was registered for the main stack, as the registration
was done with values computed before possibly adding a page
needed for the ABI redzone.

The fix is to properly register the main stack with the size of
the stack segment, once all aspects have been taken into account.
With the fix, the stack is registered as:
--31501:2:stacks     register 0xFFEFFF000-0xFFF000FFF as stack 0

  Another possible fix would be to always register the main stack with the
  full size of the aspacemgr stack segment (i.e. the anon+RSVN above)
  (idea is that this is similar to non main threads, for which the
  full thread stack is registered from the beginning, even if not fully
  used yet).
  The first fix was preferred, assuming it is better to keep registering
  the main stack "physical" size (and not its maximal size).


Test memcheck/tests/thread_alloca added, based on reproducer
done by Daniel Stodden.
The bug might be triggered or not depending on the initial value
of the SP, which is influenced by the size of the "env".
So, the test execs itself, growing each time the environment.
This has given a reasonable chance/way to reproduce the bug on Ubuntu 12
and on a Debian 6.
(tested on amd64/Ubuntu 12 and Debian 6
           x86/fedora12
           ppc64/fedora18

Note that while investigating this bug, another strange thing was seen:
thread stacks are registered in m_stacks.c but are never unregistered.
It is not very clear that it is needed or not to unregister them:
thread stack segments are not freed when a thread terminates :
when a thread slot is re-used, its thread stack will also be re-used.
(Is that good for address space mgt ? A process that has created many
temporary threads will have the thread stacks lost forever ???).

 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13467
2013-07-21 16:04:05 +00:00
Dejan Jevtic
d367666464 mips64: Add a test case for mips64.
Add a function in the memcheck/tests/leak-segv-jmp.c for MIPS64
that execute the syscall. Because we added the mips64 case we 
need to change the line number in *.exp file.
Fixes memcheck/tests/leak-segv-jmp for MIPS64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13456
2013-07-17 09:34:51 +00:00
Julian Seward
48f0d5bfbe Handle Iop_QAdd16Ux2. Needed for recent ARM v6media additions committed
in vex r2731.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13446
2013-07-04 20:37:33 +00:00
Florian Krohm
849b105814 valgrind side changes to support the new IRops introduced
in VEX r2727 (conversion ops between binary floating point and
decimal floating point).
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13428
2013-06-17 19:04:24 +00:00
Florian Krohm
ceccc0771e More comment only changes as the "DFP rounding mode" has been removed.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13421
2013-06-06 21:21:46 +00:00
Florian Krohm
feeb97b9c8 Comment only changes: IRRoundingModeDFP -> IRRoundingMode.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13419
2013-06-06 19:13:29 +00:00
Petar Jovanovic
c195593e52 update cond_ld_st test and expected outputs
Line numbers are off by one in some outputs since it differs on GCC version
how it will map source code to line number for the ternary operator written
in multiple lines.
This is small fix that replaces one occurrence of ternary operator with
if-then-else. The excepted outputs have been changed accordingly.

This fixes the test memcheck/tests/cond_ld_st for different platforms with
different GCC versions.

Tested on x86, i386, ARM, MIPS32, and MIPS64.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13415
2013-06-02 03:22:28 +00:00
Florian Krohm
7b5334ad4c s390x: The CC_DEP1 field is accessed as a whole or bits [0:31]
in case the field holds a 32-bit floating point value.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ 307113.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13413
2013-05-31 15:44:06 +00:00
Mark Wielaard
86f74d6026 Support Linux kernel AF_BLUETOOTH for bind().
Bug #320116. sockaddr_rc might contain some padding which might not be
initialized. Explicitly check the sockaddr_rc fields are set. That also
produces better diagnostics about which field is unitialized.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13404
2013-05-22 10:21:10 +00:00
Petar Jovanovic
8ad78e7e2f exp files for cond_ld and cond_st for 32-bit architectures
This fixes:
- memcheck/tests/cond_ld and
- memcheck/tests/cond_st

for 32-bit non-ARM architectures. Tested on IA32 and MIPS32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13401
2013-05-20 15:39:11 +00:00
Petar Jovanovic
54992859d7 mips: atomic_add_8bit and atomic_add_16bit for MIPS64-BE
It fixes memcheck/tests/atomic_incs on MIPS64-BE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13399
2013-05-14 13:33:27 +00:00
Julian Seward
77e6f16706 Fix incorrect filenames for the cond_ld_st tests.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13398
2013-05-13 13:27:00 +00:00
Julian Seward
cc44df221f cond_ld_st: Split the non-arm expected outputs into 32- and 64-bit
versions, since they will be different.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13395
2013-05-13 09:13:04 +00:00
Julian Seward
9c5edc6cb9 memcheck/tests/cond_ld_st: add expected outputs for ARM, where
we are using real conditional load/store instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13394
2013-05-13 08:35:19 +00:00
Julian Seward
8845cb1355 Fix up output filtering for cond_st so that the stacks are
actually present.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13393
2013-05-13 08:28:31 +00:00
Julian Seward
25c2291974 Add test cases for instrumentation of IR-level loads and stores.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13392
2013-05-12 11:07:59 +00:00
Julian Seward
6f2565de0e Whitespace-only changes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13391
2013-05-12 10:43:31 +00:00
Julian Seward
26ec2b06c1 complainIfUndefined: reinstate the 3rd argument (guard) so as to make
the definedness check and possible shadow temp set-to-defined be
optional.  Use this to properly instrument IRLoadG and IRStoreG, so
that if the load/store does not happen, not only is the validity of
the address not checked, neither is the definedness.

This fixes a regression introduced by the COMEM branch on ARM, in
which conditional loads/stores with addresses which are undefined at
runtime and with guards which are false, would generate false errors.

Also extensively re-checked the check-generation machinery and updated
a bunch of comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13386
2013-05-11 13:42:08 +00:00
Florian Krohm
1260ec88fa valgrind side support for
Iop_F64toD64, Iop_D64toF64
Iop_F64toD128, Iop_D128toF64,
Iop_F128toD128, Iop_D128toF128

Companion patch of VEX r2717.
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13382
2013-05-05 15:05:42 +00:00
Julian Seward
2582e074ba Whitespace changes only -- no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13377
2013-04-23 12:15:37 +00:00
Mark Wielaard
bca0cb2aa5 strchr.vgtest mc_replace_strmem.c [r]index and [__GI_]str[r]chr are the same.
Add memcheck/tests/filter_strchr to make it so for the testcase.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13370
2013-04-17 15:23:22 +00:00
Mark Wielaard
b81e3c86b6 Fix double 'the the' in documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13363
2013-04-05 13:19:12 +00:00
Philippe Waroquiers
a36350923b temporarily disable memalign part of the undef_malloc_args.c test
as this is breaking Darwin.

A better fix should follow



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13362
2013-04-05 12:53:16 +00:00
Philippe Waroquiers
a819df9d0a Solve false negative for various malloc replaced functions arguments
The replacement functions are running on the simulated CPU.
The code on the simulated CPU does not necessarily use
all arguments. E.g. args can be ignored and/or only given
to a NON SIMD call.
The definedness of such 'unused' arguments will not be verified
by memcheck.
A call to 'trigger_memcheck_error_if_undefined' allows 
memcheck to detect such errors for the otherwise unused args.
Apart of allowing memcheck to detect an error, the function
trigger_memcheck_error_if_undefined has no effect and
has a minimal cost for other tools replacing malloc functions.

(suggestion of the 'no operation check' from Julian).

tested on f12/x86, debian6/amd64, f18/ppc64
Note that some Darwin specific code has been modified
in coregrind/m_replace_malloc/vg_replace_malloc.c.
(Some of) this code has not been compiled (no access to a
Darwin system). The code changed is trivial, so there is
some chance it will compile and even maybe work.

Added a new test verifying that various malloc related
functions undefined args are triggering an error in memcheck.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13361
2013-04-04 21:10:22 +00:00
Petar Jovanovic
1644841498 mips: add mips64le support for atomic_incs and annotate_hbefore tests
Add mips64-le implementation of:

- atomic_add_8bit
- atomic_add_16bit
- atomic_add_32bit
- atomic_add_64bit
- do_acasW

Minor fixes for mips32 implementations are included as well.

These functions are needed to execute atomic_incs and annotate_hbefore
tests on mips64le.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13357
2013-04-03 22:51:23 +00:00
Mark Wielaard
0ec8df03c1 For memcheck overlap filter_memcpy str[n]cpy and __GI_str[n]cpy are equal.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13349
2013-03-28 22:52:14 +00:00
Mark Wielaard
684a15246c memcheck/tests/strchr test should not depend on line numbers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13348
2013-03-28 22:52:13 +00:00
Mark Wielaard
cc1ee7885f Add new MISC vector Iops to memcheck/tests/vbit-test/irops.c.
memcheck/tests/vbit-test fails with unknown opcode after introduction
of new Iops for AVX2, BMI, FMA support #317506

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13347
2013-03-28 21:24:57 +00:00
Julian Seward
9c91869bc9 Memcheck fixes for new IR ops introduced by r2702 (which added support
for AVX2, BMI1, BMI2 and FMA instructions).  Part of #305728.
(Jakub Jelinek, jakub@redhat.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13338
2013-03-27 11:40:02 +00:00
Philippe Waroquiers
66bc0e6f56 Undo void change done as part of rev 13329
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13330
2013-03-18 22:51:57 +00:00
Philippe Waroquiers
b5c064dfea Better fix for 295590
(problem reported in bug 307082, comment 8).
Solution applied is similar to what is in 307082 patch
(i.e. do not destroy the internal helgrind var if nWaiters > 0).
But also do not remove it from the FM.

+ add a test case (re-using the drd test case)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13329
2013-03-18 22:48:22 +00:00
Philippe Waroquiers
30275f300c Fix 316535 Use of |signed int| instead of (unsigned) |size_t| in messages...
* when SEGV trapped, report the main thread size as an unsigned size_t
* Similar for memcheck overlap errors
  For example, for the 2 calls:
     memcpy(&a, &a, 2147483648UL);
     memcpy(&a, &a, -1);  // silently accepted by gcc 4.4.4 -Wall
                          // while the 3rd arg is supposed to be a size_t
  we now obtain (on a 32 bit system)
    Source and destination overlap in memcpy(0xbe97113f, 0xbe97113f, 2147483648)
    Source and destination overlap in memcpy(0xbef6d13f, 0xbef6d13f, 4294967295)
  instead of
    Source and destination overlap in memcpy(0xbe8e012f, 0xbe8e012f, -2147483648)
    Source and destination overlap in memcpy(0xbe8e012f, 0xbe8e012f, -1)

Do not ask me why 
   memcpy(&a, &a, -1);
is supposed to be accepted/acceptable/valid code.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13326
2013-03-13 21:44:07 +00:00
Philippe Waroquiers
48f3860354 Avoid warning that format argument is not a string literal
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13303
2013-03-02 15:44:03 +00:00
Philippe Waroquiers
f239a1c516 small changes in sendmsg.c regtest
* avoid a warning related to pointer types
* replace exit (0) by return 0 (might help backtraces on Darwin, suggestion by Rich Coe)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13301
2013-03-01 23:05:43 +00:00
Tom Hughes
592e58c747 Don't check the flags word in msghdr for sendmsg as the
kernel will neither read nor write it.

Patch from Mark Wielaard to fix BZ#315441.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13294
2013-02-28 12:50:55 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Florian Krohm
1f53bd2199 s390: Testcases and vbit-tester changes for the following
DFP insns:
- extract basied exponent
- insert biased exponent
- quantize
- reround to significance
Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13286
2013-02-14 14:28:22 +00:00
Florian Krohm
6965adf43e s390: Add testcase for these DFP insns: CDGTRA, CXGTR, CGXTR, and CGDTR (VEX r2680).
Update vbit tester. Patch by Maran Pakkirisamy (maranp@linux.vnet.ibm.com).
Part of fixing BZ #307113.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13285
2013-02-08 23:34:31 +00:00
Julian Seward
ac5abb76ac test_reservation(), test_double_pair_instrs(): Fix broken inline assembly
causing segfaults with gcc-4.7.  The inline assembly still isn't right,
but it's better than it was before.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13279
2013-01-29 22:14:01 +00:00
Julian Seward
dbf3bf279d Increase maximum usable memory amount from 32GB to 64GB on 64-bit Linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13278
2013-01-29 21:14:46 +00:00
Julian Seward
d120d46f76 get_otrack_shadow_offset_wrk: amd64: add a (very rare) missing case.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13277
2013-01-29 21:13:00 +00:00
Julian Seward
0fe8fb34cf Non functional change (formatting, comments) related to newly created
Iex_ITE.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13276
2013-01-29 21:11:55 +00:00
Julian Seward
875aed56c4 Fix the mkLazy3 case for I32 x I8 x I128 -> I128.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13275
2013-01-29 17:18:56 +00:00