Two changes:
- Be more robust in the face of malformed stack traces. This avoids some
potential assertion errors (which have affected prior versions of Massif),
but unfortunately reduces the amount of sanity-checking that can be done
on XTrees.
- Get white-space printing right in output file. Non-functional change,
just makes output files easier to read.
Julian Seward [Sun, 2 Dec 2007 22:03:43 +0000 (22:03 +0000)]
Back out r7210 ("Fix completely bogus implementation of
VG_(seginfo_sect_kind).") as it breaks DRD and possible Callgrind.
The segment kind identification code is basically broken for non-text
segments, but requires fixing at a higher level than this. See
discussion on valgrind-developers, 20 March 07, "Bug in
VG_(seginfo_sect_kind) ?"
Julian Seward [Fri, 30 Nov 2007 21:41:40 +0000 (21:41 +0000)]
New options for Memcheck, --malloc-fill=<hexnumber> and
--fill-free=<hexnumber>, which cause malloc'd(etc) and free'd(etc)
blocks to be filled with the specified value. This can apparently be
useful for shaking out hard-to-track-down memory corruption. The
definedness/addressability of said areas is not affected -- only the
contents. Documentation to follow.
Julian Seward [Fri, 30 Nov 2007 17:19:36 +0000 (17:19 +0000)]
Make the freed-block-queue volume metrics 64-bit throughout, to avoid
any wierdness on very large machines in the future. Also, double the
default size from 5MB to 10MB, on the basis that programs are now on
average twice as lardy as they were when it was set to 5MB, whenever
that was.
Julian Seward [Thu, 29 Nov 2007 03:06:25 +0000 (03:06 +0000)]
Don't be confused by archive (.a) files which contain both a 32-bit
and a 64-bit version of the same object (with the same name). Prior
to this, it would sometimes attempt to read debug info from the wrong
version of the object, complain that the magic number wasn't right,
and so end up reading nothing at all for that object.
Julian Seward [Tue, 27 Nov 2007 11:42:47 +0000 (11:42 +0000)]
Make Memcheck work sanely on AIX5.3 (again):
* Don't intercept putenv/getenv/setenv. Causes a lot of whinging
about missing TOC pointers.
* Add 'strcmp' to the bundle of 4 functions intercepted in all
objects.
* xlc now seems to route calls through to malloc_common, free_common,
calloc_common, realloc_common, memalign_common in libc. Intercept
those names too.
Add Massif bugs fixed by the rewrite. I added them to the top part of the
file, not the "after 3.2.3" section, I hope this is the right place for
them.
- Rewrote documentation.
- Added a new time unit, instructions executed, and made it the default -- it's
much more reproducible and consistent than milliseconds. Requires IRSB
instrumentation and so slows down some programs (malloc-light ones such as
bzip2) by about 20%, others by less.
- ms_print now doesn't overwrite the x-axis in the graphs.
- Added a test for --detailed-freq and --max-snapshots
Julian Seward [Sun, 25 Nov 2007 20:20:49 +0000 (20:20 +0000)]
Un-break 'make distdir'. Either by removing from EXTRA_DIST, file
names pertaining to tests which cannot be run (no associated .vgtest),
or by adding missing .stdout.exp files for tests which are to be run
(there is an associated .vgtest).
Julian Seward [Sun, 25 Nov 2007 00:55:11 +0000 (00:55 +0000)]
Create a new chapter in the Valgrind Manual: a chapter containing info
on some advanced aspects of the core (client requests, function
wrapping) and move stuff from the main core manual into it.
Julian Seward [Sat, 24 Nov 2007 23:37:07 +0000 (23:37 +0000)]
Attempt to shake out uses of uninitialised malloc'd memory by Valgrind
itself, if such exist. Attempt failed (or no such uses exist :-)
Commit does not change any code.
Julian Seward [Thu, 22 Nov 2007 01:21:56 +0000 (01:21 +0000)]
Update documents in preparation for 3.3.0, and restructure them
somewhat to move less relevant material out of the way to some extent.
The main changes are:
* Update date and version info
* Mention other tools in the quick-start guide
* Document --child-silent-after-fork
* Rearrange order of sections in the Valgrind Core chapter, to move
advanced stuff (client requests) to the end, and compact stuff
relevant to the majority of users towards the front
* Move MPI debugging stuff from the Core manual (a nonsensical place
for it) to the Memcheck chapter
* Update the manual's introductory chapter a bit
* Connect up new tech docs summary page, and disconnect old and
very out of date valgrind/memcheck tech docs
* Add section tags to the Cachegrind manual, to stop xsltproc
complaining about their absence
Julian Seward [Thu, 22 Nov 2007 01:07:57 +0000 (01:07 +0000)]
Add a page listing papers etc about Valgrind. Cut-down version of
http://valgrind.org/docs/pubs.html. Could do with improved
formatting, but is at least a start.
Julian Seward [Tue, 20 Nov 2007 19:45:03 +0000 (19:45 +0000)]
In the --help text, print the actual name of the GDB that will by
default be used. Fixes #151938. Unfortunately this makes the help
text non-constant, which could have a bad effect on regtesting; but
GDB is so usually installed in the standard place /usr/bin/gdb that I
don't think that's much of a big deal.
Julian Seward [Tue, 20 Nov 2007 08:46:05 +0000 (08:46 +0000)]
Be more robust against malformed DWARF2 line number information: don't
assert when a reference is made to a filename not in the filename
table. Fixes #150380 and #129937.
Do Massif output file name properly. Default is massif.out.%p, where %p
expands to the PID. Updated the tests. Still todo: handle %q for
environment variables, and do the same for the core and
Cachegrind/Callgrind.
Julian Seward [Mon, 19 Nov 2007 14:54:09 +0000 (14:54 +0000)]
Zero out the vki_user_regs_struct before using it. Otherwise, we end
up passing uninitialised garbage on the stack to ptrace(SETREGS, ...)
for any fields in the struct which are not filled in. This does not
fix any known bugs, but seems like a good precautionary measure.
Julian Seward [Mon, 19 Nov 2007 02:01:01 +0000 (02:01 +0000)]
Minor tidyings to the debugger-attach code, as part of a failed
attempt to fix debugger attach on ppc32-linux and ppc64-linux (see
#151908). The fork/ptrace-based mechanism works fine for x86-linux
and amd64-linux but not on ppc. I have no idea what is going on.
It seems like the forked child process (to which we will attach GDB)
does not stop when it does PTRACE_TRACE_ME and so things go downhill
very rapidly after that.
Julian Seward [Sat, 17 Nov 2007 22:29:25 +0000 (22:29 +0000)]
Add a new flag, --child-silent-after-fork=no|yes [no]. When enabled,
causes child processes after fork to fall completely silent, which can
make the output a lot less confusing. In addition it is pretty much
essential in XML output mode, so as to avoid mixing up any child XML
output with the parent's.
Julian Seward [Sat, 17 Nov 2007 21:11:57 +0000 (21:11 +0000)]
Make handling of setuid executables marginally more sensible, as
suggested in #119404.
Prior to this commit, if the current traced process attempted to
execve a setuid executable, an error was always returned. The revised
behaviour is:
If the current (traced) process attempts to execve a setuid
executable:
* If --trace-children=yes is not in effect, the execve is allowed.
* If --trace-children=yes is in effect, the execve is disallowed
(as at present), but an error message is printed (unless in XML mode),
so at least the execve does not fail silently any more.
As per discussion on #119404 we could probably do a lot better, but
these changes are at least simple, useful and uncontroversial.
Julian Seward [Sat, 17 Nov 2007 18:35:54 +0000 (18:35 +0000)]
Makefile.tool-inplace.am: correctly handle tool names with dashes in,
using same changes to magic sed scripts as were recently applied to
Makefile.install.am.