5382 Commits

Author SHA1 Message Date
Julian Seward
e706fbfa9f Bug 368507 - valgrind throws std::bad_alloc on memory allocations larger than 34255421416 bytes.
Increase the amount of usable memory from 64GB to 128GB on Linux and Solaris.
(Solaris bits from Ivo Raisr.)  OSX is so far unchanged.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16381
2017-05-16 06:20:26 +00:00
Julian Seward
306353a8d2 arm64-linux: detect Cavium CPUs (implementer = 0x43) and enable the
fallback LLSC implementation in that case.  Pertains to bug #369459.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16380
2017-05-16 05:35:23 +00:00
Philippe Waroquiers
54e6c1e1fd Fix 2 errors found by PVS studio
(see  https://www.viva64.com/en/b/0504/ and bug 379502)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16379
2017-05-15 21:00:16 +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
87d60b9d01 Fix a build problem introduced by SVN commit r16365.
Fixes BZ#370028
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16377
2017-05-15 11:01:28 +00:00
Ivo Raisr
3ac5c1b50a Reduce the number of compiler warnings on MIPS platforms in coregrind/m_mallocfree.c
Fixes BZ#370028
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16368
2017-05-12 17:18:05 +00:00
Ivo Raisr
3b12d0e199 Fix build problems on Solaris and OS X.
Follow up to SVN r16364.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16366
2017-05-12 01:37:33 +00:00
Ivo Raisr
5e36988bea Reduce the number of compiler warnings on MIPS platforms in coregrind/launcher-linux.c
Fixes BZ#370028
Patch by: Tamara Vlahovic <tamara.vlahovic@imgtec.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16365
2017-05-12 01:16:01 +00:00
Ivo Raisr
bd0cb61cae Fix a problem when reading .valgrindrc and it is a directory instead of a file.
Fixes BZ#362223.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16364
2017-05-11 17:00:17 +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
d8de8b8beb Reduce the number of compiler warnings on MIPS platforms.
Patch by: Aleksandar Rikalo <aleksandar.rikalo@imgtec.com>
Partially fixes BZ#370028.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16348
2017-05-10 05:38:57 +00:00
Petar Jovanovic
4f3cd8ff8f mips: reduce compiler warnings
Compiler complained about

warning: implicit declaration of function ‘vgPlain_prctl’

in coregrind/m_machine.c.

Also, it complained about

warning: no previous prototype for ‘vgSysWrap_mips_linux_sys_ptrace_before’
[-Wmissing-prototypes]
warning: no previous prototype for ‘vgSysWrap_mips_linux_sys_ptrace_after’
[-Wmissing-prototypes]

in coregrind/m_syswrap/syswrap-mips32-linux.c

This change fixes those issues.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16345
2017-05-09 15:57:59 +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
Petar Jovanovic
8531fa9c3c mips32: remove false warnings on Android
Remove false warnings for strlen and strchr on Android.

Patch by Tamara Vlahovic.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16335
2017-05-05 14:36:46 +00:00
Ivo Raisr
41decc89fe Fix Valgrind internal error when dereferencing memory supplied by a client
in ptrace(getregset) and ptrace(setregset) syscall wrappers.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16334
2017-05-05 13:20:15 +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
55728164c4 macos: Fix UNKNOWN task message [id 3447, to mach_task_self(), reply 0x603] (task_register_dyld_shared_cache_image_info). bz#379372
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16328
2017-05-01 01:44:01 +00:00
Rhys Kidd
77dfe595ef macos: Fix UNKNOWN task message [id 3444, to mach_task_self(), reply 0x603] (task_register_dyld_image_infos). bz#379371
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16327
2017-05-01 00:41:40 +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
Rhys Kidd
1555060aad macos: Add a no-op wrapper for a new-in-10.12 syscall: ulock_wake
Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16320
2017-04-29 22:48:23 +00:00
Rhys Kidd
9539e65e36 macos: Add a no-op wrapper for a new-in-10.12 syscall: getentropy
Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16319
2017-04-29 22:35:30 +00:00
Rhys Kidd
f2c8220a6d macos: Improve macOS 10.12 support. bz#365327.
The new macOS 10.12 way of loading dylib (placing them at the end of the currently
loaded segments) requires that Valgrind needs to know where the last segment was loaded.

A new structure (load_info_t) has been created to store all this information and easily
carry it around.

Changes:
- dyld text address is relative instead of absolute (macOS 10.12)
- Handle dylinker's offset (macOS 10.12)
- Handle the executable requesting a non-default stack address (macOS 10.12)
- Refactor to use load_info_t structure (all macOS)

Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16318
2017-04-29 22:06:20 +00:00
Rhys Kidd
6fbaf672c8 macos: Improve consistency of VG_(printf)() usage in coregrind/m_ume/macho.c. n-i-bz.
Identified in the process of reviewing a proposed fix for bz#365327.

Patch from Louis Brunner.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16317
2017-04-29 19:39:54 +00:00
Petar Jovanovic
7d51a5cbc8 mips: add missing assembler directives to please Clang
Add missing assembler directives in VG_MINIMAL_SETJMP() and
do_syscall_WRK().
Minor rewrite of do_syscall_WRK() to use delay slots.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16316
2017-04-28 12:53:00 +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
Ivo Raisr
e8a32aa888 Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper.
Fixes BZ#379094.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16311
2017-04-25 06:44:28 +00:00
Petar Jovanovic
9b7384ae67 mips: fix build breakage introduced in r16309
Change archinfo->hwcaps to vex_archinfo.hwcaps.
Fixes build breakage.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16310
2017-04-24 13:33:17 +00:00
Julian Seward
9d6e165ea7 Bug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
This implements a fallback LL/SC implementation as described in bug 344524.

Valgrind side changes:

* Command line plumbing for --sim-hints=fallback-llsc

* memcheck: handle new arm64 guest state in memcheck/mc_machine.c



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16309
2017-04-24 09:24:57 +00:00
Petar Jovanovic
1b36c7eda6 add MIPS to info about supported architectures
Indicate that Valgrind supports MIPS architecture.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16307
2017-04-20 14:04:37 +00:00
Mark Wielaard
db52ecc036 Update libiberty demangler.
Update the libiberty demangler using the auxprogs/update-demangler
script to the gcc svn r246502 revision. Replaces our rust demangling
with the upstream variant (which is basically the same code in a
separate file). Adds handling of inheriting constructor. Handle
noexcept and throw-spec. Demangle Dc as decltype(auto). And various
(crasher) bug fixes.

Bug 378673.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16302
2017-04-12 13:01:29 +00:00
Ivo Raisr
8d35572e60 Fix an INTERNAL ERROR problem in execve syscall wrapper.
Fixes BZ#378535.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16301
2017-04-10 20:36:00 +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
Ivo Raisr
c6ef2b7e33 Follow up to SVN r16291.
Fix compilation warnings in coregrind/m_syswrap/syswrap-x86-solaris.c.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16292
2017-04-03 12:27:00 +00:00
Julian Seward
a718a920b3 Fix compilation warnings about pointer size conversions following vex r3340
(x86 guest: switch descriptor table registers to ULong type).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16291
2017-04-03 10:20:11 +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
Ivo Raisr
d9f02db4c8 Fix for 377698 - Missing memory check for futex() uaddr arg for FUTEX_WAKE,
and FUTEX_WAKE_BITSET, check only 4 args for FUTEX_WAKE_BITSET,
and 2 args for FUTEX_TRYLOCK_PI.
Fixes BZ#377698.
Patch by: diane.meirowitz@oracle.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16285
2017-03-23 23:22:21 +00:00
Julian Seward
9e280aa166 Bug 377717 - Fix massive space leak when reading compressed debuginfo sections.
This makes reading of compressed debuginfo usable for very large object files.
It also adds a bunch extra documentation about a tricky invariant in the
compressed debuginfo handling (a recursive cache refill path!) and adds a
whole bunch of assertions.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16279
2017-03-20 21:34:02 +00:00
Philippe Waroquiers
c54854475c And some more follow up for 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION
causing some addresses to be wrongly marked as addressable

Just in case, do the assert after ARG2 has been truncated to 32 bits,
to avoid comparing sign extended requests on 64 bits.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16278
2017-03-17 18:45:23 +00:00
Philippe Waroquiers
eb0d79c25a Follow up to fix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some
addresses to be wrongly marked as addressable

As noted by Ivo, if the syscall fails, then we have a leak.

So, enable the flag SfPostOnFail if we allocate memory.
In the POST ioctl, check that FAILURE only happens for this drm ioctl,
and free the memory for both SUCCESS and FAILURE.
Do the POST_MEM_WRITE only if SUCCESS
        


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16277
2017-03-17 18:38:42 +00:00
Petar Jovanovic
1a9da5927f Fix broken build on non-Linux systems
After r16273, non-Linux Valgrind builds report:

 m_signals.c:1732:36: 
 error: 'VKI_PT_PTRACED' undeclared (first use in this function)

Fix the issue with #if defined(VGO_linux) for the reported code.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16275
2017-03-16 13:10:16 +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
Petar Jovanovic
ff3c67a396 mips: improve emulation of LL/SC
Follow up to VEX r3316.

Related issue KDE #344524.

Patch by Maran Pakkirisamy.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16269
2017-03-13 17:55:07 +00:00