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.
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)
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.
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.
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.
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.
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.
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
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.
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
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.
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
Mark Wielaard [Thu, 2 Mar 2017 11:14:36 +0000 (11:14 +0000)]
Fix two safe_to_deref/sizeof mismatches in sys_sigaction/sys_rt_sigaction.
Before dereferencing the sigaction pointer and reading the fields we
need to make sure the whole struct is safe_to_deref. We were using the
size of the pointer, but needed the size of the struct.
Ivo Raisr [Sun, 26 Feb 2017 21:37:04 +0000 (21:37 +0000)]
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>
Carl Love [Mon, 20 Feb 2017 19:04:13 +0000 (19:04 +0000)]
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>
modifty sleepers to have easier evaluation of interaction between cpu freq scaling
and scheduler lock (pipe based or futex based)
See http://www.valgrind.org/docs/manual/manual-core.html#manual-core.pthreads_perf_sched
for background info about cpu freq scaling and valgrind thread scheduler.
To reproduce the interaction, do:
for sched in --fair-sched=yes --fair-sched=no
do
for affinity in 0 1
do
echo $sched $affinity
time ./vg-in-place $sched -q ./gdbserver_tests/sleepers 1000000 0 1000 B-B-B-B- $affinity
done
done
which gives the below output (intel core i5-6402P, debian 8, kernel 3.16.0).
In summary: the fair scheduler is fair, the pipe based scheduler
can be really unfair (e.g. with --fair-sched=no and no affinity,
2 threads are finishing their work, while the 2 other threads are
starting their work only after the first 2 have fully finished).
The difference in timing is significant : 1m14s versus around 47 seconds.
Note: If the governor is set to performance, strangely, the time needed for
--fair-sched=no increases slighltly (to around 48 seconds).
The time for --fair-sched=yes with or without affinity is then also
to around 48 seconds.
Below is timing with on-demand governor:
--fair-sched=yes 0
loops/sleep_ms/burn/threads_spec/affinity: 1000000 0 1000 B-B-B-B- 0
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Brussels finished to sleep and/or burn
London finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn
main finished to sleep and/or burn
real 1m14.582s
user 1m14.348s
sys 0m0.204s
--fair-sched=yes 1
loops/sleep_ms/burn/threads_spec/affinity: 1000000 0 1000 B-B-B-B- 1
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
main finished to sleep and/or burn
Brussels finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn
London finished to sleep and/or burn
real 0m46.785s
user 0m46.756s
sys 0m0.032s
--fair-sched=no 0
loops/sleep_ms/burn/threads_spec/affinity: 1000000 0 1000 B-B-B-B- 0
Brussels ready to sleep and/or burn
Brussels finished to sleep and/or burn
London ready to sleep and/or burn
London finished to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Petaouchnok finished to sleep and/or burn
main finished to sleep and/or burn
real 0m47.742s
user 0m48.224s
sys 0m0.084s
--fair-sched=no 1
loops/sleep_ms/burn/threads_spec/affinity: 1000000 0 1000 B-B-B-B- 1
Brussels ready to sleep and/or burn
London ready to sleep and/or burn
Petaouchnok ready to sleep and/or burn
main ready to sleep and/or burn
Brussels finished to sleep and/or burn
London finished to sleep and/or burn
main finished to sleep and/or burn
Petaouchnok finished to sleep and/or burn
Mark Wielaard [Sat, 18 Feb 2017 21:16:05 +0000 (21:16 +0000)]
Remove arm64 specific (unused) setup_child () and assign_guest_tls ().
valgrind svn r16186 (which fixed bug #342040 and #373192) introduced a
generic linux way of handling setup_child and assign_guest_tls. So there
is no need anymore for arch specific implementations. And gcc complained
they were unused.