90 Commits

Author SHA1 Message Date
Philippe Waroquiers
826502e89a Implement command line option --valgrind-stacksize=<number>
This allows to decrease memory usage when using many threads,
if no big stacksize is needed by Valgrind.
If needed (e.g. for demangling big c++ symbols), the V stacksize
can be increased.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15004
2015-03-12 20:43:46 +00:00
Florian Krohm
d47181fd7d Add command line flag --max-threads=<integer> to increase the number of
threads that valgrind can handle. No recompile is needed. 
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14932
2015-02-13 19:08:26 +00:00
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
Julian Seward
9b30a092c4 Add --resync-filter to the --help output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14662
2014-10-23 21:49:58 +00:00
Florian Krohm
79c843e688 Fix some testcases which implicitly assumed that TMPDIR was either
not set or set to /tmp   This is not always true. Fixes BZ 340115.
Patch by rhyskidd@gmail.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14643
2014-10-20 20:59:13 +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
3e94809f28 Slightly change the help text for some options that involve
user-supplied enumeration values.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14447
2014-09-03 21:58:54 +00:00
Julian Seward
7e3f04874a Improvements for Android:
* All Linux targets: add minimal ioctl support for the ION_IOC family

* Android targets: change proprietary-ioctl support for GPUs from
  being a build-time #define kludge to being controlled by --kernel-variant,
  as it should be.  Update documentation accordingly.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14440
2014-09-03 15:19:25 +00:00
Mark Wielaard
3f47256593 Adjust cmdline expected test output after r14401 BZ#337871.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14405
2014-09-01 14:16:49 +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
2f460aaec6 The attached patch cleanups the clo processing
of clo which are (or should be) 'enum set'.

* pub_tool_options.h : add new macrox VG_USET_CLO and VG_USETX_CLO to
  parse an 'enum set' command line option (with or without "all" keyword).

* use VG_USET_CLO for existing enum set clo options:
   memcheck --errors-for-leak-kinds, --show-leak-kinds, --leak-check-heuristics
   coregrind --vgdb-stop-at

* change --sim-hints and --kernel-variants to enum set
  (this allows to detect user typos: currently, a typo in a sim-hint
   or kernel variant is silently ignored. Now, an error will be given
   to the user)

* The 2 new sets (--sim-hints and --kernel-variants) should not make
  use of the 'all' keyword => VG_(parse_enum_set) has a new argument
  to enable/disable the use of the "all" keyword.

* The macros defining an 'all enum' set definition was duplicating
  all enum values (so addition of a new enum value could easily
  give a bug). Removing these macros as they are unused
  (to the exception of the leak-kind set).
  For this set, the 'all macro' has been replaced by an 'all function',
  coded using parse_enum_set parsing the "all" keyword.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14301
2014-08-17 20:03:51 +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
44c59fd7ea Make none/tests/cmdline[12] pass again
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14082
2014-06-22 11:13:47 +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
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
Julian Seward
dbf9b63605 Update copyright dates (20XY-2012 ==> 20XY-2013)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13658
2013-10-18 14:27:36 +00:00
Julian Seward
682b7211e6 arm-linux only: make unwinding by stack scanning (a nasty hack)
be controllable from the command line.  Fixes (kind of) #289578.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13657
2013-10-18 13:21:26 +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
Julian Seward
571f45ce1c Update expected outputs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13441
2013-07-02 20:47:24 +00:00
Philippe Waroquiers
da19b5f43e improve --help for --main-stacksize and supported ARM cpu
If the command line option --main-stacksize is not used,
the current ulimit value is used, with a min of 1MB
and a max of 16MB. Document this min/max default formula
in the --help.

Also indicate that Valgrind supports ARMv7


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13426
2013-06-12 21:45:39 +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
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
Julian Seward
4180623ef8 Add a new command line flag, --extra-debuginfo-path=path, that allows
specification of an extra directory in which to look for debuginfo
objects.  Fixes #310792.  (Alex Chiang, achiang@canonical.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13154
2012-12-05 22:15:14 +00:00
Julian Seward
fae30e8323 Add a couple of useful examples to the --help text for
--soname-synonyms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12855
2012-08-07 14:46:34 +00:00
Julian Seward
7fd108bdb0 Update expected outputs following r12843.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12844
2012-08-05 16:10:55 +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
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
Bart Van Assche
908268e4a0 Add command-line option --fair-sched=[no|yes|try]. Use --fair-sched=try
when running the annotate_hbefore regression test. Closes #270006.

To do: update manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12280
2011-12-08 16:14:59 +00:00
Julian Seward
f8b558a185 Update expected outputs following update of copyright dates.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12208
2011-10-23 08:24:43 +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
Julian Seward
46d08c579d Minor GDBserver source tidying. Also a small usability fix: if
--vgdb-error=N is specified, print a bit of text telling the user the
magic commands to give GDB in order to attach to the process.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11822
2011-06-18 08:28:04 +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
2ee9e90486 Implement a GDB server in Valgrind. See #214909.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11727
2011-05-06 21:02:55 +00:00
Julian Seward
906915e79b New command line option: --trace-children-skip-by-arg, which allows
chase/nochase decisions for child processes to be made on the basis
of their argv[] entries rather than on the name of their executables.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11483
2010-12-06 11:40:04 +00:00
Julian Seward
b43eec1219 Documentation update for 3.6.0 (not including NEWS).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11440
2010-10-13 21:47:29 +00:00
Julian Seward
1375448f10 Make the --prefix-to-strip=... command-line option added in r11312
behave more like the original proposal in #245535.  This makes it
more flexible and general.  Also rename it.

* new name is --fullpath-after=

* allow multiple instances of --fullpath-after=

* don't require the specified strings to be prefixes, only substrings

But retain the elegant backwards-compatibility trick in Bart's r11312
commit: if --fullpath-after= is not specified at all, then behave
exactly as before.

Fixes #245535.  A mixture of patches from Bart Van Assche
(bart.vanassche@gmail.com), Alexander Potapenko (glider@google.com),
and me (integration and documentation).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11430
2010-10-12 00:44:05 +00:00
Bart Van Assche
35eece7dd5 Added command-line option --prefix-to-strip=... Closes #245535.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11312
2010-08-31 15:18:32 +00:00
Julian Seward
2e6b7655d1 New flag --require-text-symbol=:sopatt:fnpatt, to be used to check
that specified shared objects contain specified symbols.  Along with a
couple of regtests that unfortunately will fail on MacOSX.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11125
2010-05-09 22:30:43 +00:00
Julian Seward
9b0574dff8 Update copyright dates to 2010.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11121
2010-05-03 21:37:12 +00:00
Bart Van Assche
53596eaf4a The help text printed by command-line option -h does now show the default
value for option --read-var-info. Fixes bug #231458.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11097
2010-03-27 07:38:39 +00:00
Julian Seward
426c137045 New flag: --trace-children-skip=patt1,patt2,etc
Specifies a comma-separated list of executable-names
(with "*" and "?" wildcards allowed) that should not be traced into
even when --trace-children=yes.  Modified version of a patch
from Bill Hoffman.  Fixes #148932.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10927
2009-11-05 08:55:13 +00:00
Bart Van Assche
ba7848aca3 Fixed bug #204317: regression tests none/tests/cmdline[12] fail if
the gdb path detected by configure differs from /usr/bin/gdb.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10855
2009-08-20 18:38:59 +00:00
Julian Seward
8ffe2fdefa Tidy up of messaging:
* For all tools and the core, don't show statistics when -v is in
  effect.  Instead, try to restrict -v to mostly user-useful
  stuff.

* A new flag --stats=no|yes [no] produces statistics output instead.

* Fix longstanding problem in that Memcheck's leak checker ran after
  the core's error manager module shut down, thereby not showing use
  counts of leak suppressions.  This fixes #186790.

* As a consequence, the leak checker text output of Memcheck has
  changed a bit -- leak check is done before the final error
  summary is done (much more logical), and the output has been
  tidied up a bit.

* Helgrind, Drd and Ptrcheck now also print "For counts of
  detected and suppressed errors, rerun with: -v", which makes
  them consistent with Memcheck in this regard.  These are
  filtered out by the regtest filter scripts.

For all tools except Memcheck, the regtests are unchanged.  On
Memcheck regtests still fail due to rearrangements of the leak
checker output.  This will be fixed by a followup commit.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10746
2009-08-07 15:46:56 +00:00
Nicholas Nethercote
8026c4766f Various option-related tweaks:
- Match the ordering of the non-tool-specific options in the usage message
  with the order in the user manual.  As a result, we now always print
  --alignment and --trace-malloc in the core's usage messages, which saves
  malloc-replacing tools from doing it themselves (and brings it in line
  with options that only apply to error-collecting tools).

- Improved the presentation of the Vex options with --help-debug.

- Removed documentation of -d in the manual because it's a debugging-only flag.

- Documented --read-var-info in the manual.  This fixes bug 201169.

- Renamed --auto-run-dsymutil as --dsymutil and documented it in the usage
  message.

- Fixed an XML error in manual-core-adv.xml.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10703
2009-08-04 02:32:55 +00:00
Nicholas Nethercote
78b2e5c83e Started overhauling the documentation:
- There were detailed descriptions of all the tools in the Quick Start
  Guide, the Manual introduction, and the start of each tool chapter.  To
  avoid duplication/overlap, I removed these altogether from the Quick Start
  Guide, and shortened them in the intro.

- Improved the description of what errors Memcheck can find.

- Made all tool chapters start with "Overview" section, for consistency.

- Made the "run with --tool=XXX" bit consistent in each tool chapter.

- Made all tool chapter titles match the description given when running them.

- Added BBV to the User Manual intro.

- Generally clarified, updated, and future-proofed various bits of text in
  the Quick Start Guide and User Manual introduction. 

Also:
- Changed Nulgrind's start-up description to "the minimal Valgrind tool".

- Fixed some punctuation in the usage message.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10652
2009-07-29 02:36:21 +00:00
Bart Van Assche
1804bafbd3 Updated expected output.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10522
2009-07-22 17:38:36 +00:00
Julian Seward
f54726edbb Merge none/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10475
2009-07-15 14:52:02 +00:00