]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
9 years agoWorkaround bar_bad testcase hanging with newer glibc in helgrind/drd tests.
Mark Wielaard [Mon, 19 Sep 2016 14:16:35 +0000 (14:16 +0000)] 
Workaround bar_bad testcase hanging with newer glibc in helgrind/drd tests.

This is a workaround for bug #358213 helgrind/drd pthread_barrier tests
hangs with new glibc pthread barrier implementation. This makes sure that
the tests don't hang anymore. It does this by creating new threads that
sleep and kill the other threads after some time. But this introduces
some non-determinism that might cause the tests to occassionally fail
(both against old and new glibc implementations).

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

9 years agoTestcases for fma4 instructions. Bug #369000.
Mark Wielaard [Mon, 19 Sep 2016 12:41:38 +0000 (12:41 +0000)] 
Testcases for fma4 instructions. Bug #369000.

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

9 years agoImplement AMD FMA4 instructions. Bug #369000.
Mark Wielaard [Mon, 19 Sep 2016 12:41:19 +0000 (12:41 +0000)] 
Implement AMD FMA4 instructions. Bug #369000.

Original patch by p4plus2@gmail.com.

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

9 years agoFix bad gdbserver_tests heap usage tests stderr output.
Mark Wielaard [Mon, 19 Sep 2016 08:08:51 +0000 (08:08 +0000)] 
Fix bad gdbserver_tests heap usage tests stderr output.

When doing inferior function calls from gdb (in mcmain_pic) there might
be extra heap usage from gdb that we aren't interested in tracking.

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

9 years agoUpdate bug lists.
Julian Seward [Fri, 16 Sep 2016 13:38:02 +0000 (13:38 +0000)] 
Update bug lists.

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

9 years agoUpdate bug list.
Julian Seward [Thu, 15 Sep 2016 10:56:00 +0000 (10:56 +0000)] 
Update bug list.

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

9 years agoupdated the NEWS file for bugzillas that have been closed:
Carl Love [Wed, 14 Sep 2016 17:16:52 +0000 (17:16 +0000)] 
updated the NEWS file for bugzillas that have been closed:

   Bugzilla 368412 commit15952
   Bugzilla 368416 commit15956

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

9 years agoAdd tc06_two_races_xml.exp output for ppc64
Carl Love [Wed, 14 Sep 2016 16:43:27 +0000 (16:43 +0000)] 
Add tc06_two_races_xml.exp output for ppc64

Update xml filter to suppress pthread_create_WRK frame.  Update the filter_xml
filter to suppress the frame containing the pthread_create_WRK function.  This
allows the tc06_two_races_xml test to complete reliably on power.

This change also adds the ability to suppress the printf that generates a
"pthread_create_WRK...pthread_create" entry to replace the suppressed frame.

This is conceptually a follow-up from r13983, which suppresses the
pthread_create_WRK entry from non-xml outputs.

Patch submitted by Will Schmidt  <will_schmidt@vnet.ibm.com>

Bugzilla 368416

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

9 years agoAdapt massif mmapunmap test to handle ppc64 backtrace
Carl Love [Wed, 14 Sep 2016 15:50:48 +0000 (15:50 +0000)] 
Adapt massif mmapunmap test to handle ppc64 backtrace

The reported backtrace on ppc64 platform reports "generic_start_main.isra.0"
in the backtrace, where other platforms typically see "main".  Adjust the
vgtest file to handle this variation.  This is similar to existing changes
as seen in deep-D.post.exp

FORGOT to add the file massif/tests/mmapunmap.post.exp-ppc64 before doing
commit 15950.

Bugzilla 368461

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

9 years agoUpdate.
Julian Seward [Wed, 14 Sep 2016 13:15:28 +0000 (13:15 +0000)] 
Update.

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

9 years agoBug #359503 continued. adjtimex syscall missing on arm64.
Mark Wielaard [Wed, 14 Sep 2016 11:47:26 +0000 (11:47 +0000)] 
Bug #359503 continued. adjtimex syscall missing on arm64.

Enable adjtimex syscall on arm64 and fix bug if argument is a bad pointer.

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

9 years agoCorrect an Altivec configure think-o.
Mark Wielaard [Tue, 13 Sep 2016 19:18:36 +0000 (19:18 +0000)] 
Correct an Altivec configure think-o.

An earlier change introduced a think-o in the altivec capability
check, allowing a false positive if the compiler supported altivec
but the hardware did not.

Resolves bug #368412 - False positive result for altivec capability check
Patch by Will Schmidt <will_schmidt@vnet.ibm.com>

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

9 years agoUpdate libiberty demangler.
Mark Wielaard [Tue, 13 Sep 2016 19:06:23 +0000 (19:06 +0000)] 
Update libiberty demangler.

Update the libiberty demangler using the auxprogs/update-demangler
script. There were various extensions and bug fixes since our last
import. Add new D language demangler file d-demangle.c and update
the vg_libciface.h header with some new constructs used (strtol,
xmalloc_failed, xmemdup, XDELETEVEC, XDUPVEC).

Resolves bug #359181 - Buffer Overflow during Demangling.

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

9 years agoAdapt massif mmapunmap test to handle ppc64 backtrace
Carl Love [Tue, 13 Sep 2016 15:54:33 +0000 (15:54 +0000)] 
Adapt massif mmapunmap test to handle ppc64 backtrace

The reported backtrace on ppc64 platform reports "generic_start_main.isra.0"
in the backtrace, where other platforms typically see "main".  Adjust the
vgtest file to handle this variation.  This is similar to existing changes
as seen in deep-D.post.exp

Bugzilla 368461

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

9 years agoSupport clang compiler shipped with Apple’s Xcode 8. bz#366138.
Rhys Kidd [Sun, 11 Sep 2016 13:54:04 +0000 (13:54 +0000)] 
Support clang compiler shipped with Apple’s Xcode 8. bz#366138.

This applies to both OS X 10.11 and macOS 10.12.

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

9 years agoImprove configure output error message, when compiler version not supported. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 13:42:50 +0000 (13:42 +0000)] 
Improve configure output error message, when compiler version not supported. n-i-bz.

Based on a patch by Jeremy Hu <jeremyhu@uclink4.berkeley.edu>. Refer bz#366138.

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

9 years agoMAXSYSCALL for OS X 10.11.6 (xnu 3248.60.10) was indeed 500. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 05:28:59 +0000 (05:28 +0000)] 
MAXSYSCALL for OS X 10.11.6 (xnu 3248.60.10) was indeed 500. n-i-bz.

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

9 years agoFollow up to r15905, properly guard memcheck/tests/amd64/shr_edx on clang. n-i-bz.
Rhys Kidd [Sun, 11 Sep 2016 04:33:20 +0000 (04:33 +0000)] 
Follow up to r15905, properly guard memcheck/tests/amd64/shr_edx on clang. n-i-bz.

“error in backend: 32-bit absolute addressing is not supported in 64-bit mode”

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

9 years agoFix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more...
Philippe Waroquiers [Wed, 7 Sep 2016 20:12:30 +0000 (20:12 +0000)] 
Fix 199468 - Suppressions: stack size limited to 25 while --num-callers allows more frames

Nr of callers in a suppression entry had a smaller limit than the max
for --num-callers.
This means it was not possible to precisely suppress an error with a big
stack trace.
Also, --gen-suppressions was not providing the full stack trace of
the error in the generated suppressions.

Now, a suppression entry can have the same nr of callers as a backtrace.
Generated suppressions are generated with up to --num-callers callers.

This change has neglectible impact :
* memory: stack array of 500*2 words is declared, instead of 24*2 words
  This array is declared on the interim stack (startup stack), which is
  largely big enough.
* cpu : neglectible more cpu needed to read suppression entries
        (to initialise the bigger stack array when reading a supp entry),
Apart of the above, no impact on performance (unless of course bigger
supp entries are really used).

Note that this does not impact the behaviour for existing suppression files.

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

9 years agoUse -std=c++0x for big_debuginfo_symbol to appease older compilers.
Mark Wielaard [Mon, 5 Sep 2016 13:13:12 +0000 (13:13 +0000)] 
Use -std=c++0x for big_debuginfo_symbol to appease older compilers.

gcc 4.4 doesn't know -std=c++11, but does recognize -std=c++0x.

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

9 years agoConnect up the v8 memory insn tests to the build system, and arrange
Julian Seward [Thu, 1 Sep 2016 15:19:07 +0000 (15:19 +0000)] 
Connect up the v8 memory insn tests to the build system, and arrange
for both ARM and Thumb encodings to be tested.

Modify the existing v8 crypto tests so that both ARM and Thumb encodings
are tested.

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

9 years agoEnable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
Julian Seward [Thu, 1 Sep 2016 13:10:55 +0000 (13:10 +0000)] 
Enable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
(load-acquire exclusive, store-release exclusive)

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

9 years agoImplement arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
Julian Seward [Thu, 1 Sep 2016 13:08:10 +0000 (13:08 +0000)] 
Implement arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D}
(load-acquire exclusive, store-release exclusive)

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

9 years agoAdd test cases for ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.
Julian Seward [Sun, 28 Aug 2016 16:17:12 +0000 (16:17 +0000)] 
Add test cases for ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.
Not connected to the build system yet.

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

9 years agoImplement ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.
Julian Seward [Sun, 28 Aug 2016 16:16:27 +0000 (16:16 +0000)] 
Implement ARMv8 insns: LDA, LDAB, LDAH, STL, STLB, STLH.

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

9 years agoAllow building vbit_test when srdir != builddir.
Mark Wielaard [Fri, 26 Aug 2016 13:10:14 +0000 (13:10 +0000)] 
Allow building vbit_test when srdir != builddir.

Link against libvex-<arch>-<os>.a in top_builddir.

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

9 years agoAdd a dummy initialisation and a dummy path to avoid warnings with gcc -Og.
Julian Seward [Fri, 19 Aug 2016 11:47:59 +0000 (11:47 +0000)] 
Add a dummy initialisation and a dummy path to avoid warnings with gcc -Og.
Neither are actually necessary, but gcc's flow analysis at -Og is weaker than
at -O or above and so it produces false warnings here.   No functional change.

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

9 years agoFollow up to SVN commit r15936.
Ivo Raisr [Wed, 17 Aug 2016 18:05:13 +0000 (18:05 +0000)] 
Follow up to SVN commit r15936.
Fix the sloppy check I introduced.
n-i-bz

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

9 years agoPower PC Add support for ISA 3.0, part 5, fix
Carl Love [Wed, 17 Aug 2016 00:28:33 +0000 (00:28 +0000)] 
Power PC Add support for ISA 3.0, part 5, fix

Fix for  the xscvdphp instruction added in vex commit 3244.

Bugzilla 364948

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

9 years agoPower PC test suite for ISA 3.0, part 5 of 5
Carl Love [Mon, 15 Aug 2016 21:54:04 +0000 (21:54 +0000)] 
Power PC test suite for ISA 3.0, part 5 of 5

The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3244 is added in this commit.

bugzilla 364948

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

9 years agoPower PC Add support for ISA 3.0, part 5
Carl Love [Mon, 15 Aug 2016 21:53:20 +0000 (21:53 +0000)] 
Power PC Add support for ISA 3.0, part 5

Added support for the
cnttz, cnttz., cnttzd, cnttzd., vctzb, vctzh, vctzw,
vctzd, xscvhpdp, xscvdphp, xvcvhpsp, xvcvsphpv,
xsrqpi, xsrqpix, xsrqpxp, xsaddqp, xsaddqpo, xsmulqp,
xsmulqpo, xsmaddqp, xsmaddqpo, xsmsubqp, xsmsubqpo,
xsnmaddqp, xsnmaddqpo, xsnmsubqp, xsnmsubqpo, xssubqp,
xssubqpo, xsdivqp, xsdivqpo, xssqrtqp, xssqrtqpo,
xscvqpuwz, xscvudqp, xscvqpswz, xscvsdqp, xscvqpudz,
xscvqpdp, xscvqpdpo, xscvdpqp, xscvqpsdz, vmul10cuq,
vmul10ecuq, vmul10uq, vmul10euq, bcdctsq, bcdcfsq
instructions.

Most of these instructions required adding a new Iop as they could not
be emulated with existing Iops.  In some cases, some of the above instrctions
could be emulated using another instruction from the above list.

Most of the instructions add support for 128-bit instructions.  There are a
number of helper functions that check a values for zero, infinity, NaN, etc.
for various sizes.  The new 128-bit instructions require a new version of these
existing functions for a 128-bit operand.  Rather then adding another size
specific version of these functions, the existing size specific functions were
replaced with a single function that takes the size of operand to be operated
on.  There are some additional helper functions that are added to support
the size independent version of these functions.

Note this is the last of the 5 patches required to complete the ISA 3.0
support.

Bugzilla 364948

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

9 years agoFollow up to r15936.
Ivo Raisr [Mon, 15 Aug 2016 02:31:27 +0000 (02:31 +0000)] 
Follow up to r15936.
Kernel allocates another page after fork and we have to
keep aspacemgr's point of view consistent.
n-i-bz

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

9 years agoFollow recent Solaris development with respect to
Ivo Raisr [Fri, 12 Aug 2016 22:28:50 +0000 (22:28 +0000)] 
Follow recent Solaris development with respect to
SUNWDTRACE program header. Newer Solaris no longer utilizes
this program header as a scratchspace for DTrace fasttrap
provider, before libc is loaded.
For the time being, it serves as a space for initial thread
pointer.
n-i-bz

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

10 years agoConnect the v8crypto test to the build system, at least somewhat, so
Julian Seward [Wed, 10 Aug 2016 22:22:20 +0000 (22:22 +0000)] 
Connect the v8crypto test to the build system, at least somewhat, so
as to make the post-regtest-tests happy.  Still needs configure.ac
checking for "-mfpu=crypto-neon-fp-armv8" gcc flag support.

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

10 years agomips32: add support for FPXX mode
Petar Jovanovic [Wed, 10 Aug 2016 14:38:10 +0000 (14:38 +0000)] 
mips32: add support for FPXX mode

With this patch, MIPS32 Valgrind compiled with -mfpxx can handle all types
(regarding FP_ABI flag) of MIPS32 ELFs.

- Functions arch_elf_pt_proc() and arch_check_elf() are added to elf reader
  according to linux/fs/binfmt_elf.c from Linux 4.1;
- Processing .MIPS.abiflags section and initializing appropriate FPU mode
  for MIPS32 are added;
- Emulation of prctl(GET/SET_FP_MODE) sys-calls are implemented for MIPS32.

Patch by Aleksandar Rikalo <Aleksandar.Rikalo@imgtec.com>

Related VEX change: r3243.

This implements BZ#366079.

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

10 years agomips32: extend the current fp-mode code to support fpxx features
Petar Jovanovic [Wed, 10 Aug 2016 14:33:21 +0000 (14:33 +0000)] 
mips32: extend the current fp-mode code to support fpxx features

Part of the changes to support FPXX mode for MIPS32.

Patch by Aleksandar Rikalo <Aleksandar.Rikalo@imgtec.com>

Related issue BZ #366079.

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

10 years agonone/tests/arm/v8crypto:
Julian Seward [Sun, 7 Aug 2016 23:36:10 +0000 (23:36 +0000)] 
none/tests/arm/v8crypto:
* enable all tests in this file
* add an expected output (stderr.exp) file

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

10 years agoImplement VMULL.P64.
Julian Seward [Sun, 7 Aug 2016 23:33:48 +0000 (23:33 +0000)] 
Implement VMULL.P64.

dis_neon_data_3diff: don't mistakenly recognise VMULL.P64 as a plain
VMUL due to inadequate checking for the VMULL.P64 case.

Fix ARM decoding of SHA1SU1, SHA256SU0, SHA1H introduced in r3241.

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

10 years agoImplement SHA1C, SHA1M, SHA1P, SHA1SU0, SHA256H2, SHA256H, SHA256SU1,
Julian Seward [Sun, 7 Aug 2016 16:42:37 +0000 (16:42 +0000)] 
Implement SHA1C, SHA1M, SHA1P, SHA1SU0, SHA256H2, SHA256H, SHA256SU1,
SHA1H, SHA1SU1, SHA256SU0.

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

10 years agoFix UBSAN reported complaints about left shifts of signed values
Julian Seward [Sat, 6 Aug 2016 13:04:32 +0000 (13:04 +0000)] 
Fix UBSAN reported complaints about left shifts of signed values
in the arm32 front and back ends.

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

10 years agoFix uses of CPSR in these tests, so that (1) the relevant fields are
Julian Seward [Sat, 6 Aug 2016 12:33:59 +0000 (12:33 +0000)] 
Fix uses of CPSR in these tests, so that (1) the relevant fields are
initialised properly before the test, and (2) after the test, we don't
print implementation-defined parts of the resulting CPSR.

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

10 years agodo_vldm_vstm_check: don't use caller saved FP ('s') registers to hold
Julian Seward [Sat, 6 Aug 2016 12:32:37 +0000 (12:32 +0000)] 
do_vldm_vstm_check: don't use caller saved FP ('s') registers to hold
data that we expect to stay alive over calls to printf.  Fixes erratic
failures of this test.

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

10 years agoFix invalid code caught by Ubsan, in which we compute the address
Julian Seward [Sat, 6 Aug 2016 07:15:30 +0000 (07:15 +0000)] 
Fix invalid code caught by Ubsan, in which we compute the address
of "cgs->events[-1]", even though it isn't dereferenced.

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

10 years agoFix completely bogus array indexing introduced in r15927 -- how did this
Julian Seward [Fri, 5 Aug 2016 17:22:21 +0000 (17:22 +0000)] 
Fix completely bogus array indexing introduced in r15927 -- how did this
ever work?  Spotted by UBSAN.  Yay UBSAN!  Also update comments.

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

10 years agoUpdate.
Julian Seward [Fri, 5 Aug 2016 15:15:20 +0000 (15:15 +0000)] 
Update.

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

10 years agoReduce the number of IR sanity checks from 4 per block to 2 per block.
Julian Seward [Fri, 5 Aug 2016 15:02:48 +0000 (15:02 +0000)] 
Reduce the number of IR sanity checks from 4 per block to 2 per block.
Also relax assertion checking in the register allocator.

Together with valgrind r15927 this reduces per-block JITting cost by 10%-15%.

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

10 years agoReimplement MC_(final_tidy) much more efficiently. This reduces its instruction
Julian Seward [Fri, 5 Aug 2016 14:59:50 +0000 (14:59 +0000)] 
Reimplement MC_(final_tidy) much more efficiently.  This reduces its instruction
count by a factor of about 4.

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

10 years agoReimplement pszB_to_listNo using a binary search rather than a linear search.
Julian Seward [Fri, 5 Aug 2016 14:54:27 +0000 (14:54 +0000)] 
Reimplement pszB_to_listNo using a binary search rather than a linear search.
Unlikely as it seems, this saves a considerable number of instructions (2% of total)
on very heap-intensive code (perf/heap.c).

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

10 years agoFix two invalid signed left shifts picked up by ubsan.
Julian Seward [Fri, 5 Aug 2016 10:34:15 +0000 (10:34 +0000)] 
Fix two invalid signed left shifts picked up by ubsan.

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

10 years agoConnect up the new CRC32 tests to the build system.
Julian Seward [Thu, 4 Aug 2016 21:40:59 +0000 (21:40 +0000)] 
Connect up the new CRC32 tests to the build system.

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

10 years agoAdd test cases for the CRC32* instruction group. Is not yet connected to the
Julian Seward [Thu, 4 Aug 2016 21:14:24 +0000 (21:14 +0000)] 
Add test cases for the CRC32* instruction group.  Is not yet connected to the
build system.

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

10 years agoMake "ashmem" and "binder" ioctls be handled properly on 64-bit ARM Android,
Julian Seward [Thu, 4 Aug 2016 21:11:28 +0000 (21:11 +0000)] 
Make "ashmem" and "binder" ioctls be handled properly on 64-bit ARM Android,
rather than falling through to the generic handler and being mishandled.
Fixes #360574.

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

10 years agoImplement CRC32{B,H,W,X} and CRC32C{B,H,W,X}. Fixes #366344.
Julian Seward [Thu, 4 Aug 2016 09:13:11 +0000 (09:13 +0000)] 
Implement CRC32{B,H,W,X} and CRC32C{B,H,W,X}.  Fixes #366344.

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

10 years ago* Add infrastructure for decoding (32-bit) ARMv8 instructions.
Julian Seward [Wed, 3 Aug 2016 11:55:33 +0000 (11:55 +0000)] 
* Add infrastructure for decoding (32-bit) ARMv8 instructions.

* Use this to implement AESE, AESD, AESMC, AESIMC.

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

10 years agoarm32 backend stuff needed to support IR artefacts resulting from
Julian Seward [Wed, 3 Aug 2016 11:53:11 +0000 (11:53 +0000)] 
arm32 backend stuff needed to support IR artefacts resulting from
guest support of 32-bit V8 crypto instructions:

* add new pseudo-instruction ARMin_VXferQ, to move values between
  two D regs and a Q reg, in either direction.  Use this to implement
  Iop_64HLtoV128 much more efficiently than before, and to implement
  Iop_V128HIto64 and Iop_V128to64.

* Generate code for helper calls in which have four or more
  (32-bit) word-sized arguments and a V128 return value.
  These require passing arguments on the stack.

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

10 years agoAdd test cases for v8 crypto instructions in 32-bit mode. Is not yet connected
Julian Seward [Wed, 3 Aug 2016 11:44:02 +0000 (11:44 +0000)] 
Add test cases for v8 crypto instructions in 32-bit mode.  Is not yet connected
to the build/test system.

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

10 years agoAdd infrastructure for detection of 32-bit ARMv8 capable CPUs (VEX side).
Julian Seward [Wed, 3 Aug 2016 11:41:24 +0000 (11:41 +0000)] 
Add infrastructure for detection of 32-bit ARMv8 capable CPUs (VEX side).

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

10 years agoAdd infrastructure for detection of 32-bit ARMv8 capable CPUs (Valgrind side).
Julian Seward [Wed, 3 Aug 2016 11:40:36 +0000 (11:40 +0000)] 
Add infrastructure for detection of 32-bit ARMv8 capable CPUs (Valgrind side).

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

10 years agoIgnore built binary memcheck/tests/amd64/shr_edx.
Ivo Raisr [Sat, 30 Jul 2016 03:04:20 +0000 (03:04 +0000)] 
Ignore built binary memcheck/tests/amd64/shr_edx.
Follow up to r15905.
n-i-bz

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

10 years agoFix test memcheck/tests/descr_belowsp so as the stack
Ivo Raisr [Sat, 30 Jul 2016 03:01:52 +0000 (03:01 +0000)] 
Fix test memcheck/tests/descr_belowsp so as the stack
guard page is visible also on Solaris.
n-i-bz

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

10 years agoFix test memcheck/tests/descr_belowsp a bit on Solaris.
Ivo Raisr [Fri, 29 Jul 2016 20:52:21 +0000 (20:52 +0000)] 
Fix test memcheck/tests/descr_belowsp a bit on Solaris.

On Solaris, '%p' outputs just a hexadecimal number
without '0x' prefix. This is perfectly valid but not
understood by VG_(strtok_get_address_and_size)().
Therefore use universal PRIxPTR.
n-i-bz

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

10 years agoWhen running the valgrind tests, the jm-insns test is segfaulting when it
Carl Love [Thu, 28 Jul 2016 16:51:53 +0000 (16:51 +0000)] 
When running the valgrind tests, the jm-insns test is segfaulting when it
attempts to patch instructions as it deals with the ppc64 (BE) function
descriptor. This is actually due to the RELRO option being enabled by default
for the ppc64 (BE) platform, per an upstream binutils change.

Bugzilla 365912 reported by  Will Schmidt, Will supplied the patch to fix the
make file none/tests/ppc64/Makefile.a

Patch tested on Power 7 and Power 8.

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

10 years agodis_neon_data_3same: for the case A==12, don't silently produce invalid IR
Julian Seward [Thu, 28 Jul 2016 08:23:37 +0000 (08:23 +0000)] 
dis_neon_data_3same: for the case A==12, don't silently produce invalid IR
which then causes the sanity checker to abort the run.  Instead synthesise
a SIGILL in the normal way.

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

10 years agoAdd missing x86/Solaris and amd64/Solaris supported platforms.
Ivo Raisr [Wed, 27 Jul 2016 18:16:29 +0000 (18:16 +0000)] 
Add missing x86/Solaris and amd64/Solaris supported platforms.
n-i-bz

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

10 years agoEnable test cases for PMULL 1q,1d,1d and PMULL2 1q,2d,2d. n-i-bz.
Julian Seward [Sun, 24 Jul 2016 18:59:02 +0000 (18:59 +0000)] 
Enable test cases for PMULL 1q,1d,1d and PMULL2 1q,2d,2d.  n-i-bz.

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

10 years agoImplement PMULL 1q,1d,1d and PMULL2 1q,2d,2d. n-i-bz.
Julian Seward [Sun, 24 Jul 2016 18:58:21 +0000 (18:58 +0000)] 
Implement PMULL 1q,1d,1d and PMULL2 1q,2d,2d.  n-i-bz.

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

10 years agoFix grammatically nonsensical comments. No functional change.
Julian Seward [Sun, 24 Jul 2016 16:56:22 +0000 (16:56 +0000)] 
Fix grammatically nonsensical comments.  No functional change.

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

10 years agoUpdate.
Julian Seward [Sun, 24 Jul 2016 11:45:58 +0000 (11:45 +0000)] 
Update.

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

10 years agoAdd test cases for PCMPxSTRx cases 0x62 and 0x72, and reformat the associated
Julian Seward [Sun, 24 Jul 2016 11:41:12 +0000 (11:41 +0000)] 
Add test cases for PCMPxSTRx cases 0x62 and 0x72, and reformat the associated
switch statements a bit more consistently.  Pertains to #353384 and #353727.

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

10 years agoEnable PCMPxSTRx cases 0x62 and 0x72, and reformat the associated
Julian Seward [Sun, 24 Jul 2016 11:40:07 +0000 (11:40 +0000)] 
Enable PCMPxSTRx cases 0x62 and 0x72, and reformat the associated
switch statements a bit more consistently.  Fixes #353384 and #353727.

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

10 years agoFix incorrect assertion re sizeof TTEntryC on arm-linux. Fixes #362935.
Julian Seward [Thu, 21 Jul 2016 12:47:51 +0000 (12:47 +0000)] 
Fix incorrect assertion re sizeof TTEntryC on arm-linux.  Fixes #362935.

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

10 years agoUpdate.
Julian Seward [Wed, 20 Jul 2016 17:51:53 +0000 (17:51 +0000)] 
Update.

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

10 years agoIf an instruction can't be decoded, print the first 10 bytes at RSP
Julian Seward [Wed, 20 Jul 2016 17:01:55 +0000 (17:01 +0000)] 
If an instruction can't be decoded, print the first 10 bytes at RSP
rather than 8.  8 is not enough to disambiguate the instruction in
some situations, in particular where there is a control immediate byte
at the end of the instruction.

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

10 years agoAdd test cases for PCMPxSTRx cases 0x70 and 0x19. Pertains to #359952.
Julian Seward [Wed, 20 Jul 2016 16:37:09 +0000 (16:37 +0000)] 
Add test cases for PCMPxSTRx cases 0x70 and 0x19.  Pertains to #359952.

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

10 years agoEnable PCMPxSTRx cases 0x70 and 0x19. Fixes #359952.
Julian Seward [Wed, 20 Jul 2016 16:35:55 +0000 (16:35 +0000)] 
Enable PCMPxSTRx cases 0x70 and 0x19.  Fixes #359952.

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

10 years agoUpdate w/ recent arm64 insn emulation fixes.
Julian Seward [Tue, 19 Jul 2016 07:08:56 +0000 (07:08 +0000)] 
Update w/ recent arm64 insn emulation fixes.

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

10 years agoImplement CLREX. Fixes #359838.
Julian Seward [Tue, 19 Jul 2016 07:05:34 +0000 (07:05 +0000)] 
Implement CLREX.  Fixes #359838.

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

10 years agodis_pc_relative, case 0x002: remove a path that cannot be taken. That
Julian Seward [Tue, 19 Jul 2016 05:32:50 +0000 (05:32 +0000)] 
dis_pc_relative, case 0x002: remove a path that cannot be taken.  That
stops gcc -Og complaining.  It complains because at that relatively
low level of optimisation, its flow analysis is apparently too weak to
see that the removed path cannot be taken and so it complains
(wrongly) about a possibly uninitialised use of |result|.  No
functional change.

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

10 years agoAdd test cases for: SHA1C SHA1H SHA1M SHA1P SHA1SU0 SHA1SU1 SHA256H2 SHA256H
Julian Seward [Mon, 18 Jul 2016 06:35:13 +0000 (06:35 +0000)] 
Add test cases for: SHA1C SHA1H SHA1M SHA1P SHA1SU0 SHA1SU1 SHA256H2 SHA256H
SHA256SU0 SHA256SU1.

Increase the number of iterations from 10 to 50 for AESD AESE AESIMC AESMC.

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

10 years agoImplement: SHA1C SHA1H SHA1M SHA1P SHA1SU0 SHA1SU1 SHA256H2 SHA256H
Julian Seward [Mon, 18 Jul 2016 06:33:52 +0000 (06:33 +0000)] 
Implement: SHA1C SHA1H SHA1M SHA1P SHA1SU0 SHA1SU1 SHA256H2 SHA256H
SHA256SU0 SHA256SU1.  Fixes #357338.

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

10 years agoFix arm64/fp_and_simd.c compile error.
Mark Wielaard [Sat, 16 Jul 2016 21:50:45 +0000 (21:50 +0000)] 
Fix arm64/fp_and_simd.c compile error.

Older GCC don't default to GNU11 and will produce:
error: ‘for’ loop initial declarations are only allowed in C99 mode

Move int i declaration to top of main.

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

10 years agoEnable test cases for: AESE AESD AESMC AESIMC.
Julian Seward [Fri, 15 Jul 2016 10:33:20 +0000 (10:33 +0000)] 
Enable test cases for: AESE AESD AESMC AESIMC.

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

10 years agoImplement arm64 instructions: AESE AESD AESMC AESIMC. n-i-bz.
Julian Seward [Fri, 15 Jul 2016 10:31:34 +0000 (10:31 +0000)] 
Implement arm64 instructions: AESE AESD AESMC AESIMC.  n-i-bz.

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

10 years agoFix n-i-bz amd64: memcheck false positive with shr %edx
Philippe Waroquiers [Tue, 12 Jul 2016 20:49:05 +0000 (20:49 +0000)] 
Fix n-i-bz amd64: memcheck false positive with shr %edx

False positive analysis and fix by Julian.

Thanks

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

10 years agoRegression test for n-i-bz amd64: memcheck false positive with shr %edx
Philippe Waroquiers [Tue, 12 Jul 2016 20:48:31 +0000 (20:48 +0000)] 
Regression test for n-i-bz amd64: memcheck false positive with shr %edx
Valgrind side : reproducer for the false positive memcheck
+ announce the fix (VEX side in next commit)

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

10 years agoIgnore pselect_sigmask_null executable.
Ivo Raisr [Mon, 11 Jul 2016 21:10:47 +0000 (21:10 +0000)] 
Ignore pselect_sigmask_null executable.
Part of fix for BZ#364413.

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

10 years agoSet executable protection on schedctl pages only when necessary.
Ivo Raisr [Mon, 11 Jul 2016 21:05:03 +0000 (21:05 +0000)] 
Set executable protection on schedctl pages only when necessary.
n-i-bz

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

10 years agoFix 365273 - Invalid write to stack location reported after signal handler runs
Philippe Waroquiers [Sun, 10 Jul 2016 21:17:58 +0000 (21:17 +0000)] 
Fix 365273 - Invalid write to stack location reported after signal handler runs

Analysis and patch by Earl Chew

Tested on x86/amd64/ppc64

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

10 years agoFinish first-pass classification of bugs reported up to 4 July 2016.
Julian Seward [Tue, 5 Jul 2016 08:41:07 +0000 (08:41 +0000)] 
Finish first-pass classification of bugs reported up to 4 July 2016.

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

10 years agoInitial triage of a bunch of bugs from Oct 2015 to Feb 2016, roughly.
Julian Seward [Mon, 4 Jul 2016 16:57:36 +0000 (16:57 +0000)] 
Initial triage of a bunch of bugs from Oct 2015 to Feb 2016, roughly.

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

10 years agoUpdate the bug list.
Julian Seward [Mon, 4 Jul 2016 11:17:37 +0000 (11:17 +0000)] 
Update the bug list.

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

10 years agoFix leak in m_redir.c
Philippe Waroquiers [Sat, 2 Jul 2016 18:46:23 +0000 (18:46 +0000)] 
Fix leak in m_redir.c
See below discussion for more details.

On Sat, 2016-07-02 at 14:20 +0200, Philippe Waroquiers wrote:
> I am testing a patch (provided by Julian) that solves a false positive
> memcheck found at my work.
>
> Testing this, I decided to run valgrind under valgrind (not done since
> a long time).
>
> This shows a leak in many tests, the stack trace being such as:
> ==26246== 336 bytes in 21 blocks are definitely lost in loss record 72 of 141
> ==26246==    at 0x2801C01D: vgPlain_arena_malloc (m_mallocfree.c:1855)
> ==26246==    by 0x2801D616: vgPlain_arena_strdup (m_mallocfree.c:2528)
> ==26246==    by 0x2801D616: vgPlain_strdup (m_mallocfree.c:2600)
> ==26246==    by 0x2801F5AD: vgPlain_redir_notify_new_DebugInfo (m_redir.c:619)
> ==26246==    by 0x2803B650: di_notify_ACHIEVE_ACCEPT_STATE (debuginfo.c:771)
> ==26246==    by 0x2803B650: vgPlain_di_notify_mmap (debuginfo.c:1067)
> ==26246==    by 0x2806589C: vgModuleLocal_generic_PRE_sys_mmap (syswrap-generic.c:2368)
> ==26246==    by 0x2809932A: vgSysWrap_amd64_linux_sys_mmap_before (syswrap-amd64-linux.c:637)
> ==26246==    by 0x28061E11: vgPlain_client_syscall (syswrap-main.c:1906)
> ==26246==    by 0x2805E9D2: handle_syscall (scheduler.c:1118)
> ==26246==    by 0x280604A6: vgPlain_scheduler (scheduler.c:1435)
> ==26246==    by 0x2806FF87: thread_wrapper (syswrap-linux.c:103)
> ==26246==    by 0x2806FF87: run_a_thread_NORETURN (syswrap-linux.c:156)
>
>
> The strdup call in m_redir.c:619 was introduced by r15726.
>
> However, I am not sure this is a bug that is introduced by this change,
> or if it just reveals a leak that was already there.
> The "very original" replacement logic did not do memory allocation for
> the replacement: see m_redir.c in valgrind 3.10.1 : it was just copying
> some chars from VG_(clo_soname_synonyms) to demangled_sopatt

Yes, it should do exactly the same as the other code paths. If
replaced_sopatt != NULL then it is an allocated string that has been
assigned to demangled_sopatt. I had assumed that would take care of the
life-time issues of the allocated string. But now that I read the code
it is indeed not so clear.

> Then in 3.11, the fixed size demangled_sopatt was changed to be
> a dynamically allocated buffer.
> The revision log 14664 that introduced this explains that the ownership of
> returned buffer is not easy. It tells at the end:
> "So the rule of thunb here is: if in doubt strdup the string."
>
> but now we have to see when to free what, it seems ???
>
> Any thoughts ?

So if replaced_sopatt != NULL, then demangled_sopatt contains the
allocated string, and it is then immediately copied and assigned to
spec->from_sopatt. After that it is used under check_ppcTOCs. But there
it will first be reassigned a new value through maybe_Z_demangle
(overwriting any existing string being pointed to). So for this
particular leak it seem fine to free it right after the spec[List] has
been initialized (line 642).

Cheers,

Mark

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

10 years agofix 364058 - clarify in manual limitations of array overruns detections
Philippe Waroquiers [Thu, 30 Jun 2016 20:28:53 +0000 (20:28 +0000)] 
fix 364058 - clarify in manual limitations of array overruns detections

Further try to clarify again with more words the way sgcheck works
and the implied limitations

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

10 years agoPower PC test suite for ISA 3.0, part 4
Carl Love [Wed, 29 Jun 2016 18:09:57 +0000 (18:09 +0000)] 
Power PC test suite for ISA 3.0, part 4

The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3222 is added in this commit.

Note, this is part 4 of 5.  The NEWS file will be updated when the ISA 3.0
support is complete.

valgrind bugzilla 363858

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

10 years agoPower PC Add support for ISA 3.0, part 4
Carl Love [Wed, 29 Jun 2016 18:06:15 +0000 (18:06 +0000)] 
Power PC Add support for ISA 3.0, part 4

Added support to emulate the setb, cmprb, cmpeqb, dtstsfi,
dtstsfiq, dtstsfq, dtstsfiq, xscmpexpdp, xsxexpd, xsxsigdp,
xststdcsp, xststdcdp, xvtstdcsp, xvxsigdp, xsiexpdp, xvxexpdp,
xvxsigdp, xvxexpsp, xvxsigsp, xvtstdcdp, xvxsigdp, wait, addpcis
instructions.

bugzilla 363858

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

10 years agoAdd the HW register support for missing registers in get_otrack_shadow_offset_wrk...
Carl Love [Mon, 27 Jun 2016 15:50:29 +0000 (15:50 +0000)] 
Add the HW register support for missing registers in get_otrack_shadow_offset_wrk().  The registers are: NRADDR, NRADDR_GPR2, (REDIR_STACK, TFHAR, TEXASR, TEXASRU, TFIAR, PPR, PSPB.

Bugzilla  36728

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

10 years agoBug 364413 followup - fix signask -> sigmask typo in EXTRA_DIST
Mark Wielaard [Tue, 21 Jun 2016 21:06:27 +0000 (21:06 +0000)] 
Bug 364413 followup - fix signask -> sigmask typo in EXTRA_DIST

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

10 years agoBug 364413 pselect sycallwrapper mishandles NULL sigmask.
Mark Wielaard [Tue, 21 Jun 2016 19:58:21 +0000 (19:58 +0000)] 
Bug 364413 pselect sycallwrapper mishandles NULL sigmask.

Don't check or try to copy sigmask if it is NULL. The sigmask might be
given in a struct, where the length is non-zero, but the signal set
pointer is NULL.

Testcase provided by Paul Eggert <eggert@cs.ucla.edu>.

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

10 years agoUpdated NEWS file for bugzilla 360035: missing (broken) support for wbit field
Carl Love [Mon, 13 Jun 2016 17:30:24 +0000 (17:30 +0000)] 
Updated NEWS file for bugzilla 360035: missing (broken) support for wbit field
on mtfsfi instruction (ppc64).  VEX fix committed, vex commit 3221.

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

10 years agoFix mtfsfi usage of W bit. (isa2.05,ppc64)
Carl Love [Mon, 13 Jun 2016 17:27:03 +0000 (17:27 +0000)] 
Fix mtfsfi usage of W bit. (isa2.05,ppc64)

Fix mtfsfi usage of W bit.
The Wbit field was added in ISA 2.05, allowing updates to the 'other'
half of the 64-bit FPSCR field.
Logic and Support for that bit is in place, but a 'reserved field
must contain zeros' check was not updated, preventing the desired
path from being taken.

Bugzilla 362894

Signed-off-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Patch reviewed and verified by: Carl Love <cel@ibm.com>

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