Commit Graph

3022 Commits

Author SHA1 Message Date
Julian Seward
f5adf7f83a Get rid of VG_NUMW_CLO, as it is pretty much identical to VG_NUM_CLO,
and only used in one place.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7257
2007-11-30 17:50:44 +00:00
Julian Seward
953b8549d7 Changes to make Memcheck work sanely on recent incarnations of AIX 5.3:
* add a few more syscall wrappers, and fix a couple of buggy ones

* intercept strcmp et al in a few more libraries



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7249
2007-11-29 03:08:32 +00:00
Julian Seward
9d7f1c6a52 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7248
2007-11-29 03:06:25 +00:00
Julian Seward
eadeac4197 Dump extraneous code.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7246
2007-11-28 01:50:55 +00:00
Julian Seward
c7fbd65201 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7241
2007-11-27 11:42:47 +00:00
Julian Seward
a60ad6740d AIX 5.3 build fixes.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7232
2007-11-26 22:43:03 +00:00
Julian Seward
54e5bf2856 Misc changes needed to support exp-drd (Bart Van Assche).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7213
2007-11-25 14:08:53 +00:00
Julian Seward
931a40e83b Core-tool iface changes needed to support exp-drd (Bart Van Assche).
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7212
2007-11-25 14:06:06 +00:00
Julian Seward
e78a73e925 Fix completely bogus implementation of VG_(seginfo_sect_kind). This
was reported a very long time ago (2 years?) but was not fixed until
now.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7210
2007-11-25 12:30:36 +00:00
Julian Seward
b1cd71d2ca 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7207
2007-11-24 23:37:07 +00:00
Julian Seward
ba878b5c54 Don't let the debugger attachment fail silently in some cases.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7205
2007-11-24 21:24:25 +00:00
Nicholas Nethercote
4d236e4fb2 Tweak VG_(expand_file_name), as per Josef's suggestions.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7204
2007-11-23 22:37:35 +00:00
Nicholas Nethercote
d6b40a390d Fixed up the log file mess throughout, including the docs. This killed
--log-file-qualifier and --log-file-exactly.

Updated NEWS some in preparation for 3.3.0.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7202
2007-11-23 01:41:32 +00:00
Nicholas Nethercote
4481b0b4be Add support for %q in --massif-out-file. Todo: use this mechanism for the
core and Cachegrind.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7200
2007-11-22 23:01:59 +00:00
Tom Hughes
70a1666570 Don't load debug sections from the linked debug file if we have
already loaded them from the main ELF file. Fixes #145609.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7196
2007-11-21 16:09:18 +00:00
Julian Seward
4d601bfed7 Support sys_utimensat on x86-linux. (Dan McGee)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7195
2007-11-20 23:41:23 +00:00
Julian Seward
4027cc76a2 Followup to r7192: don't bork the compilation if GDB_PATH is not
defined (in config.h)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7194
2007-11-20 21:38:14 +00:00
Julian Seward
15295992a0 Handle sys_getitimer on ppc32-linux and ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7193
2007-11-20 19:59:51 +00:00
Julian Seward
83f6ead3b5 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7192
2007-11-20 19:45:03 +00:00
Julian Seward
6520d8f476 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7191
2007-11-20 08:46:05 +00:00
Nicholas Nethercote
a72987b053 shut GCC up
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7189
2007-11-20 07:04:36 +00:00
Julian Seward
04ac736514 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7187
2007-11-19 14:54:09 +00:00
Julian Seward
8624d07814 Add initial code to support debugger attaching on ppc64-linux (Ryan John).
Works on 2.6.20.  Does not work on 2.6.23 for unknown reasons.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7185
2007-11-19 02:29:07 +00:00
Julian Seward
5343a25e2b 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7184
2007-11-19 02:01:01 +00:00
Julian Seward
e6ab39f170 When doing ptrace on amd64-linux, provide values which don't fail the
kernel's sanity checks for kernel >= 2.6.21.  Fixes #145622.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7183
2007-11-19 00:58:18 +00:00
Julian Seward
29ff6066e9 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7177
2007-11-17 22:29:25 +00:00
Julian Seward
e83bc0c180 Don't pollute the XML output if the program terminates with a signal,
and for a couple of other minor warnings.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7176
2007-11-17 21:31:48 +00:00
Julian Seward
db29debc13 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7175
2007-11-17 21:11:57 +00:00
Julian Seward
cb12a8770d Stack registration stuff: don't dereference NULL pointers (Eric
Sharkey, #150044).



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7171
2007-11-17 02:05:57 +00:00
Julian Seward
8dd547a530 Don't segfault on syscall (SYS_io_destroy, 0). (Jakub Jelinek) Fixes
#147325.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7170
2007-11-17 01:49:06 +00:00
Julian Seward
4044188f76 Add support for private futexes (whatever they might be). Patch from
Eric Dumazet.  Fixes #146781.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7169
2007-11-17 01:35:08 +00:00
Julian Seward
f0a790693c Don't crap out when malloc_stats is called; instead just have a no-op
implementation of it.  Fixes #145559.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7168
2007-11-16 22:29:27 +00:00
Julian Seward
760e1d046e Make one redirect mandatory for ppc64-linux.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7167
2007-11-16 19:39:49 +00:00
Julian Seward
5d69e35fdc Make one of the ppc32-linux initial redirects mandatory, and add
further comments.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7166
2007-11-16 18:45:40 +00:00
Julian Seward
f245d83cc4 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.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7165
2007-11-16 18:32:40 +00:00
Nicholas Nethercote
13c597f709 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7149
2007-11-11 21:58:21 +00:00
Julian Seward
dc77d6e27a In vg_SP_update_pass (stack-pointer-change analysis code), correctly
handle partial updates of SP.  Tricky.  This fixes #152022.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7147
2007-11-11 18:56:39 +00:00
Nicholas Nethercote
d95559802b 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.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7133
2007-11-10 04:08:08 +00:00
Julian Seward
6e9e59f46b Allow VG_(atoll16) to accept a leading "0x".
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7125
2007-11-09 23:25:46 +00:00
Julian Seward
33e93b4514 Oops (a second time), this was missed out of r7118 (Merge (from
branches/THRCHECK) the following amd64-linux stack unwind kludges)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7124
2007-11-09 23:24:09 +00:00
Julian Seward
06666933d9 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7123
2007-11-09 23:21:44 +00:00
Julian Seward
30238ecdb2 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7121
2007-11-09 23:13:22 +00:00
Julian Seward
75fd9878c9 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7118
2007-11-09 23:02:28 +00:00
Julian Seward
5b02b70476 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.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7112
2007-11-09 12:30:36 +00:00
Nicholas Nethercote
d4afc89b08 Add comment about 32-bit UIDs/GIDs.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7030
2007-10-23 22:26:12 +00:00
Tom Hughes
a985431199 Use geteuid32/getegid32 on those platforms which have them.
Fixes bug #151209.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7028
2007-10-23 08:03:59 +00:00
Nicholas Nethercote
cd95227e38 Add a comment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7009
2007-10-16 23:18:06 +00:00
Dirk Mueller
ab6ac6192c readd right adjustment.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6948
2007-10-04 21:36:40 +00:00
Dirk Mueller
76b90cdeb9 fix a few format string warnings
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6928
2007-10-01 10:33:41 +00:00
Nicholas Nethercote
7cb817e078 Fix various format string errors, courtesy of Florian Krohm.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6902
2007-09-23 00:51:24 +00:00