Florian Krohm [Fri, 12 Aug 2011 15:07:10 +0000 (15:07 +0000)]
Check return code of pthread_create and bail out if
the function failed. This helps on systems which don't
have lots of memory.
Suggested by Christian Borntraeger.
Florian Krohm [Thu, 11 Aug 2011 02:23:54 +0000 (02:23 +0000)]
Due to a kernel bug the siginfo struct was not filled in correctly.
The si_code was incorrect not matching any of the VKI_ILL_....
cases checked in m_signals.c function default_action.
So let's have two expected output files for buggy kernels and otherwise.
Also, add op00 to the list of files to be ignored.
Florian Krohm [Mon, 8 Aug 2011 23:47:23 +0000 (23:47 +0000)]
Followup to VEX r2189 -- handling invalid opcode 00 specially.
Update golden log for testcase op_exception which no longer
complains about invalid opcode 00.
Add testcase op00.c
Fix a Massif bug: when realloc'ing a block, any values in the part of the
block beyond the original request weren't copied. They are now. This is
important because a program could use malloc_usable_size to gain legitimate
access to those extra bytes.
Fix prerequisite for memcheck/tests/linux/timerfd-syscall.
The testcase was executed despite uname -r being 2.6.9-42.EL
Extend tests/os_test.c to take an optional 2nd argument
which is a minimum version number. Use os_test in the
prerequisite expression.
drd: Make racing pthread_barrier_wait() calls trigger an error message instead
of an assertion failure. Also, make barrier tracing output more detailed.
drd: Fix a race condition in the barrier implementation that could result in false positives.
What could occur before this fix is:
- The pthread_barrier() call in a first thread finishes.
- Another thread invokes pthread_join() on that thread, causing the information
associated with that thread to be removed from the barrier object.
- The pthread_barrier() call in another thread finishes. Because some
thread information has already been removed from the barrier object, the
per-thread vector clock "last" won't be computed correctly by
DRD_(barrier_post_wait)().
- Because of the above false positives could be reported.
This resulted in sporadic failure of the drd/tests/matinv regression test, and
should now be fixed.
drd: Make drd_pthread_intercepts.c compile again on systems where
FUTEX_PRIVATE_FLAG has not been defined in <linux/futex.h>, e.g. older System z
systems.
Avoid excessive fragmentation in m_mallocfree facility by munmapping
unused superblocks in some circumstances. Bug 250101 (==269884,
==275852)
(Philippe Waroquiers, philippe.waroquiers@skynet.be)
Add a new client request and pair of macros,
VALGRIND_{DISABLE,ENABLE}_ERROR_REPORTING, which allow a thread to
temporarily disable reporting of errors it makes. This is useful for
making Memcheck behave sanely in the presence of some MPI
implementations. Also mark up libmpiwrap.c accordingly.
Update ugly Callgrind hack for supporting instrumentation modes
To support different instrumentation modes, callgrind calls
VG_(discard_translations), which up to now does not belong to the
functions allowed to call from tools, as this is unsafe if
called from generated code.
Callgrind hacks around that by defining the prototype itself.
However, in r4789 (from Sep 27 2005!) a 3rd arg was added for
debugging output. Thus, callgrind could crash if called
with "-d -d".
As the "instrumentation off" feature seems to be used quite often,
it really would be nice to have VG_(discard_translations) callable
from tools...
If valgrind is called with absolute path (as qtcreator does),
callgrind_control found nothing, as it looked for
"... for valgrind ...", thus breaking qtcreator.
This also fixes expected behavior with client commands called with
absolute path. For "/usr/bin/valgrind --tool callgrind /usr/bin/foo",
running "callgrind_control foo" should catch this callgrind command.
Instead, you previously had to include the absolute path.
Fix regtest: the delta value printed by the VSTn with register
post-index is bogus due to an accidental stringification in the macro.
Bug 277689. (Mans Rullgard, mans@mansr.com)
Enable chasing of unconditional jumps/calls for s390x.
Tune function chase_into_ok to not chase into EX/EXRL
insn.
Observed speedups on performance tests were:
none -6% ... -12%
memcheck -3% ... -8%
Make the location for temporary files configurable at runtime.
To that effect observe the environment variable TMPDIR. If defined,
its value takes precedence over VG_TMPDIR.
Because the directory name is no longer a compile time constant,
VG_(err_config_error) was changed to take a variable argument list.
Fixes #267020.
Fix up preload code so that on Android it doesn't try to call anything
else -- that seems to give a runtime link failure. In particular,
avoid calling _exit, getpagesize or __libc_freeres.
Build system fixes so as to temporarily disable the GDBserver on
Android. Making that work will require a bit of extra effort due to
minor glibc-vs-bionic differences.
Allow selection of an alternative location for temporary files at
configure time, via the --with-tmpdir flag. The configure.in part of
this was mistakenly committed already in r11872 as first hunk of the
configure.in change. Bug 266035 comment 11. (Kenny Root,
kroot@google.com)
The pthread.h on Android has no definition for pthread_rwlock_t, which
makes the associated intercepts in Helgrind and DRD un-compilable.
Add a configure test for it, and use them to guard the aforementioned
intercepts.
Pass platform-variant tags (-DVGPV_blah_blah_blah) to regtest
compiles. Also, fix some $(NAME) stuff which looks like it should
have been @NAME@ all along.
Introduce the concept of platform variants. These allow further
qualification of the normal (arch, os) pairings used to factorise the
code base via the VGP_ defines. With this change, a new define
VGPV_<arch>_<os>_<variant> is also passed to each compile. The
initial motivation is to allow clean factorisation of Android-specific
code, which is a minor variant of arm-linux, without having to
introduce a complete new platform. In all other cases the supplied
tag is simply "vanilla".
Also add configure.in stuff to recognise Android at configure time.