tc09_bad_unlock fails randomly for the following reason:
Thread 1 is creating a lock in a stack variable and locks it.
It then clones a Thread 2 that will unlock this lock.
The test fails if the Thread 2 unlocks the lock while the
main thread is still just after the clone syscall:
There is no unwind info in this area, and so doing a stacktrace
implies a nasty hack (see hg_main.c evh__pre_thread_ll_create).
There is no such hack when describing the address of the lock
(as there is no logic in the 'normal' stack trace to detect we are
in the clone syscall code).
In such a case, the unwind fail, and the lock address description
lacks the frame nr derived from the captured stack trace.
Adding --fair-sched=yes seems to make a more reproducible test.
Note that the proper solution to all these 'racy helgrind regtests'
would be to add some synchronisations operations between threads
that helgrind does not observe (e.g. using a technique similar to
the pipe big lock) and have correct (but invisible to helgrind) synchronisation
between the threads actions needed for a reproducible regtest.
Not very cheap to develop, --fair-sched=try is cheap and easy
so use that till someone courageous implements non visible synchronisation
* Memcheck:
- A new monitor command 'xb <addr> <len>' shows the validity bits
of <len> bytes at <addr>. Below the validity bits, the byte
values are shown using a layout similar to the GDB command
'x /<len>xb <addr>'. The monitor command 'xb' is easier to use
(in particular on little endian computers) when you need to associate
byte data value with their corresponding validity bits.
Florian Krohm [Sun, 2 Aug 2015 20:05:41 +0000 (20:05 +0000)]
GCC 5.1 issues warnings about static variables declared within non-static
inline functions. There is no command line flag so suppress that particular
warnings. So let's suppress all warnings for this testcase.
Florian Krohm [Sun, 2 Aug 2015 19:35:49 +0000 (19:35 +0000)]
Silence a few warnings issued by GCC 5.1 claiming that 'res' is
uninitialised. Perhaps an incorrect clobber or a compiler bug?
Anyhow, initialising the variable will do the trick.
Florian Krohm [Sun, 2 Aug 2015 19:31:14 +0000 (19:31 +0000)]
As pointed out by GCC 5.1 macro arguments ought to be paranthesized
when referenced. Previously CHECK(a && b) would expand to !a && b
which clearly was not the intention.
Zhi-Gang Liu [Sat, 1 Aug 2015 03:52:03 +0000 (03:52 +0000)]
Merge tilegx instruction test patch "valgrind-tilegx-instruction-test.patch"
in Bug 345921 - Add TileGX instruction set test in none/tests/tilegx
Submitted by Liming Sun, lsun@ezchip.com
Fix testcase such that it can be run under cron on Solaris.
The tescase depends on SIGHUP to be delivered but cron on Solaris
ignored the signal. So it needs to be enabled in child processes
after fork.
Patch by Ivo Raisr <ivosh@ivosh.net>. Fixes BZ #350809.
Fix BZ #338606. Basically, the bug was that it was believed that
the interpreter following the #! has to be an absolute path name.
Not so; relative path works just fine.
Carl Love [Mon, 20 Jul 2015 22:22:42 +0000 (22:22 +0000)]
Patch 7 of 7, improve PPC HW capabiltiy checking.
The patch was submitted by Will Schmidt (will_schmidt@vnet.ibm.com).
A handful of cosmetic changes to the ppc32 and ppc64 makefiles.
Cleans up some whitespace issues, spaces/tabs/etc,
Rearranges some of the contents so they are logically group, and
more consistent between the 32- and 64- bit versions of the same.
Carl Love [Mon, 20 Jul 2015 21:57:21 +0000 (21:57 +0000)]
Patch 6 of 7, improve PPC HW capabiltiy checking.
The patch was submitted by Will Schmidt (will_schmidt@vnet.ibm.com).
Rework hwcap checking in configure.ac. This adds and swizzles
some of the capability checking as found in configure.ac.
This cleans up some corner cases where capabilities were assumed
based on compiler features, but not supported by the platform.
- clean up vsx kludge, and remove associated comment.
- check assorted capabilities against the hwcap values, including
altivec, vsx, dfp, htm, ISA_2_0* .
Carl Love [Mon, 20 Jul 2015 19:36:53 +0000 (19:36 +0000)]
Patch 2 of 7, improve PPC HW capabiltiy checking.
The patch was submitted by Will Schmidt (will_schmidt@vnet.ibm.com).
Update all vgtest files to reference the new capability check helper.
This includes a few adjustments to ensure the test is checking for
the specific capability. I.e. isa_2_07 is a requirement for htm, but
does not indicate htm support is actually present.
VG_(helperc_LOADV64le): add handwritten assembly helper for ARM32
VG_(helperc_LOADV32le): VG_(helperc_LOADV16le): VG_(helperc_LOADV8):
use ".L" style assembly labels so they don't appears as new symbols
during disassembly.
Fix syntax error;
Certain GCC versions do not accept empty clobber lists.
Patch by Andreas Arnez (arnez@linux.vnet.ibm.com). Part of
fixing BZ #342841.
VG_(get_StackTrace_wrk) for x86-{linux,darwin}: when following
frame-pointer chains (via EBP), don't continue if EBP doesn't contain
a 4-aligned value. A misaligned EBP is almost certainly invalid --
hence, no loss in unwind capability here -- and the misaligned access
causes gcc 5.1 ubsan alignment checks to fail. So avoid them.
Use seg->start instead of a as DebugInfoMapping avma. Normally seg->start
equals a. But when it is not then the size of the map might extend beyond
the segment (and not actually cover the start of the segment). When another
ELF file is them mapped right after this then it triggers an overlap purge
of the DebugInfo. In the case the mapping was for libc or ld.so this then
removes all intercepts causing "bad things".
Carl Love [Wed, 1 Jul 2015 21:29:12 +0000 (21:29 +0000)]
Backing out patch 1 and 2 from Bugzilla 349790.
The new script (tests/check_ppc64_auxv_cap) in the first patch was
written for the bash shell. I was told by fkrohm that there was an
issue with bash sometime ago and the decision was to use sh instead.
sh maps to bash on a lot of systems but on some it maps to dash. The
script is not compatible with dash.
In retesting the second patch with a fresh svn pull, I found that I
forgot to do the svn add for the new script file. Which causes the
regression test to fail with the second patch applied.
So, I have decided it will be best to just back out patch 1 and 2 for now.
I will fix the script and do this again.
Carl Love [Wed, 1 Jul 2015 19:44:13 +0000 (19:44 +0000)]
Patch 2 of 6
Update all vgtest files to reference the new capability check helper.
This includes a few adjustments to ensure the test is checking for
the proper capability. (i.e. htm versus isa_2_07).
Patch 1 valgrind commit id 15388.
The bugzilla for this commit is 349790
Patch submitted by Will Schmidt <will_schmidt@vnet.ibm.com>
Reviewed and tested by Carl Love <cel@ibm.com>
Carl Love [Wed, 1 Jul 2015 18:48:48 +0000 (18:48 +0000)]
Patch 1 of 6
Rework the aux vector hwcap capability checking utilities.
This is meant to consolidate a number of existing _cap
checking scripts, and allow a better way of checking for
additional capabilites.
The bugzilla for this commit is 349790
Patch submitted by Will Schmidt <will_schmidt@vnet.ibm.com>
Reviewed and tested by Carl Love <cel@ibm.com>