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.
Julian Seward [Fri, 16 Nov 2007 18:32:40 +0000 (18:32 +0000)]
Introduce the concept of a 'mandatory redirection'. A redirection
says (essentially) "I am the replacement for function foo in object w/
soname bar.so". Now, if a redirection is mandatory, and bar.so is
loaded but foo is not found in its symbol table, then V aborts.
The initial motivation for this is making Memcheck work sanely on
glibc-2.6.X ppc32-linux. We really need to intercept 'strlen' in
ld.so right from startup. If ld.so does not have a visible 'strlen'
symbol, Memcheck generates an impossible number of errors resulting
from highly tuned strlen implementation in ld.so, and is completely
unusable -- the resulting undefinedness eventually seeps everywhere.
- Make other integer CLO macros more correct, as I did for VG_NUM_CLO in the
last commit.
- Add a VG_DBL_CLO for fractional arguments.
- Make Massif's --threshold and --peak-inaccuracy arguments fractional.
Add four 'strtoll' variants, which are like 'atoll' but let you detect if
the string converted wasn't entirely numeric. Using them for numeric
command-line options -- previously if you had a option "--foo=<n>", where
<n> is supposed to be an integer, then "--foo=blah" would be interpreted as
"--foo=0", because the "blah" would be converted to zero and the remaining
chars wouldn't be noticed.
Fixed an incorrect command-line option in two massif tests that this change
exposed.
Julian Seward [Sat, 10 Nov 2007 22:50:13 +0000 (22:50 +0000)]
Followup to r7105: stop gcc complaining about violations of ANSI C
aliasing rules by casting through (char*) as an intermediate type,
rather than through (void*). This seems at least moderately
justifiable since the ANSI C standard explicitly says that any object
may be accessed through a char pointer.
Julian Seward [Sat, 10 Nov 2007 20:21:11 +0000 (20:21 +0000)]
Include omega.h in the distribution tarball, else building from the
tarball fails. As it stands omega.h is not installed into
$prefix/include/valgrind, so cannot be used in client requests.
Perhaps it should be.
Changed Massif to record the 'slop' heap bytes caused by rounding asked-for
sizes up to a multiple of 8 (or whatever --alignment is). This is combined
with the "admin" bytes, resulting in the "extra" bytes. Added
VG_(malloc_usable_size) to the tool interface to support this.
Julian Seward [Fri, 9 Nov 2007 23:29:46 +0000 (23:29 +0000)]
Merge (from branches/THRCHECK) r7043:
Allow a test to have any number of .stderr.exp* files, so long as at
least one is found. In fact the comments in the code that claimed
that .stderr.exp[0-9] are the only ones allowed were misleading;
.stderr.exp* has always been allowed. The only functional change here
is to mandate that at least one such file exists; prior to the change
the script mandated that at least a .stderr.exp (with no other suffix)
file existed.
Purpose is to allow collections of .stderr.exp files with suffixes
arranged in some meaningful way, eg, foo.stderr.exp-glibc25-amd64.
This might help in making testsuites more maintainable when there
have to be multiple .stderr.exp files. Naming them merely as
.stderr.exp1, .stderr.exp2, etc, makes it impossible to remember
what the differences between the files actually is.
Julian Seward [Fri, 9 Nov 2007 23:21:44 +0000 (23:21 +0000)]
Merge (from branches/THRCHECK) the following two changes to the core-tool
interface:
r6805: Modify two thread-notification events in the core-tool
interface. This removes track_post_thread_create and
track_post_thread_join. The core can only see low level thread
creation and exiting, and has no idea about pthread-level concepts
like "pthread_create" and "pthread_join", so these are a bit
ambiguous.
Replace them with track_pre_thread_ll_create, which is notified before
a new thread makes any memory references, and
track_pre_thread_ll_exit, which is notified just before the new thread
exits, that is, after it has made its last memory reference.
r6823: Core-tool interface: give 'needs_tool_errors' an extra Boolean
indicating whether or not the core should print thread id's on error
messages.
Julian Seward [Fri, 9 Nov 2007 23:13:22 +0000 (23:13 +0000)]
Merge (from branches/THRCHECK) r6804:
Split the scheduler initialisation into two phases, for reasons I
can't exactly remember. But I think it was so that the tool can be
told of the initial thread's TID before it is notified of any initial
address range permissions. Or something like that.
Julian Seward [Fri, 9 Nov 2007 23:09:50 +0000 (23:09 +0000)]
Merge r6806 from branches/THRCHECK:
Fix longstanding error in the amd64-linux function-wrapping macros:
protect the caller's red zone across the hidden call. All rather
nasty as explained in big comment.
Julian Seward [Fri, 9 Nov 2007 23:02:28 +0000 (23:02 +0000)]
Merge (from branches/THRCHECK) the following amd64-linux stack unwind
kludges^H^H^H^H^H^H^Henhancements:
r6802: For VG_(record_ExeContext) et al, add a new parameter
(first_ip_delta) which is added to the initial IP value before the
stack is unwound. A safe value to pass is zero, which causes the
existing behaviour to be unchanged. This is a kludge needed to work
around the incomplete amd64 stack unwind info in glibc-2.5's clone()
routine.
r7059: Add a last-ditch heuristic-hack to the amd64-linux stack
unwinder, which is used when all other methods fail. Seems like GDB
has something similar.
Julian Seward [Fri, 9 Nov 2007 12:30:36 +0000 (12:30 +0000)]
Add Bryan Meredith's Omega tool as an experimental tool. Maintainer
is Rich Coe. Also, a minor mod to Makefile.install.am to handle tool
names with dashes in.