]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 years agoReduce the number of compiler warnings on MIPS platforms.
Ivo Raisr [Wed, 10 May 2017 05:38:57 +0000 (05:38 +0000)] 
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

8 years agoFix typo
Philippe Waroquiers [Tue, 9 May 2017 18:08:16 +0000 (18:08 +0000)] 
Fix typo

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16347

8 years agoFirst pass triage of remaining untriaged bugs.
Julian Seward [Tue, 9 May 2017 16:23:36 +0000 (16:23 +0000)] 
First pass triage of remaining untriaged bugs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16346

8 years agomips: reduce compiler warnings
Petar Jovanovic [Tue, 9 May 2017 15:57:59 +0000 (15:57 +0000)] 
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

8 years agodrd/tests/Makefile.am: Add dlopen.stdout.exp to EXTRA_DIST
Bart Van Assche [Tue, 9 May 2017 05:13:40 +0000 (05:13 +0000)] 
drd/tests/Makefile.am: Add dlopen.stdout.exp to EXTRA_DIST

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16344

8 years agodrd/tests: Add the "dlopen" test program
Bart Van Assche [Tue, 9 May 2017 04:46:20 +0000 (04:46 +0000)] 
drd/tests: Add the "dlopen" test program

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16343

8 years agodrd: Add support for calling pthread_create() from inside a shared library - bug...
Bart Van Assche [Tue, 9 May 2017 04:45:30 +0000 (04:45 +0000)] 
drd: Add support for calling pthread_create() from inside a shared library - bug #356374

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16342

8 years agodrd: Rename a function
Bart Van Assche [Tue, 9 May 2017 04:44:25 +0000 (04:44 +0000)] 
drd: Rename a function

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16341

8 years agoRemove TileGX/Linux port.
Ivo Raisr [Mon, 8 May 2017 17:21:59 +0000 (17:21 +0000)] 
Remove TileGX/Linux port.
Fixes BZ#379504.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16340

8 years agoRemove TileGX/Linux port.
Ivo Raisr [Mon, 8 May 2017 17:21:36 +0000 (17:21 +0000)] 
Remove TileGX/Linux port.
Fixes BZ#379504.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3363

8 years agoUpdate NEWS with the latest fix
Petar Jovanovic [Mon, 8 May 2017 15:38:24 +0000 (15:38 +0000)] 
Update NEWS with the latest fix

KDE #379473 has been fixed with VEX r3362.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16339

8 years agomips: improve support for RDHWR instruction
Petar Jovanovic [Mon, 8 May 2017 15:32:25 +0000 (15:32 +0000)] 
mips: improve support for RDHWR instruction

Add support for reading CPUNum, CC and CCRes registers using RDHWR.
This is a fix for KDE #379473.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3362

8 years agoSome bug squashing before 3.13 release
Ivo Raisr [Mon, 8 May 2017 14:57:58 +0000 (14:57 +0000)] 
Some bug squashing before 3.13 release

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16338

8 years agoUpdate.
Julian Seward [Mon, 8 May 2017 14:50:42 +0000 (14:50 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16337

8 years agoFix some spelling mistakes.
Ivo Raisr [Fri, 5 May 2017 22:13:20 +0000 (22:13 +0000)] 
Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336

8 years agomips32: remove false warnings on Android
Petar Jovanovic [Fri, 5 May 2017 14:36:46 +0000 (14:36 +0000)] 
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

8 years agomips: reduce compile warnings
Petar Jovanovic [Fri, 5 May 2017 14:15:48 +0000 (14:15 +0000)] 
mips: reduce compile warnings

Tune the code so it does not trigger any compile warnings.

argregs and tmpregs arrays have been enlarged to have 8 elements on mips32,
since that way we get rid of several false warnings:

 warning: array index 5 is past the end of the array
 (which contains 4 elements) [-Warray-bounds]

Also removing three "vassert(tmp >= 0);" as these asserts are not valid,
since tmp is an unsigned value. With the change, we get rid of:

 warning: comparison of unsigned expression >= 0 is always true
 [-Wtautological-compare]

git-svn-id: svn://svn.valgrind.org/vex/trunk@3361

8 years agoFix Valgrind internal error when dereferencing memory supplied by a client
Ivo Raisr [Fri, 5 May 2017 13:20:15 +0000 (13:20 +0000)] 
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

8 years agoUpdate copyright end year to 2017 in preparation for 3.13 release.
Ivo Raisr [Thu, 4 May 2017 15:10:00 +0000 (15:10 +0000)] 
Update copyright end year to 2017 in preparation for 3.13 release.
n-i-bz

git-svn-id: svn://svn.valgrind.org/vex/trunk@3360

8 years agoUpdate copyright end year to 2017 in preparation for 3.13 release.
Ivo Raisr [Thu, 4 May 2017 15:09:39 +0000 (15:09 +0000)] 
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

8 years agoRemove list of potential trunk->3.12.1 merges as it is no longer needed with the...
Ivo Raisr [Thu, 4 May 2017 10:25:26 +0000 (10:25 +0000)] 
Remove list of potential trunk->3.12.1 merges as it is no longer needed with the upcoming 3.13

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16332

8 years agoUpdate.
Julian Seward [Thu, 4 May 2017 10:21:17 +0000 (10:21 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16331

8 years agoUpdated PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
Carl Love [Wed, 3 May 2017 18:15:01 +0000 (18:15 +0000)] 
Updated  PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.

Forgot to add the new files.

Vex commit 3359  Has the source code changes for the instruction and OV32, CS32
support

Valgrind commit 16329 updated the existing files

This commit adds all the new files.

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16330

8 years agoPPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
Carl Love [Wed, 3 May 2017 17:28:35 +0000 (17:28 +0000)] 
PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.

Additionally, the OV32 and CA32 bits were introduced in ISA 3.0 but
Valgrind add support for setting these bits for ISA 3.0.  The OV32 and CA32
bits must now be set on a number of pre ISA 3.0 instructions.  So now the
instructions produce different results in the XER register.  Thus we need pre
and post ISA 3.0 expect files.  Command line options were added to thee
pre ISA test cases so instructions that didn't change could be run with one
set of command line args.  The instructions that have different XER results
are run using a different set of command line args.  The tests were split into
two, one for instructions that didn't change on for instructions that do
change under ISA 3.0.  We then create ISA3.0 expect files only for the tests
that run differently.  By doing this we minimized the size of the expect files
needed.

Vex commit 3359  Has the source code changes for the instruction and OV32, CS32
support

This commit is all the test case changes, adding the new test case files.

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16329

8 years agoPPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
Carl Love [Wed, 3 May 2017 17:24:55 +0000 (17:24 +0000)] 
PPC64 ISA 3.0B, add support for the additional instructions: addex, mffscdrn,
mffscdrni, mffsce, mffscrn, mffscrni, mffsl. vmsumudm.

Additionally, the OV32 and CA32 bits were introduced in ISA 3.0 but
Valgrind add support for setting these bits for ISA 3.0.  The OV32 and CA32
bits must now be set on a number of pre ISA 3.0 instructions.  So now the
instructions produce different results in the XER register.  Thus we need pre
and post ISA 3.0 expect files.  Command line options were added to thee
pre ISA test cases so instructions that didn't change could be run with one
set of command line args.  The instructions that have different XER results
are run using a different set of command line args.  The tests were split into
two, one for instructions that didn't change on for instructions that do
change under ISA 3.0.  We then create ISA3.0 expect files only for the tests
that run differently.  By doing this we minimized the size of the expect files
needed.

Valgrind bugzilla 378931

git-svn-id: svn://svn.valgrind.org/vex/trunk@3359

8 years agomips: remove unnecessary code
Petar Jovanovic [Wed, 3 May 2017 14:34:02 +0000 (14:34 +0000)] 
mips: remove unnecessary code

After r16309, abiinfo->guest__use_fallback_LLSC is already set for Cavium,
and hence it is not necessary to check archinfo->hwcaps in VEX.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3358

8 years agomacos: Fix UNKNOWN task message [id 3447, to mach_task_self(), reply 0x603] (task_reg...
Rhys Kidd [Mon, 1 May 2017 01:44:01 +0000 (01:44 +0000)] 
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

8 years agomacos: Fix UNKNOWN task message [id 3444, to mach_task_self(), reply 0x603] (task_reg...
Rhys Kidd [Mon, 1 May 2017 00:41:40 +0000 (00:41 +0000)] 
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

8 years agomacos: Fix unhandled syscall: mach:70 (host_create_mach_voucher_trap). bz#379390
Rhys Kidd [Sun, 30 Apr 2017 21:52:33 +0000 (21:52 +0000)] 
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

8 years agomacos: Add additional darwin16 suppressions for system libraries. n-i-bz.
Rhys Kidd [Sun, 30 Apr 2017 19:40:03 +0000 (19:40 +0000)] 
macos: Add additional darwin16 suppressions for system libraries. n-i-bz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16325

8 years agomacos: Block out a few more macOS / Darwin syscalls. n-i-bz.
Rhys Kidd [Sun, 30 Apr 2017 01:59:33 +0000 (01:59 +0000)] 
macos: Block out a few more macOS / Darwin syscalls. n-i-bz.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16324

8 years agomacos: Add a no-op wrapper for a new-in-10.10 syscall: fstatat64
Rhys Kidd [Sun, 30 Apr 2017 00:34:59 +0000 (00:34 +0000)] 
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

8 years agomacos: Add a no-op wrapper for a new-in-10.10 syscall: faccessat
Rhys Kidd [Sun, 30 Apr 2017 00:28:10 +0000 (00:28 +0000)] 
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

8 years agomacos: Add a no-op wrapper for a new-in-10.10 syscall: csrctl
Rhys Kidd [Sun, 30 Apr 2017 00:09:56 +0000 (00:09 +0000)] 
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

8 years agomacos: Add a no-op wrapper for a new-in-10.12 syscall: ulock_wake
Rhys Kidd [Sat, 29 Apr 2017 22:48:23 +0000 (22:48 +0000)] 
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

8 years agomacos: Add a no-op wrapper for a new-in-10.12 syscall: getentropy
Rhys Kidd [Sat, 29 Apr 2017 22:35:30 +0000 (22:35 +0000)] 
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

8 years agomacos: Improve macOS 10.12 support. bz#365327.
Rhys Kidd [Sat, 29 Apr 2017 22:06:20 +0000 (22:06 +0000)] 
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

8 years agomacos: Improve consistency of VG_(printf)() usage in coregrind/m_ume/macho.c. n-i-bz.
Rhys Kidd [Sat, 29 Apr 2017 19:39:54 +0000 (19:39 +0000)] 
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

8 years agomips: add missing assembler directives to please Clang
Petar Jovanovic [Fri, 28 Apr 2017 12:53:00 +0000 (12:53 +0000)] 
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

8 years agoFollow up to SVN r16311.
Ivo Raisr [Thu, 27 Apr 2017 07:45:16 +0000 (07:45 +0000)] 
Follow up to SVN r16311.
Fix mismerge from SVN r16314.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16315

8 years agoSyscall wrapper for prctl(PR_SET_NAME) must not check more than 16 bytes.
Ivo Raisr [Wed, 26 Apr 2017 19:27:14 +0000 (19:27 +0000)] 
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

8 years agoupdate drd/tests/tc23_bogus_condwait.stderr.exp files
Petar Jovanovic [Wed, 26 Apr 2017 10:15:45 +0000 (10:15 +0000)] 
update drd/tests/tc23_bogus_condwait.stderr.exp files

Follow up to r16312. drd tests use the same file, so we need to update
its exp files too.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16313

8 years agomips: add missing assembler directive to ASM_VOLATILE_UNARY64
Petar Jovanovic [Tue, 25 Apr 2017 17:28:01 +0000 (17:28 +0000)] 
mips: add missing assembler directive to ASM_VOLATILE_UNARY64

Clang is picky and notices we have not explicitly set up fp64 mode.
This fixes issue with Clang build.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3356

8 years agomips: remove unnecessary code from FCSR_fp32 dirty helper
Petar Jovanovic [Tue, 25 Apr 2017 16:37:16 +0000 (16:37 +0000)] 
mips: remove unnecessary code from FCSR_fp32 dirty helper

These cases should never happen. Removing the code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3355

8 years agomips: limit cvt.s.l instruction translation to fp_mode64
Petar Jovanovic [Tue, 25 Apr 2017 14:40:54 +0000 (14:40 +0000)] 
mips: limit cvt.s.l instruction translation to fp_mode64

The documentation says:
"For CVT.S.L, the result of this instruction is UNPREDICTABLE if the
processor is executing in the FR=0 32-bit FPU register model; it is
predictable if executing on a 64-bit FPU in the FR=1 mode, but not with
FR=0, and not on a 32-bit FPU."

Hence the fix.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3354

8 years agomake helgrind/tc23_bogus_condwait test deterministic
Petar Jovanovic [Tue, 25 Apr 2017 13:52:21 +0000 (13:52 +0000)] 
make helgrind/tc23_bogus_condwait test deterministic

Using properly initialized mutex (instead of a dirty one) in case
"mx is not locked" makes behavior of this test deterministic.

Patch by Tamara Vlahovic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16312

8 years agoValgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper.
Ivo Raisr [Tue, 25 Apr 2017 06:44:28 +0000 (06:44 +0000)] 
Valgrind reports INTERNAL ERROR in rt_sigsuspend syscall wrapper.
Fixes BZ#379094.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16311

8 years agomips: fix build breakage introduced in r16309
Petar Jovanovic [Mon, 24 Apr 2017 13:33:17 +0000 (13:33 +0000)] 
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

8 years agowiden_z_16_to_64, widen_z_8_to_64: generate less stupid code.
Julian Seward [Mon, 24 Apr 2017 10:57:05 +0000 (10:57 +0000)] 
widen_z_16_to_64, widen_z_8_to_64: generate less stupid code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3353

8 years agoBug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
Julian Seward [Mon, 24 Apr 2017 09:24:57 +0000 (09:24 +0000)] 
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

8 years agoBug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)
Julian Seward [Mon, 24 Apr 2017 09:23:43 +0000 (09:23 +0000)] 
Bug 369459 - valgrind on arm64 violates the ARMv8 spec (ldxr/stxr)

This implements a fallback LL/SC implementation as described in bug 344524.

The fallback implementation is not enabled by default, and there is no
auto-detection for when it should be used.  To use it, run with the
flag --sim-hints=fallback-llsc.  This commit also allows the existing
MIPS fallback implementation to be enabled with that flag.

VEX side changes:

* priv/main_main.c, pub/libvex.h

  Adds new field guest__use_fallback_LLSC to VexAbiInfo

* pub/libvex_guest_arm64.h priv/guest_arm64_toIR.c

  add front end support, new guest state fields
  guest_LLSC_{SIZE,ADDR,DATA}, also documentation of the scheme

* priv/guest_mips_toIR.c

  allow manual selection of fallback implementation via
  --sim-hints=fallback-llsc

* priv/host_arm64_defs.c priv/host_arm64_defs.h priv/host_arm64_isel.c

  Add support for generating CAS on arm64, as needed by the front end changes

git-svn-id: svn://svn.valgrind.org/vex/trunk@3352

8 years agoupdate svn:ignore list
Petar Jovanovic [Thu, 20 Apr 2017 14:07:37 +0000 (14:07 +0000)] 
update svn:ignore list

Add mcmain_pic.heur to the svn:ignore list.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16308

8 years agoadd MIPS to info about supported architectures
Petar Jovanovic [Thu, 20 Apr 2017 14:04:37 +0000 (14:04 +0000)] 
add MIPS to info about supported architectures

Indicate that Valgrind supports MIPS architecture.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16307

8 years agoHave a cleaner way to remove the massif preload from LD_PRELOAD.
Philippe Waroquiers [Wed, 19 Apr 2017 20:15:50 +0000 (20:15 +0000)] 
Have a cleaner way to remove the massif preload from LD_PRELOAD.

The previous code was removing the massif preload (when --pages-as-heap=yes)
by replacing the entry with spaces.
This is not very clear, and I suspect this gives problems with the
android linker, which seems to use such a space entry as a real entry
to load (and then fails to start the application).

This patch really removes the entry, by shifting the characters.

Tested on amd64/debian.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16306

8 years agoFix regression following r16303
Philippe Waroquiers [Sun, 16 Apr 2017 08:36:43 +0000 (08:36 +0000)] 
Fix regression following r16303
Use 'set heuristic-fence-post 999999' only on mips platforms

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16305

8 years agoadd additional stderr.exp file for helgrind/tests/pth_destroy_cond
Petar Jovanovic [Thu, 13 Apr 2017 16:33:06 +0000 (16:33 +0000)] 
add additional stderr.exp file for helgrind/tests/pth_destroy_cond

On some platforms, Helgrind detects valid additional data race over "cond".
Thread one is at pthread_cond_wait(&cond, &mutex).
Thread two is at pthread_cond_destroy(&cond).

This fixes helgrind/tests/pth_destroy_cond on different platforms.

Contributed by Aleksandra Karadzic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16304

8 years agoincrease heuristic-fence-post limit for gdbserver_tests/mcmain_pic
Petar Jovanovic [Thu, 13 Apr 2017 16:11:54 +0000 (16:11 +0000)] 
increase heuristic-fence-post limit for gdbserver_tests/mcmain_pic

GDB reports to be "unable to find the start of the function" and suggests
increasing the range of the search using the 'set heuristic-fence-post'
command. So we did.
It fixes gdbserver_tests/mcmain_pic on some platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16303

8 years agofix early initialization of s390_host_hwcaps in LibVEX_FrontEnd
Petar Jovanovic [Wed, 12 Apr 2017 17:51:45 +0000 (17:51 +0000)] 
fix early initialization of s390_host_hwcaps in LibVEX_FrontEnd

This is a follow-up to r3341 and r3344. r3341 split LibVEX_Translate into
LibVEX_FrontEnd and LibVEX_BackEnd. s390_host_hwcaps needs to be initialized
early when arch_host is VexArchS390X.

This also fixes none/tests/libvexmultiarch_test on MIPS64 BE platforms.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3348

8 years agoUpdate libiberty demangler.
Mark Wielaard [Wed, 12 Apr 2017 13:01:29 +0000 (13:01 +0000)] 
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

8 years agomips: update code for Dis_Resteer for mode64
Petar Jovanovic [Tue, 11 Apr 2017 17:06:02 +0000 (17:06 +0000)] 
mips: update code for Dis_Resteer for mode64

Even though Dis_Resteer is currently unused, the code for mode64 should
be different.
Nicely spotted by Florian K.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3347

8 years agoMark VPMULHRSW ymm3/m256, ymm2, ymm1 as a "verbose instruction". This
Julian Seward [Tue, 11 Apr 2017 16:34:53 +0000 (16:34 +0000)] 
Mark VPMULHRSW ymm3/m256, ymm2, ymm1 as a "verbose instruction".  This
pertains to failures documented at https://bugs.kde.org/show_bug.cgi?id=375839
comments 10 to 18.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3346

8 years agoFix an INTERNAL ERROR problem in execve syscall wrapper.
Ivo Raisr [Mon, 10 Apr 2017 20:36:00 +0000 (20:36 +0000)] 
Fix an INTERNAL ERROR problem in execve syscall wrapper.
Fixes BZ#378535.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16301

8 years agoUpdate svn:ignore list
Petar Jovanovic [Mon, 10 Apr 2017 17:55:59 +0000 (17:55 +0000)] 
Update svn:ignore list

Add vgprintf_nvalgrind to it.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16300

8 years agomips64: update Makefile
Petar Jovanovic [Mon, 10 Apr 2017 17:43:20 +0000 (17:43 +0000)] 
mips64: update Makefile

Update Makefile with new name for the stdout.exp file.
Missed to do this as part of r16298.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16299

8 years agomips64: update cvm_atomic_thread test for BE
Petar Jovanovic [Mon, 10 Apr 2017 17:11:01 +0000 (17:11 +0000)] 
mips64: update cvm_atomic_thread test for BE

Update the test cvm_atomic_thread so it can be executed on BE boards too.
Reuse the stdout.exp file.

Based on patch from Tamara Vlahovic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16298

8 years agoUpdate NEWS
Petar Jovanovic [Thu, 6 Apr 2017 12:46:06 +0000 (12:46 +0000)] 
Update NEWS

r16296 has fixed Bug 359202.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16297

8 years agoAdd musl libc configure/compile
Petar Jovanovic [Thu, 6 Apr 2017 12:39:15 +0000 (12:39 +0000)] 
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

8 years agoInitialize s390_host_hwcaps early in LibVEX_FrontEnd.
Mark Wielaard [Tue, 4 Apr 2017 12:02:14 +0000 (12:02 +0000)] 
Initialize s390_host_hwcaps early in LibVEX_FrontEnd.

VEX svn r3341 split LibVEX_Translate into LibVEX_FrontEnd and
LibVEX_BackEnd. The s390_host_hwcaps (KLUDGE) needs to be initialized
early in LibVEX_FrontEnd.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3344

8 years agomips: update the list of fixed bugs for 3.12 release
Petar Jovanovic [Tue, 4 Apr 2017 11:09:00 +0000 (11:09 +0000)] 
mips: update the list of fixed bugs for 3.12 release

For the record, bug 348924 has been fixed with VEX r3219.
This fix is already available in 3.12 release.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16294

8 years agomips: update the list of fixed bugs
Petar Jovanovic [Tue, 4 Apr 2017 10:40:22 +0000 (10:40 +0000)] 
mips: update the list of fixed bugs

Bug 340777 has been resolved with different changes over the last two years.
The last important commit is r16261.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16293

8 years agomips64: sign-extend results from dirty helper
Petar Jovanovic [Mon, 3 Apr 2017 14:30:13 +0000 (14:30 +0000)] 
mips64: sign-extend results from dirty helper

Values returned from the dirty helper may not be sign-extended, so let's
make sure the values get passed as sign-extended for Ity_I32, Ity_I16, and
Ity_I8 cases.
At the same time, we can remove now redundant sign-extensions introduced in
VEX r3304.

This fixes memcheck/test/bug340392 on some MIPS64 boards.

Patch by Aleksandar Rikalo.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3342

8 years agoSplit LibVEX_Translate into front- and back-end parts. Also, removes use
Julian Seward [Mon, 3 Apr 2017 13:24:05 +0000 (13:24 +0000)] 
Split LibVEX_Translate into front- and back-end parts.  Also, removes use
of __typeof__ when built with MSVC.  A combination of parts of two patches
from Andrew Dutcher <andrewrdutcher@gmail.com>.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3341

8 years agoFollow up to SVN r16291.
Ivo Raisr [Mon, 3 Apr 2017 12:27:00 +0000 (12:27 +0000)] 
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

8 years agoFix compilation warnings about pointer size conversions following vex r3340
Julian Seward [Mon, 3 Apr 2017 10:20:11 +0000 (10:20 +0000)] 
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

8 years agox86 guest: switch descriptor table registers to ULong type so they will take up
Julian Seward [Mon, 3 Apr 2017 10:19:13 +0000 (10:19 +0000)] 
x86 guest: switch descriptor table registers to ULong type so they will take up
consistent amount of space (VEX side).  Andrew Dutcher <andrewrdutcher@gmail.com>.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3340

8 years agoBug 358697 - valgrind.h: Some code remains even when defining NVALGRIND.
Julian Seward [Thu, 30 Mar 2017 12:14:23 +0000 (12:14 +0000)] 
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

8 years agoAdd a mechanism for hinting to the core disassembler loop, that the
Julian Seward [Wed, 29 Mar 2017 16:13:35 +0000 (16:13 +0000)] 
Add a mechanism for hinting to the core disassembler loop, that the
just-disassembled instruction is very verbose.  This allows dynamic changes to
the maximum number of guest instructions allowed in the current IRSB.
Fixes #375839.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3337

8 years agoImplement the most important cases for amd64 direct-reload optimisation:
Julian Seward [Tue, 28 Mar 2017 14:57:17 +0000 (14:57 +0000)] 
Implement the most important cases for amd64 direct-reload optimisation:

   cmpq $imm32, %vreg  ->  cmpq $imm32, (stack-slot-of-vreg)
   orq %vreg, %reg     ->  orq (stack-slot-of-vreg), %reg

This is in support of "Bug 375839 - Temporary storage exhausted, when long
sequence of vfmadd231ps instructions to be executed", and reduces code size by
around 3% in that case.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3335

8 years agoRewrite dis_FMA so it generates not-quite-so-terrible code. It's still terrible
Julian Seward [Mon, 27 Mar 2017 18:32:10 +0000 (18:32 +0000)] 
Rewrite dis_FMA so it generates not-quite-so-terrible code.  It's still terrible
(breaks vectors into scalars) but this rewrite does it in a way which makes it
interact better with put-to-get forwarding.  It also removes all the
Iop_Reinterp casting involved.  For long sequences of FMA instructions this
reduces the amount of memcheck-generated code to about 75% of what it was
before.  Improves the situation for
  Bug 375839 - Temporary storage exhusted , when long sequence of vfmadd231ps instructions to be executed
but isn't a convincing fix.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3331

8 years agofcntl syscall wrapper was missing flock structure check on Linux.
Ivo Raisr [Mon, 27 Mar 2017 05:06:32 +0000 (05:06 +0000)] 
fcntl syscall wrapper was missing flock structure check on Linux.
Fixes BZ#377930.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16287

8 years agoUse consistently chase1() in MSVC specific transformation hacks.
Ivo Raisr [Fri, 24 Mar 2017 13:46:15 +0000 (13:46 +0000)] 
Use consistently chase1() in MSVC specific transformation hacks.
This code is experimental and not used by default but should be self-consistent.
n-i-bz

git-svn-id: svn://svn.valgrind.org/vex/trunk@3329

8 years agomemcheck/tests/unit_oset.c: Fix compiler warnings
Bart Van Assche [Fri, 24 Mar 2017 02:07:14 +0000 (02:07 +0000)] 
memcheck/tests/unit_oset.c: Fix compiler warnings

Avoid that the compiler warns about using the result of an assignment
as a truth value.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16286

8 years agoFix for 377698 - Missing memory check for futex() uaddr arg for FUTEX_WAKE,
Ivo Raisr [Thu, 23 Mar 2017 23:22:21 +0000 (23:22 +0000)] 
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

8 years agoAnnounce fix for bug 377717 in the NEWS
Ivo Raisr [Thu, 23 Mar 2017 22:12:03 +0000 (22:12 +0000)] 
Announce fix for bug 377717 in the NEWS

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16284

8 years agoBug 377717 - Fix massive space leak when reading compressed debuginfo sections.
Julian Seward [Mon, 20 Mar 2017 21:34:02 +0000 (21:34 +0000)] 
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

8 years agoAnd some more follow up for 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION
Philippe Waroquiers [Fri, 17 Mar 2017 18:45:23 +0000 (18:45 +0000)] 
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

8 years agoFollow up to fix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some
Philippe Waroquiers [Fri, 17 Mar 2017 18:38:42 +0000 (18:38 +0000)] 
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

8 years agoUpdate the list of fixed issues
Petar Jovanovic [Thu, 16 Mar 2017 15:07:12 +0000 (15:07 +0000)] 
Update the list of fixed issues

The bug 377376 has been fixed with r16273 and r16275.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16276

8 years agoFix broken build on non-Linux systems
Petar Jovanovic [Thu, 16 Mar 2017 13:10:16 +0000 (13:10 +0000)] 
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

8 years agoFix 376956 syswrap of SNDDRV and DRM_IOCTL_VERSION causing some addresses
Philippe Waroquiers [Wed, 15 Mar 2017 19:35:29 +0000 (19:35 +0000)] 
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

8 years agoAdd support for syscall ptrace(traceme)
Petar Jovanovic [Wed, 15 Mar 2017 15:23:27 +0000 (15:23 +0000)] 
Add support for syscall ptrace(traceme)

It fixes Bug 377376.

Patch by Aleksandra Karadzic.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16273

8 years agoUpdate the list of fixed bugs
Petar Jovanovic [Tue, 14 Mar 2017 17:11:51 +0000 (17:11 +0000)] 
Update the list of fixed bugs

The following issues have been fixed:

341481 MIPS64: Iop_CmpNE32 triggers false warning on MIPS64 platforms
(VEX r3304)

344524 store conditional of guest applications always fail - observed
on Octeon3(MIPS)
(Valgrind r16269, VEX r3316)

376142 Segfaults on MIPS Cavium Octeon boards
(Valgrind r16261)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16272

8 years agoFix type of t_inc to correct IRTemp.
Ivo Raisr [Tue, 14 Mar 2017 00:47:45 +0000 (00:47 +0000)] 
Fix type of t_inc to correct IRTemp.
No functional change.
n-i-bz

git-svn-id: svn://svn.valgrind.org/vex/trunk@3319

8 years agoThere is a typo in the configure.ac file that causes the HAS_ISA_3_00
Carl Love [Mon, 13 Mar 2017 20:14:08 +0000 (20:14 +0000)] 
There is a typo in the configure.ac file that causes the HAS_ISA_3_00
variable to not be set.

The mask64 value, in file VEX/priv/guest_ppc_toIR.c is missing the
HWCAPS bit for ISA3.0.

vex commit 3317.

bugzilla 377478

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16270

8 years agoThe mask64 value, in file VEX/priv/guest_ppc_toIR.c is missing the
Carl Love [Mon, 13 Mar 2017 20:10:40 +0000 (20:10 +0000)] 
The mask64 value, in file VEX/priv/guest_ppc_toIR.c is missing the
HWCAPS bit for ISA3.0.

bugzilla 377478

git-svn-id: svn://svn.valgrind.org/vex/trunk@3317

8 years agomips: improve emulation of LL/SC
Petar Jovanovic [Mon, 13 Mar 2017 17:55:07 +0000 (17:55 +0000)] 
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

8 years agomips: emulate LL/SC w/ guest_LLaddr and guest_LLdata
Petar Jovanovic [Mon, 13 Mar 2017 17:50:25 +0000 (17:50 +0000)] 
mips: emulate LL/SC w/ guest_LLaddr and guest_LLdata

Improve LL/SC emulation with introduction of LLaddr and LLdata in the
guest state. LLaddr gets invalidated when the threads switch.

More info at KDE #344524. This patch should fix the issue.

Currently, this is effective for Cavium boards only.

Patch by Maran Pakkirisamy.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3316

8 years agoAdd missing break for the DRM ioctl operations that do not have any args
Philippe Waroquiers [Sat, 11 Mar 2017 21:07:21 +0000 (21:07 +0000)] 
Add missing break for the DRM ioctl operations that do not have any args
Due to this missing break, the code was falling through to
the case VKI_SNDRV_CTL_IOCTL_PVERSION:
and was then setting some bytes as defined at (whatever address is in) ARG3.

Patch and analysis by Daniel Glöckner

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16266

8 years agoPowerPC: Fix incorrect register pair check for lxv, stxv, stxsd, stxssp, lxsd,
Carl Love [Fri, 10 Mar 2017 20:10:49 +0000 (20:10 +0000)] 
PowerPC:  Fix incorrect register pair check for lxv, stxv, stxsd, stxssp, lxsd,
lxssp instructions

The lfdpx, stdpx, lfdp and stfdp instructions work on a register pair.  The
register pair test must only be applied to these instructions in the
dis_fp_pair() function.

Updating NEWS file for the commit

VEX commit 3308  makes the fix in VEX/priv/guest_ppc_toIR.c

bugzilla 377427

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16262

8 years agoPowerPC: Fix incorrect register pair check for lxv, stxv, stxsd, stxssp, lxsd,
Carl Love [Fri, 10 Mar 2017 20:07:09 +0000 (20:07 +0000)] 
PowerPC:  Fix incorrect register pair check for lxv, stxv, stxsd, stxssp, lxsd,
lxssp instructions

The lfdpx, stdpx, lfdp and stfdp instructions work on a register pair.  The
register pair test must only be applied to these instructions in the
dis_fp_pair() function.

bugzilla 377427

git-svn-id: svn://svn.valgrind.org/vex/trunk@3308