]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
11 years agoHandle IRStmt::STle of type F32.
Julian Seward [Wed, 7 May 2014 09:20:59 +0000 (09:20 +0000)] 
Handle IRStmt::STle of type F32.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2855

11 years agoAllow early-writeback for the cases
Julian Seward [Wed, 7 May 2014 09:20:11 +0000 (09:20 +0000)] 
Allow early-writeback for the cases
   stp d, d, [sp,#-imm]!
   stp s, s, [sp,#-imm]!
as well as for the existing case
   stp q, q, [sp,#-imm]!

git-svn-id: svn://svn.valgrind.org/vex/trunk@2854

11 years agoFix two warnings of unusued variable or variable set but not used
Philippe Waroquiers [Tue, 6 May 2014 21:54:09 +0000 (21:54 +0000)] 
Fix two warnings of unusued variable or variable set but not used

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13939

11 years agoFor the following c program:
Philippe Waroquiers [Tue, 6 May 2014 20:15:55 +0000 (20:15 +0000)] 
For the following c program:

main(int argc)
{
   typedef
      struct {
      int before_name;
      char name[argc];
      int after_name;
   }
   namet;
  namet n;

}

compiled with gcc 4.7.4, the trunk --read-var-info=yes gives:
parse_type_DIE: confused by:
 <2><51>: DW_TAG_structure_type
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 4
     DW_AT_sibling     : <83>

This is because that dwarf entry defines a struct with no size.
This happens when the struct has a VLA array in the middle
of a struct. This is a C gcc extension, and is a standard
feature of Ada.
The proper solution would be to have the size calculated at runtime,
using the gnat extensions or dwarf entries (to be generated by
the compiler).

The patch fixes this problem by defining the size of such structure
as 1 byte.
Another approach tried was to put the max possible size.
This had the disadvantage that any address on the stack was seen
as belonging to this variable.
This allows the description to work for the 1st byte of the variable
but cannot properly describe the 2nd and following bytes :
    (gdb) p &n
    $9 = (namet *) 0xbefbc070
    (gdb) mo c d 0xbefbc070
    Address 0xBEFBC070 len 1 not defined:
    Uninitialised value at 0xBEFBC070
    ==1396==  Location 0xbefbc070 is 0 bytes inside n.before_name,
    ==1396==  declared at crec.c:10, in frame #0 of thread 1
    (gdb) mo c d 0xbefbc071
    Address 0xBEFBC071 len 1 not defined:
    Uninitialised value at 0xBEFBC071
    ==1396==  Address 0xbefbc071 is on thread 1's stack
    (gdb)

A possible refinement would be to use a huge size but have the
logic of variable description understanding this and describing
all between this var and hte next var on the stack as being
in the VLA variable.

In the meantime, the size 1 avoids --read-var-info=yes to fail.

Also, the 'goto bad_DIE' have been replaced by a macro
goto_bad_DIE that ensures the line nr at which the bad DIE has
been detected is reported in the error msg.
This makes it easier to understand what is the problem.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13938

11 years agoFill in some SIMD integer test cases.
Julian Seward [Tue, 6 May 2014 14:46:44 +0000 (14:46 +0000)] 
Fill in some SIMD integer test cases.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13937

11 years agoBig reorganisation:
Julian Seward [Tue, 6 May 2014 09:30:29 +0000 (09:30 +0000)] 
Big reorganisation:

* add lane type descriptors, to be used by the random data
  generators -- as-yet unused

* move existing tests into new groupings, and rename some of
  them to be more consistent with the new notation.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13936

11 years agoRename these two test files to make their names a bit less cumbersome.
Julian Seward [Mon, 5 May 2014 13:38:37 +0000 (13:38 +0000)] 
Rename these two test files to make their names a bit less cumbersome.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13935

11 years agoFix assertion failures resulting from change of arity of
Julian Seward [Mon, 5 May 2014 10:03:56 +0000 (10:03 +0000)] 
Fix assertion failures resulting from change of arity of
Iop_{Add,Sub,Mul}32Fx4 introduced in r2809, in which said IROps
acquired a rounding-mode argument.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2853

11 years agoRenaming only (no functional change): rename IR artefacts to do
Julian Seward [Sun, 4 May 2014 10:54:08 +0000 (10:54 +0000)] 
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

11 years agoRenaming only (no functional change): rename IR artefacts to do
Julian Seward [Sun, 4 May 2014 10:52:11 +0000 (10:52 +0000)] 
Renaming only (no functional change): rename IR artefacts to do
with i-cache invalidation to be more consistent with new d-cache
invalidation functionality:
  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/vex/trunk@2852

11 years agoUpdate aarch64 fixes.
Julian Seward [Sat, 3 May 2014 21:29:18 +0000 (21:29 +0000)] 
Update aarch64 fixes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13933

11 years agoVG_(invalidate_icache) for ARM64: fix incorrect computation of cache
Julian Seward [Sat, 3 May 2014 21:28:00 +0000 (21:28 +0000)] 
VG_(invalidate_icache) for ARM64: fix incorrect computation of cache
line sizes.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13932

11 years agoARM64: add support for cache management instructions (Valgrind side):
Julian Seward [Sat, 3 May 2014 21:22:55 +0000 (21:22 +0000)] 
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

11 years agoARM64: add support for cache management instructions (VEX side):
Julian Seward [Sat, 3 May 2014 21:20:56 +0000 (21:20 +0000)] 
ARM64: add support for cache management instructions (VEX side):
  dc cvau, regX
  ic ivau, regX
  mrs regX, ctr_el0
Fixes #333228 and #333230.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2851

11 years agoHelgrind : two new gdbserver commands 'describe address' and 'info locks'
Philippe Waroquiers [Sat, 3 May 2014 11:12:50 +0000 (11:12 +0000)] 
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

11 years agoUpdate.
Julian Seward [Thu, 1 May 2014 22:42:53 +0000 (22:42 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13929

11 years agosyswrap: XEN_DOMCTL_resumedomain
Bart Van Assche [Thu, 1 May 2014 08:05:49 +0000 (08:05 +0000)] 
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

11 years agosyswrap: XEN_HVMOP_set_mem_type
Bart Van Assche [Thu, 1 May 2014 08:05:24 +0000 (08:05 +0000)] 
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

11 years agosyswrap: XEN_HVMOP_set_pci_link_route
Bart Van Assche [Thu, 1 May 2014 08:05:06 +0000 (08:05 +0000)] 
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

11 years agosyswrap: XEN_HVMOP_set_isa_irq_level
Bart Van Assche [Thu, 1 May 2014 08:04:42 +0000 (08:04 +0000)] 
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

11 years agosyswrap: XEN_DOMCTL_cacheflush
Bart Van Assche [Thu, 1 May 2014 08:04:18 +0000 (08:04 +0000)] 
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

11 years agosyswrap: XEN_DOMCTL_settimeoffset
Bart Van Assche [Thu, 1 May 2014 08:03:13 +0000 (08:03 +0000)] 
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

11 years agoFix P{RE,OST}_XEN_HVMOP_{READ,WRITE}
Bart Van Assche [Thu, 1 May 2014 08:02:39 +0000 (08:02 +0000)] 
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

11 years agoAdd test cases for out-of-range argument handling for x87 instructions
Julian Seward [Wed, 30 Apr 2014 22:51:47 +0000 (22:51 +0000)] 
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

11 years agox87 instructions FSIN, FCOS, FSINCOS and FPTAN: handle out-of-range
Julian Seward [Wed, 30 Apr 2014 22:50:34 +0000 (22:50 +0000)] 
x87 instructions FSIN, FCOS, FSINCOS and FPTAN: handle out-of-range
arguments correctly.  Mozilla bug 995564.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2850

11 years agoFix/improve user manual and man page derived from it.
Philippe Waroquiers [Wed, 30 Apr 2014 20:23:47 +0000 (20:23 +0000)] 
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

11 years agoAlso give the indication on how to use vgdb when --vgdb-stop-at is given
Philippe Waroquiers [Tue, 29 Apr 2014 19:04:50 +0000 (19:04 +0000)] 
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

11 years agoAdd a list of all the FP+SIMD insns, as a base from which to
Julian Seward [Mon, 28 Apr 2014 22:12:39 +0000 (22:12 +0000)] 
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

11 years agoFinish off and/or re-enable test cases for: vector integer comparison
Julian Seward [Sun, 27 Apr 2014 12:03:37 +0000 (12:03 +0000)] 
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

11 years agoFinish off vector integer comparison instructions, and
Julian Seward [Sun, 27 Apr 2014 12:02:12 +0000 (12:02 +0000)] 
Finish off vector integer comparison instructions, and
vector shift-by-immediates (Shr/Shl/Sar) instructions.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2849

11 years agoIncrease some sleep time to (try to) avoid some failure.
Philippe Waroquiers [Sun, 27 Apr 2014 08:23:17 +0000 (08:23 +0000)] 
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

12 years agoclo_processing is now done when this procedure is called.
Philippe Waroquiers [Sat, 26 Apr 2014 22:50:08 +0000 (22:50 +0000)] 
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

12 years agoAdd a new test that shows a surprising side effect of the
Philippe Waroquiers [Sat, 26 Apr 2014 21:50:57 +0000 (21:50 +0000)] 
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

12 years agoFilter lines such as:
Philippe Waroquiers [Sat, 26 Apr 2014 20:40:41 +0000 (20:40 +0000)] 
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

12 years agoMake the test (more) deterministic by having send_signal using
Philippe Waroquiers [Sat, 26 Apr 2014 20:23:47 +0000 (20:23 +0000)] 
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

12 years agoImprove the comments in the test
Philippe Waroquiers [Sat, 26 Apr 2014 20:01:28 +0000 (20:01 +0000)] 
Improve the comments in the test

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13911

12 years agoDue to timing problem, test was not properly testing.
Philippe Waroquiers [Sat, 26 Apr 2014 19:55:33 +0000 (19:55 +0000)] 
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

12 years agoFor the ld.so redirections for arm32-linux, allow the soname
Julian Seward [Thu, 24 Apr 2014 23:47:16 +0000 (23:47 +0000)] 
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

12 years agoEnable sys_sendmmsg() on arm32.
Julian Seward [Thu, 24 Apr 2014 23:45:18 +0000 (23:45 +0000)] 
Enable sys_sendmmsg() on arm32.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13908

12 years agoRemove the 2 sed expressions that were trying to massage the
Philippe Waroquiers [Thu, 24 Apr 2014 21:56:21 +0000 (21:56 +0000)] 
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

12 years agoToo difficult to match the stacktrace of the last instruction
Philippe Waroquiers [Thu, 24 Apr 2014 21:52:02 +0000 (21:52 +0000)] 
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

12 years ago* Modify nlgone_exit so that it tests --vgdb-stop-at=startup,exit
Philippe Waroquiers [Wed, 23 Apr 2014 21:27:07 +0000 (21:27 +0000)] 
* 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

12 years ago* Implement optimisation in storev8/16/64 similar to optimisations in storev32
Philippe Waroquiers [Tue, 22 Apr 2014 22:07:01 +0000 (22:07 +0000)] 
* 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

12 years ago* Factorise code between is_valid_for_client and is_valid_for_valgrind.
Philippe Waroquiers [Sun, 20 Apr 2014 22:10:24 +0000 (22:10 +0000)] 
* 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

12 years agoCleanup some old leftover of AIX port + fix a comment
Philippe Waroquiers [Sun, 20 Apr 2014 19:50:13 +0000 (19:50 +0000)] 
Cleanup some old leftover of AIX port + fix a comment

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13902

12 years ago* New option --aspace-minaddr=<address> allows to (possibly) make
Philippe Waroquiers [Sun, 20 Apr 2014 14:20:37 +0000 (14:20 +0000)] 
* 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

12 years ago- The option "--vgdb-stop-at=event1,event2,..." allows the user
Philippe Waroquiers [Sun, 20 Apr 2014 13:41:10 +0000 (13:41 +0000)] 
- 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

12 years agoReword/clarify the VG_(parse_enum_set) comment.
Philippe Waroquiers [Sat, 19 Apr 2014 10:27:28 +0000 (10:27 +0000)] 
Reword/clarify the VG_(parse_enum_set) comment.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13899

12 years agoFactorise enum set parsing code
Philippe Waroquiers [Sat, 19 Apr 2014 09:52:32 +0000 (09:52 +0000)] 
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

12 years agoSeveral improvements to (internal) statistics reporting about memory usage,
Philippe Waroquiers [Sat, 19 Apr 2014 00:25:54 +0000 (00:25 +0000)] 
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

12 years agovgdb must not transmit signals when gdbserver has been ptrace-invoked.
Philippe Waroquiers [Tue, 15 Apr 2014 22:35:23 +0000 (22:35 +0000)] 
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

12 years agomips64: Add an extra case for mips64 in ML_(get_CFA).
Dejan Jevtic [Mon, 14 Apr 2014 11:54:36 +0000 (11:54 +0000)] 
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

12 years agomips32: According to the glibc bug 5044 (https://sourceware.org/bugzilla/show_bug...
Dejan Jevtic [Fri, 11 Apr 2014 11:59:11 +0000 (11:59 +0000)] 
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

12 years agoMake origin tracking work on arm64.
Julian Seward [Tue, 8 Apr 2014 15:26:12 +0000 (15:26 +0000)] 
Make origin tracking work on arm64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13893

12 years agoHandle Iop_Max32U, so as to make origin tracking in Memcheck work.
Julian Seward [Tue, 8 Apr 2014 15:24:15 +0000 (15:24 +0000)] 
Handle Iop_Max32U, so as to make origin tracking in Memcheck work.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2848

12 years ago{FMOV,MOVI} (vector, immediate): fix incorrect DIP format string
Julian Seward [Tue, 8 Apr 2014 15:23:42 +0000 (15:23 +0000)] 
{FMOV,MOVI} (vector, immediate): fix incorrect DIP format string

git-svn-id: svn://svn.valgrind.org/vex/trunk@2847

12 years agoEnable syscalls:
Julian Seward [Mon, 7 Apr 2014 14:47:23 +0000 (14:47 +0000)] 
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

12 years agomips32/64: According to DWARF version 4 in DW_TAG_structure_type we can
Dejan Jevtic [Fri, 4 Apr 2014 10:20:03 +0000 (10:20 +0000)] 
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

12 years agomips32: Add an extra case for mips32 in ML_(get_CFA) in witch Valgrind will call
Dejan Jevtic [Fri, 4 Apr 2014 10:02:03 +0000 (10:02 +0000)] 
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

12 years agoImplement
Julian Seward [Thu, 3 Apr 2014 23:03:32 +0000 (23:03 +0000)] 
Implement
LD2/ST2 (multiple structures, post index) (some cases)
LD1/ST1 (multiple structures, no offset)  (some cases)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2846

12 years agoAdd tests for some variants of LD{1,2}/ST{1,2} that load or
Julian Seward [Thu, 3 Apr 2014 23:01:24 +0000 (23:01 +0000)] 
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

12 years agoAdd tests for FCMEQ, FCMGE, FCMGT, FACGE, FACGT
Julian Seward [Thu, 3 Apr 2014 23:00:45 +0000 (23:00 +0000)] 
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

12 years agoImplement TBL and TBX instructions.
Julian Seward [Thu, 3 Apr 2014 13:48:54 +0000 (13:48 +0000)] 
Implement TBL and TBX instructions.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2845

12 years agoAdd a couple more constant folding rules for vectors.
Julian Seward [Thu, 3 Apr 2014 13:48:21 +0000 (13:48 +0000)] 
Add a couple more constant folding rules for vectors.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2844

12 years agoBug 332658 - ldrd.w r1, r2, [PC, #imm] does not adjust for 32bit alignment
Julian Seward [Tue, 1 Apr 2014 11:00:36 +0000 (11:00 +0000)] 
Bug 332658 - ldrd.w r1, r2, [PC, #imm] does not adjust for 32bit alignment
(dimitry@google.com)

git-svn-id: svn://svn.valgrind.org/vex/trunk@2843

12 years agoFix a small typo in drd EXTRADIST Makefile.am file list for mips32
Philippe Waroquiers [Sat, 29 Mar 2014 00:37:51 +0000 (00:37 +0000)] 
Fix a small typo in drd EXTRADIST Makefile.am file list for mips32

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13887

12 years agoImplement FCM{EQ,GE,GT}, FAC{GE,GT} (vector).
Julian Seward [Thu, 27 Mar 2014 18:59:00 +0000 (18:59 +0000)] 
Implement FCM{EQ,GE,GT}, FAC{GE,GT} (vector).

git-svn-id: svn://svn.valgrind.org/vex/trunk@2842

12 years agomips32: Additional .exp files for mips32.
Dejan Jevtic [Thu, 27 Mar 2014 13:35:56 +0000 (13:35 +0000)] 
mips32: Additional .exp files for mips32.

Add a regression tests output file variants.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13886

12 years agomips32: Additional .exp file for mips32.
Dejan Jevtic [Wed, 26 Mar 2014 16:05:16 +0000 (16:05 +0000)] 
mips32: Additional .exp file for mips32.

memcheck/tests/origin5-bz2: Add a regression test output file variant.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13885

12 years agoAdd client requests
Julian Seward [Thu, 20 Mar 2014 23:00:09 +0000 (23:00 +0000)] 
Add client requests
   VALGRIND_DISABLE_ADDR_ERROR_REPORTING_IN_RANGE and
   VALGRIND_ENABLE_ADDR_ERROR_REPORTING_IN_RANGE
and supporting machinery for managing whole-address-space sparse
mappings.  n-i-bz.  In support of
https://bugzilla.mozilla.org/show_bug.cgi?id=970643

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13884

12 years agomips32: When we are accessing elements via double pointer MIPS compiler can
Dejan Jevtic [Thu, 20 Mar 2014 10:23:43 +0000 (10:23 +0000)] 
mips32: When we are accessing elements via double pointer MIPS compiler can
generate two consecutive 32bit loads instead of one 64bit load. Because of that
in error log we have two conflict loads of size 4 instead of one conflict load
of size 8.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13883

12 years agodrd: Add post-rwlock_init and pre-rwlock_destroy client requests (#332265)
Bart Van Assche [Wed, 19 Mar 2014 18:48:01 +0000 (18:48 +0000)] 
drd: Add post-rwlock_init and pre-rwlock_destroy client requests (#332265)

From: Ivo Raisr <ivosh@ivosh.net>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13882

12 years agomips: Disable test on mips32/64 big-endian platforms.
Dejan Jevtic [Wed, 19 Mar 2014 15:44:19 +0000 (15:44 +0000)] 
mips: Disable test on mips32/64 big-endian platforms.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13881

12 years agoVG_(strlen) ( const HChar* str ) does not count the null terminator '\0' at the
Dejan Jevtic [Wed, 19 Mar 2014 11:58:35 +0000 (11:58 +0000)] 
VG_(strlen) ( const HChar* str ) does not count the null terminator '\0' at the
end of the string, so we need to add an extra element in string 's' for the null
terminator.
VG_(strcpy) ( HChar* dest, const HChar* src ) function copies the string pointed
to by src, including the null terminator ('\0'), to the buffer pointed to by dest.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13880

12 years agomips32: Avoid compiler warnings.
Dejan Jevtic [Wed, 19 Mar 2014 11:10:51 +0000 (11:10 +0000)] 
mips32: Avoid compiler warnings.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2841

12 years agoUpdate.
Julian Seward [Tue, 18 Mar 2014 23:03:38 +0000 (23:03 +0000)] 
Update.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13879

12 years agoMake Helgrind test cases build on arm64-linux.
Julian Seward [Tue, 18 Mar 2014 23:02:59 +0000 (23:02 +0000)] 
Make Helgrind test cases build on arm64-linux.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13878

12 years agodrd: Fix pthread_rwlock_timed{rd,wr}lock intercepts (#332263)
Bart Van Assche [Tue, 18 Mar 2014 17:53:56 +0000 (17:53 +0000)] 
drd: Fix pthread_rwlock_timed{rd,wr}lock intercepts (#332263)

From: Ivo Raisr <ivosh@ivosh.net>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13877

12 years agodrd/tests/atomic_var: Avoid that platform-specific code can trigger a false negative
Bart Van Assche [Tue, 18 Mar 2014 08:45:51 +0000 (08:45 +0000)] 
drd/tests/atomic_var: Avoid that platform-specific code can trigger a false negative

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13876

12 years agoFor arm64, implement macros CALL_FN_W_5W to CALL_FN_W_12W.
Julian Seward [Sun, 16 Mar 2014 14:21:41 +0000 (14:21 +0000)] 
For arm64, implement macros CALL_FN_W_5W to CALL_FN_W_12W.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13875

12 years agostrmem intercepts: Add mempcpy() intercepts for ld-linux on x86
Bart Van Assche [Sat, 15 Mar 2014 12:47:28 +0000 (12:47 +0000)] 
strmem intercepts: Add mempcpy() intercepts for ld-linux on x86

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13874

12 years agoUn-break the arm32 compilation pipeline following the change of
Julian Seward [Sat, 15 Mar 2014 11:41:39 +0000 (11:41 +0000)] 
Un-break the arm32 compilation pipeline following the change of
arity of Iop_Mul32Fx4, Iop_Sub32Fx4, Iop_Add32Fx4 in r2809.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2840

12 years agoUpdate for ARM fe fixes for 332037 and n-i-bz LDRD .. [PC, ]
Julian Seward [Sat, 15 Mar 2014 08:35:15 +0000 (08:35 +0000)] 
Update for ARM fe fixes for 332037 and n-i-bz LDRD .. [PC, ]

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13873

12 years agoLDRD/STRD reg+/-#imm8: allow PC as the base register in the
Julian Seward [Sat, 15 Mar 2014 08:33:06 +0000 (08:33 +0000)] 
LDRD/STRD reg+/-#imm8: allow PC as the base register in the
case "ldrd Rt, Rt2, [PC, #+/-imm8]".  n-i-bz.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2839

12 years agoCorrectly handle add(hi) when the destination register is the PC.
Julian Seward [Sat, 15 Mar 2014 08:14:06 +0000 (08:14 +0000)] 
Correctly handle add(hi) when the destination register is the PC.
Fixes #332037.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2838

12 years agoNEWS: Mention recently fixed DRD issues
Bart Van Assche [Thu, 13 Mar 2014 08:40:56 +0000 (08:40 +0000)] 
NEWS: Mention recently fixed DRD issues

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13872

12 years agoNEWS: Mention recently fixed DRD issues
Bart Van Assche [Wed, 12 Mar 2014 14:44:34 +0000 (14:44 +0000)] 
NEWS: Mention recently fixed DRD issues

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13871

12 years agodrd: Fix an assertion failure in the internal consistency check code (#332055)
Bart Van Assche [Wed, 12 Mar 2014 14:27:49 +0000 (14:27 +0000)] 
drd: Fix an assertion failure in the internal consistency check code (#332055)

When DRD is built with ENABLE_DRD_CONSISTENCY_CHECKS enabled it fails with an assert on platforms where VG_STACK_REDZONE_SZB is #define'd as 0 (for example on 32-bit x86). drd: drd_thread.h:299 (vgDrd_thread_set_stack_min): Assertion 'DRD_(g_threadinfo)[tid].stack_min < DRD_(g_threadinfo)[tid].stack_max || DRD_(g_threadinfo)[tid].stack_max == 0' failed. ==12392== at 0x380227CD: report_and_quit (m_libcassert.c:279) ==12392== by 0x38022979: vgPlain_assert_fail (m_libcassert.c:359) ==12392== by 0x38015B29: drd_post_thread_create (drd_thread.h:297) ==12392== by 0x380A5DDC: run_a_thread_NORETURN (syswrap-linux.c) This is because on drd_post_thread_create() call is made to: drd_start_using_mem_stack2(drd_created, stack_max, 0); and in drd_start_using_mem_stack2() calls is made to: DRD_(thread_set_stack_min)(tid, a - VG_STACK_REDZONE_SZB); For many platforms VG_STACK_REDZONE_SZB is #define'd as 0 so that stack_min == stack_max in DRD_(thread_set_stack_min)(). I think it is safe to change the assert from (stack_min < stack_max) to (stack_min <= stack_max).

From: Ivo Raisr <ivosh@ivosh.net>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13870

12 years agoAdd vki/vki-*arm64-linux.h to include/Makefile.am nobase_pkginclude_HEADERS.
Mark Wielaard [Tue, 11 Mar 2014 21:32:51 +0000 (21:32 +0000)] 
Add vki/vki-*arm64-linux.h to include/Makefile.am nobase_pkginclude_HEADERS.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13869

12 years agoMake sure all files under the new shared dir are included in make dist.
Mark Wielaard [Tue, 11 Mar 2014 19:30:32 +0000 (19:30 +0000)] 
Make sure all files under the new shared dir are included in make dist.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13868

12 years agoAdd vgdb.h to coregrind/Makefile.am noinst_HEADERS.
Mark Wielaard [Tue, 11 Mar 2014 19:30:32 +0000 (19:30 +0000)] 
Add vgdb.h to coregrind/Makefile.am noinst_HEADERS.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13867

12 years agoAdd vki/vki-xen-tmem.h to include/Makefile.am nobase_pkginclude_HEADERS.
Mark Wielaard [Tue, 11 Mar 2014 19:30:25 +0000 (19:30 +0000)] 
Add vki/vki-xen-tmem.h to include/Makefile.am nobase_pkginclude_HEADERS.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13866

12 years agomips32/64: Fix some mips32 and mips64 definitions.
Dejan Jevtic [Tue, 11 Mar 2014 13:08:47 +0000 (13:08 +0000)] 
mips32/64: Fix some mips32 and mips64 definitions.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13865

12 years agocoregrind/m_scheduler + drd: Rework r13862
Bart Van Assche [Mon, 10 Mar 2014 19:40:45 +0000 (19:40 +0000)] 
coregrind/m_scheduler + drd: Rework r13862

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13864

12 years agodrd: Build fix for ENABLE_DRD_CONSISTENCY_CHECKS
Bart Van Assche [Mon, 10 Mar 2014 18:58:19 +0000 (18:58 +0000)] 
drd: Build fix for ENABLE_DRD_CONSISTENCY_CHECKS

From: Ivo Raisr <ivosh@ivosh.net>

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13863

12 years agocoregrind/m_scheduler: Inform tools about thread ID while translating
Bart Van Assche [Mon, 10 Mar 2014 18:54:40 +0000 (18:54 +0000)] 
coregrind/m_scheduler: Inform tools about thread ID while translating

This patch fixes the following assertion failure in DRD with
ENABLE_DRD_CONSISTENCY_CHECKS defined:

drd: drd_load_store.c:186 (vgDrd_trace_load): the 'impossible' happened.
==9543==    at 0x2803C4EC: report_and_quit (m_libcassert.c:279)
==9543==    by 0x2803C646: vgPlain_assert_fail (m_libcassert.c:359)
==9543==    by 0x2802A488: vgDrd_trace_load (drd_load_store.c:186)
==9543==    by 0x2805743E: vgPlain_translate (m_translate.c:1403)
==9543==    by 0x28088FCE: vgPlain_scheduler (scheduler.c:1014)
==9543==    by 0x280983D2: run_a_thread_NORETURN (syswrap-linux.c:103)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13862

12 years agoEnable sys_getpriority and sys_setpriority for ppc64.
Mark Wielaard [Mon, 10 Mar 2014 14:45:32 +0000 (14:45 +0000)] 
Enable sys_getpriority and sys_setpriority for ppc64.

Bug 331830 - ppc64: WARNING: unhandled syscall: 96/97
(Miroslav Franc, mfranc@redhat.com)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13861

12 years agoHandle IROps introduced by the arm64 port:
Julian Seward [Mon, 10 Mar 2014 10:42:36 +0000 (10:42 +0000)] 
Handle IROps introduced by the arm64 port:
Iop_ZeroHI64ofV128, Iop_ZeroHI96ofV128, Iop_ZeroHI112ofV128,
Iop_ZeroHI120ofV128, Iop_Abs64Fx2, Iop_Neg64Fx2

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13860

12 years agoBack-end handling of Iop_CmpNEZ32x4, Iop_CmpNEZ16x8, Iop_CmpNEZ8x16,
Julian Seward [Mon, 10 Mar 2014 10:40:48 +0000 (10:40 +0000)] 
Back-end handling of Iop_CmpNEZ32x4, Iop_CmpNEZ16x8, Iop_CmpNEZ8x16,
needed for Memchecking of SIMD arm64 code.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2837

12 years agoSupporting macros for function intercept and wrapping on arm64:
Julian Seward [Sun, 9 Mar 2014 09:46:04 +0000 (09:46 +0000)] 
Supporting macros for function intercept and wrapping on arm64:
* implement VALGRIND_ALIGN_STACK, VALGRIND_RESTORE_STACK
* preserve r30(LR) across the hidden call, so as to avoid segfaulting later

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13859