]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
8 years agoWell, 5 seconds is too short for me to type a attach pid command
Philippe Waroquiers [Sat, 1 Oct 2016 14:10:59 +0000 (14:10 +0000)] 
Well, 5 seconds is too short for me to type a attach pid command
so increase to 8 seconds.

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

8 years agoReplace --wait-for-gdb=yes memory loop by a call to VG_(poll) (5000 milliseconds)
Philippe Waroquiers [Sat, 1 Oct 2016 13:46:53 +0000 (13:46 +0000)] 
Replace --wait-for-gdb=yes memory loop by a call to VG_(poll) (5000 milliseconds)

Depending on the cpu speed, this loop was way too fast or too slow.
=> replace by a syscall that will always give the same waiting time.

A few notes:
  A VG_(poll) is available on all supported OS
  B no signals are supposed to interrupt the syscall, as at that place, nothing works yet.
  C gdb can attach to a process blocked in a syscall.

If ever B or C would not be true on some setups, then we could instead do a loop
of e.g. 50 * VG_(poll) (100 milli-seconds)

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

8 years agoDon't crash, but warn and return EINVAL on unknown fcntl command.
Mark Wielaard [Sat, 1 Oct 2016 11:54:52 +0000 (11:54 +0000)] 
Don't crash, but warn and return EINVAL on unknown fcntl command.

Bug #369446
LTP: testcases/kernel/syscalls/fcntl/fcntl13

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

8 years agoDon't check bad iovec array in process_vm_readv/writev. Bug #369441.
Mark Wielaard [Sat, 1 Oct 2016 11:54:51 +0000 (11:54 +0000)] 
Don't check bad iovec array in process_vm_readv/writev. Bug #369441.

Found by LTP testcases/kernel/syscalls/cma/process_vm01.

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

8 years agolinux-x86 check get/set_thread_area pointer before use. Bug #369402.
Mark Wielaard [Sat, 1 Oct 2016 11:54:50 +0000 (11:54 +0000)] 
linux-x86 check get/set_thread_area pointer before use. Bug #369402.

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

8 years agoFix crash in sys_modify_ldt wrapper on bad ptr. Bug #369383.
Mark Wielaard [Sat, 1 Oct 2016 11:54:50 +0000 (11:54 +0000)] 
Fix crash in sys_modify_ldt wrapper on bad ptr. Bug #369383.

Make sure ptr is safe_to_deref if not NULL.
Also fixup some corner case error return codes.
We have to do that ourselves since we never actually call into the kernel.

Found by LTP testcases/kernel/syscalls/modify_ldt/modify_ldt01.

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

8 years agoFix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler.
Mark Wielaard [Sat, 1 Oct 2016 11:54:49 +0000 (11:54 +0000)] 
Fix crash in linux [rt_]sigaction wrapper with bad old/new sigaction handler.

Since we try to modify the old/new sigaction handler before passing it
to the kernel we must make sure that (if they aren't NULL) it is safe
to use. If not we should bail out early with EFAULT.

Bug #369362
Found by LTP testcases/kernel/syscalls/rt_sigaction/rt_sigaction02.

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

8 years agoFix crash in vmsplice linux kernel wrapper when iovec is bad. Bug #369361.
Mark Wielaard [Sat, 1 Oct 2016 11:54:48 +0000 (11:54 +0000)] 
Fix crash in vmsplice linux kernel wrapper when iovec is bad. Bug #369361.

Found by LTP testcases/kernel/syscalls/vmsplice/vmsplice02.

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

8 years agoFix crash when old/new sigprocmask isn't safe to dereference. Bug #369360.
Mark Wielaard [Sat, 1 Oct 2016 11:54:47 +0000 (11:54 +0000)] 
Fix crash when old/new sigprocmask isn't safe to dereference. Bug #369360.

Since we want to use the set and oldset for bookkeeping we also want
to make sure they are addressable otherwise, like the kernel, we EFAULT.
Also use EINVAL instead of EMFILE as failure when sigset size is wrong.

Found by LTP testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.

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

8 years agoFix crash in msghdr_foreachfield when iov_len isn't safe to dereference.
Mark Wielaard [Sat, 1 Oct 2016 11:54:41 +0000 (11:54 +0000)] 
Fix crash in msghdr_foreachfield when iov_len isn't safe to dereference.

Also stop checking when max length of bytes have been reached.

Bug #369359
Found by LTP testcases/kernel/syscalls/recvmsg/recvmsg01.

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

8 years agoFix pre_mem_read_sockaddr crash on invalid syscall arguments. Bug #369356.
Mark Wielaard [Sat, 1 Oct 2016 11:54:40 +0000 (11:54 +0000)] 
Fix pre_mem_read_sockaddr crash on invalid syscall arguments. Bug #369356.

Don't do any more checks if it isn't safe to inspect the address family.
Likewise, don't check sun_path if the string address isn't safe.

Found by LTP testcases/kernel/syscalls/bind/bind01.

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

8 years agoDon't require the current working directory to exist. Bug #369209.
Mark Wielaard [Sat, 1 Oct 2016 11:54:38 +0000 (11:54 +0000)] 
Don't require the current working directory to exist. Bug #369209.

At startup valgrind fetches the current working directory and stashes
it away to be used later (in debug messages, read config files or create
log files). But if the current working directory didn't exist (or there
was some other error getting its path) then valgrind would go in an
endless loop. This was caused by assuming that any error meant a larger
buffer needed to be created to store the cwd path (ERANGE). However
there could be other reasons calling getcwd failed.

Fix this by only looping and resizing the buffer when the error is
ERANGE. Any other error just means we cannot fetch and store the current
working directory. Fix all callers to check get_startup_wd() returns
NULL. Only abort startup if a relative path needs to be used for
user supplied relative log files. Debug messages will just show
"<NO CWD>". And skip reading any config files from the startup_wd
if it doesn't exist.

Also add a new testcase that tests executing valgrind in a deep,
inaccessible and/or non-existing directory (none/tests/nocwd.vgtest).

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

8 years agoUse AM_LDFLAGS instead of LDFLAGS in exp-bbv/tests Makefiles.
Mark Wielaard [Sat, 1 Oct 2016 10:12:31 +0000 (10:12 +0000)] 
Use AM_LDFLAGS instead of LDFLAGS in exp-bbv/tests Makefiles.

That makes it possible to add to LDFLAGS instead of overriding
when doing make. Useful if you want to have different LD_FLAGS
added for the main and check makes.

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

8 years agomc-manual.xml: Fix some mismatched open/close tags.
Mark Wielaard [Fri, 30 Sep 2016 22:32:24 +0000 (22:32 +0000)] 
mc-manual.xml: Fix some mismatched open/close tags.

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

8 years agoAdd an optional 2nd arg to leak-autofreepool to test performance
Philippe Waroquiers [Thu, 29 Sep 2016 20:04:43 +0000 (20:04 +0000)] 
Add an optional 2nd arg to leak-autofreepool to test performance
e.g. using the beloz
for f in 1 2 3 4 5 6 7 8 9; do echo $f;  time ./vg-in-place -q ./memcheck/tests/leak-autofreepool 2 $(expr $f \* 100000); done

This shows that freeing a mempool with significant nr of elements
has a bad effect on performance

Note that no effort has been spent to avoid leaks in this
optional perf test. This is just to analyse the time taken to
free the pool.

The above loop shows that a medium size pool (e.g. < 1000000 elts)
can already take significant time, probably due to the quadratic
algorithm to clear the pool.
Note that the increase can vary a lot, probably depending on the
way the blocks are spread in the hash table: when lucky, the quadratic
algorithm probably somewhat becomes more linear if the elements
are 'properly' ordered in the hash table by deletion order.

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

8 years agoFix test so that leaked bytes is the same in 32 and 64 bits
Philippe Waroquiers [Sun, 25 Sep 2016 18:38:19 +0000 (18:38 +0000)] 
Fix test so that leaked bytes is the same in 32 and 64 bits

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

8 years agoAdded meta mempool support into memcheck for describing a custom allocator which:
Ivo Raisr [Sat, 24 Sep 2016 21:15:44 +0000 (21:15 +0000)] 
Added meta mempool support into memcheck for describing a custom allocator which:
- Auto-frees all chunks assuming that destroying a pool destroys all
  objects in the pool
- Uses itself to allocate other memory blocks
Unit tests included.
Fixes BZ#367995
Patch by: Ruurd Beerstra <ruurd.beerstra@infor.com>

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

8 years agoFix warning introduced by revision 15982
Philippe Waroquiers [Sat, 24 Sep 2016 12:58:29 +0000 (12:58 +0000)] 
Fix warning introduced by revision 15982

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

8 years agoFix 361615 - Inconsistent termination for multithreaded process terminated by signal
Philippe Waroquiers [Sat, 24 Sep 2016 12:06:34 +0000 (12:06 +0000)] 
Fix 361615 - Inconsistent termination for multithreaded process terminated by signal

Test program by earl_chew

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

8 years agoSolaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
Ivo Raisr [Fri, 23 Sep 2016 23:00:21 +0000 (23:00 +0000)] 
Solaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
n-i-bz

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

8 years agoFix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/
Mark Wielaard [Fri, 23 Sep 2016 20:52:30 +0000 (20:52 +0000)] 
Fix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/

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

8 years agoFix expected error output of drd/tests/bar_bad* on Solaris.
Ivo Raisr [Fri, 23 Sep 2016 17:23:47 +0000 (17:23 +0000)] 
Fix expected error output of drd/tests/bar_bad* on Solaris.
On Solaris, we still do get error reports about destroying
a barrier which was never initialized even after SVN r15962.
We also get an error report about destroying barrier bar3
which is still waited upon by a thread.
n-i-bz

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

8 years agoUse proper compiler flags on Solaris for fma4 test.
Ivo Raisr [Fri, 23 Sep 2016 14:10:55 +0000 (14:10 +0000)] 
Use proper compiler flags on Solaris for fma4 test.
n-i-bz

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

8 years agoPowerpc big endian, fix the expected output file for
Carl Love [Thu, 22 Sep 2016 15:37:57 +0000 (15:37 +0000)] 
Powerpc big endian, fix the expected output file for
none/tests/ppc64/jm_int_isa_2_07.stdout.exp

By convention the file jm_int_isa_2_07.stdout.exp is the big endian reuslts.
If the little endian results differ, the file has -LE appended to it.
This patch replaces the little endian results that are currenttly in
none/tests/ppc64/jm_int_isa_2_07.stdout.exp with the correct the big
endian results.

Bugzilla 369169

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

8 years agoPreliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.
Rhys Kidd [Thu, 22 Sep 2016 02:55:24 +0000 (02:55 +0000)] 
Preliminary support for macOS Sierra (10.12). Does not fully resolve bz#365327.

No regressions on OS X 10.11.

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

8 years agoAvoid unused variable warning.
Philippe Waroquiers [Wed, 21 Sep 2016 21:06:04 +0000 (21:06 +0000)] 
Avoid unused variable warning.

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

8 years agoUpdate.
Julian Seward [Wed, 21 Sep 2016 13:48:20 +0000 (13:48 +0000)] 
Update.

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

8 years agoAdd a feature check for tests that use -march=armv8-a+crc.
Mark Wielaard [Tue, 20 Sep 2016 17:57:00 +0000 (17:57 +0000)] 
Add a feature check for tests that use -march=armv8-a+crc.

Older gcc versions for arm64 don't support the crc arch feature.

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

8 years agofix for bugzilla 361253 [s390x] ex_clone.c:42: undefined reference to `pthread_create'
Christian Borntraeger [Tue, 20 Sep 2016 12:31:49 +0000 (12:31 +0000)] 
fix for bugzilla 361253  [s390x] ex_clone.c:42: undefined reference to `pthread_create'

Fix provides by Dann Frazier

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

8 years agoAdd none/tests/ppc64/ppc64_helpers.h to noinst_HEADERS.
Mark Wielaard [Mon, 19 Sep 2016 22:03:34 +0000 (22:03 +0000)] 
Add none/tests/ppc64/ppc64_helpers.h to noinst_HEADERS.

Makes sure that the header file will be included in the dist tar.

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

8 years agoAdd missing file for bug #358213 workaround.
Mark Wielaard [Mon, 19 Sep 2016 19:25:33 +0000 (19:25 +0000)] 
Add missing file for bug #358213 workaround.

svn commit r15962 missed adding bar_bad.stderr.exp-destroy-hang.

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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

8 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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

9 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