Bart Van Assche [Sun, 7 Mar 2010 10:42:15 +0000 (10:42 +0000)]
Made the behavior of the annotate_smart_pointer test program configurable
through command-line arguments, and made sure that the annotations present
in the source code are recognized by all Valgrind-based data race detection
tools.
Bart Van Assche [Sat, 6 Mar 2010 10:54:36 +0000 (10:54 +0000)]
Changes:
- Annotated the smart pointer implementation.
- Explained the purpose of the test via source code comments.
- Removed class Semaphore.
- Made it possible to specify the number of threads to be created via the
command line.
Tom Hughes [Fri, 5 Mar 2010 10:11:41 +0000 (10:11 +0000)]
On amd64 all IPC calls behave as if the IPC_64 flag is set in the
command, so pretend that it is set when calling the generic wrapper
functions in pre and post handlers. Fixes #229509.
Julian Seward [Wed, 3 Mar 2010 22:57:47 +0000 (22:57 +0000)]
Make the version number available in the valgrind.h headers, so
clients can do version-specific client requests. This is something we
should have done long ago. Still needs a way to regtest this, to
check that the embedded version matches what's stated in configure.in.
Tom Hughes [Tue, 23 Feb 2010 10:02:55 +0000 (10:02 +0000)]
Add support for the getcpu system call on x86, ppc32 and ppc64. There
is no support for amd64 because there is no getcpu system call on that
platform - it is always done as a vsyscall in user space.
Based on patch from Aleksander Salwa. Closes #223758.
Julian Seward [Mon, 22 Feb 2010 11:03:10 +0000 (11:03 +0000)]
When creating a child thread, initially set its os_state.threadgroup
to have the same value as the parent. This avoids exit races leading
to hangs and strange behaviour in heavily multithreaded apps, in the
situation where threads are rapidly being created, and at the same
time an existing thread does sys_exit_group so as to terminate the
entire process. Thanks to Konstantin S for chasing this down to a
small test case. Fixes #226116.
Tom Hughes [Fri, 19 Feb 2010 16:50:45 +0000 (16:50 +0000)]
Add parentheses round the "zzarg" macro argument when using it as it
may expand to an expression which may mean we wind up doing the cast
before evaluating the expression... Closes #227570.
Tom Hughes [Tue, 16 Feb 2010 15:05:55 +0000 (15:05 +0000)]
Neither FUTEX_WAKE or FUTEX_WAKE_BITSET actually dereference the
futex at all (they just use the address) so we shouldn't insist on
it's contents being define. Fixes #224723.
Julian Seward [Fri, 12 Feb 2010 12:12:39 +0000 (12:12 +0000)]
Try to find the PDB file for a given PE file by the totally kludgey
method of doing "strings file.dll | egrep '\.pdb|\.PDB'".
Distantly derived from a patch by leiz@ucla.edu. Fixes #222902,
although I still would prefer to do this the proper way, by parsing
the PE file properly.
Julian Seward [Sat, 30 Jan 2010 13:40:27 +0000 (13:40 +0000)]
The client request VG_USERREQ__LOAD_PDB_DEBUGINFO that we get from
Wine as a notification to read PDB/PE debug info, contains a parameter
'reloc' whose purpose is unknown, and which is unused. Rename it
accordingly, to 'unknown_purpose__reloc'. (a non-functional change)
Julian Seward [Fri, 29 Jan 2010 22:37:02 +0000 (22:37 +0000)]
PE/PDB handling: allow the PDB (the debuginfo file) to be up to 1
minute older than the PE (the .exe/.dll it describes) even though this
doesn't seem particularly safe. Partially fixes #190675.
(patch from Dan Kegel)
Julian Seward [Thu, 28 Jan 2010 15:23:54 +0000 (15:23 +0000)]
Followup fix to r11006. Don't pass va_list by value through client
requests, since there's no guarantee it is the same size as a machine
word.
This renames the private client request VG_USERREQ__INTERNAL_PRINTF to
VG_USERREQ__INTERNAL_PRINTF_VALIST_BY_REF and changes the
argument-passing accordingly.
The public client requests VG_USERREQ__PRINTF and
VG_USERREQ__PRINTF_BACKTRACE are now deprecated, and handled only in
the case where sizeof(UWord) == sizeof(va_list). In all other cases V
will now print a detailed error message and abort. This breaks binary
compatibility of apps compiled using VALGRIND_PRINTF and
VALGRIND_PRINTF_BACKTRACE, but that's not easy to avoid.
VG_USERREQ__PRINTF and VG_USERREQ__PRINTF_BACKTRACE are now replaced
by VG_USERREQ__PRINTF_VALIST_BY_REF and
VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF. The end-user macros
VALGRIND_PRINTF and VALGRIND_PRINTF_BACKTRACE have been adjusted to
use these new requests instead.
Overall result is that source level compatibility of code using
VALGRIND_PRINTF{,_BACKTRACE} is retained, but binary level
compatibility may be broken, necessitating a rebuild of code using
these macros.
Julian Seward [Wed, 27 Jan 2010 10:28:00 +0000 (10:28 +0000)]
Fix handling of mprotect so as to be more consistent with the handling
of mmap. Fixes #205541 and its dup #210268. The fix is simple enough
but the analysis is a bit complex, as detailed in comments.
Julian Seward [Fri, 15 Jan 2010 10:57:57 +0000 (10:57 +0000)]
Add command line flag --vex-guest-chase-cond=no|yes [no] to control
whether front ends should speculatively chase through conditional
branches. Disabled by default.
Julian Seward [Mon, 11 Jan 2010 13:02:19 +0000 (13:02 +0000)]
Apparently the dynamic linker on ARM-Linux has soname "ld-linux.so.3"
rather than "ld-linux.so.2". No, don't ask me why. Anyway, on
Helgrind, don't instrument code in ld-linux.so.3. This makes Helgrind
pretty much usable on ARM-Linux.
Julian Seward [Wed, 6 Jan 2010 11:08:18 +0000 (11:08 +0000)]
arm-linux: remove wrappers for __NR_ipc, __NR_mmap, __NR_sigsuspend
and __NR_sigaction, which all did I_die_here and therefore can never
have been used. I think they were here as a result of this file being
derived from the x86-linux version, and that arm-linux uses more
modern equivalents (mmap2, rt_sig*, and the broken-out versions of
ipc).
Julian Seward [Sun, 3 Jan 2010 21:24:09 +0000 (21:24 +0000)]
Make sure the Memcheck tests are built on arm-linux using hardware
floating point, since the softfloat results are way different from the
hardware one (not to mention, V reports lots of accesses-below-the-SP
in the softfloat helper functions.)
Julian Seward [Sat, 2 Jan 2010 10:41:46 +0000 (10:41 +0000)]
Redo r10971 ("Made sure that C++ compilers do not complain about the
_VKI_IOC_TYPECHECK() macro") in a way which is easier to understand.
Also, add it for arm-linux.
Julian Seward [Fri, 1 Jan 2010 20:56:13 +0000 (20:56 +0000)]
initUnwindContext: put back into the loop, some initialisations for
ARM which were originally in the loop but inadvertantly got lifted out
during recent merging. This appears to make stack unwinding work
again on ARM-Linux.
Julian Seward [Fri, 1 Jan 2010 18:46:41 +0000 (18:46 +0000)]
Make the Dwarf3 CFI stack unwinding machinery work on arm-linux
too. This is a first step towards making not be completely
x86/amd64-linux specific, and so replaces some x86/amd64-specific
stuff with more general constructions:
* structure 'DiCfSI', into which the info is summarised, has been
made target-specific (ugh), since the sets of registers to be
unwound differ on different targets.
* enum CfiReg and the CFIC_ constants have been expanded
accordingly, to handle both arm and x86/amd64 registers.
The abbreviation "IA" (Intel Architecture) has been used in a
few places where the x86 and amd64 definitions are shared.
* the CFI reader/summariser in readdwarf.c has been expanded &
generalised appropriately.
* the DiCfSI evaluator in debuginfo.c, VG_(use_CFI_info), has
also been generalised appropriately.
The main change is that instead of passing around triples
of (IP, SP, BP) values, a new structure 'D3UnwindRegs' is
passed around instead. This is defined differently for IA and
ARM and succeeds in hiding at least some of the differences
where we don't care about them.
Note also, D3UnwindRegs duplicates, in purpose and structure,
structure 'RegSummary' in priv_d3basics.h. This will be tidied
up in due course.
This commit almost certainly breaks stack unwinding on amd64-linux.
Julian Seward [Fri, 1 Jan 2010 18:30:59 +0000 (18:30 +0000)]
Don't use -Wdeclaration-after-statement. We long since abandoned any
pretense of being buildable with gcc prior to 3.0, hence there's no
point in having this flag.
Julian Seward [Fri, 1 Jan 2010 11:59:33 +0000 (11:59 +0000)]
Merge from branches/ARM, all parts of the ARM-Linux port except for
the changes to do with reading and using ELF and DWARF3 info.
This breaks all targets except amd64-linux and x86-linux.
Bart Van Assche [Tue, 29 Dec 2009 14:11:38 +0000 (14:11 +0000)]
Changes:
- Made sure that C++ compilers do not complain about the header files
include/pub_tool_libcassert.h and include/pub_tool_basics.h.
- Added the source file none/tests/valgrind_cpp_test.cpp. This source file
is compiled together with the regression tests in order to verify that
Valgrind's public header files compile cleanly with a C++ compiler.
These modifications are based on a patch provided by Konstantin Serebryany.
Callgrind: fix bug 217849: Switch to running thread in CLG_(post_signal)
If instrumentation is switched off on multithreaded code,
multiple signals in a row handled by different threads could
confuse callgrind.
Callgrind assumed that in post_signal, it has the correct understanding
of the currently running thread. This is not always correct.
Really switch to running thread.