Commit Graph

12415 Commits

Author SHA1 Message Date
Mark Wielaard
547abdee69 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
2016-10-01 11:54:50 +00:00
Mark Wielaard
e1e9a77564 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
2016-10-01 11:54:49 +00:00
Mark Wielaard
1063360181 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
2016-10-01 11:54:48 +00:00
Mark Wielaard
52b55f29f3 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
2016-10-01 11:54:47 +00:00
Mark Wielaard
1e3852e27c 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
2016-10-01 11:54:41 +00:00
Mark Wielaard
31e1b8c9ba 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
2016-10-01 11:54:40 +00:00
Mark Wielaard
be052139d6 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
2016-10-01 11:54:38 +00:00
Mark Wielaard
b3213195d1 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
2016-10-01 10:12:31 +00:00
Mark Wielaard
5027860f74 mc-manual.xml: Fix some mismatched open/close tags.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15987
2016-09-30 22:32:24 +00:00
Philippe Waroquiers
b53d2291e8 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
2016-09-29 20:04:43 +00:00
Philippe Waroquiers
4a12396ba8 Fix test so that leaked bytes is the same in 32 and 64 bits
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15985
2016-09-25 18:38:19 +00:00
Ivo Raisr
f2b34df721 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
2016-09-24 21:15:44 +00:00
Philippe Waroquiers
cd2843e06d Fix warning introduced by revision 15982
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15983
2016-09-24 12:58:29 +00:00
Philippe Waroquiers
eaefbe1f25 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
2016-09-24 12:06:34 +00:00
Ivo Raisr
98273bc5f4 Solaris: Add ioctl wrapper for MNTIOC_GETEXTMNTENT.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15981
2016-09-23 23:00:21 +00:00
Mark Wielaard
45dc581a53 Fix none/tests/amd64/Makefile.am typo s/AM_CFKAGS/AM_CFLAGS/
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15980
2016-09-23 20:52:30 +00:00
Ivo Raisr
4e6b94f570 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
2016-09-23 17:23:47 +00:00
Ivo Raisr
b21c19ffb3 Use proper compiler flags on Solaris for fma4 test.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15978
2016-09-23 14:10:55 +00:00
Carl Love
3c751e88ac 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
2016-09-22 15:37:57 +00:00
Rhys Kidd
ab2edd2901 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
2016-09-22 02:55:24 +00:00
Philippe Waroquiers
fef93fffb2 Avoid unused variable warning.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15975
2016-09-21 21:06:04 +00:00
Julian Seward
4216a9e19a Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15974
2016-09-21 13:48:20 +00:00
Mark Wielaard
87b9c5b125 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
2016-09-20 17:57:00 +00:00
Christian Borntraeger
bcef0a5407 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
2016-09-20 12:31:49 +00:00
Mark Wielaard
23615e5bb3 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
2016-09-19 22:03:34 +00:00
Mark Wielaard
1ea3342d69 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
2016-09-19 19:25:33 +00:00
Mark Wielaard
5f37e4dcde 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
2016-09-19 14:16:35 +00:00
Mark Wielaard
c5556b2094 Testcases for fma4 instructions. Bug #369000.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15961
2016-09-19 12:41:38 +00:00
Mark Wielaard
7e588e2a8a 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
2016-09-19 08:08:51 +00:00
Julian Seward
237fcf7d36 Update bug lists.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15959
2016-09-16 13:38:02 +00:00
Julian Seward
f4e420c096 Update bug list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15958
2016-09-15 10:56:00 +00:00
Carl Love
97783a3760 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
2016-09-14 17:16:52 +00:00
Carl Love
4f2ab6749e 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
2016-09-14 16:43:27 +00:00
Carl Love
b6928573e9 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
2016-09-14 15:50:48 +00:00
Julian Seward
dbbb036b4a Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15954
2016-09-14 13:15:28 +00:00
Mark Wielaard
219f3152bc 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
2016-09-14 11:47:26 +00:00
Mark Wielaard
a57acb9be6 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
2016-09-13 19:18:36 +00:00
Mark Wielaard
9d0a8787d5 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
2016-09-13 19:06:23 +00:00
Carl Love
4a1581f982 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
2016-09-13 15:54:33 +00:00
Rhys Kidd
002a63dfd7 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
2016-09-11 13:54:04 +00:00
Rhys Kidd
72097ab0f7 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
2016-09-11 13:42:50 +00:00
Rhys Kidd
60defe8a5f 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
2016-09-11 05:28:59 +00:00
Rhys Kidd
9c0d0908f9 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
2016-09-11 04:33:20 +00:00
Philippe Waroquiers
5de4bad5a7 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
2016-09-07 20:12:30 +00:00
Mark Wielaard
a7d9347bdf 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
2016-09-05 13:13:12 +00:00
Julian Seward
5ec46ea778 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
2016-09-01 15:19:07 +00:00
Julian Seward
6ce2e83f67 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
2016-09-01 13:10:55 +00:00
Julian Seward
3e4a4540b1 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
2016-08-28 16:17:12 +00:00
Mark Wielaard
2f1ec093bc 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
2016-08-26 13:10:14 +00:00
Ivo Raisr
b0b7bbf30b 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
2016-08-17 18:05:13 +00:00