Commit Graph

11618 Commits

Author SHA1 Message Date
Philippe Waroquiers
7aee63c33e Ensure we print the memory statistics with the default verbosity,
when giving --stats=yes


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15114
2015-04-19 17:56:42 +00:00
Philippe Waroquiers
3a0bea5c87 For ppc64, use the endianess of the running program, rather
than an harcoded endness.
(this is because ppc64 supports 2 endness, decided at runtime)

For mips, use BE if running on a non mips system, otherwise
use the endness of the running program
(this is because mips supports 2 endness, but decided at compile time).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15113
2015-04-19 15:43:53 +00:00
Philippe Waroquiers
9d18c8ddd0 fix 346307 fuse filesystem syscall deadlocks
Mark 2 additional syscalls as 'mayblock' when fuse-compatible hint
is given.
Patch from aozgovde@ralota.com



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15112
2015-04-19 12:39:33 +00:00
Florian Krohm
8d5672dbd6 Remove a few unneeded header files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15111
2015-04-18 17:45:34 +00:00
Florian Krohm
8291138a99 Fix a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15110
2015-04-18 17:41:31 +00:00
Florian Krohm
d1a1c32462 Factor out the 'extend' function. We only need one version for Linux and
one for Darwin. Down from 11. 
Carve out a new function 'track_frame_memory' that communicates to the
tool the allocation of a new stack frame. This was slightly different on
Linux and Darwin but should be the same on both platforms.
New files: priv_sigframe.h and sigframe-common.c


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15109
2015-04-18 10:33:54 +00:00
Florian Krohm
40315d9702 Add missing header file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15108
2015-04-18 09:15:47 +00:00
Carl Love
ec0778f110 Forgot to add the new files in memcheck/tests/ppc32 and memcheck/tests/ppc32.
They should have been part of the previous commit 15106.

--------------------------------------------------------------------

Add support for the lbarx, lharx, stbcx and sthcs instructions.

The instructions are part of the ISA 2.06 but were not implemented
in all versions of hardware.  The four instructions are all supported
in ISA 2.07.  The instructions were put under the ISA 2.07 category
of supported instructions in this patch.

The VEX commit for this fix is r3137.

The bugzilla for this issue is 346324.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15107
2015-04-18 00:01:58 +00:00
Carl Love
eb5aced360 Add support for the lbarx, lharx, stbcx and sthcs instructions.
The instructions are part of the ISA 2.06 but were not implemented
in all versions of hardware.  The four instructions are all supported
in ISA 2.07.  The instructions were put under the ISA 2.07 category
of supported instructions in this patch.

The VEX commit for this fix is r3137.

The bugzilla for this issue is 346324.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15106
2015-04-17 23:43:36 +00:00
Philippe Waroquiers
3041d1036a Fix statistics about ctxt_rcec :
* the nr of discards was always 0
* the cur nr of values was shown as max



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15105
2015-04-17 21:19:43 +00:00
Florian Krohm
789084fb99 Followup to r15101. Remove pointless cast. The castee already
has that type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15104
2015-04-17 08:56:11 +00:00
Carl Love
a10fc36f9f Fix the compiler warning about casting the arguments to the functions
LibVEX_GuestPPC64_get_CR() and LibVEX_GuestPPC64_get_XER(). 

The bugzilla for this issue is 346267.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15101
2015-04-16 16:25:29 +00:00
Florian Krohm
74d8930a26 Fix function call: 1st argument is the thread id.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15100
2015-04-15 21:45:57 +00:00
Philippe Waroquiers
1c4ae2b0a5 Following fix done in tilegx host in vex: r3130, reenable tilegx as host
in libvexmultiarch_test



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15099
2015-04-15 20:30:52 +00:00
Florian Krohm
1749963aa5 Update list of ignored files.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15098
2015-04-15 18:35:52 +00:00
Zhi-Gang Liu
2e186aae13 To address memcheck/tests/leak-segv-jmp test failure for TILEGX
By: Zhi-Gang Liu       zhg.liu@gmail.com


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15097
2015-04-15 03:26:38 +00:00
Zhi-Gang Liu
48fab8613a Add TILEGX arch. specific syscall #245, __NR_cacheflush
By:Zhi-Gang Liu


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15096
2015-04-15 03:22:17 +00:00
Zhi-Gang Liu
fefc424204 Fix the bigcode test failure for TILEGX
By: Zhi-Gang Liu



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15095
2015-04-15 02:56:20 +00:00
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