1197 Commits

Author SHA1 Message Date
Philippe Waroquiers
619fb35df7 Fix 376257 - helgrind history full speed up using a cached stack
This patch implements the flag --delta-stacktrace=yes/no.
Yes indicates to calculate the full history stack traces by
changing just the last frame if no call/return instruction was
executed.
This can speed up helgrind by up to 25%.

This flags is currently set to yes only on linux x86 and amd64, as some
platform dependent validation of the used heuristics is needed before
setting the default to yes on a platform. See function check_cached_rcec_ok
in libhb_core.c for more details about how to validate/check the behaviour
on a new platform.
2017-11-02 21:33:35 +01:00
Rhys Kidd
1ce04c35c2 Preliminary support for Darwin 17.x (macOS 10.13) 2017-10-01 19:45:10 -04:00
Rhys Kidd
ed6ad13bc8 Fix missing workq_ops operations (macOS)
Related to discussion in bz#383723. Patch based upon one provided by
Andy Maloney.
2017-10-01 19:05:48 -04:00
Petar Jovanovic
c96148a2a1 mips: fix VKI_SIOCATMARK, VKI_SIOCSPGRP and VKI_SIOCGPGRP macros
Set correct values from Linux kernel.
See ./arch/mips/include/uapi/asm/sockios.h

This issue is covered by newly introduced memcheck test mips32/bad_sioc.
2017-09-27 16:04:31 +02:00
Rhys Kidd
55fe390c7a Fix missing pselect syscall (OS X 10.11). bz#379748
Based upon patch from Louis Brunner.
2017-09-03 12:55:52 -04:00
Ivo Raisr
ba17add79a Fix out-of-tree build on Solaris.
Simply #include config.h with no path at all.
Path by: Rob Boehne <robb@datalogics.com>
2017-08-17 22:38:18 +02:00
Mark Wielaard
33fa406cb1 Fix pub_tool_basics.h build issue with g++ 4.4.7.
g++ 4.4.7 doesn't accept union field initializers:
In file included from ../../include/pub_tool_vki.h:50,
                 from valgrind_cpp_test.cpp:13:
../../include/vki/vki-linux.h: In function ‘vki_cmsghdr* __vki_cmsg_nxthdr(void*, __vki_kernel_size_t, vki_cmsghdr*)’:
../../include/vki/vki-linux.h:673: error: expected primary-expression before ‘.’ token

Assign value after declaration which works for any g++ version.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16437
2017-06-06 09:03:03 +00:00
Julian Seward
fdd319ac66 Update version numbers for 3.13.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16431
2017-06-01 15:44:29 +00:00
Petar Jovanovic
81ba51146e mips: implement set/long_jmp instead of builtins
- VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP for VGP_mips64_linux are defined.
- Implementation of VG_MINIMAL_SETJMP and VG_MINIMAL_LONGJMP for mips32 is
  improved by rescuing FP registers.

This should unbreak mips64/clang build.

Patch by Aleksandar Rikalo.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16378
2017-05-15 14:56:22 +00:00
Ivo Raisr
754487de4f Add Linux specific ioctl wrapper for CDROMREADMODE1
Fixes BZ#360429
Original patch by: Vasantha Ganesh K <vasanthaganesh.k@tuta.io>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16358
2017-05-10 23:14:31 +00:00
Ivo Raisr
d73f2c748a Implement additional Xen hypercalls
Fixes BZ#373086
Patch by: Mihai DONȚU <mihai.dontu@gmail.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16355
2017-05-10 18:04:17 +00:00
Ivo Raisr
4770c34059 Update Xen 4.6 domctl wrappers
Fixes BZ#377891
Patch by: Antony Saba <awsaba@gmail.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16354
2017-05-10 17:37:35 +00:00
Ivo Raisr
246bb0e25f Remove TileGX/Linux port.
Fixes BZ#379504.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340
2017-05-08 17:21:59 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
38edd50c0e Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16333
2017-05-04 15:09:39 +00:00
Rhys Kidd
8226909643 macos: Fix unhandled syscall: mach:70 (host_create_mach_voucher_trap). bz#379390
Based upon a patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16326
2017-04-30 21:52:33 +00:00
Rhys Kidd
bc4ee3af41 macos: Block out a few more macOS / Darwin syscalls. n-i-bz.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16324
2017-04-30 01:59:33 +00:00
Rhys Kidd
254ca9753a macos: Add a no-op wrapper for a new-in-10.10 syscall: fstatat64
Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16323
2017-04-30 00:34:59 +00:00
Rhys Kidd
fd128453ff macos: Add a no-op wrapper for a new-in-10.10 syscall: faccessat
Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16322
2017-04-30 00:28:10 +00:00
Rhys Kidd
2cc6181ab4 macos: Add a no-op wrapper for a new-in-10.10 syscall: csrctl
Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16321
2017-04-30 00:09:56 +00:00
Ivo Raisr
c356e1c01f Syscall wrapper for prctl(PR_SET_NAME) must not check more than 16 bytes.
Fixes BZ#379039.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16314
2017-04-26 19:27:14 +00:00
Petar Jovanovic
f8f1e9cb43 Add musl libc configure/compile
- add musl libc detection (prevents configure error)
- adjust preload and symbol names (based on the OpenWrt patch, see [1])

[1] https://dev.openwrt.org/browser/trunk/package/devel/valgrind/patches/
200-musl_fix.patch?rev=46302

Patch by Peter Seiderer <ps.report@gmx.net>

It fixes Bug 359202.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16296
2017-04-06 12:39:15 +00:00
Julian Seward
d52a222f8b Bug 358697 - valgrind.h: Some code remains even when defining NVALGRIND.
Patch from Matthias Schwarzott (zzam@gentoo.org).  The patch removes
a volatile memory read which was only there to stop compilers warning
about |format| being unused.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16290
2017-03-30 12:14:23 +00:00
Ivo Raisr
76e451c60d fcntl syscall wrapper was missing flock structure check on Linux.
Fixes BZ#377930.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16287
2017-03-27 05:06:32 +00:00
Philippe Waroquiers
a6a72c71be Fix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some addresses
to be wrongly marked as addressable

Patch from Daniel Glöckner, slightly modified.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16274
2017-03-15 19:35:29 +00:00
Petar Jovanovic
30717ab5a2 Add support for syscall ptrace(traceme)
It fixes Bug 377376.

Patch by Aleksandra Karadzic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16273
2017-03-15 15:23:27 +00:00
Ivo Raisr
f1a6076bcf Introduce macro ASSUME_ALIGNED and use it in vki-linux.h.
Reduces the number of compiler warnings on MIPS platforms.
Partial fix for BZ#370028.
Patch by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16256
2017-02-26 21:37:04 +00:00
Carl Love
41308849ef Patch submitted by Will Schmidt for PPC64.
On ppc64*, the TOC ptr should not be considered a scratch
register, and should not be in the clobber list.
This is called out in newer GCC (i.e. gcc7) and triggers an error.

Thusly, remove R2 from the clobber list.

Signed-Off-By: Will Schmidt <will_schmidt@vnet.ibm.com>

Tested and committed by: Carl Love <cel@us.ibm.com>

Bugzilla is 376729.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16254
2017-02-20 19:04:13 +00:00
Ivo Raisr
39dcf62ccd Fix sr_EQ() comparison on Solaris syscall failure
On rare occasions, garbage is found in sr1._val2
while sr2._val2 contains 0.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16252
2017-02-20 08:07:21 +00:00
Ivo Raisr
804686fc2c Solaris: Add syscall wrapper for fast trap getlgrp(6)
Fixes BZ#376518.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16227
2017-02-16 18:29:46 +00:00
Ivo Raisr
fc10a2f3de Solaris: include <sys/lgrp_user_impl.h> only on newer Solaris.
Follow up to SVN r16224 and r16225, BZ#376455. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16226
2017-02-15 15:22:05 +00:00
Ivo Raisr
72a8b52a60 Solaris: Add additional subcodes for lgrpsys(180) syscall
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16225
2017-02-14 12:38:06 +00:00
Ivo Raisr
0f667376e6 Solaris: Add syscall wrapper for lgrpsys(180)
Fixes BZ#376455.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16224
2017-02-14 10:35:20 +00:00
Philippe Waroquiers
489cfd5156 Fix 342040 Valgrind mishandles clone with CLONE_VFORK | CLONE_VM that clones to a different stack
Fix 373192 Calling posix_spawn in glibc 2.24 completely broken

Functionally, this patch just does the following 2 changes to the
fork clone handling:
* It does not mask anymore CLONE_VFORK :
  The only effect of this flag is to suspend the parent, waiting for
  the child to either exit or execve.
  If some applications depends on this synchronisation, better keep it,
  as it will not harm to suspend the parent valgrind waiting for the
  child valgrind to exit or execve.
* In case the guest calls the clone syscall providing a non zero client stack,
  set the child guest SP after the syscall, before executing guest instructions.
  Not setting the guest stack ptr was the source of the problem reported
  in the bugs.

This also adds a test case  none/tests/linux/clonev.
Before this patch, test gives a SEGV, which is fixed by the patch.

The patch is however a lot bigger : this fix was touching some (mostly
identical/duplicated) code in all the linux platforms.
So, the clone/fork code has been factorised as much as possible.
This removes about 1700 lines of code.

This has been tested on:
* amd64
* x86
* ppc64 be and le
* ppc32
* arm64

This has been compiled on but *not really tested* on:
* mips64 (not too clear how to properly build and run valgrind on gcc22)

It has *not* been compiled and *not* tested on:
* arm
* mips32
* tilegx
* darwin   (normally, no impact)
* solaris  (normally, no impact)

The changes are relatively mechanical, so it is not impossible that
it will compile and work out of the box on these platforms.
Otherwise, questions welcome.

A few points of interest:
* Some platforms did have a typedef void vki_modify_ldt_t,
  and some platforms had no definition for this type at all.
  To make it easier to factorise, for such platforms, the following has
  been used:
     typedef char vki_modify_ldt_t;
    When the sizeof vki_modify_ldt_t is > 1, then the arg syscall is checked.
  This is somewhat a hack, but was simplifying the factorisation.

* for mips32/mips64 and tilegx, there is a strange unconditional assignment
  of 0 to a register (guest_r2 on mips, guest_r0 on tilegx).
  Unclear what this is, in particular because this is assigned whatever
  the result of the syscall (success or not).
  



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16186
2016-12-11 21:39:23 +00:00
Rhys Kidd
db0a061667 Add placeholders for all new OS X 10.11 syscalls. Related to bz#348909.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16185
2016-12-11 08:07:21 +00:00
Rhys Kidd
766afc937e Add placeholders for all new macOS 10.12 syscalls. Related to bz#365327.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16184
2016-12-11 07:17:43 +00:00
Bart Van Assche
14362fe2e2 include/valgrind.h: Fix spelling in a source code comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16156
2016-11-26 02:42:11 +00:00
Julian Seward
cad347059e Bug 348616 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5390
with no size/direction hints. (DVD_READ_STRUCT)

Patch from Austin English (austinenglish@gmail.com).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16153
2016-11-23 13:26:23 +00:00
Julian Seward
15f0421b15 Bug 352767 - Wine/valgrind: Warning: noted but unhandled ioctl 0x5307
with no size/direction hints. (CDROMSTOP).

Patch from Austin English (austinenglish@gmail.com).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16152
2016-11-23 13:15:22 +00:00
Ivo Raisr
8f6ff4a27b Solaris: Add syscall wrapper for sigsendsys(108)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16145
2016-11-20 05:19:02 +00:00
Ivo Raisr
8e08fc91ec Solaris: Add syscall wrapper for sigsuspend(95)
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16144
2016-11-20 00:20:34 +00:00
Philippe Waroquiers
39c197ef4d Improve the outer/inner setup: have the outer reporting the inner guest stacktrace
Note: the outer now unconditionally report the inner guest stacktrace.
If that would be a problem, we might add a sim-hint no-inner-guest-stacktrace
to optionally disable such outer behaviour.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16139
2016-11-19 13:24:13 +00:00
Philippe Waroquiers
471900460d Add typedef Alloc_Fn_t/Free_Fn_t in pub_tool_basics.h, use them everywhere
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16138
2016-11-18 21:54:09 +00:00
Philippe Waroquiers
f9386afa89 Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
This commit is the bulk of the new code.
There is however no functional impact yet : the new modules are not used by anybody.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16123
2016-11-11 14:07:03 +00:00
Philippe Waroquiers
b86956b6b9 Add VG_(strIsMemberXA) in pub_tool_xarray.h
This allows to search more efficiently a string in an xarray of string.
(support work for xtree)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16122
2016-11-11 13:55:07 +00:00
Philippe Waroquiers
599a062f61 Support pool of unique string in pub_tool_deduppoolalloc.h
This is support code for the xtree implementation.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16120
2016-11-11 13:30:08 +00:00
Ivo Raisr
7708e249b8 Support '%' in symbol Z-encoding.
Fixes BZ #371869.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16112
2016-11-02 21:50:19 +00:00
Philippe Waroquiers
3553ac9aad Add some more comments in pub_tool_debuginfo.h about memory persistence/ownership
and have m_debuginfo.c referencing these comments.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16106
2016-10-25 20:46:00 +00:00
Ivo Raisr
a32762d529 Solaris: Add wrapper for fcntl(F_DUPFD_CLOEXEC)
n-i-bz



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16105
2016-10-25 04:55:35 +00:00
Petar Jovanovic
5645228957 mips: fix coredump creation in Valgrind
Coredumps created for MIPS are not valid today. Update the list of
registers that have to be saved, and use the structure defined in
kernel.

Patch by Aleksandar Rikalo.
It fixes BZ#351692.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16080
2016-10-19 17:49:06 +00:00