Commit Graph

1307 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Carl Love
d2450cd776 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
2016-08-15 21:54:04 +00:00
Julian Seward
5ee5496e04 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
2016-08-10 22:22:20 +00:00
Julian Seward
ede1952161 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
2016-08-07 23:36:10 +00:00
Julian Seward
38d065af6a 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
2016-08-06 12:33:59 +00:00
Julian Seward
bafba31e41 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
2016-08-06 12:32:37 +00:00
Julian Seward
22f4d5081d Connect up the new CRC32 tests to the build system.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15925
2016-08-04 21:40:59 +00:00
Julian Seward
aac43218ab 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
2016-08-04 21:14:24 +00:00
Julian Seward
b8490fbbb9 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
2016-08-03 11:44:02 +00:00
Carl Love
68a17eeb24 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
2016-07-28 16:51:53 +00:00
Julian Seward
64fa2bc977 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
2016-07-24 18:59:02 +00:00
Julian Seward
def5ad1abf 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
2016-07-24 11:41:12 +00:00
Julian Seward
a488a6f093 Add test cases for PCMPxSTRx cases 0x70 and 0x19. Pertains to #359952.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15910
2016-07-20 16:37:09 +00:00
Julian Seward
b73c6004c2 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
2016-07-18 06:35:13 +00:00
Mark Wielaard
395fc80118 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
2016-07-16 21:50:45 +00:00
Julian Seward
a0a11b70b0 Enable test cases for: AESE AESD AESMC AESIMC.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15906
2016-07-15 10:33:20 +00:00
Ivo Raisr
22a4556203 Ignore pselect_sigmask_null executable.
Part of fix for BZ#364413.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15904
2016-07-11 21:10:47 +00:00
Carl Love
8db3f9d608 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
2016-06-29 18:09:57 +00:00
Mark Wielaard
c08b257601 Bug 364413 followup - fix signask -> sigmask typo in EXTRA_DIST
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15894
2016-06-21 21:06:27 +00:00
Mark Wielaard
08086f0855 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
2016-06-21 19:58:21 +00:00
Carl Love
e72b1dd772 Power PC Add test suite support for ISA 3.0, part 3
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3220 is added in this commit.

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

valgrind bugzilla 362329


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15890
2016-06-01 18:13:19 +00:00
Philippe Waroquiers
268ff84f7b Document brk segment limitation, reference manual in limit reached msg.
The msg telling brk cannot be extended confuses some users
so improve the documentation and have the msg referencing the doc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15880
2016-05-22 20:48:09 +00:00
Carl Love
8b6b6958e2 Power PC Add test suite support for ISA 3.0, part 2
The test suite support for the Power PC ISA 3.0 instructions added in
VEX commit 3217 is added in this commit.

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

valgrind bugzilla 359767

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15870
2016-04-26 17:37:05 +00:00
Ivo Raisr
5d4c5ae3d6 Fix Valgrind coredump when VG_(unimplemented)() is called
early during main initialization, before the threads are
created and scheduler is initialized.
Fixes BZ#362009


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15867
2016-04-23 19:35:11 +00:00
Ivo Raisr
3a6ba37072 Clean up after none/tests/solaris/stack-overflow.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15861
2016-04-18 19:10:01 +00:00
Ivo Raisr
f0dd8157d7 Clean up properly Valgrind coredump after tests
none/tests/solaris/reserve_sysstat_addr and reserve_sysstat_zone_addr.
The coredump is expected there as the test cases trigger unsupported
functionality.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15860
2016-04-18 10:28:53 +00:00
Ivo Raisr
4fb3660832 Fix compiler warning about implicit declaration of function "ioctl" on Solaris.
It is required to #include <unistd.h> as well.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15859
2016-04-17 20:21:24 +00:00
Ivo Raisr
7407c16737 Fix compiler warnings on Solaris 12 about assigning a function pointer
of an incompatible type to signal handler.
Untyped function pointer sa_handler() is no longer available
so we leverage sa_sigaction(int, siginfo_t *, void *) instead.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15858
2016-04-17 19:28:04 +00:00
Christian Borntraeger
b8593502ea Bug 361226 valgrind part: s390x: risbgn (EC59) not implemented
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15852
2016-04-07 18:55:25 +00:00
Rhys Kidd
c8f08a1e4d Fix ppoll_alarm exclusion on OS X. n-i-bz.
ppoll() is not POSIX, and accordingly we should ignore the lack
of support for this on OS X.

Exclude the ppoll_alarm regression test on that platform, as
introduced in r15823.

Regression test output on OS X 10.11

Before:

n/a

After:

== 602 tests, 223 stderr failures, 13 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15851
2016-04-07 03:48:59 +00:00
Ivo Raisr
5b3c2f59c5 Run __gnu_cxx::__freeres() cleanup function available
from libstdc++ when available, similar to existing __libc_freeres().
New option --run-cxx-freeres=<yes|no> can be used to change whether
this cleanup function is called or not.

Note that __gnu_cxx::__freeres() is currently available
only in gcc 6. It is not yet decided what to do about
libstdc++ from gcc 5.
Tracked under https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69945
for libstdc++.

Fixes BZ#345307 (partially).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15840
2016-03-30 17:53:03 +00:00
Carl Love
b9a5fed275 Power PC Add test suite support for ISA 3.0, part 1
The test suite support for the Power PC ISA 3.0 support is added in this commit.  The
following files were added:

   none/tests/ppc64/ppc64_helpers.h
   none/tests/ppc64/test_isa_3_0.c
   none/tests/ppc64/test_isa_3_0_altivec.stderr.exp
   none/tests/ppc64/test_isa_3_0_altivec.stdout.exp
   none/tests/ppc64/test_isa_3_0_altivec.vgtest
   none/tests/ppc64/test_isa_3_0_other.stderr.exp
   none/tests/ppc64/test_isa_3_0_other.stdout.exp
   none/tests/ppc64/test_isa_3_0_other.vgtest

The following file was modified:
   none/tests/ppc64/Makefile.am 

Note, the NEWS file was not updated as the ISA 3.0 support is not complete yet. This is the
first of five sets of commits needed to add all of the ISA 3.0 support.

valgrind bugzilla 359767

Corresponding Valgrind support added in:
  VEX commit 3214
  valgrind commit 15837

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15838
2016-03-29 21:47:00 +00:00
Mark Wielaard
7c181202c5 Bug #360425 - arm64 unsupported instruction ldpsw tests.
Add tests for ldpsw implementation VEX svn r3212.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15830
2016-03-15 15:08:01 +00:00
Mark Wielaard
3d73703cdb Bug #360519 none/tests/arm64/memory.vgtest might fail with newer gcc
The LDR (literal, int reg) testcase takes a code label and compares the
instructions around the label with known instructions in the code stream.
There were only fixed insns on either side of the checking instruction
which isn't enough given that offsets of +/-8 are used, instructions are
only 4 wide and the values loaded are 64bit. Newer gcc versions would
generate different code around the label and cause the tests to fail.

Add enough nops around the actual instruction to really give known
expected constant values to check against.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15829
2016-03-15 13:56:19 +00:00
Ivo Raisr
912bede3dd Sanitize signal mask in ppoll and pselect syscalls
Reported and Linux patch contributed by Steven Smith <sos22@archy.org.uk>
Fixes BZ#359871



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15823
2016-03-08 09:04:48 +00:00
Petar Jovanovic
7abdec37ee mips32: minor improvements to vfp test
Remove wrong use of early-clobber constraints.
Some formatting/codestyle changes added too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15822
2016-03-07 14:31:48 +00:00
Ivo Raisr
6da8549607 Unbreak build of several regression tests on Solaris 12 with gcc 5.3
We need to move _XOPEN_SOURCE from 500 to 600 which
comes with '-std=c99'.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15821
2016-03-04 20:49:35 +00:00
Carl Love
1df0d33a8c Power PPC test case test_isa_2_07 steps out of array bounds.
The test none/tests/ppc64/test_isa_2_07.c steps beyond the data array in a
number of places. The issue is the array is declared to be of size N. The for
loop is: for (i=0; i<N; i=i+2). In the body of the loop the array elements
A[i] and A[i+1] are accessed. On the last iteration i=N-1 and the second array
access becomes A[N-1+1] which accesses one element past the declared array
size.

This commit fixes the array bounds by making the for loop read:  
  
   for (i=0; i<N-1; i=i+2)

The expected output files 

none/tests/ppc64/jm_int_isa_2_07.stdout.exp 
none/tests/ppc64/jm_vec_isa_2_07.stdout.exp

are updated with the new expected results.

Valgrind Bugzilla 359829


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15816
2016-02-26 17:38:47 +00:00
Ivo Raisr
6d7ee1151c Fix expected output of coredump generating test cases
after SVN r15810.

Now that we have AT_ENTRY in the client auxv, mdb does not
print binary name before function designation.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15811
2016-02-24 03:20:17 +00:00