Tom Hughes [Wed, 25 Nov 2009 11:29:14 +0000 (11:29 +0000)]
Clean up support for sync_file_range system call and add second version used
by ppc platforms based on patch from Dodji Seketeli. Part fix for #215973.
Tom Hughes [Wed, 25 Nov 2009 11:24:00 +0000 (11:24 +0000)]
Rename LOHI64 to MERGE64 and make it work correctly on big endian
platforms. Also add MERGE64_FIRST and MERGE64_SECOND macros to help
produce the right argument names in error messages on big/little
endian platforms.
Based on patch from Dodji Seketeli. Part fix for #215973.
Tom Hughes [Thu, 12 Nov 2009 13:28:34 +0000 (13:28 +0000)]
Various improvements to DWARF handling to cope with changes in recent
versions of gcc as shipped with Fedora 12. Specific changes include:
- Vastly increase the number of opcodes we understand how to
evaluate when processing a location expression.
- Process frame unwind data from the debug_frame ELF section as
well as the eh_frame section.
- Handle version 3 CIEs in frame unwind data.
- Handle the compact form of DW_AT_data_member_location which just
gives a constant offset from the start of it's base type instead
of a full location expression.
Based on patches from Jakub Jelinek on bugs #210479 and #210566.
Julian Seward [Thu, 5 Nov 2009 08:55:13 +0000 (08:55 +0000)]
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.
Tom Hughes [Tue, 3 Nov 2009 21:14:31 +0000 (21:14 +0000)]
Rework VG_(memmove) in the case where the destination address is greater
that the source address to use the same logic as the mc_replace_strmem.c
version so that underflow is avoided. Fixes #211008.
Tom Hughes [Thu, 29 Oct 2009 14:03:02 +0000 (14:03 +0000)]
If a signal arrives when a thread which has just finished executing a
system call is between the blksys_committed and blksys_finished markers
in the system call routine then the post handler for the system call
was failing to run.
This commit fixes that by ensuring that the syscall status is recovered
from the guest state before the post VG_(post_syscall) is called just
as VG_(client_syscall) would normally do when the assembly wrapper
returned. Without that VG_(post_syscall) will not do anything a it
will think the system call is still running.
Tom Hughes [Thu, 29 Oct 2009 09:27:11 +0000 (09:27 +0000)]
Add support for ELF indirect functions. These are symbols of
type STT_GNU_IFUNC which, instead of pointing directly at the
function, point at a routine which will return the address of
the real function. Redirection of indirect functions is handled
by valgrind as follows:
- When a redirection specification matches an indirect
function symbol an active redirection is added in the
normal way, but with the isIFunc flag set.
- When a call is made to an address which matches an
active redirection with the isIFunc flag set the call
is redirected, but not to the target address of the
redirection - instead it is sent to a small wrapper
routine that is preloaded into the client.
- The wrapper routine calls the original client routine
and collects the result, which it reports to valgrind
using a client request, and then returns the result to
the caller.
- When valgrind gets the client request it looks up the
active redirection for the indirect function and then
adds a new active redirection which redirects from the
address returned by the indirection function to the
redirection target. This new redirection does not have
the isIFunc flag set so behaves as a normal redirection.
In addition to the above we also add a few new redirections to
memcheck to capture internal calls made by glibc to things like
strlen, as these internal calls do not go through the indirect
function and instead go direct to the chosen implementation.
Based on a patch from Dodji Seketeli and comments from Jakub
Jelinek, this commit closes bug 206013.
Bart Van Assche [Mon, 26 Oct 2009 16:14:04 +0000 (16:14 +0000)]
Removed the restriction that the size argument of drd_pre_mem_read_asciiz()
should be less than 4096 bytes. This function is called a.o. for the path
argument of the open() system call. This path can be longer than 4096 bytes.
Should fix bug #211941.
Bart Van Assche [Tue, 20 Oct 2009 18:13:26 +0000 (18:13 +0000)]
Fixed an assertion failure triggered by running DRD with the command-line option --trace-mutex=yes on a program using one of the ANNOTATE_HAPPENS_*() macros.
Tom Hughes [Mon, 7 Sep 2009 08:58:29 +0000 (08:58 +0000)]
Unmap the vdso as well as suppressing it by dropping the auxv
entry as on some systems the vdso will be at a random address
and can conflict with things like wine that need to tightly
control where things are mapped.
Bart Van Assche [Wed, 26 Aug 2009 18:11:18 +0000 (18:11 +0000)]
Added regression tests that verify the following behavior:
- On Linux, whether Valgrind properly intercepts the system calls that access
/proc/self/cmdline, /proc/<pid>/cmdline, /proc/self/exe and /proc/<pid>/exe.
- On Darwin, whether Valgrind does not modify the behavior of the system calls
that access the aforementioned files.
Bart Van Assche [Tue, 25 Aug 2009 20:15:41 +0000 (20:15 +0000)]
Switched back from dynamic detection of whether the proc filesystem
is mounted to compile-time logic in order to minimize the differences
in behavior with Valgrind version 3.5.0.
Bart Van Assche [Tue, 25 Aug 2009 17:34:58 +0000 (17:34 +0000)]
Renamed the function VG_(have_proc_filesystem)() into
VG_(is_procfs_mounted)(). The old name was derived from the name
of the preprocessor macro HAVE_PROC while the new name is a more
accurate description of what this function does.
Bart Van Assche [Sun, 23 Aug 2009 11:11:36 +0000 (11:11 +0000)]
Fixed a declaration: function attributes must be inserted after the return type instead of before, otherwise gcc 4.4 ignores the attribute declaration.
Bart Van Assche [Sun, 23 Aug 2009 09:53:27 +0000 (09:53 +0000)]
The configure-time test whether the proc filesystem is mounted (introduced
in r10156) broke cross-compilation. This patch converts the configure-time
test into a runtime test. Should fix bug #204843.
Bart Van Assche [Thu, 20 Aug 2009 06:07:10 +0000 (06:07 +0000)]
Removed the most recently added DRD suppression pattern (was added
to make drd/tests/qt4_mutex pass on Fedora 11 x86_64). Further
analysis has shown that this is an issue in libQtCore that should be
fixed instead of suppressed. Will file a bug report in the Fedora
bugzilla instead.
Tom Hughes [Tue, 18 Aug 2009 14:12:48 +0000 (14:12 +0000)]
The linker in Fedora Rawhide seems to be using ELFOSABI_LINUX as
the ABI in the ELF files it generates instead of ELFOSABI_SYSV as
has been used to date.
This was causing us to use the 64 bit backend to run 32 bit
programs as the launcher failed to identify them as 32 bit.
Vince Weaver [Tue, 18 Aug 2009 00:21:51 +0000 (00:21 +0000)]
Work around a binutils limitation on SuSE 9.1
by hand-coding the 32-bit fldcw instructions,
as the assembler gives an error when
trying to assemble them. The generated binary
is identical to one generated on a system
with working binutils.
Julian Seward [Mon, 17 Aug 2009 16:36:11 +0000 (16:36 +0000)]
Back out r10385 (Change demangler to not use excessive space from
stack) pending further investigations, as per discussion at
http://bugs.kde.org/show_bug.cgi?id=197988.
Julian Seward [Sun, 16 Aug 2009 22:56:53 +0000 (22:56 +0000)]
Comment that we never actually expect to see the string ]]> in a
generated suppression, and hence the problem of having to split it
into multiple CDATA blocks is moot.