146 Commits

Author SHA1 Message Date
Philippe Waroquiers
88d11f08b4 factorise sys_socketcall
sys_socketcall was duplicated in syswrap-{ppc64|ppc32|arm|mips32|s390x}-linux.c
=>
* Similarly for what was done for sys_ipc, factorise the code in syswrap-linux.c
* re-enabled PRE_MEM_READ for VKI_SYS_SENDMSG and VKI_SYS_RECVMSG 
  (PRE_MEM_READ calls were commented out around 2003, for what
   was supposed a glibc bug.
   The PRE_MEM_READ calls were already re-enabled in s390x)
* s390x also had some more checking to verify the addressibility of
  the args and fail the syscall with EFAULT if not addressable
  => same checks are now done for all platforms.

(tested on x86/amd64/mips32/s390x/ppc32/ppc64, 
 compiled for arm-android-emulator)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13104
2012-11-04 20:40:33 +00:00
Philippe Waroquiers
b83003a1e0 restructure code for future fixing of 123837 (semctl GETVAL false positive)
Regrouped identical code (except for indentation)
from syswrap-ppc64-linux.c, syswrap-ppc32-linux.c,syswrap-mips32-linux.c
  syswrap-x86-linux.c, syswrap-s390x-linux.c
into
  syswrap-linux.c

(compiled/regtested on x86, amd64, ppc64, mips32, s390x)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13076
2012-10-21 20:21:17 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Tom Hughes
bc2f84b39f Add support for the move_pages system call. BZ#282790.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12485
2012-04-03 10:51:27 +00:00
Bart Van Assche
563f0acd21 Check whether the big lock is held before invoking pre_thread_ll_create.
If the pre_thread_ll_create tracking function would be invoked without the
big lock being held, that would trigger a race condition in the tools that
implement this tracking function.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12458
2012-03-25 17:51:59 +00:00
Tom Hughes
3925f2d664 Only mark data which has actually been filled in by recvmsg as defined.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12380
2012-02-10 16:45:01 +00:00
Tom Hughes
baec53c5f1 Add support for the sendmmsg and recvmmsg system calls. Fixes BZ#277779.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12376
2012-02-10 11:30:09 +00:00
Tom Hughes
74eb6fb3b4 Add support for process_vm_readv and process_vm_writev system calls.
Patch from Lénaïc Huard to fix BZ#292995.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12374
2012-02-10 09:39:37 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Julian Seward
1007d8b2c9 ppc64-linux: handle sys_setresuid and sys_setresgid. #273640.
(Jan Stancek, jan.stancek@gmail.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12175
2011-10-20 10:44:34 +00:00
Tom Hughes
d2814b28ef Wire up pselect6 on ppc32 and ppc64. Fixes #278078.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11961
2011-08-10 12:39:37 +00:00
Julian Seward
9aacfb0e51 Remove a commented-out copy of the sys_sigaction wrappers
that also are duplicated for x86-linux and ppc32-linux.
(No functional change.)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11868
2011-07-11 16:07:01 +00:00
Tom Hughes
912fe51553 It seems that the perf_counter_open system call was renamed to
perf_event_open some time after we added it, so correct the name
wherever it appears to match the current kernel source.

Also fixup the PRE handler to do the check correctly, using the
size field of the structure to work out how much data there is.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11804
2011-06-08 09:10:40 +00:00
Julian Seward
c2aaad41cc Enable sys_pwrite64 on ppc64-linux. Fixes #272955.
(Maynard Johnson, maynardj@us.ibm.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11765
2011-05-17 16:07:33 +00:00
Julian Seward
b3827d6c33 Create new module m_libcsetjmp, which wraps up uses of
__builtin_setjmp and __builtin_longjmp so that they can be selectively
replaced, on a platform by platform basis.  Does not change any
functionality.  Related to #259977.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11687
2011-04-11 16:17:51 +00:00
Julian Seward
adb0e3b18d Remove a bunch more warnings generated by gcc-4.6 about dead
assignments ("[-Wunused-but-set-variable]"), on ppc32-linux and
ppc64-linux.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11674
2011-03-28 20:33:52 +00:00
Bart Van Assche
a170de4e78 Linux/ppc: Added support for the ppoll() system call.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11655
2011-03-18 17:47:38 +00:00
Julian Seward
669d87bcc1 Support sys_readahead on Linux.
(Sean Bartell, wingedtachikoma@gmail.com)  Fixes #247894.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11394
2010-10-04 20:03:27 +00:00
Tom Hughes
f26002da90 Fix amd64 and ppc64 to correctly mark mq_timedreceive as LINXY so that
the post handler is run to mark the retrieved message as correct.

Also change the post handler to only mark the number of bytes actually
returned as defined, rather than the whole buffer.

Fixes #238679.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11133
2010-05-24 13:40:10 +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
Tom Hughes
2a70cf0b01 Add support for the getcpu system call on x86, ppc32 and ppc64. There
is no support for amd64 because there is no getcpu system call on that
platform - it is always done as a vsyscall in user space.

Based on patch from Aleksander Salwa. Closes #223758.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11054
2010-02-23 10:02:55 +00:00
Julian Seward
e6c318c531 When creating a child thread, initially set its os_state.threadgroup
to have the same value as the parent.  This avoids exit races leading
to hangs and strange behaviour in heavily multithreaded apps, in the
situation where threads are rapidly being created, and at the same
time an existing thread does sys_exit_group so as to terminate the
entire process.  Thanks to Konstantin S for chasing this down to a
small test case.  Fixes #226116.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11053
2010-02-22 11:03:10 +00:00
Julian Seward
6a9a4015c7 Various minor fixups to make ppc32/64-linux work again following
recent ARM-Linux merge.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10992
2010-01-02 13:24:58 +00:00
Tom Hughes
3174f947e2 Add support for accept4 system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10955
2009-11-25 12:05:41 +00:00
Tom Hughes
25a99cd1eb Wire up vhangup system call on amd64/ppc32/ppc64 linux platforms.
Patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10954
2009-11-25 11:54:56 +00:00
Tom Hughes
27f8eb0f4a Clean up support for sync_file_range system call and add second version used
by ppc platforms based on patch from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10952
2009-11-25 11:29:14 +00:00
Tom Hughes
e46ec05df6 Re-enable old support for adjtimex system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10948
2009-11-24 16:38:21 +00:00
Tom Hughes
40fa55a53b Add support for rt_tgsigqueueinfo system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10947
2009-11-24 16:08:40 +00:00
Tom Hughes
0d0f835353 Add support for sched_rr_get_interval system call based on patch
from Dodji Seketeli. Part fix for #215973.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10946
2009-11-24 16:03:19 +00:00
Tom Hughes
128df057cb Handle the dup3 system call. Closes #215448.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10945
2009-11-23 08:19:20 +00:00
Bart Van Assche
c8d8e1fd86 Compiles again -- added trailing comma's that were missing from r10907.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10919
2009-10-29 09:01:39 +00:00
Tom Hughes
33d5189e1a Add support for preadv and pwritev. Fixes #212149.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10914
2009-10-28 10:04:11 +00:00
Bart Van Assche
9727f3d16f Enabled the rt_sigqueueinfo() system call for ppc64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10911
2009-10-27 14:55:49 +00:00
Tom Hughes
387cb44cc1 Add support for the inotify_init1 system call, based on patches
from Dodji Seketeli and Jakub Jelinek. Fixes #202315.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10909
2009-10-27 14:17:27 +00:00
Tom Hughes
141ec942a1 Add support for the perf_counter_open system call. Fixes #211498.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10907
2009-10-27 09:19:26 +00:00
Tom Hughes
d32144bb8d Update linux system calls lists to match 2.6.31.5 kernel.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10906
2009-10-27 09:01:43 +00:00
Julian Seward
cdcf259f35 Enable sys_rmdir on ppc64-linux. Fixes #206903.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10887
2009-09-13 13:37:16 +00:00
Julian Seward
e7dde85a24 Merge coregrind/ changes from branches/MESSAGING_TIDYUP r10464.
This commit tidies up and rationalises what could be called the
"messaging" system -- that part of V to do with presenting output to
the user.  In particular it brings significant improvements to XML
output.

Changes are:

* XML and normal text output now have separate file descriptors,
  which solves longstanding problems for XML consumers caused by
  the XML output getting polluted by unexpected non-XML output.

* This also means that we no longer have to hardwire all manner
  of output settings (verbosity, etc) when XML is requested.

* The XML output format has been revised, cleaned up, and made
  more suitable for use by error detecting tools in general
  (various Memcheck-specific features have been removed).  XML
  output is enabled for Ptrcheck and Helgrind, and Memcheck is
  updated to the new format.

* One side effect is that the behaviour of VG_(message) has been
  made to be consistent with printf: it no longer automatically
  adds a newline at the end of the output.  This means multiple
  calls to it can be used to build up a single line message; or a
  single call can write a multi-line message.  The ==pid==
  preamble is automatically inserted at each newline.

* VG_(message)(Vg_UserMsg, ..args..) now has the abbreviated form
  VG_(UMSG)(..args..); ditto VG_(DMSG) for Vg_DebugMsg and
  VG_(EMSG) for Vg_DebugExtraMsg.  A couple of other useful
  printf derivatives have been added to pub_tool_libcprint.h,
  most particularly VG_(vcbprintf).

* There's a small change in the core-tool interface to do with
  error handling: VG_(needs_tool_errors) has a new method
  void (*before_pp_Error)(Error* err)  which, if non-NULL, is
  called just before  void (*pp_Error)(Error* err).  This is to
  give tools the chance to look at errors before any part of them
  is printed, so they can print any XML preamble they like.

* coregrind/m_errormgr.c has been overhauled and cleaned up, and
  is a bit simpler and more commented.  In particular pp_Error
  and VG_(maybe_record_error) are significantly changed.

The diff is huge, but mostly very boring.  Most of the changes
are of the form

-   VG_(message)(Vg_UserMsg, "this is a message %d", n);
+   VG_(message)(Vg_UserMsg, "this is a message %d\n", n);

Unfortunately as a result of this, it touches a large number
of source files.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10465
2009-07-15 14:48:32 +00:00
Nicholas Nethercote
f00335141b Handle fallocate() on 64-bit platforms. Fixes bug 185794.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10456
2009-07-15 03:08:35 +00:00
Nicholas Nethercote
400b917577 Handle epoll_create1. Patch from Sam Varshavchik. Fixes bug 188427.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10427
2009-07-10 12:02:03 +00:00
Nicholas Nethercote
b05a2a18d7 This commit merges the BUILD_TWEAKS branch onto the trunk. It has the
following improvements:

- Arch/OS/platform-specific files are now included/excluded via the
  preprocessor, rather than via the build system.  This is more consistent
  (we use the pre-processor for small arch/OS/platform-specific chunks
  within files) and makes the build system much simpler, as the sources for
  all programs are the same on all platforms.

- Vast amounts of cut+paste Makefile.am code has been factored out.  If a
  new platform is implemented, you need to add 11 extra Makefile.am lines.
  Previously it was over 100 lines.

- Vex has been autotoolised.  Dependency checking now works in Vex (no more
  incomplete builds).  Parallel builds now also work.  --with-vex no longer
  works;  it's little use and a pain to support.  VEX/Makefile is still in
  the Vex repository and gets overwritten at configure-time;  it should
  probably be renamed Makefile-gcc to avoid possible problems, such as
  accidentally committing a generated Makefile.  There's a bunch of hacky
  copying to deal with the fact that autotools don't handle same-named files
  in different directories.  Julian plans to rename the files to avoid this
  problem.

- Various small Makefile.am things have been made more standard automake
  style, eg. the use of pkginclude/pkglib prefixes instead of rolling our
  own.

- The existing five top-level Makefile.am include files have been
  consolidated into three.

- Most Makefile.am files now are structured more clearly, with comment
  headers separating sections, declarations relating to the same things next
  to each other, better spacing and layout, etc.

- Removed the unused exp-ptrcheck/tests/x86 directory.

- Renamed some XML files.

- Factored out some duplicated dSYM handling code.

- Split auxprogs/ into auxprogs/ and mpi/, which allowed the resulting
  Makefile.am files to be much more standard.

- Cleaned up m_coredump by merging a bunch of files that had been
  overzealously separated.

The net result is 630 fewer lines of Makefile.am code, or 897 if you exclude
the added Makefile.vex.am, or 997 once the hacky file copying for Vex is
removed.  And the build system is much simpler.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10364
2009-06-24 00:37:09 +00:00
Nicholas Nethercote
7b2a259bea DARWIN sync: pread64 and pwrite64 wrappers.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9971
2009-05-19 06:50:37 +00:00
Nicholas Nethercote
131ab00744 Merged non-Darwin-specific parts of r9397,r9423,r9490, 9461, 9462 from the
DARWIN branch.  A big ugly DARWIN/trunk sync commit, mostly to do with
changing the representation of SysRes and vki_sigset_t.  Functionality of
the trunk shouldn't be changed by it.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9876
2009-05-18 02:12:08 +00:00
Nicholas Nethercote
2001629c3f Updated copyright years.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9344
2009-03-10 22:02:09 +00:00
Nicholas Nethercote
87b5e49494 Merge a large chunk of r8949 (the part that moved fcntl and ioctl wrappers
out of syswrap-generic into syswrap-linux) from the DARWIN branch.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9219
2009-02-22 23:00:30 +00:00
Nicholas Nethercote
3bfae3eec1 Merged r9185 (fix up getsockopt mess) from the DARWIN branch, minus the
Darwin-specific parts.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9186
2009-02-17 00:23:30 +00:00
Tom Hughes
f1ac1fd992 Add signalfd4 support.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8930
2009-01-09 16:42:51 +00:00
Tom Hughes
2ebda825b1 Add support ioprio_get and wire up ioprio_set on all platforms.
Fixes bug #177819.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8826
2008-12-15 08:58:29 +00:00
Tom Hughes
4d4d4c10fe Add support for eventfd2 (and wire up pipe2 on PPC platforms).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8815
2008-12-10 09:28:56 +00:00
Bart Van Assche
86ff87c102 Enabled capget and capset system calls for amd64, ppc32 and ppc64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8554
2008-08-27 17:41:56 +00:00