1251 Commits

Author SHA1 Message Date
Bart Van Assche
8122b2aaef Added new memcheck command-line option --show-possibly-lost. Closes #201170.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11292
2010-08-26 10:56:27 +00:00
Julian Seward
d866af8d34 Change the replacement for memcpy to a vectorised version that does
word copies whenever possible.  This drastically reduces the number of
memory references Memcheck has to process and speeds up a test program
that does repeated memcpys of large blocks by a factor of 4 or more.
Also add a vectorised version of memset.

The memcpy version is also constructed with a view to be used in
exp-ptrcheck, so it can copy areas of memory without losing
pointer-identity shadow data, as happens when doing all copies at a
byte granularity.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11288
2010-08-24 09:05:52 +00:00
Julian Seward
58d26cc998 Merge from branches/THUMB: add (partial) --track-origins support for
new guest state components needed for Thumb and NEON support.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11282
2010-08-22 12:16:25 +00:00
Julian Seward
5e6248c7ed Merge from branches/THUMB: tool-side handling of new primops required
for NEON support.  Requires further checking.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11277
2010-08-22 11:54:14 +00:00
Julian Seward
b2113a567d Add in comments a (validated) strspn replacement, should it become
necessary.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11270
2010-08-20 18:24:16 +00:00
Julian Seward
9a8dd3161a Add intercepts for strstr, strpbrk, strcspn. These are needed for
glibc-2.11 when running on SSE4-enabled (virtual) CPUs, for the usual
reason: to avoid ultra-optimised routines using the SSE 4.2 PCMPxSTRx
instructions.  I would not be surprised if it turned out that strspn
was required, but I haven't seen a need for it so far.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11268
2010-08-19 13:22:34 +00:00
Julian Seward
1ec3c376a6 Track vex r2001 (initial PCMPISTRI support):
* handle new pseudo-reg XMM16 in memcheck/mc_machine.c

* run_thread_for_a_while: assert that the amd64 XMM guest reg array
  has no holes and the elements are the right size, so that the
  (PCMP)ISTRI_* helpers can treat it as an array.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11249
2010-08-06 08:01:47 +00:00
Bart Van Assche
229c4c92b3 Follow-up for r11191: made this test pass again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11248
2010-07-31 13:37:58 +00:00
Bart Van Assche
4a91cb990c Passes now when compiled with gcc 4.5.x too.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11247
2010-07-31 13:13:53 +00:00
Julian Seward
af6f731ae8 Make the --workaround-gcc296-bugs kludge take into account the stack
redzone size.  Fixes #238208.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11217
2010-07-21 12:46:44 +00:00
Julian Seward
ee41ec86f0 Try to fix 'make dist' -- possible fallout from r11188.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11213
2010-07-15 13:05:42 +00:00
Nicholas Nethercote
11f94ef626 Make error messages at start-up more consistent. Every line of such
messages now begin with "valgrind: ", and they're more often printed before
the preamble.  This required introducing a new message kind, Vg_FailMsg, and
functions VG_(fmsg) and VG_(fmsg_bad_option), and removing
VG_(err_bad_option).

Where we used to have horrible output like this:

    [ocean:~/grind/ws2] vg5 --tool=massif --threshold=101 date
    ==31877== Massif, a heap profiler
    ==31877== Copyright (C) 2003-2010, and GNU GPL'd, by Nicholas Nethercote
    ==31877== Using Valgrind-3.6.0.SVN and LibVEX; rerun with -h for copyright info
    ==31877== Command: date
    ==31877== 
    ==31877== --threshold must be between 0.0 and 100.0
    valgrind: Bad option '--threshold'; aborting.
    valgrind: Use --help for more information.

We now have nice output like this:

    [ocean:~/grind/ws2] vg2 --tool=massif --threshold=101 date
    valgrind: Bad option: --threshold=101
    valgrind: --threshold must be between 0.0 and 100.0
    valgrind: Use --help for more information or consult the user manual.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11209
2010-07-06 04:05:23 +00:00
Nicholas Nethercote
fb6d1e0427 Fix various bits of regtest breakage on amd64-linux caused by the MACOSX106
merge.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11199
2010-07-01 01:09:42 +00:00
Nicholas Nethercote
2086d71421 Remove a bogus header file listing.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11197
2010-07-01 00:37:46 +00:00
Nicholas Nethercote
5fcd51035e Add a missing filter_stderr file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11196
2010-07-01 00:34:54 +00:00
Nicholas Nethercote
6fd0eb7b07 Merged the MACOSX106 branch to the trunk. Merge command:
svn merge -r11143:HEAD svn://svn.valgrind.org/valgrind/branches/MACOSX106

There were some easy-to-resolve conflicts.

Then I had to fix up coregrind/link_tool_exe*.in -- those files had been
added independently on both the trunk and the branch, AFAICT.  I just
overwrote the trunk versions with the branch versions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11194
2010-07-01 00:20:20 +00:00
Julian Seward
b946fac47a Handle new primop Iop_RoundF32toInt, needed by SSE4 ROUNDSS (vex
r1986).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11189
2010-06-27 09:08:54 +00:00
Julian Seward
1ce6a7eda5 Valgrind-side changes needed to go with vex r1984 (Implement SSE4
insns: CMPGTQ PMAXUD PMINUD PMAXSB PMINSB PMULLD)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11181
2010-06-18 08:18:38 +00:00
Julian Seward
05124264b0 Remove link_tool_exe.c and replace it with perl scripts that do the
same thing.  A .c file doesn't work for cross compilation.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11174
2010-06-13 22:13:58 +00:00
Julian Seward
c46347280b Add a new program (link_tool_exe.c) and use this to link the tool
executables.  Gets rid of the linker script kludgery and uniformly
uses -Ttext=0x38000000 (or whatever) on Linux, so as to accomodate
both traditional ld and gold.  Should fix #193413 although I have
been unable to test it.  Using a whole new program seems like
overkill, but this is infrastructure to support static linking of
the tool executables on MacOS too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11141
2010-06-02 00:31:34 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Julian Seward
96b3024832 Fix handling of mprotect so as to be more consistent with the handling
of mmap.  Fixes #205541 and its dup #210268.  The fix is simple enough
but the analysis is a bit complex, as detailed in comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11031
2010-01-27 10:28:00 +00:00
Julian Seward
dab35973c5 Update expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11022
2010-01-08 10:51:25 +00:00
Julian Seward
db42582f80 Analysis/make-it-work for arm-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11014
2010-01-04 12:10:24 +00:00
Julian Seward
3c1644f476 Enable origin tracking through arm VFP registers; was apparently
previously not enabled only due to brain-deadness on my part.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11012
2010-01-04 11:48:19 +00:00
Julian Seward
3322cbe3a1 Handle Iop_SqrtF32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11001
2010-01-03 22:29:32 +00:00
Julian Seward
2d7fcf0f82 Make sure the Memcheck tests are built on arm-linux using hardware
floating point, since the softfloat results are way different from the
hardware one (not to mention, V reports lots of accesses-below-the-SP
in the softfloat helper functions.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10999
2010-01-03 21:24:09 +00:00
Julian Seward
7f0663010b Disable this test (effectively) on arm-linux, since that uses
sys_rt_sigprocmask and not the Aulde Fashionede sys_sigprocmask.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10997
2010-01-03 16:10:14 +00:00
Julian Seward
e9de458500 Merge from branches/ARM, all parts of the ARM-Linux port except for
the changes to do with reading and using ELF and DWARF3 info.
This breaks all targets except amd64-linux and x86-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10982
2010-01-01 11:59:33 +00:00
Julian Seward
7ed620741c Track changes in the names of a few IR primops to do with int<->fp
conversions, as introduced in vex r1949.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10980
2009-12-31 19:24:12 +00:00
Julian Seward
be9f7279ce Track vex r1930 (Change the IR representation of load linked and store
conditional.)  Completes the fix of #215771.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10957
2009-11-26 17:20:21 +00:00
Bart Van Assche
e8e16af0dc Made sure that the sigqueue regression test passes on 32-bit and on 64-bit systems.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10922
2009-10-30 11:37:35 +00:00
Tom Hughes
00d987f91a Add support for ELF indirect functions. These are symbols of
type STT_GNU_IFUNC which, instead of pointing directly at the
function, point at a routine which will return the address of
the real function. Redirection of indirect functions is handled
by valgrind as follows:

  - When a redirection specification matches an indirect
    function symbol an active redirection is added in the
    normal way, but with the isIFunc flag set.

  - When a call is made to an address which matches an
    active redirection with the isIFunc flag set the call
    is redirected, but not to the target address of the
    redirection - instead it is sent to a small wrapper
    routine that is preloaded into the client.

  - The wrapper routine calls the original client routine
    and collects the result, which it reports to valgrind
    using a client request, and then returns the result to
    the caller.

  - When valgrind gets the client request it looks up the
    active redirection for the indirect function and then
    adds a new active redirection which redirects from the
    address returned by the indirection function to the
    redirection target. This new redirection does not have
    the isIFunc flag set so behaves as a normal redirection.

In addition to the above we also add a few new redirections to
memcheck to capture internal calls made by glibc to things like
strlen, as these internal calls do not go through the indirect
function and instead go direct to the chosen implementation.

Based on a patch from Dodji Seketeli and comments from Jakub
Jelinek, this commit closes bug 206013.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10920
2009-10-29 09:27:11 +00:00
Bart Van Assche
0e5846e018 Fixed expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10916
2009-10-28 10:13:20 +00:00
Bart Van Assche
8e84bb3784 Added a comment that explains the purpose of the sigqueue.c test program.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10915
2009-10-28 10:13:03 +00:00
Bart Van Assche
20f6ef5896 Added a modified version of the rt_sigqueue test program provided by Konstantin Serebryany.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10910
2009-10-27 14:20:23 +00:00
Julian Seward
5b1edb07f6 When generating XML output for suppressions, print the suppression
both wrapped up in XML tags (as before) but also in plain text in a
sequence of CDATA blocks.  Normally only one, but in the worst case
the raw data will have ]]> in it, in which case it needs to be split
across two CDATA blocks.

This apparently simple change involved a lot of refactoring of the
suppression printing machinery:

* in the core-tool iface, change "print_extra_suppression_info" (which
  prints any auxiliary info) to "get_extra_suppression_info", which
  parks the text in a caller-supplied buffer.  Adjust tools to match.

* VG_(apply_StackTrace): accept a void* argument, which is passed to
  each invokation of the functional parameter (a poor man's closure
  implementation).

* move PRINTF_CHECK into put_tool_basics.h, where it should have been
  all along

* move private printf-into-an-XArray-of-character functions from
  m_debuginfo into m_xarray, and make them public

* gen_suppression itself: use all the above changes.  Basically we
  always generate the plaintext version into an XArray.  In text mode
  that's just printed.  In XML mode, we print the XMLery as before,
  but the plaintext version is dumped into a CDATA block too.

* update the Protocol 4 specification to match all this.

This still isn't 100% right in the sense that the CDATA block data
needs to be split across multiple blocks if it should ever contain the
CDATA end mark "]]>".  The Protocol 4 spec has this right even though
the implementation currently doesn't.

Fixes #191189.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10822
2009-08-15 22:41:51 +00:00
Nicholas Nethercote
dbe64c1746 Fix a .exp file. Avoid an assertion failure with -v.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10799
2009-08-13 04:24:38 +00:00
Nicholas Nethercote
226deeb16d Don't count leaks as errors with --leak-check=summary, because the results
can be confusing.  Document the behaviour.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10798
2009-08-13 00:02:30 +00:00
Bart Van Assche
73db3de513 Suppressed compiler warnings reported by gcc 4.4.x on the source code
of regression tests about intentionally uninitialized variables and
about intentionally freed non-heap memory.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10794
2009-08-12 12:55:56 +00:00
Nicholas Nethercote
c922a7201d Add a crappy wrapper for access_extended(), one of the more ridiculous
syscalls I've had the displeasure of encountering.  Due to its
ridiculousness, the wrapper misses a PRE_MEM_WRITE check and so can result
in false positives.  The POST_MEM_WRITE update is present, though, so it
shouldn't cause subsequent problems.  Fixes bug 200760.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10786
2009-08-12 02:30:20 +00:00
Nicholas Nethercote
71694b3c20 Darwin .exp fixes following r10783.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10785
2009-08-12 00:32:44 +00:00
Nicholas Nethercote
86be4a7cf3 Update .exp files for r10783.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10784
2009-08-12 00:14:44 +00:00
Nicholas Nethercote
829fbc977d Output tweaks:
- Always print a blank line after significant messages (eg. errors).  This
  makes the handling of blank lines much simpler.

- Don't print full stops at the end of messages.  We mostly don't do it, so
  I got rid of all the remaining ones I could find for consistency.

- Use --leak-check=full rather than --leak-check=yes, for consistency with
  docs and other messages.

- Update partiallydefinedeq.stderr.exp2 for older changes.

This commit only updates the code.  Test updates will follow shortly.  (I'm
separating them so the code changes aren't swamped by the test changes in
the SVN logs.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10783
2009-08-12 00:14:16 +00:00
Nicholas Nethercote
9d2e0f9cbe Count error contexts properly in VG_(unique_error). Avoids the problem seen
of "5 errors from 0 contexts" with leak errors.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10773
2009-08-11 00:52:40 +00:00
Nicholas Nethercote
675914e025 Try to fix error_counts.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10768
2009-08-10 08:25:39 +00:00
Nicholas Nethercote
49d480e3ca Count leak as errors. Fixes bug 152393.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10767
2009-08-10 07:50:00 +00:00
Nicholas Nethercote
6fd1b000e4 Allow custom blocks to overlap with malloc blocks. Fixes bug 100628.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10765
2009-08-10 07:36:54 +00:00
Nicholas Nethercote
15773b3fbe augment a comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10764
2009-08-10 06:47:00 +00:00
Nicholas Nethercote
794810cd02 wibble
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10762
2009-08-10 04:07:54 +00:00