Commit Graph

12371 Commits

Author SHA1 Message Date
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
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
Ivo Raisr
b6224ced96 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
2016-08-15 02:31:27 +00:00
Ivo Raisr
6260274e4e 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
2016-08-12 22:28:50 +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
Petar Jovanovic
030cea68c8 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
2016-08-10 14:38:10 +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
c6e56acc75 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
2016-08-06 07:15:30 +00:00
Julian Seward
d1b3d1f181 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
2016-08-05 17:22:21 +00:00
Julian Seward
d8fc8361bc Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15928
2016-08-05 15:15:20 +00:00
Julian Seward
7ce46139ec 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
2016-08-05 14:59:50 +00:00
Julian Seward
1a2f71d6ff 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
2016-08-05 14:54:27 +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
7c3b4bf540 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
2016-08-04 21:11:28 +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
Julian Seward
f8eca86bbf Add infrastructure for detection of 32-bit ARMv8 capable CPUs (Valgrind side).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15921
2016-08-03 11:40:36 +00:00
Ivo Raisr
1735cc43a3 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
2016-07-30 03:04:20 +00:00
Ivo Raisr
2935e69718 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
2016-07-30 03:01:52 +00:00
Ivo Raisr
d04009b787 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
2016-07-29 20:52:21 +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
Ivo Raisr
788d5baef5 Add missing x86/Solaris and amd64/Solaris supported platforms.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15916
2016-07-27 18:16:29 +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
48adfb9ed4 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15914
2016-07-24 11:45:58 +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
7a8129795c Fix incorrect assertion re sizeof TTEntryC on arm-linux. Fixes #362935.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15912
2016-07-21 12:47:51 +00:00
Julian Seward
55c7b5dd94 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15911
2016-07-20 17:51:53 +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
33140037a9 Update w/ recent arm64 insn emulation fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15909
2016-07-19 07:08:56 +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
Philippe Waroquiers
2679aea160 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
2016-07-12 20:48:31 +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
Ivo Raisr
86203023fa Set executable protection on schedctl pages only when necessary.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15903
2016-07-11 21:05:03 +00:00
Philippe Waroquiers
80dec3e514 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
2016-07-10 21:17:58 +00:00
Julian Seward
e5782be21b Finish first-pass classification of bugs reported up to 4 July 2016.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15901
2016-07-05 08:41:07 +00:00
Julian Seward
259caf2e10 Initial triage of a bunch of bugs from Oct 2015 to Feb 2016, roughly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15900
2016-07-04 16:57:36 +00:00
Julian Seward
d48bff9642 Update the bug list.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15899
2016-07-04 11:17:37 +00:00
Philippe Waroquiers
b07050d998 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
2016-07-02 18:46:23 +00:00
Philippe Waroquiers
35589fdb14 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
2016-06-30 20:28:53 +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
Carl Love
47216ba855 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
2016-06-27 15:50:29 +00:00