Commit Graph

11279 Commits

Author SHA1 Message Date
Julian Seward
548a64bfef * add a logging mechanism to show repeated messages at exponentially
declining rates, so as to reduce the amount of junk spewed out by
  the various support functions for the MacOS syscall wrappers.

* add a couple more cases to the resync filter for Yosemite.  This
  is working pretty well now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14725
2014-11-15 10:29:57 +00:00
Florian Krohm
ff08422233 Pass buffer size to VG_(elapsed_wallclock_time) so the function
can check it's large enough.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14724
2014-11-14 22:34:40 +00:00
Florian Krohm
e7020c5a7e Minor non-functional cleanups.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14723
2014-11-14 19:25:08 +00:00
Florian Krohm
8293498c84 m_compiler.c was added to noinst_HEADERS but should of course
be added to COREGRIND_SOURCES_COMMON. Now fixed.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14722
2014-11-14 14:47:12 +00:00
Julian Seward
258b4a6bc9 Implement missing heap-intercept function "dh_malloc_usable_size".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14721
2014-11-14 10:13:49 +00:00
Florian Krohm
04b8584502 Audit two buffer sizes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14720
2014-11-13 22:45:58 +00:00
Florian Krohm
ac3b22e6af Merge revisions 14445 and 14446 from the BUF_REMOVAL branch to trunk.
Two things:
- remove the buffer argument from VG_(DebugInfo_sect_kind)
- allocate AddrInfo::SectKind::objname dynamically


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14719
2014-11-13 21:41:28 +00:00
Julian Seward
2b9da24a5c * add syscall wrappers for some new OSX 10.10 specific calls
necp_match_policy
    sysctlbyname
      getattrlistbulk (kludged)

* add initial entries for the resync-filter on OSX 10.10.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14718
2014-11-13 16:30:09 +00:00
Julian Seward
5beed73e4f Update suppressions for OSX 10.10.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14717
2014-11-13 16:28:24 +00:00
Mark Wielaard
560e558b88 Bug 340922 arm64: unhandled getgroups/setgroups syscalls.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14716
2014-11-13 13:03:25 +00:00
Philippe Waroquiers
4c0e46ecd8 Follow up 14714: use a real malloc cost centre instead of an empty string
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14715
2014-11-12 21:10:37 +00:00
Philippe Waroquiers
77f136cef4 Implement Option --error-markers=<begin>,<end>
* This option can be used to mark the begin/end of errors in textual
output mode, to facilitate searching/extracting errors in output files
mixing valgrind errors with program output.

* Use the new option in various existing regtests to test the various
  possible usage.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14714
2014-11-12 19:43:29 +00:00
Florian Krohm
73df75ebba Merge r14340,14346-14348,14352,14354-14355 from the BUF_REMOVAL branch to
trunk.
Convert callgrind to use VG_(fprintf).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14713
2014-11-11 20:46:34 +00:00
Julian Seward
fafcf8e893 Interceot _platform_strncmp also on OSX 10.10.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14712
2014-11-11 12:46:58 +00:00
Julian Seward
cf3f0c09cb PRE(mach_msg) on OSX 10.10 64-bit: replace failing assertion
vg_assert(! (mh->msgh_bits & MACH_SEND_TRAILER));
with a warning message, but let it continue.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14711
2014-11-11 12:46:19 +00:00
Florian Krohm
67233d8994 Remove unneeded macro definition.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14710
2014-11-10 21:54:34 +00:00
Tom Hughes
b8308dd756 Add support for the getrandom system call. BZ#340788.
Requires r14705 for updated system call lists.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14709
2014-11-10 09:55:59 +00:00
Julian Seward
013876996a MacOSX 10.10: Resolve "UNKNOWN attrlist flags 0:0x10000000. Fixes
#340722.  Patch from Rhys Kidd (rhyskidd@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14708
2014-11-10 07:26:43 +00:00
Florian Krohm
479e0e5b54 Fix a bug spotted by IBM's BEAM checker in VG_(describe_IP).
In the non-XML part buf_dirname was read without observing the
know_dirinfo guard. Now fixed. Initialise buf_dirname nevertheless.
Also remove a dead assignment.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14707
2014-11-09 21:57:23 +00:00
Florian Krohm
ab2599f4cf Change VG_(mkstemp) such that
(a) the 2nd argument must not be NULL
    This was true anyhow and requiring it allows us to simplify the function
    by eliminating the local buffer.
(b) the memory pointed to by the 2nd argument is always initialised
    In the past the output file name was not initialised in case VG_(open)
    failed 10 times in a row. The call sites in m_main.c and m_gdbserver/target.c
    were reading the uninitialised filename unconditionally. This was spotted
    by IBM's BEAM checker.
Fix call sites, eliminate some magic constants along the way.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14706
2014-11-09 16:15:23 +00:00
Tom Hughes
fa63a472b7 Update system call lists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14705
2014-11-09 13:59:51 +00:00
Philippe Waroquiers
993eded14d Comment only changes.
* Clarify in the dedup pool comments that all bytes of elements are compared.
* pub_core_options.h : remove old/misplaced comment for clo_trace_children
                       and replace by a more clear comment (matching the --help)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14704
2014-11-07 22:16:27 +00:00
Julian Seward
409c042298 Add some Mac OSX 10.10 specific wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14703
2014-11-07 00:08:13 +00:00
Julian Seward
b9ab9b89ab Enable suppressions for zlib false positives on OSX 10.10.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14702
2014-11-07 00:06:26 +00:00
Julian Seward
6f2d1b4dd5 Add a no-op wrapper for a new-in-10.10 syscall: getattrlistbulk
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14701
2014-11-07 00:05:56 +00:00
Florian Krohm
f3358e09cb Merge revisions 14366 and 14367 from the BUF_REMOVAL branch to trunk.
In function dump_state_togdb use VG_(gdb_printf) directly. No need to write
to a buffer first.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14700
2014-11-06 22:01:15 +00:00
Florian Krohm
dc0c3d41ac Merge revisions 14344 and 14345 from the BUF_REMOVAL branch to trunk.
Basically:
CLG_(sprint_eventmapping)  --> CLG_(eventmapping_as_string)
CLG_(sprint_mappingcost)   --> CLG_(mappingcost_as_string)
The new functions return the string in a dynamically allocated buffer
that caller ought to free.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14699
2014-11-06 21:43:44 +00:00
Julian Seward
a2ca87cf7b Adds initial support for new syscalls on MacOS X 10.10, including new
syscall numbers, and dummy wrappers for bsdthread_ctl and
sysctlbyname.  Mash up of patches from fxcoudert@gcc.gnu.org and Rhys
Kidd (rhyskidd@gmail.com).  Part of bug 339045.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14698
2014-11-06 20:29:01 +00:00
Julian Seward
b08260a158 On MacOS X 10.10, when postprocessing tool executables, set the SVMA
of __PAGEZERO to zero.  Without this, the 10.10 kernel refuses to
start these executables.  Based on investigations and a
proof-of-concept implementation by Rhys Kidd (rhyskidd@gmail.com).
Part of bug 339045.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14697
2014-11-06 20:23:22 +00:00
Julian Seward
ba74ff2302 On MacOS X 10.10, provide a dummy definition for voucher_mach_msg_set.
Not sure why this is necessary, but without it, the tool executables
don't link.  Part of bug 339045.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14696
2014-11-06 20:20:01 +00:00
Julian Seward
ca44cf32c3 Build system changes to enable building on MacOS X 10.10 (Yosemite).
See bug 339045.  Part of a patch from fxcoudert@gcc.gnu.org.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14695
2014-11-06 20:16:05 +00:00
Julian Seward
eb219c4398 Fix symbol name typo (correct: DARWIN_VERS wrong: DARWIN_VERSION).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14694
2014-11-05 21:27:36 +00:00
Josef Weidendorfer
b30ac05feb Compile (arm). Fix typo from r14664
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14693
2014-11-05 19:46:21 +00:00
Julian Seward
627046a073 Back out the darwin-specific part of r14683, since darwin doesn't
appear to have SHM_HUGETLB, and it causes build failures.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14692
2014-11-05 15:54:21 +00:00
Philippe Waroquiers
559955c15d Unmask all signals in vgdb, as the process that launches vgdb
might have masked some.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14691
2014-11-04 20:28:36 +00:00
Julian Seward
b519f73307 Adds initial support for AArch64 (arm64) on Android. Small programs
(/system/bin/ls, /system/bin/date) run.  Still to do:

* enable more malloc/free intercepts

* enable wrappers for ashmem and binder syscalls

* check to see if any special ioctl support is required for ARM Mali GPUs



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14690
2014-11-04 17:44:21 +00:00
Julian Seward
59b90d186c PRE(sys_openat): when checking whether ARG1 == VKI_AT_FDCWD, be sure
only to check the lowest 32 bits, since that arg is a file descriptor
-- hence "int" -- and checking all 64 bits fails unexpectedly if ARG1
and VKI_AT_FDCWD are not both zero- or sign- extended.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14689
2014-11-04 17:35:04 +00:00
Mark Wielaard
6415f59e9e Bug 340632 arm64: unhandled instruction fcvtas
NEWS entry for VEX commit r2987.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14688
2014-11-04 15:43:27 +00:00
Florian Krohm
3a05af83d1 Merge r14339 from BUF_REMOVAL branch to trunk.
Prepare print_file function to be converted to use VG_(fprintf). 
Basically get rid of arithmetic involving the output buffer.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14687
2014-11-04 15:08:53 +00:00
Mark Wielaard
a83732ca72 Bug 340630 arm64: fchmod (52) and fchown (55) syscalls not recognized.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14686
2014-11-04 13:43:21 +00:00
Florian Krohm
d2723ddc9b Merge r14308 from the BUF_REMOVAL branch to trunk
Changes VG_(describe_IP) to return the untruncated result in a statically
allocated local buffer. Fix call sites and update two .exp files who had
truncated names.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14685
2014-11-03 22:43:42 +00:00
Julian Seward
bb19f6d8e8 Add tests for all SIMD FP instructions, except int<->fp conversions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14684
2014-11-03 09:52:57 +00:00
Philippe Waroquiers
80ae5a2395 fix 338995 shmat with hugepages (SHM_HUGETLB) fails with EINVAL
Bug is not really fixed, instead the SHM_HUGETLB flag is ignored.
Note that it is not straightforward to properly fix this,
as this implies either to learn aspacemgr what huge pages are.
Also, the trick used in the fix for 333051 cannot be used easily,
because the SHM_HUGETLB flag is given in shmget, while the mmap
is done in shmat.

So, the easiest is to just ignore the SHM_HUGETLB flag.

SHM_HUGETLB is supposed to only give a performance impact.
Ignoring it should be benign.
Theoretically, the caller might expect a sucessful shmget(SHM_HUGETLB)+shmat
to give pages aligned on e.g. 1MB.
In this case, bad luck, the program will misbehave under valgrind.
To warn of this, a warning is given (once) when SHM_HUGETLB is seen.

The map_unmap.c test has been restructured somewaht to allow
TEST_SHM_HUGETLB to be tested independently (or not) of the TEST_MAP_HUGETLB.

Note also that by default, testing  MAP_HUGETLB and SHM_HUGETLB
is disabled as usually, huge pages are not enabled.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14683
2014-11-01 22:00:50 +00:00
Philippe Waroquiers
41610f34c2 Fix 333051 mmap of huge pages fails due to incorrect alignment
Learning aspacemgr to handle huge page is too difficult.
So, huge page requests that fails due to bad advice by aspacemgr
will (we hope) succeed if a mmap retry is done with the kernel,
without any constraints.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14682
2014-11-01 21:02:13 +00:00
Julian Seward
4d6c92fda5 Rearrange the test case generators to be exactly in the same order
that they are called, so as to make future editing easier.  And
generally tidy up.  No functional change.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14681
2014-11-01 12:05:09 +00:00
Julian Seward
889bda0c3c Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14680
2014-10-31 12:11:41 +00:00
Julian Seward
74d6639320 Add test cases and expected outputs for
FMLA 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
FMLS 2d_2d_d[], 4s_4s_s[], 2s_2s_s[]
PRFM (immediate)

Unfortunately huge diff for arm64/fp_and_simd.stdout.exp because the
new cases are not at the end, and the random data for all after it is
different.  ToDo: reset RNG after each test.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14679
2014-10-31 10:29:23 +00:00
Florian Krohm
645563670a Merge revisions 14222, 14268, and 14270 from the BUF_REMOVAL branch to trunk.
Assorted fixes in exp-bbv to eliminate a few buffers.
Implement a suggestion found in the massif source, namely to add the
equivalent of fprintf to m_libcprint. Good suggestion. Thusly
- VgFile: similar to FILE; buffered output, 8k buffer
- VG_(fopen): similar to fopen, but with arguments as in VG_(open)
- VG_(fprintf) and VG_(vfprintf): like [v]fprintf with VgFile 1at argument
- VG_(fclose)
Change massif, exp-bbv and cachegrind to use this functionality.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14678
2014-10-30 22:17:56 +00:00
Julian Seward
2bf85a3929 Bug 340236 - 4 unhandled syscalls on aarch64/arm64:
mknodat (33), fchdir (50), chroot (51), fchownat (54)
Patch from Miroslav Franc (mfranc@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14677
2014-10-30 14:28:14 +00:00
Julian Seward
9d5584da64 Bug 340028 - unhandled syscalls for arm64 (msync, pread64, setreuid
and setregid)
Patch from dimitry@google.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14676
2014-10-30 14:11:32 +00:00