Commit Graph

10591 Commits

Author SHA1 Message Date
Julian Seward
f3841c8aae Rename these two test files to make their names a bit less cumbersome.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13935
2014-05-05 13:38:37 +00:00
Julian Seward
f7058ba74b Renaming only (no functional change): rename IR artefacts to do
with i-cache invalidation to be more consistent with new d-cache
flushing functionality, so as to track changes in Vex r2852:
  Ijk_TInval          -> Ijk_InvalICache
  TISTART             -> CMSTART (CM == "Cache Management")
  TILEN               -> CMLEN
  VEX_TRC_JMP_TINVAL  -> VEX_TRC_JMP_INVALICACHE



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13934
2014-05-04 10:54:08 +00:00
Julian Seward
1f3b682ca0 Update aarch64 fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13933
2014-05-03 21:29:18 +00:00
Julian Seward
130f008275 VG_(invalidate_icache) for ARM64: fix incorrect computation of cache
line sizes.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13932
2014-05-03 21:28:00 +00:00
Julian Seward
9e320cfacb ARM64: add support for cache management instructions (Valgrind side):
dc cvau, regX
  ic ivau, regX
  mrs regX, ctr_el0
Fixes #333228 and #333230.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13931
2014-05-03 21:22:55 +00:00
Philippe Waroquiers
9bd0d72eb9 Helgrind : two new gdbserver commands 'describe address' and 'info locks'
- Helgrind GDB server monitor command 'describe <address>'
    allowing to describe an address (e.g. where it was allocated).
  - Helgrind GDB server monitor command 'info locks' giving
    the list of locks, their location, and their status.

In a further patch, it is intended to
  1. factorise the describe address code between memcheck and helgrind
  2. generalise the describe address gdbsrv command so as to make
     it usable for all tools.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13930
2014-05-03 11:12:50 +00:00
Julian Seward
13efd27da6 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13929
2014-05-01 22:42:53 +00:00
Bart Van Assche
31ea126303 syswrap: XEN_DOMCTL_resumedomain
No input or output parameters
    
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13928
2014-05-01 08:05:49 +00:00
Bart Van Assche
8e96f7cb2e syswrap: XEN_HVMOP_set_mem_type
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13927
2014-05-01 08:05:24 +00:00
Bart Van Assche
ab0b9aeee2 syswrap: XEN_HVMOP_set_pci_link_route
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13926
2014-05-01 08:05:06 +00:00
Bart Van Assche
a73358e813 syswrap: XEN_HVMOP_set_isa_irq_level
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13925
2014-05-01 08:04:42 +00:00
Bart Van Assche
79d4a4bc9e syswrap: XEN_DOMCTL_cacheflush
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13924
2014-05-01 08:04:18 +00:00
Bart Van Assche
bbb123c729 syswrap: XEN_DOMCTL_settimeoffset
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13923
2014-05-01 08:03:13 +00:00
Bart Van Assche
3c3aed19ee Fix P{RE,OST}_XEN_HVMOP_{READ,WRITE}
_type should be a type, not a string
    
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13922
2014-05-01 08:02:39 +00:00
Julian Seward
6199b0550b Add test cases for out-of-range argument handling for x87 instructions
FSIN, FCOS, FSINCOS and FPTAN.  Mozilla bug 995564.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13921
2014-04-30 22:51:47 +00:00
Philippe Waroquiers
d8b376f404 Fix/improve user manual and man page derived from it.
The current manual and man page tells:
      --tool=<toolname> [default: memcheck]
           Run the Valgrind tool called toolname, e.g. Memcheck, Cachegrind, etc.

where the toolname examples do not list all the tools, and use uppercase
first letter, which is not understood.

So, use lower case, and give the list of all known tools.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13920
2014-04-30 20:23:47 +00:00
Philippe Waroquiers
4b81782886 Also give the indication on how to use vgdb when --vgdb-stop-at is given
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13919
2014-04-29 19:04:50 +00:00
Julian Seward
d5cb000e92 Add a list of all the FP+SIMD insns, as a base from which to
generate test cases.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13918
2014-04-28 22:12:39 +00:00
Julian Seward
f80904ff97 Finish off and/or re-enable test cases for: vector integer comparison
instructions, and vector shift-by-immediates (Shr/Shl/Sar)
instructions.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13917
2014-04-27 12:03:37 +00:00
Philippe Waroquiers
d4afe02753 Increase some sleep time to (try to) avoid some failure.
With the new sleep time, no failure on 1200 runs of the test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13916
2014-04-27 08:23:17 +00:00
Philippe Waroquiers
49e5388060 clo_processing is now done when this procedure is called.
So, we can now allocate this memory only when approx history level
is requested.

I double checked using printf that clo processing was done before
this procedure is called.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13915
2014-04-26 22:50:08 +00:00
Philippe Waroquiers
ec8e145850 Add a new test that shows a surprising side effect of the
medium resolution (4 callers) used to compare errors.

To look at the strange side effect, do:
  ./vg-in-place -v --suppressions=memcheck/tests/suppfreecollision.supp memcheck/tests/suppfree activatenondangerouserror

You obtain at the end:
...
--19240-- used_suppression:      2 suppressnondangerouserror memcheck/tests/suppfreecollision.supp:2
...

showing that the suppression aiming at suppressing a nondangerous error has in fact
suppressed more than expected.

This is because m_errormgr.c compares the exe_context in medium resolution/4 calls
(or low resolution/2 calls  once 100 errors have been collected).

The error machinery first encounters the non dangerous error. This error is suppressed,
because all callers match the suppression entry. In particular, we have
in the stacktrace the function ok_to_suppress_double_free_from_this_fun

Then the error machinery encounters the second error.
The stacktrace of the 2nd error has the same first 4 callers than the non
dangerous error. So the 2nd error is considered equal to the first one
and is (unexpectedly in my opinion) suppressed.

This looks a bug (or at least something very surprising).
(the doc mentions the fact that errors are 'commoned up' on 4 callers, but
I am not sure the above side effect was understood).


There are several ways this can be improved, some are more easier than other
  * have   --error-resolution=low/med/high
    similar to the memcheck   --leak-resolution=low/med/high
     (which default value would we take for this new clo ?)

  * have a lot more intelligent error comparison:
      when comparing an error with a suppressed error, one must
      check that the callers used for suppression are equal.
     This looks difficult to implement and probably a significant slow down
     in the error machinery, which will impact applications producing
     many suppressed errors (e.g. helgrind + some pthread lib errors).
     This also implies more memory (e.g. one byte per caller in the
     error, to indicate which caller(s) were used to suppress.
     Still wondering what to do with * and ... ?

  * have a somewhat more intelligent error comparison:
     Instead of comparing only the callers used for suppression, we
     compare the range first..last caller used (so including some
     callers in the range that were not used to suppressed if e.g.
     a ... matching was put in the supp entry).
     Probably still a slowdown (less than previous solution ?)
     and less memory than the previous solution.
     But also not completely clear how to compute the range.

  * always re-evaluate the suppression : this will very probably be
    a significant slow down.

  * do nothing, as nobody complained about this behaviour up to now :)

  * ??? any other idea



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13914
2014-04-26 21:50:57 +00:00
Philippe Waroquiers
dc21443635 Filter lines such as:
+38     ../sysdeps/unix/sysv/linux/_exit.c: No such file or directory.

This should make nlgone_exit work on s390 suse and x86_64 suse


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13913
2014-04-26 20:40:41 +00:00
Philippe Waroquiers
38471445e1 Make the test (more) deterministic by having send_signal using
a guardcmd before sending the signal.
This allows to be sure that the signal are emitted when vgdb
is attached.
We still have one 'sleep' in the test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13912
2014-04-26 20:23:47 +00:00
Philippe Waroquiers
5bdc88da20 Improve the comments in the test
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13911
2014-04-26 20:01:28 +00:00
Philippe Waroquiers
922a8c4f8d Due to timing problem, test was not properly testing.
What needs to be ensured is:
   vgdb is attached (i.e. is ptracing valgrind)
   2 sigusr1 signals are sent while vgdb is ptracing
     vgdb will queue these signals
   when continuing, the queued signals are delivered.

With 3.9.0, the above causes an internal error in valgrind:
valgrind: m_syswrap/syswrap-main.c:1436 (vgPlain_client_syscall): Assertion 'sci->status.what == SsIdle' failed.

It would be better to have explicit synchronisation in the test
rather than counting on 'sleep xxx' to have things done in the
order that tests the signal queueing.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13910
2014-04-26 19:55:33 +00:00
Julian Seward
58fb3e424c For the ld.so redirections for arm32-linux, allow the soname
ld-linux-armhf.so.3 in addition to the existing name, ld-linux.so.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13909
2014-04-24 23:47:16 +00:00
Julian Seward
2320d23f1f Enable sys_sendmmsg() on arm32.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13908
2014-04-24 23:45:18 +00:00
Philippe Waroquiers
887231c654 Remove the 2 sed expressions that were trying to massage the
stacktrace for the last program instruction encountered with
  --vgdb-stop-at=exit
These are not needed anymore, as these lines are now removed


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13907
2014-04-24 21:56:21 +00:00
Philippe Waroquiers
ac230f7fcb Too difficult to match the stacktrace of the last instruction
of a program => let's remove these (uninteresting) lines
rather than trying to 'sed' them to make them look the same
on different OS/platform/....


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13906
2014-04-24 21:52:02 +00:00
Philippe Waroquiers
e548d704c3 * Modify nlgone_exit so that it tests --vgdb-stop-at=startup,exit
* remove empty lines from nlgone_*.stdinB.gdb, as these empty
  lines are (surprisingly) repeating the previous gdb command.
  Empty lines should be be put in the *gdb files.
* And add yet another sed expression in filter_gdb to cope with
  the different place where a thread exits.
  (this filter technique is now *really* arriving in a dead end
   e.g. the link between the comment and the sed expression is very
   poor).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13905
2014-04-23 21:27:07 +00:00
Philippe Waroquiers
e2286363d9 * Implement optimisation in storev8/16/64 similar to optimisations in storev32
See comments in MC_(helperc_STOREV8) for a detailed explanation.

On modern cpu, this gives a few percent speed improvement for
some perf tests, and reduces the nr of undistinguished secondary
map.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13904
2014-04-22 22:07:01 +00:00
Philippe Waroquiers
b8735981a0 * Factorise code between is_valid_for_client and is_valid_for_valgrind.
* Implement VG_(am_is_valid_for_valgrind)
* Use it in gdbsrv to check accessibility when hostvisibility is activated



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13903
2014-04-20 22:10:24 +00:00
Philippe Waroquiers
a05f43f011 Cleanup some old leftover of AIX port + fix a comment
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13902
2014-04-20 19:50:13 +00:00
Philippe Waroquiers
9ba256ffb0 * New option --aspace-minaddr=<address> allows to (possibly) make
use of some more memory by decreasing the default value
  or solve some conflicts with system libraries by increasing the value.
  See user manual for details.

Note that the lowest accepted possible value is 0x1000, which is
the current value used by Macos in 32bits.
On linux, 0x10000 (64KB) seems to cause not much conflicts.

Default values are unchanged (i.e. are the same as when there
was no clo option).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13901
2014-04-20 14:20:37 +00:00
Philippe Waroquiers
8b7a52c4cb - The option "--vgdb-stop-at=event1,event2,..." allows the user
to ask GDB server to stop before program execution, at the end
  of the program execution and on Valgrind internal errors.

- A new monitor command "v.set hostvisibility" that allows GDB server
  to provide access to Valgrind internal host status/memory.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13900
2014-04-20 13:41:10 +00:00
Philippe Waroquiers
c23409d4e8 Reword/clarify the VG_(parse_enum_set) comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13899
2014-04-19 10:27:28 +00:00
Philippe Waroquiers
d17935e604 Factorise enum set parsing code
* add a function Bool VG_(parse_enum_set) in pub_tool_libcbase.h/m_libcbase.c
  (close to Bool VG_(parse_Addr)
* Implement Bool MC_(parse_leak_heuristics) and MC_(parse_leak_kinds)
  as a call to VG_(parse_enum_set)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13898
2014-04-19 09:52:32 +00:00
Philippe Waroquiers
9cbab7ee2c Several improvements to (internal) statistics reporting about memory usage,
making it easier to understand the memory and/or oom situation.
No functional (user level) change.

* For --profile-heap=yes, sort the cost centers by decreasing size,
  so that the most relevant cost centers are closed to the arena
  total.

* factorise duplicated code calling a series of print stat functions

* VG_(show_sched_status)
    optionally show the host stacktrace
               the amount of valgrind stack used by each thread
               the exited threads

* various functions: update to add VG_(show_sched_status) new
  args, keeping the same info production as before.
 
* In case of out of memory situation detected by m_mallocfree.c,
  reports more information:
    valgrind and tool stats
    scheduler status (full information)

* gdbserver v.info scheduler :
    show full information.

The oom behaviour/reporting was tested using a small
program causing an OOM, and having several threads
(some terminated, some still active).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13897
2014-04-19 00:25:54 +00:00
Philippe Waroquiers
74fb3e1c3e vgdb must not transmit signals when gdbserver has been ptrace-invoked.
Most of the time, Valgrind masks async signals, and polls for such
signals at regular interval.
There is a very narrow range of code (around client syscall logic)
where such signals are unmasked (as they must be able to interrupt
syscalls).
This is the only range of code where Valgrind is expecting to
receive such a signal.

When gdbserver is ptraced invoked, Valgrind is artificially made
to jump out of this code portion. Signals are not masked.
When ptraceing valgrind, vgdb will get these signals but cannot
transmit them immediately, otherwise they arrive in range
of code where they are not expected (causing internal error
in syscall logic) and/or causing gdbserver syscalls to be
interrupted.

3 solutions to solve that were looked at:
1. have the gdbserver code masking signals "as quickly as possible".
 Easy to implement, but this leaves still a small window
 of code where signals are not masked and would cause a problem.
2. have vgdb setting the SIGMASK of valgrind before invoking
  gdbserver.
  This would be easy to implement, but changing the SIGMASK
  of the ptrace-d process is only available on very recent kernels.
3. have vgdb queuing signals, and only transmitting them once
   gdbserver invocation is finished.
This 3rd solution has been implemented.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13896
2014-04-15 22:35:23 +00:00
Dejan Jevtic
958717766b mips64: Add an extra case for mips64 in ML_(get_CFA).
This patch resolves the issue with the memcheck/tests/dw4 on mips64 platform.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13895
2014-04-14 11:54:36 +00:00
Dejan Jevtic
a383b110f9 mips32: According to the glibc bug 5044 (https://sourceware.org/bugzilla/show_bug.cgi?id=5044)
until the glibc version 2.17 printf hadn't respected the rounding mode for decimal
output. Because of change in glibc printf function we need to change our
expected output file for none/tests/mips32/FPUarithmetic test.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13894
2014-04-11 11:59:11 +00:00
Julian Seward
9be796fe75 Make origin tracking work on arm64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13893
2014-04-08 15:26:12 +00:00
Julian Seward
20f47d4181 Enable syscalls:
sys_readv sys_signalfd4 sys_utimensat sys_timerfd_create
sys_timerfd_settime sys_timerfd_gettime sys_capget sys_syslog
sys_sched_yield sys_sigaltstack sys_rt_sigqueueinfo
sys_mq_timedsend sys_mq_timedreceive sys_mq_notify
sys_mq_getsetattr sys_mremap



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13892
2014-04-07 14:47:23 +00:00
Dejan Jevtic
6cb9b78f0d mips32/64: According to DWARF version 4 in DW_TAG_structure_type we can
have DW_AT_signature attribute. That wasn't the case in DWARF version 3.

From DWARF version 4:
If the complete declaration of a type has been placed in a separate type unit, 
an incomplete declaration of that type in the compilation unit may provide the
unique 64-bit signature of the type using a DW_AT_signature attribute.

This patch adds an extra field in TyStOrUn structure (typeR). This field is 
reference to other TyEnt that is placed in separate type unit. Because of the new
field in TyStOrUn structure we need to add an extra case in parse_type_DIE
that will put the right reference to other TyEnt and an extra case in
ML_(describe_type) that will describe type when the ty->Te.TyStOrUn.typeR field
is used.

This patch is resolving the problem with memcheck/tests/dw4 test when it's 
compiled with compiler that will emit DW_AT_signature under the DW_TAG_structure_type.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13891
2014-04-04 10:20:03 +00:00
Dejan Jevtic
eb40633b9b mips32: Add an extra case for mips32 in ML_(get_CFA) in witch Valgrind will call
compute_cfa to get the call frame address.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13890
2014-04-04 10:02:03 +00:00
Julian Seward
00cbf4454f Add tests for some variants of LD{1,2}/ST{1,2} that load or
store two registers.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13889
2014-04-03 23:01:24 +00:00
Julian Seward
4330b24498 Add tests for FCMEQ, FCMGE, FCMGT, FACGE, FACGT
(reg-vs-reg variants only)

Add tests for all TBL and TBX variants.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13888
2014-04-03 23:00:45 +00:00
Philippe Waroquiers
e122b8d637 Fix a small typo in drd EXTRADIST Makefile.am file list for mips32
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13887
2014-03-29 00:37:51 +00:00
Dejan Jevtic
4f9a9ceb7a mips32: Additional .exp files for mips32.
Add a regression tests output file variants.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13886
2014-03-27 13:35:56 +00:00