10710 Commits

Author SHA1 Message Date
Julian Seward
91350dc8a5 Add initial build support for Mac OS X 10.9 (Mavericks). Bug 326724
comment 12.  (Diego Giagio, diego@giagio.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14055
2014-06-20 11:48:38 +00:00
Julian Seward
b79c843632 Enable/enhance test cases for: dup_{d_d[], s_s[], h_h[], b_b[]}, ext
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14054
2014-06-19 22:21:28 +00:00
Philippe Waroquiers
bcd0b77c3b Improve/fix hash table collision statistics + remove useless space in gdbsrv hostvisibility keywork
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14053
2014-06-19 20:33:27 +00:00
Julian Seward
1a1ee7a2c7 Enable test cases for: orr_{8h,4h}_imm8_shifted,
orr_{4s,2s}_imm8_shifted, bic_{8h,4h}_imm8_shifted,
bic_{4s,2s}_imm8_shifted, cls_std6_std6, cm{eq,ge,gt,hi,hs,tst}_d_d_d,
cm{ge,gt,le,lt}_d_d_zero, cnt_{16,8}b_{16,8}b




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14052
2014-06-19 14:22:20 +00:00
Julian Seward
9f656ed8d8 When printing "REDIR:" lines at -v, print not only the name of the
function being redirected but also the soname of the object that it is
in.  This makes it a bit easier to diagnose redirection problems.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14051
2014-06-17 20:37:08 +00:00
Philippe Waroquiers
c919ff8a7a restructure dwarf3 DIE tracing
* add a trace_DIE function
* use it to trace a bad DIE
  and to trace all DIEs that are (maybe) read

(due to the "avoid read twice" optimisation, the tracing was not
so easy to read anymore => add an explicit trace_DIE call at the beginning
of read_DIE)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14050
2014-06-17 20:21:26 +00:00
Philippe Waroquiers
2ee4ccfb2a optimisation : avoid double reading of a DIE when the DIE will be parsed
by a DIE parser

Instead of pre-reading the DIE, first let the parser(s) possibly
parse the DIE. Read (to skip) the DIE data if no parser has parsed it.
OTherwise, just jump to the end of the DIE as established by the parser
that has read the DIE.

This slightly improves the reading of inlined info.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14049
2014-06-16 21:49:42 +00:00
Philippe Waroquiers
49514f8121 Refine NEWS entry for helgrind Ada tasks intercepts
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14048
2014-06-16 21:26:24 +00:00
Philippe Waroquiers
e6201c3eb1 Use a string literal format to avoid a gcc warning (-Wformat-security)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14047
2014-06-16 21:25:31 +00:00
Philippe Waroquiers
f3ee06ddce Add helgrind intercepts to have helgrind understanding Ada tasks terination rules
A recent gnatpro version is needed for this to work.

Thanks to these intercepts, some false positive errors are avoided,
and helgrind properly recuperates some internal memory associated
to the terminated task.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14046
2014-06-16 20:00:14 +00:00
Philippe Waroquiers
e5d788fc40 Announce in NEWS 199144 == 278972
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14045
2014-06-16 18:28:51 +00:00
Philippe Waroquiers
6ef6931a84 Fix random crash due to non-init inlparser when --read-var-info given but not --read-inline-info
Wrong place for the assertion for the inlparser
+ move the "zero the parsers" out of the "if VG_(clo*)" conditions



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14044
2014-06-16 18:08:02 +00:00
Julian Seward
4cad2990c8 Handle new IROp Iop_Abs64x2.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14043
2014-06-15 21:56:54 +00:00
Julian Seward
1cf00e8338 Enable test cases for instructions implemented today.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14042
2014-06-15 21:56:28 +00:00
Philippe Waroquiers
707197d56b Add a comment to document a possible optimisation (avoid double reading
of DIEs when one or more parsers will read them also)
+ add the name of the parser in the barf output.
 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14041
2014-06-15 21:49:13 +00:00
Philippe Waroquiers
01bcadac8f When only reading inline info, no need to parse debug_types sections
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14040
2014-06-15 19:16:46 +00:00
Philippe Waroquiers
efbeef9e71 Fix some obsolete comments, now that we have an ht of parsed abbvs
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14039
2014-06-15 18:28:31 +00:00
Philippe Waroquiers
af510aa4c3 separate the tracing code in other function, call the tracing code only
if trace active.

This makes the code somewhat easier to read and somewhat more efficient



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14038
2014-06-15 18:06:20 +00:00
Philippe Waroquiers
6158ccf35b Announce in NEWS the support for inlined function calls in stacktraces/suppressions
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14037
2014-06-15 15:54:58 +00:00
Philippe Waroquiers
ceaa5b2efe This patch implements the support needed for stacktraces
showing inlined function calls.
See 278972 valgrind stacktraces and suppression do not handle inlined function call debuginfo

Reading the inlined dwarf call info is activated using the new clo
  --read-inline-info=yes
Default is currently no but an objective is to optimise the performance
and memory in order to possibly set it on by default.
(see below discussion about performances).

Basically, the patch provides the following pieces:
1. Implement a new dwarf3 reader that reads the inlined call info
2. Some performance improvements done for this new parser, and
   on some common code between the new parser and the var info parser.
3. Use the parsed inlined info to produce stacktrace showing inlined calls
4. Use the parsed inlined info in the suppression matching and suppression generation
5. and of course, some reg tests

1. new dwarf3 reader:
---------------------
Two options were possible: add the reading of the inlined info
in the current var info dwarf reader, or add a 2nd reader.
The 2nd approach was preferred, for the following reasons:
The var info reader is slow, memory hungry and quite complex.
Having a separate parsing phase for the inlined information
is simpler/faster when just reading the inlined info.
Possibly, a single parser would be faster when using both
--read-var-info=yes and --read-inline-info=yes.
However, var-info being extremely memory/cpu hungry, it is unlikely
to be used often, and having a separate parsing for inlined info
does in any case make not much difference.
(--read-var-info=yes is also now less interesting thanks to commit
r13991, which provides a fast and low memory "reasonable" location
for an address).

The inlined info parser reads the dwarf info to make calls
to priv_storage.h ML_(addInlInfo).

2. performance optimisations
----------------------------
* the abbrev cache has been improved in revision r14035.
* The new parser skips the non interesting DIEs
  (the var-info parser has no logic to skip uninteresting DIEs).
* Some other minor perf optimisation here and there.
In total now, on a big executable, 15 seconds CPU are needed to
create the inlined info (on my slow x86 pentium).

With regards to memory, the dinfo arena:
with inlined info: 172281856/121085952  max/curr mmap'd
without          : 157892608/106721280  max/curr mmap'd,
So, basically, inlined information costs about 15Mb of memory for
my big executable (compared to first version of the patch, this is
already using less memory, thanks to the strpool deduppoolalloc.
The needed memory can probably be decreased somewhat more.

3. produce better stack traces
------------------------------
VG_(describe_IP) has a new argument InlIPCursor *iipc which allows
to describe inlined function calls by doing repetitive calls 
to describe_IP. See pub_tool_debuginfo.h for a description.

4. suppression generation and matching
--------------------------------------
* suppression generation now also uses an InlIPCursor *iipc
  to generate a line for each inlined fn call.

* suppression matching: to allow suppression matching to
match one IP to several function calls in a suppression entry,
the 'inputCompleter' object (that allows to lazily generate
function or object names for a stacktrace when matching 
an error with a suppression) has been generalised a little bit
more to also lazily generate the input sequence.
VG_(generic_match) has been updated so as to be more generic
with respect to the input completer : when providing an
input completer, VG_(generic_match) does not need anymore
to produce/compute any input itself : this is all delegated
to the input completer.

5. various regtests
-------------------
to test stack traces with inlined calls, and suppressions
of (some of) these errors using inlined fn calls matching.


Work still to do:
-----------------
* improve parsing performance
* improve the memory overhead.
* handling the directory name for files of the inlined function calls is not yet done.
  (probably implies to refactor some code)
* see if m_errormgr.c *offsets arrays cannot be managed via xarray



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14036
2014-06-15 15:42:20 +00:00
Philippe Waroquiers
19a3689518 Improve performance of dwarf3 reader using a hashtable of parsed abbreviations
For each DIE, the dwarf3 reader must know which data elements to read.
These elements are described by an abbreviation.
Re-reading these abbreviations for each DIE is costly as
the location of the needed abbreviation is found by scanning the full
abbv section, which is very costly.
(A small cache of 32 abbv offsets in the abbv section somewhat decreases
the cost, but reading the abbvs is still a hot spot, in particular for
big debug informations).

This patch:
  * adds an hash table of parsed abbreviations
  * all abbreviations for a CU are read in one single scan of the abbv
    section, when the CU header is read
So, with the patch, the di image is not accessed anymore for reading the abbvs
after the CU header parsing.

On a big executable, --read-var-info=yes user cpu changes from
  trunk:      320 seconds
to
  abbv cache: 270 seconds

This further improves on a previous (not committed) abbv cache that
was just caching up to 513 entries in the abbv pos cache and populating
the cache with an initial scan. The user cpu for this version was 285 seconds.

NB: this is some work in anticipation of a following patch that
will add reading dwarf3 inlined information, with the hope to make
this reading fast enough to activate it by default.

Note: on the examples I looked at, all abbreviations were numbered starting
from 1, with no holes. If that would always be the case, then one could use
an xarray of parsed abbreviations rather than an hash table. However,
I found nothing in the dwarf standard that guarantees that abbreviations
are numbered from 1. So, the hash table.
  




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14035
2014-06-15 10:51:14 +00:00
Philippe Waroquiers
24af4cfe61 small improvement in x86 unwind debug tracing
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14034
2014-06-14 22:12:37 +00:00
Philippe Waroquiers
266ab63f8b Do not destroy the strpool if NULL
It is possible that a debug info contains no string (and so strpool
is never allocated).
A protection to avoid accessing strpool was already necessary
in ML_(canonicaliseTables) :
   if (di->strpool)
      VG_(freezeDedupPA) (di->strpool);

So, if a similar debug info is released, we need the same protection
to avoid accessing a NULL strpool.

Detect by Julian on arm64, but not (at least easily) reproduced on amd64.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14033
2014-06-14 19:09:22 +00:00
Julian Seward
cc3cafc37a Add test cases for LD1R (single structure, replicate).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14032
2014-06-14 18:06:14 +00:00
Bart Van Assche
05c33b8e3e drd: Revert r14023
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14031
2014-06-14 16:39:46 +00:00
Bart Van Assche
73c2760051 drd/tests/std_thread2: Disable this test temporarily such that the suppression patterns can be restored
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14030
2014-06-14 16:39:28 +00:00
Philippe Waroquiers
53df23f0a6 This patch adds a 'de-duplicating memory pool allocator':
include/pub_tool_deduppoolalloc.h
  coregrind/pub_core_deduppoolalloc.h
  coregrind/m_deduppoolalloc.c
and uses it (currently only) for the strings in m_debuginfo/storage.c
The idea is that such ddup pool allocator will also be used for other
highly duplicated information (e.g. the DiCFSI information), where
significant gains can also be achieved.
The dedup pool for strings also decreases significantly the memory
needed by the read inline information (patch still to be committed,
see bug 278972).

When testing with a big executable (tacot_process),
this reduces the size of the dinfo arena from
  trunk:  158941184/109760512  max/curr mmap'd, 156775944/107882728 max/curr,
to
  ddup:   157892608/106614784  max/curr mmap'd, 156362160/101414712 max/curr

(so 3Mb less mmap-ed once debug info is read, 1Mb less mmap-ed in peak,
6Mb less allocated once debug info is read).

This is all gained due to the string which changes from:
  trunk:   17,434,704 in       266: di.storage.addStr.1
to
  ddup:    10,966,608 in       750: di.storage.addStr.1
(6.5Mb less memory used by strings)
The gain in mmap-ed memory is smaller due to fragmentation.
Probably one could decrease the fragmentation by using bigger
size for the dedup pool, but then we would lose memory on the last
allocated pool (and for small libraries, we often do not use much
of a big pool block).
Solution might be to increase the pool size but have a "shrink_block"
operation. To be looked at in the future.

In terms of performance, startup of a big executable (on an old pentium)
is not influenced significantly (something like 0.1 seconds on 15 seconds
startup for a big executable, on a slow pentium).

The dedup pool uses a hash table. The hash function used currently
is the VG_(adler32) check sum. It is reported (and visible also here)
that this checksum is not a very good hash function (many collisions).

To have statistics about collisions, use  --stats -v -v -v

As an example of the collisions, on the strings in debug info of memcheck tool on x86,
one obtain:
   --4789-- dedupPA:di.storage.addStr.1 9983 allocs (8174 uniq) 11 pools (4820 bytes free in last pool)
   --4789-- nr occurences of chains of len N, N-plicated keys, N-plicated elts
   --4789-- N: 0 : nr chain   6975, nr keys      0, nr elts      0
   --4789-- N: 1 : nr chain   3670, nr keys   6410, nr elts   8174
   --4789-- N: 2 : nr chain   1070, nr keys    226, nr elts      0
   --4789-- N: 3 : nr chain    304, nr keys    100, nr elts      0
   --4789-- N: 4 : nr chain    104, nr keys     84, nr elts      0
   --4789-- N: 5 : nr chain     72, nr keys     42, nr elts      0
   --4789-- N: 6 : nr chain     44, nr keys     34, nr elts      0
   --4789-- N: 7 : nr chain     18, nr keys     13, nr elts      0
   --4789-- N: 8 : nr chain     17, nr keys      8, nr elts      0
   --4789-- N: 9 : nr chain      4, nr keys      6, nr elts      0
   --4789-- N:10 : nr chain      9, nr keys      4, nr elts      0
   --4789-- N:11 : nr chain      1, nr keys      0, nr elts      0
   --4789-- N:13 : nr chain      1, nr keys      1, nr elts      0
   --4789-- total nr of unique   chains:  12289, keys   6928, elts   8174
which shows that on 8174 different strings, we have only 6410 strings which have
a unique hash value. As other examples, N:13 line shows we have 13 strings
mapping to the same key. N:14 line shows we have 4 groups of 10 strings mapping to the
same key, etc.
So, adler32 is definitely a bad hash function.
Trials have been done with another hash function, giving a much lower
collision rate. So, a better (but still fast) hash function would probably
be beneficial. To be looked at ...




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14029
2014-06-14 16:30:09 +00:00
Philippe Waroquiers
8ab2c85c16 Enhance slightly the x86 debug trace unwind code
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14028
2014-06-14 10:04:51 +00:00
Florian Krohm
5caf0bf724 Fix the cleanup: line to avoid an error message in case the
file does not exist.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14027
2014-06-12 15:37:15 +00:00
Julian Seward
36bf1f4d67 Add test cases for FMUL 2d_2d_d[], 4s_4s_s[], 2s_2s_s[].
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14026
2014-06-12 13:16:43 +00:00
Julian Seward
d4751b4053 Add tests for movi_4s_#imm8,lsl8 and ushr_d_d_#imm.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14025
2014-06-12 10:13:44 +00:00
Bart Van Assche
ad8de46e89 configure.ac: Fix Boost detection test
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14024
2014-06-12 07:45:23 +00:00
Bart Van Assche
2897b4095c glibc-2.X-drd.supp: Add support for --num-callers=1
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14023
2014-06-11 06:57:02 +00:00
Bart Van Assche
1f61c5c959 drd/tests/std_thread2: Make this test independent of the libstdc++ version
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14022
2014-06-11 06:39:03 +00:00
Julian Seward
37f5b9dd14 Enable test for movi_{16b,8b}_#imm8.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14021
2014-06-10 22:53:01 +00:00
Julian Seward
e32c76a6c2 Update.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14020
2014-06-10 12:05:33 +00:00
Bart Van Assche
af82b029c2 drd/tests/std_thread2: Filter out libstdc++ header file line numbers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14019
2014-06-10 07:46:50 +00:00
Philippe Waroquiers
e6aafd6394 Avoid warnings due to implicit conversion between void*, Addr, and fn pointers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14018
2014-06-09 22:08:45 +00:00
Philippe Waroquiers
a20d06587e When enabling hostvisibility in gdbsrv, give a more user friendly
message for the required GDB add-symbol-file command


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14017
2014-06-09 15:47:46 +00:00
Bart Van Assche
8273cee477 drd/tests: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14016
2014-06-09 09:20:20 +00:00
Bart Van Assche
6d68e47b19 drd: Ignore ordering introduced by a mutex used in the thread creation wrapper
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14015
2014-06-09 09:19:26 +00:00
Bart Van Assche
b7a7c3c66c drd/tests/std_thread2: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14014
2014-06-09 09:01:46 +00:00
Bart Van Assche
703310223e drd/tests/local_static: Disable because g++ does not yet allow proper interception of initialization of local static variables
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14013
2014-06-09 09:00:42 +00:00
Bart Van Assche
d665dce62e drd: Add __cxa_guard_*() intercepts
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14012
2014-06-09 07:55:14 +00:00
Bart Van Assche
3dac2e0ca4 drd/tests/local_static: Fix a typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14011
2014-06-09 07:38:32 +00:00
Bart Van Assche
49e21780e9 drd/tests: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14010
2014-06-09 06:56:06 +00:00
Bart Van Assche
77897d6ecb drd/tests/local_static: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14009
2014-06-09 06:54:30 +00:00
Bart Van Assche
c5e570a8b7 gdbserver_tests: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14008
2014-06-09 06:53:13 +00:00
Bart Van Assche
a659f00a97 memcheck/tests: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14007
2014-06-09 06:52:46 +00:00
Bart Van Assche
12cccdeb45 none/tests/amd64: Update Subversion ignore list
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14006
2014-06-09 06:52:24 +00:00