137 Commits

Author SHA1 Message Date
Philippe Waroquiers
77f136cef4 Implement Option --error-markers=<begin>,<end>
* This option can be used to mark the begin/end of errors in textual
output mode, to facilitate searching/extracting errors in output files
mixing valgrind errors with program output.

* Use the new option in various existing regtests to test the various
  possible usage.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14714
2014-11-12 19:43:29 +00:00
Florian Krohm
4cb2cb656c Fix some grammatical weirness which was reported in BZ #340430.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14670
2014-10-28 16:25:23 +00:00
Philippe Waroquiers
3453b54f22 Add missing ]] to terminate CDATA. Missing brackets are causing
the man page to contain:
               ></programlisting>

                     <para>And here are the same errors with
                     <option>--read-var-info=yes</option>:</para>

               <programlisting><![CDATA[

Rather than the nicely formatted 'And here ...' paragraph.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14561
2014-09-22 19:19:50 +00:00
Julian Seward
44591524a2 Merge r14513 from 3_10_BRANCH (Update docs w.r.t. status of
partially-enabled --read-inline-info.)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14520
2014-09-12 09:22:36 +00:00
Julian Seward
de3c2f793b Rename "--kernel-variant=android-emulator-no-hw-tls" to
"=android-no-hw-tls" per suggestion from Philippe.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14479
2014-09-06 14:45:12 +00:00
Julian Seward
39b8117fc8 Document the new --kernel-variant options committed in r14440.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14448
2014-09-03 22:21:25 +00:00
Philippe Waroquiers
8e605f14c5 Add option a new sim-hint no-nptl-pthread-stackcache.
Activating this hint using --sim-hints=no-nptl-pthread-stackcache
means the glibc nptl stack cache will be disabled.

Disabling this stack/tls cache avoids helgrind false positive race conditions
errors when using __thread variables.

Note: disabling the stack cache is done by a kludge, dependent on
internal knowledge of glibc code, and using libpthread debug info.
So, this kludge might be broken with newer glibc version.
This has been tested on various platforms and various
glibc versions 2.11, 2.16 and 2.18

To check if the disabling works, you can do:
valgrind --tool=helgrind --sim-hints=no-nptl-pthread-stackcache -d -v ./helgrind/tests/tls_threads |& grep kludge

If you see the below 2 lines, then hopefully the stack cache has been disabled.
--12624-- deactivate nptl pthread stackcache via kludge: found symbol stack_cache_actsize at addr 0x3AF178
--12624:1:sched    pthread stack cache size disabling done via kludge




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14313
2014-08-19 22:46:44 +00:00
Philippe Waroquiers
2a49250682 Small fixes in 'getting started' section of user manual
* Mention --read-inline-info=yes as an alternative to compile without inlining.

* Mention that stabs debuginfo reader is not working anymore since 3.9.0



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14160
2014-07-14 22:04:17 +00:00
Bart Van Assche
9214c37d49 Rename --defaultsupp into --default-suppressions as requested by Julian
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14090
2014-06-24 05:08:21 +00:00
Bart Van Assche
4b6bd7b0fc core: Add command-line option --defaultsupp
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14080
2014-06-22 10:11:59 +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
ab71852280 Fix 334788 clarify doc about --log-file initial program directory
Behaviour is kept unchanged, a paragraph is added in the doc to
clarify.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13979
2014-05-17 05:50:46 +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
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
7d40b140ac Following svn r13758 (bug 328711), some further similar fixes,
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13759
2013-12-12 23:19:13 +00:00
Julian Seward
e2bff1c182 Merge the following revisions from 3_9_BRANCH to trunk:
r13682  Initial cut at 3.9.0 release notes.
r13683  Remove duplicate NEWS entries for 3.9.0.
r13689  Minor docs/NEWS fixes
r13690  Documentation updates for 3.9.0.
r13691  More documentation updates, re leak-checker changes
r13692  NEWS: Note increased max mem size.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13724
2013-11-29 23:08:28 +00:00
Philippe Waroquiers
4f7d2ae066 Two small wording fixes in manual
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13667
2013-10-20 17:12:16 +00:00
Julian Seward
ab319a7e24 Followup to r13652 (make the translation cache size be command-line
controllable): reduce MAX_N_SECTORS to 24, speed up Sector
initialisation, wording tweaks.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13655
2013-10-18 11:18:45 +00:00
Philippe Waroquiers
61b8b9617b Allow the user to dimension the translation cache
A previous commit had decreased to 6 (on android) and increased to 16
(other platforms) the nr of sectors in the translation cache.
This patch adds a command line option to let the user specify
the nr of sectors as e.g. 16 sectors might be a lot and cause
an out of memory for some workloads or might be too small for
huge executable or executables using a lot of shared libs.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13652
2013-10-18 00:08:20 +00:00
Philippe Waroquiers
619be966db Allow tools to provide some statistics in suppression list produced at the end
Option -v outputs a list of used suppressions. This only gives
the nr of times a suppression was used.
For a leak search, this only gives the nr of loss records that
have been suppressed, but it does not give additional needed details
to understand more precisely what has been suppressed
(i.e. nr of blocks and nr of bytes).

=> Add in the tool interface update_extra_suppression_use and
print_extra_suppression_info functions to allow the tool to record
additioonal use statistics for a suppression. These statistics
can be done depending on the error (and its data) which is suppressed.

Use this in memcheck for the leak suppressions, to maintain and output
the nr of blocks and bytes suppressed by a suppression during
the last leak search.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13651
2013-10-17 22:10:41 +00:00
Mark Wielaard
defd29702f Bug 321738 Add manpages for vgdb and valgrind-listener.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13443
2013-07-03 10:00:19 +00:00
Philippe Waroquiers
52b0e470c3 Document that user level client stack switches might cause crashes
and that these crahses might be avoided using VALGRIND_STACK_REGISTER
See bug 316613


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13327
2013-03-13 22:03:31 +00:00
Philippe Waroquiers
58ceb6c593 Fix 316144 (valgrind.1 manpage contains ??? strings for references)
Patch by Mark Wielaard.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13314
2013-03-06 22:39:18 +00:00
Philippe Waroquiers
6fb1158a78 Implement --merge-recursive-frames + provide VALGRIND_MONITOR_COMMAND client req.
In a big applications, some recursive algorithms have created
hundreds of thousands of stacktraces, taking a lot of memory.

Option --merge-recursive-frames=<number> tells Valgrind to
detect and merge (collapse) recursive calls when recording stack traces.
The value is changeable using the monitor command
'v.set merge-recursive-frames'.

Also, this provides a new client request: VALGRIND_MONITOR_COMMAND
allowing to execute a gdbsrv monitor command from the client
program.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13246
2013-01-20 17:11:58 +00:00
Julian Seward
bb446d67bb Add documentation for --extra-debuginfo-path=. Relates to #310972.
(Alex Chiang, achiang@canonical.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13169
2012-12-07 08:40:16 +00:00
Julian Seward
f192a5574d Make diagnostics for SIGILL more controllable (Valgrind part).
Fixes #309425.  (Mark Wielaard, mjw@redhat.com)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13164
2012-12-06 18:08:54 +00:00
Philippe Waroquiers
0df0a2725c Fix 308644 vgdb command for having the info for the track-fds option
(allows to have the list of opened fds and the associated info
on request from GDB or from the shell, using vgdb)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13072
2012-10-21 14:37:14 +00:00
Philippe Waroquiers
2d90de0dfb Doc: remove 'is' in 'is replaces'
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12847
2012-08-05 17:23:55 +00:00
Julian Seward
60f5b47a01 Fix typo spotted by John Reiser.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12841
2012-08-05 14:59:39 +00:00
Julian Seward
9461b8012f Doc updates for 3.8.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12838
2012-08-05 13:44:15 +00:00
Philippe Waroquiers
36ca11463d Remove --vex-iropt-precise-memory-exns, implement --vex-iropt-register-updates
* Option --vex-iropt-precise-memory-exns has been removed.
  It is replaced by --vex-iropt-register-updates which accepts
  3 values : 'unwindregs-at-mem-access' (replacing
  --vex-iropt-precise-memory-exns=no), 'allregs-at-mem-access'
  (replacing --vex-iropt-precise-memory-exns=yes)
  and a new value 'allregs-at-each-insn'.
  'allregs-at-each-insn' allows the Valgrind gdbserver to always
  show up to date values to GDB.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12809
2012-08-01 22:03:12 +00:00
Philippe Waroquiers
d045b4236a Implement --redzone-size and --core-redzone-size
* For tools replacing the malloc library (e.g. Memcheck, Helgrind, ...),
  the option --redzone-size=<number> allows to control the padding 
  blocks (redzones) added before and after each client allocated block.
  Smaller redzones decrease the memory needed by Valgrind. Bigger
  redzones increase the chance to detect blocks overrun or underrun.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12807
2012-07-31 22:17:28 +00:00
Florian Krohm
5dec28d4af Increase allowed size of a back-trace to 500 frames.
This limit is large enough for all practical purposes. It exists
only to sanity check the value specified with --num-callers.
Be frugal in record_ExeContext_wrk and only allocate on the stack 
as many frames as needed. 
Testcase included.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12685
2012-06-29 21:20:52 +00:00
Philippe Waroquiers
0ea6d36f1d fix 219156 support static malloc or alternate malloc lib (e.g. tcmalloc) with new option --soname-synonyms
* pub_tool_redir.h : define the prefix to be used for "soname synonym"
  place holder
* vg_replace_malloc.c : define synonym place holder for malloc related
  functions
* m_redir.c : when detecting a soname synonym place holder redir spec, search
  in clo_soname_synonyms if there is a synonym pattern.
  If yes, replace the soname pattern. If not, ignore the redir spec.
* various files: implement or document the new clo --soname-synonyms
* new test memcheck/tests/static_malloc.vgtest



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12559
2012-05-11 19:33:46 +00:00
Philippe Waroquiers
aa50a7e4df Allows to run regression tests in an outer/inner setup.
A '3 lines how to':
   perl tests/vg_regtest --outer-valgrind=../trunk_untouched/install/bin/valgrind --all
           (the outer results for a test xxx is in xxx.outer.log)
   To run with another tool (e.g. drd), add the argument --outer-tool=drd


Still to do/things to improve:

* Most (inner) tests are successful when running under an outer
  memcheck. Need to analyse the reasons of remaining failures.

* The memcheck annotations in m_mallocfree.c can be improved:
  - A superblock is marked 'undefined', it should rather be marked
    'no access'.
  - When a free block is splitted, the remaining free block is
    not made 'no access'. Instead, it is made 'undefined'.
      => this decreases the chance to find bugs.
      => this is not very efficient (e.g. the rest of a superblock
         is often marked undefined repetitively).
    Similarly, the free block created by VG_(arena_memalign)
    is marked 'undefined'. 'No access' would be preferrable.
  - mkInuseBlock marks the new block as undefined. This is probably
    not needed, as VALGRIND_MALLOCLIKE_BLOCK will do it already.
  - VG_(arena_malloc) should give the requested size to
    VALGRIND_MALLOCLIKE_BLOCK, not the malloc usable size,
    as this decreases the chance to find buffer overrun bugs.
    But giving the requested size is tricky (see comments in
    the code).

* need to do memcheck annotations in m_poolalloc.c
   so as to allow leak checking for pool allocated elements.

* vg_regtest.in
  - should analyse the results of the outer and should
    produce a separate result for the tests for which
    the outer detects an error or a memory leak or ...


Changes done:
   README_DEVELOPERS: document the new outer/inner features.
   manual-core.xml: document the new sim-hint no-inner-prefix
   tests/outer_inner.supp: new file, containing the suppressions for inner.
   vg_regtest.in: implement new args --outer-valgrind, --outer-tool, --outer-args.
   m_mallocfree.c: annotations for memcheck.
   m_libcprint.c: handle the new sim-hint no-inner-prefix
   m_main.c: do an (early) parse of --sim-hints




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12441
2012-03-11 22:24:03 +00:00
Philippe Waroquiers
c0883bddd7 * Improve documentation of --vgdb=full
* make a reference to --vex-iropt-precise-memory-exns=yes 
  to obtain up to date registers values.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12416
2012-03-05 22:09:20 +00:00
Philippe Waroquiers
74d44d1764 * README_DEVELOPERS : complete/enhance the section about outer/inner
* manual-core.xml : fix a typo
* include/pub_tool_inner.h : new file, defining macros for inner annotation
  include/Makefile.am : reference this new file.
* syswrap-linux.c : when ENABLE_INNER, register the stacks for the outer.
   (otherwise, nothing works properly).
* m_redir.c : avoid inner interpreting the outer vgpreload instructions.
* sema.c : annotate the semaphore with RWLOCK annotations for helgrind
* ticket-lock-linux.c : similar.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12414
2012-03-03 12:01:48 +00:00
Philippe Waroquiers
6a15dd16e4 Document the new --fair-sched option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12398
2012-02-22 20:23:29 +00:00
Julian Seward
9d39d5ad6d Some small doc updating for 3.7.0.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12239
2011-10-27 10:01:17 +00:00
Bart Van Assche
2882ffc1e8 Update documentation now that DRD supports XML output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12160
2011-10-14 18:06:41 +00:00
Julian Seward
7bb130f5f3 Add a new simulation hint, --sim-hints=fuse-compatible, which causes
a bunch of file-related syscalls to be handled on the might-block
syscall path rather than the fast syscall path.  This fixes deadlocks
when running some FUSE-specific filesystem codes.  Fixes #278057.
(Mike Shal, marfey@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11993
2011-08-18 15:08:20 +00:00
Tom Hughes
09b283bb40 Mention the --tool option in the manual page. Fixes #249970.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11979
2011-08-15 08:20:53 +00:00
Julian Seward
ad7de5b336 Delete the AIX5 port. The last release this worked for is 3.4.1,
and then only on AIX 5.2 and 5.3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11842
2011-06-28 07:25:29 +00:00
Julian Seward
70af73cc4f Remove references to Ptrcheck in the documentation, and replace
them as relevant with references to SGcheck.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11839
2011-06-26 19:57:26 +00:00
Julian Seward
e5bd8ec4c8 Minor documentation fixes for the GDB server. (Philippe Waroquiers,
philippe.waroquiers@skynet.be).  Bug 214909 comment 106.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11834
2011-06-25 10:05:28 +00:00
Julian Seward
48d69a241a Move the GDBserver documentation from the "Valgrind core" chapter
to the "Valgrind core: advanced topics" chapter.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11821
2011-06-17 08:31:22 +00:00
Julian Seward
97024bcccb Edits for the GDBserver documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11820
2011-06-17 08:14:00 +00:00
Julian Seward
da49be7c14 Add a fourth --smc-check= variant, --smc-check=all-non-file. This
adds self-modifying-code checks to all guest code taken from mappings
which are not file backed, but omits checks in code from file backed
mappings.  This has the effect of giving complete smc-coverage of JIT
generated code -- since that is invariably generated into anonymous
mapped areas -- without burdening non-JIT generated code with such
checks.  Running Firefox 6, --smc-check=all-non-file reduces by a
factor of between 3 and 10 the number of translations requiring a self
check, compared to --smc-check=all.  These changes depend on the vex
interface changes in r2158.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11798
2011-06-07 21:39:28 +00:00
Julian Seward
dd51367883 Further fixes for GDB server on Thumb code:
* Disabled several tests on ARM when gdb version < 7.1
  gdb 7.0 has problems with next/step/... in ARM thumb code.

* Documented in manual-core.xml that ARM thumb code implies
  a gdb version >= 7.1

* m_gdbserver.h/.c : take into account the thumb bit at several places

* use new IRStmt_IMark::delta field to distinguish ARM vs Thumb
  instructions as committed in vex r2153

Patch from bug 214909 comment 99 (valgrind part).
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11779
2011-05-27 13:23:44 +00:00