167 Commits

Author SHA1 Message Date
Ivo Raisr
bd077baa71 Add a simple progress-reporting facility.
Fixes BZ#384633.
Patch by: Julian Seward <jseward@acm.org>
2018-01-20 19:56:02 +00:00
Julian Seward
cceed053ce Bug 79362 - Debug info is lost for .so files when they are dlclose'd. Majorly reworked by Philippe Waroquiers. 2018-01-11 19:40:12 +01:00
Ivo Raisr
c46053cc38 Optionally exit on the first error with --exit-on-first-error=<yes|no>.
Fixes BZ#385939.
Slightly modified patch by: Fauchet Gauthier <gauthier.fauchet@free.fr>
2017-11-04 14:31:22 +01:00
Philippe Waroquiers
477ef25e67 Small improvement to user manual: capitalise another occurence of memcheck
(yes, I am experimenting with valgrind git repository :)
2017-08-15 23:37:15 +02:00
Philippe Waroquiers
3e35ebc464 Small improvement to user manual: capitalise one occurence of memcheck 2017-08-15 23:06:28 +02:00
Ivo Raisr
75e99530c2 Ignore sim hint "no-nptl-pthread-stackcache"
on Solaris and Mac OS X. Do not produce a warning
message when it is given.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16424
2017-05-31 13:47:57 +00:00
Julian Seward
dee4156566 Documents --sim-hints=fallback-llsc. Pertains to bug 369459.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16404
2017-05-22 08:29:58 +00:00
Ivo Raisr
bd0cb61cae Fix a problem when reading .valgrindrc and it is a directory instead of a file.
Fixes BZ#362223.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16364
2017-05-11 17:00:17 +00:00
Ivo Raisr
d8f648486e Fix some spelling mistakes.
Fixes BZ#374719
Patch by: klemens <ka7@la-evento.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16336
2017-05-05 22:13:20 +00:00
Ivo Raisr
5216c18012 Document limitation of --log-file when a program forks.
Follow up to r16200 and BZ#162848.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16210
2017-01-25 07:22:18 +00:00
Philippe Waroquiers
c972a2b8b0 Allow memcheck to output the leak results as a callgrind xtree file.
* New command line options --xtree-leak=no|yes and --xtree-leak-file=<file>
  to produce the end of execution leak report in a xtree callgrind format
  file.

* New option 'xtleak' in the memcheck leak_check monitor command, to
  produce the leak report in an xtree file.

* File name template arguments (such as --log-file, --xtree-memory-file, ...)
  have a new %n format letter that is replaced by a sequence number.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16205
2017-01-21 11:00:39 +00:00
Philippe Waroquiers
d62083795c xtree: CALLED_FLF must be called only up to ips[0] + minor doc update
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16195
2017-01-10 18:07:07 +00:00
Philippe Waroquiers
f898cb0e21 xtree: minor updates to documentation, comments and indentation, no functional change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16193
2017-01-06 18:38:27 +00:00
Philippe Waroquiers
3be4b5ba1c Update documentation and NEWS for xtree concept.
Final patch of the xtree serie, which provides the documentation.

The xtree concept was committed in the revisions
16120 : Support pool of unique string in pub_tool_deduppoolalloc.h
16121 : Implement a cache 'address -> symbol name' in m_debuginfo.c
16122 : Add VG_(strIsMemberXA) in pub_tool_xarray.h
16123 : Addition of the pub_tool_xtree.h and pub_tool_xtmemory.h modules, and of the --xtree-memory* options
16124 : Addition of the options --xtree-memory and --xtree-memory-file
16125 : Small changes in callgrind_annotate and callgrind manual
16126 : Locally define vgPlain_scrcmp in 2 unit tests
16127 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in helgrind
16128 : Support for xtree memory profiling and xtmemory gdbsrv monitor command in memcheck
16129 : Update massif implementation to xtree

Some smaller follow-up patches to be expected to add some regtests,
and refine documentation.

Thanks to Ivo, Julian and Josef for the review comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16131
2016-11-11 15:11:49 +00:00
Ivo Raisr
38e4b15eb0 Minor clarification for r15880.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15881
2016-05-24 22:29:24 +00:00
Philippe Waroquiers
268ff84f7b Document brk segment limitation, reference manual in limit reached msg.
The msg telling brk cannot be extended confuses some users
so improve the documentation and have the msg referencing the doc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15880
2016-05-22 20:48:09 +00:00
Ivo Raisr
5b3c2f59c5 Run __gnu_cxx::__freeres() cleanup function available
from libstdc++ when available, similar to existing __libc_freeres().
New option --run-cxx-freeres=<yes|no> can be used to change whether
this cleanup function is called or not.

Note that __gnu_cxx::__freeres() is currently available
only in gcc 6. It is not yet decided what to do about
libstdc++ from gcc 5.
Tracked under https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69945
for libstdc++.

Fixes BZ#345307 (partially).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15840
2016-03-30 17:53:03 +00:00
Ivo Raisr
0d30686d21 When searching for global public symbols (like for the somalloc
synonym symbols), exclude the dynamic (runtime) linker as it is very
special.
Fixes BZ#355454


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15728
2015-11-18 20:38:37 +00:00
Mark Wielaard
8b4dd5c47c BZ#355188 valgrind should intercept all malloc related global functions.
This implements the interception of all globally public allocation
functions by default. It works by adding a flag to the spec to say the
interception only applies to global functions. Which is set for the
somalloc spec. The librarypath to match is set to "*" unless the user
overrides it. Then each DiSym keeps track of whether the symbol is local
or global. For a spec which has isGlobal set only isGlobal symbols will
match.

Note that because of padding to keep the addresses in DiSym aligned the
addition of the extra bool isGlobal doesn't actually grow the struct.
The comments explain how the struct could be made more compact on 32bit
systems, but this isn't as easy on 64bit systems. So I didn't try to do
that in this patch.

For ELF symbols keeping track of which are global is trivial. For pdb I
had to guess and made only the "Public" symbols global. I don't know
how/if macho keeps track of global symbols or not. For now I just mark
all of them local (which just means things work as previously on platforms
that use machos, no non-system symbols are matches by default for somalloc
unless the user explicitly tells which library name to match).

Included are two testcases for shared libraries (wrapmalloc) and staticly
linked (wrapmallocstatic) malloc/free overrides that depend on the new
default. One existing testcase (new_override) was adjusted to explicitly
not use the new somalloc default because it depends on a user defined
new implementation that has side-effects and should explicitly not be
intercepted.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15726
2015-11-15 16:50:43 +00:00
Ivo Raisr
740867d1d9 Document that --read-inline-info=yes is the default
even on Solaris for Memcheck, Helgrind and DRD.
n-i-bz


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15613
2015-09-01 11:51:16 +00:00
Julian Seward
0b063cb3c3 Change the default setting for --dsymutil from =no to =yes, since
in practice it needs to be permanently enabled on OS X.  No change
on other platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15603
2015-08-31 14:37:25 +00:00
Julian Seward
5582e3a511 Revisit r15601 (Change the --smc-check default value to =all-non-file.)
to restrict the change to those architectures that do provide automatic
D-I coherence (x86, amd64, s390x).  This commit restores the default
value for all other architectures back to its pre r15601 state, so as not
to burden those architectures unnecessarily with =all-non-file.

Also, this rewrites the relevant manual section.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15602
2015-08-31 14:24:14 +00:00
Julian Seward
6bf68780dc Change the --smc-check default value to =all-non-file.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15601
2015-08-31 13:05:35 +00:00
Florian Krohm
021a3ef28b Remove command line options --db-attach and --db-command which were
deprecated in 3.10.0


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15445
2015-07-24 11:50:12 +00:00
Julian Seward
ac60633d65 Bug 345248 - add support for Solaris OS in valgrind
Authors of this port:
    Petr Pavlu         setup@dagobah.cz
    Ivo Raisr          ivosh@ivosh.net
    Theo Schlossnagle  theo@omniti.com
            


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15426
2015-07-21 14:44:28 +00:00
Philippe Waroquiers
162d69c37f New Option --avg-transtab-entry-size=<number> can be used to tune
the size of the translation table sectors, either to gain memory
  or to avoid too many retranslations.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15016
2015-03-15 12:24:19 +00:00
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
071d18df06 Document the --max-threads command line option.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14934
2015-02-16 21:55:52 +00:00
Florian Krohm
8a33421f4f Fix a typo.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14853
2015-01-06 17:07:09 +00:00
Florian Krohm
d509d8aff0 Add a command line option to allow the user to provide an upper bound
for the number of connected processes. This is still lame but better
than asking her to recompile.
Part of fixing BZ #337869.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14838
2014-12-29 22:07:35 +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
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