11600 Commits

Author SHA1 Message Date
Zhi-Gang Liu
b6b2f0ebb3 Address minor issues in Julian's last review.
For TILEGX only.
By: Zhi-Gang Liu


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15094
2015-04-15 02:33:09 +00:00
Zhi-Gang Liu
7134b4ef2d Add 'allexec.c' in "none/tests/tilegx"
The symbolic link 'allexec.c' -> ../allecec.c

By: Zhi-Gang Liu
zhg.liu@gmail.com



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15093
2015-04-15 00:56:40 +00:00
Zhi-Gang Liu
039acff030 Remove allecec.c from none/tests/tilegx
Will add a symbolic link for that file next.

Zhi-Gang Liu



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15092
2015-04-15 00:48:34 +00:00
Florian Krohm
fce9b1644b Followup to r14974. That revision oversimplified a condition, part
of which was presumed to be redundant but wasn't. This caused code
to hang due to an infinite signal-delivery loop. Observed and
tracked down by Austin English.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15091
2015-04-14 19:59:21 +00:00
Julian Seward
639b5687b1 Make the version checking for Apple LLVM a bit less strict.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15088
2015-04-13 11:41:30 +00:00
Julian Seward
37e6ca6c9c Un-break the Darwin build after r15078. Patch from Mark Pauley
(pauley@unsaturated.net).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15087
2015-04-13 11:39:50 +00:00
Florian Krohm
dda7589260 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15085
2015-04-11 18:50:47 +00:00
Philippe Waroquiers
e39dd9d073 Add 2 tests none/tests/libvex_test and libvexmultiarch_test
The objective of libvex_test is to verify that the VEX lib
can be used in 'single arch mode' (host == guest).

The objective of libvexmultiarch_test is to verify that the VEX lib
can be used in 'multi arch mode' (freely choose host and guest).
(but not many combinations are working: if wordsize or endianess
differs, then libVEX quickly asserts somewhere).

libvex_test.c is somewhat bizarre, as it uses the architecture
for which we have compiled as the guest, and use a 'foreign' arch
as the host.
That allows to avoid having to define in the test a bunch
of arch specific asm instructions : the test just decode a part
of its own code, and translate it to other archs.

By default, only the combination host == guest is run.
Arguments must be given to run other combinations.
See libvex_test.c for a description on how to specify which combinations
to run.

LibVEX host != guest does not (yet?) work when endianess or word size differs
between host and guest.

Also, currently, TILEGX host is not working properly (unless guest is also
TILEGX), as the evcheck instructions generated differs according to
the offset of the host_EvC_{FAILADDR,COUNTER}.

So, using TILEGX as host is only done when guest is also TILEGX.

Note that it is possible to specify a specific host arch to use.
For example, to force TILEGX to be used, do:
./none/tests/libvexmultiarch_test 1034
(where 1034 is the decimal value corresponding to the enum VexArchTILEGX.
This currently aborts with:
...
------------------------ Assembly ------------------------

EvCheck   (evCheck) ld r11, 8(r50); addli r11, r11, -1; st r11, 8(r50); bgez r11, nofail; jalr *(r50); nofail:

vex: priv/host_tilegx_defs.c:2353 (emit_TILEGXInstr): Assertion `evCheckSzB_TILEGX() == (UChar*)p - (UChar*)p0' failed.
//// failure exit called by libVEX
Whe TILEGX is fixed, we can remove the specific condition that avoids using
TILEGX as host.


Small changes have been done on VEX to allow more combinations
to work:
* host_mips_defs.c : when not compiled on mips,
  a lot of mips specific code is not compiled at all, because
  one of _MIPSEL or _MIPSEB must be defined to have either the
  little endian code or big endian code.
  emit32 function must however work to use mips as host.
  So, for this function, if _MIPSEL is not defined, then
  the big endian code is compiled in by default.
  (the mips endianess should probably be handled like the ppc
   endianess, for which the endianness to use is decided at runtime).

* host_arm64_isel.c : addition of a 'do not emit anything' for
   ABI HINT (avoid an assert e.g. for amd64 guest, arm64 host)

* libvex_guest_amd64.h : when I was still hoping mixing amd64 and x86,
  a first assert was firing up due to size/alignment
  of VexGuestAMD64State when compiled in 32 bits.
  => addition of pad elements to ensure the size and alignment
  of VexGuestAMD64State stays the same when compiled in 32 and
  64 bits (the 64 bits layout is unchanged).


The new tests have been run on x86/amd64/ppc64/s390x.
It is very well possible that the tests will fail on untested archs
(ppc32 or mips* or arm* or tilegx)
(e.g. because the hardcoded hwcaps in libvex_test.c are not ok).
It should be relatively trivial to fix these hwcaps problems.
Some other problems might be less easy to understand and fix 
(e.g. similar to the TILEGX evcheck or mips emit32 problem).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15084
2015-04-11 14:32:25 +00:00
Philippe Waroquiers
da3a839f90 Remove useless arguments in sparsewa, that were inheritated from WordFM
These arguments are not needed for sparsewa, as they can only
return the key given in input.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15083
2015-04-11 11:42:22 +00:00
Philippe Waroquiers
e6c0ac4195 Have the event map GC use the same approach as the other GC
done from libhb_maybe_GC, i.e. check the condition in
libhb_maybe_GC, and call the (non inlined) GC only if
a GC is needed.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15082
2015-04-10 19:34:14 +00:00
Philippe Waroquiers
8707b88cbb Update expected result for leak-segv-jmp, following TileGX addition of
a few lines in leak-segv-jmp.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15081
2015-04-10 19:08:17 +00:00
Julian Seward
082f9298a1 Add a port to Linux/TileGx. Zhi-Gang Liu (zliu@tilera.com)
Valgrind aspects, to match vex r3124.

See bug 339778 - Linux/TileGx platform support to Valgrind



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15080
2015-04-10 12:30:09 +00:00
Philippe Waroquiers
3a7b533846 Add missing stdout.exp file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15079
2015-04-09 20:07:11 +00:00
Carl Love
d1d8339a69 ADD AT_DCACHEBSIZE and AT_HWCAP2 support for POWER PC
Valgrind currently does not support the following AUX vector entries:
AT_DCACHEBSIZE, and AT_HWCAP2. By default these entries are suppressed by
Valgrind. The attached patch adds the needed support so the user level programs
can correctly determine that hardware level they are running on. Specifically
that the ISA 2.07 for Power 8 is supported.

Bugzilla 345695

This fix adds the needed support.  It makes a minor change to allow the
VEX settings of the host platform to be passed down so they can be checked
against the HWCAP values.

The files touched are:
  coregrind/m_initimg/initimg-linux.c
  coregrind/pub_core_initimg.h
  coregrind/m_main.c

committed by Carl Love cel@us.ibm.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15078
2015-04-09 16:23:20 +00:00
Florian Krohm
fa7e44d039 Assorted cleanups: remove magic constants and unneeded header file. Update
a few comments. Exit with code 127 in bash emulation mode when file was
not found.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15077
2015-04-08 19:01:15 +00:00
Florian Krohm
551540fc1f Consolidate shell script testcases without interpreter.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15076
2015-04-08 12:20:04 +00:00
Florian Krohm
acc090b03a Certain kernels on s390 provide extra read permissions on executable
segments. See discussion here: https://bugs.kde.org/show_bug.cgi?id=345824#c4
Making sure that rx and x compare equal.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15075
2015-04-07 20:43:55 +00:00
Julian Seward
e51ade1d11 Track vex r3120, that changed the type of Iop_Sqrt64x2 and Iop_Sqrt32x4.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15074
2015-04-07 09:08:42 +00:00
Florian Krohm
0f10b973f1 Followup to r14898 which changes the storage of segment names by
putting them into a string table.
This patch adds reference counting to segment names and frees them
when they are no longer used. The so freed memory can be reclaimed to
store future segment names.
New file coregrind/m_aspacemgr/aspacemgr-segnames.c which has all the
code dealing with segment names. Carved out of aspacemgr-linux.c
Detailled comments in the code.
Fixes BZ 344559.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15073
2015-04-06 21:34:30 +00:00
Julian Seward
5c4ce96cac arm64: remove redundant comment on test cases for FSQRT 2d_2d, 4s_4s, 2s_2s
(should have been included in r15071).  No functional change.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15072
2015-04-06 19:41:12 +00:00
Julian Seward
bcbe199f52 arm64: enable test cases for
FSQRT 2d_2d, 4s_4s, 2s_2s


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15071
2015-04-06 19:35:08 +00:00
Julian Seward
2eca28d9d3 Memcheck: add support for recently added IROps:
Iop_F64toF16 
Iop_F32toF16 
Iop_F16toF64 
Iop_F16toF32 



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15070
2015-04-06 14:52:28 +00:00
Julian Seward
352f312d73 arm64: enable test cases for
SCVTF d_d_imm, s_s_imm 
UCVTF d_d_imm, s_s_imm 
FCVTZS d_d_imm, s_s_imm 
FCVTZU d_d_imm, s_s_imm 
FCVTXN s_d 
SCVTF d_d, s_s 
UCVTF d_d, s_s 
SCVTF {2d_2d,4s_4s,2s_2s}_imm 
UCVTF {2d_2d,4s_4s,2s_2s}_imm 
FCVTZS {2d_2d,4s_4s,2s_2s}_imm 
FCVTZU {2d_2d,4s_4s,2s_2s}_imm 
FCVTXN 2s/4s_2d 
FCVTZ{S,U} {w,x}_{s,x}_#fbits 
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15069
2015-04-06 14:49:42 +00:00
Florian Krohm
e70d5a57f1 The linux launcher showed some odd behaviour. When given a shell script
named 'now' with this contents:

#!
/bin/date

the platform selection logic does this:

--11196:1:launcher no tool requested, defaulting to 'memcheck'
--11196:2:launcher   selecting platform for './now'
--11196:2:launcher   selecting platform for './now'
--11196:2:launcher   opened './now'
--11196:2:launcher   read 13 bytes from './now'
--11196:2:launcher   selecting platform for ''
--11196:2:launcher   selecting platform for '/home/florian/bin/'
--11196:2:launcher   opened '/home/florian/bin/'
--11196:2:launcher   selected platform 'unknown'
--11196:1:launcher no platform detected, defaulting platform to 'amd64-linux'

That is not quite right. Instead the platform should be determined by
examining the default shell.
Additionally, define VKI_BINPRM_BUF_SIZE because on linux only that many
characters are considered on a #! line. C.f. <linux>/fs/binfmt_script.c
m_ume/* needs to be adapted as well but that is a different patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15068
2015-04-06 14:29:45 +00:00
Florian Krohm
c094c3fdc4 Ignore generated files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15067
2015-04-06 14:24:44 +00:00
Florian Krohm
87a05e65b1 Tweak STATIC_ASSERT such that there is no warning about an unused
variable when used at block scope.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15066
2015-04-04 18:43:00 +00:00
Florian Krohm
f7d604f2c7 New directory: none/tests/scripts
Move corresponding testcases there.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15065
2015-04-03 15:47:19 +00:00
Florian Krohm
1096d55baa Add testcase for BZ 231357.
To do that a small enhancement to vg_regtest was needed:
(1) New declaration to allow specifying an environemnt variable
    that is set prior to invoking valgrind.
    eg:    env:  VAR=VAL
    There can be more than one such declaration
(2) prog-asis:  program_name
    This is like prog: except the program name is not prefixed with
    the testdir.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15064
2015-04-02 22:02:24 +00:00
Florian Krohm
909b88c40b When skipping white space after #! to find the interpreter
only skip ' ' and tabs.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15063
2015-04-02 16:07:41 +00:00
Philippe Waroquiers
9b8670b58d Add a test that triggers sector recycling
(cfr bug fix in revision 15058: without 15058, the below test
loops for ever).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15062
2015-04-01 22:51:07 +00:00
Philippe Waroquiers
3c9cad9e38 Commit the VEX makefile changes needed to have the libvexmultiarch
build and installed by default


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15061
2015-04-01 20:06:26 +00:00
Florian Krohm
17913a5d5d Fix function sr_EQ which compares two SysRes values. On Linux it was
forgotten to compare SysRes::_valEx.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15060
2015-04-01 19:20:16 +00:00
Philippe Waroquiers
c2c856712d Fix infinite loop in sector recycling introduced by r15054
(a regression test that will exercise sector recycling will follow)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15058
2015-04-01 18:15:42 +00:00
Florian Krohm
c358a23efc Announce fix for 231257. A pretty old BZ. We must have fixed this
in the meantime...


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15057
2015-04-01 15:07:34 +00:00
Rhys Kidd
537b3dfeeb Fix Darwin: -v does not show kernel version
bz#201435

Before:

== 590 tests, 237 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 590 tests, 237 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15056
2015-04-01 12:15:49 +00:00
Florian Krohm
3c25adc488 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15055
2015-03-31 22:19:23 +00:00
Philippe Waroquiers
92b8318dbb Further reduction of the size of the sector TTE tables
For default memcheck configuration, 32 bits) this patch
decreases by 13.6 MB ie. from 89945856 to 76317696.

Note that the type EClassNo is introduced only for readibility
purpose (and avoid some cast). That does not change the size
of the TTEntry.
The TTEntry size is reduced by using unions and/or Bool on 1 bit.

No performance impact detected (outer callgrind/inner memcheck bz2
on x86 shows a small improvement).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15054
2015-03-31 20:38:52 +00:00
Philippe Waroquiers
d528006d50 Fix a typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15053
2015-03-30 21:29:54 +00:00
Julian Seward
149f6c980d Un-break the build following vex r3110. Thanks to PetarJ for the fix.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15052
2015-03-30 19:14:35 +00:00
Julian Seward
790235a343 arm64: enable test cases for
FCVT{N,M,A,P,Z}{S,U} 2d_2d, 4s_4s, 2s_2s


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15051
2015-03-30 18:50:23 +00:00
Julian Seward
060b4f01f9 arm64: add test cases for
FCVT{N,M,A,P,Z}{S,U} d_d, s_s 
FCVTN 4h/8h_4s, 2s/4s_2d 
FCVTL 4s_4h/8h, 2d_2s/4s 
FCVT Sd, Hn 
FCVT Dd, Hn 
FCVT Hd, Sn 
FCVT Hd, Dn


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15050
2015-03-30 09:11:34 +00:00
Petar Jovanovic
6545da0072 mips: update list of ignored files in auxprogs
Update the ignore list with:
- getoff-mips32-linux
- getoff-mips64-linux


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15049
2015-03-30 00:05:54 +00:00
Rhys Kidd
356b09ad91 Fix memcheck/tests/sendmsg on OS X
bz#345637
- Support the lowercase for of libsystem* in filter_libc script

Before:

== 590 tests, 238 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==

After:

== 590 tests, 237 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 31 post failures ==


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15048
2015-03-29 05:21:15 +00:00
Florian Krohm
f39011b8b6 Add STATIC_ASSERT and use it.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15047
2015-03-28 18:36:01 +00:00
Philippe Waroquiers
275c1897dc Extensible main thread stack is tricky :(.
Revision 14976 causes a regression : stacktrace produced when the
stack has not yet been extended to cover SP will only contain one
element, as the stack limits are considered to be the limits of
the resvn segment.

This patch fixes that, by taking Resvn/SmUpper segment into
account to properly compute the limits.
It also contains a new regtest that fails with the trunk
(only one function in the stacktrace)
and succeeds with this patch (the 2 expected functions).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15046
2015-03-28 12:52:23 +00:00
Philippe Waroquiers
c9f8890723 The hint given by Valgrind gdbserver when enabling host visibility
in gdbserver was wrongly giving the file load address,
instead of the text segment address start.
This means that GDB was then showing wrong symbols for an address
(typically, symbols slightly before the address being printed).

This patch ensures the hint given is using the text start address.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15045
2015-03-28 12:23:07 +00:00
Philippe Waroquiers
02655d3115 Helgrind optimisation:
* do VTS pruning only if new threads were declared
  very dead since the last pruning round.
* When doing pruning, use the new list of threads very dead
  to do the pruning : this decreases the cost of the dichotomic search
  in VTS__substract



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15044
2015-03-28 12:01:58 +00:00
Petar Jovanovic
768a928b2b mips64: extend the test with new cases for Cavium SEQI and SNEI
Extend the test to introduce cases for SEQI and SNEI when immediate is
equal to the content of the GPR rs. Minor code style changes added.

Patch by Maran Pakkirisamy.

Related issue - BZ #341997.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15043
2015-03-28 00:59:32 +00:00
Florian Krohm
b8c19b3f67 Change the minimum allowable value of aspacem_minAddr to
be VKI_PAGE_SIZE. That follows from the requirement that
the address ought to be page aligned and > 0. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15042
2015-03-27 08:47:22 +00:00
Philippe Waroquiers
06b9624009 Improve --stats=yes:
* give the avg nr of IPs per execontext
 * use the newly introduced %f in m_transtab.c ratio
   and in the avg nr of execontext per list



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15041
2015-03-26 22:12:40 +00:00