Commit Graph

449 Commits

Author SHA1 Message Date
Bart Van Assche
c907d5f5a1 drd/tests/free_is_write: Reduce stack usage
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14254
2014-08-10 08:14:55 +00:00
Bart Van Assche
6a597e577e drd/tests/threaded-fork-vcs: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14243
2014-08-08 16:20:13 +00:00
Carl Love
914f75de32 This commit is for Bugzilla 334384. The Bugzilla contains patch 1 of 3
to add PPC64 LE support.  The other two patches can be found in Bugzillas
334834 and 334836.  The commit does not have a VEX commit associated with it.

POWER PC, add initial Little Endian support

The IBM POWER processor now supports both Big Endian and Little Endian.
This patch renames the #defines with the name ppc64 to ppc64be for the BE
specific code.  This patch adds the Little Endian #define ppc64le to the

Additionally, a few functions are renamed to remove BE from the name if the
function is used by BE and LE. Functions that are BE specific have BE put
in the name.

The goals of this patch is to make sure #defines, function names and
variables consistently use PPC64/ppc64 if it refers to BE and LE,
PPC64BE/ppc64be if it is specific to BE, PPC64LE/ppc64le if it is LE
specific.  The patch does not break the code for PPC64 Big Endian.

The test files memcheck/tests/atomic_incs.c, tests/power_insn_available.c
and tests/power_insn_available.c are also updated to the new #define
definition for PPC64 BE.

Signed-off-by: Carl Love <carll@us.ibm.com>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14238
2014-08-07 23:17:29 +00:00
Florian Krohm
282aac6b09 Adapt testcase so it can be compiled with GCC 3.4.6 against glibc 2.3.4
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14193
2014-07-26 11:10:30 +00:00
Bart Van Assche
a7401620ad drd/tests/std_thread*: Add a workaround for an Ubuntu 14.04 gcc bug
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14156
2014-07-12 09:30:14 +00:00
Bart Van Assche
9214c37d49 Rename --defaultsupp into --default-suppressions as requested by Julian
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14090
2014-06-24 05:08:21 +00:00
Bart Van Assche
7f0e2c91ae drd/tests/std_thread2: Re-enable
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14081
2014-06-22 10:13:47 +00:00
Bart Van Assche
73c2760051 drd/tests/std_thread2: Disable this test temporarily such that the suppression patterns can be restored
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14030
2014-06-14 16:39:28 +00:00
Bart Van Assche
1f61c5c959 drd/tests/std_thread2: Make this test independent of the libstdc++ version
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14022
2014-06-11 06:39:03 +00:00
Bart Van Assche
af82b029c2 drd/tests/std_thread2: Filter out libstdc++ header file line numbers
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14019
2014-06-10 07:46:50 +00:00
Bart Van Assche
b7a7c3c66c drd/tests/std_thread2: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14014
2014-06-09 09:01:46 +00:00
Bart Van Assche
703310223e drd/tests/local_static: Disable because g++ does not yet allow proper interception of initialization of local static variables
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14013
2014-06-09 09:00:42 +00:00
Bart Van Assche
3dac2e0ca4 drd/tests/local_static: Fix a typo
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14011
2014-06-09 07:38:32 +00:00
Bart Van Assche
77897d6ecb drd/tests/local_static: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14009
2014-06-09 06:54:30 +00:00
Bart Van Assche
110f1ebd71 drd/tests/std_thread: Remove two superfluous macro definitions
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14003
2014-06-07 13:13:45 +00:00
Bart Van Assche
457786af9b drd/tests/std_thread: Minimize diffs with original
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14002
2014-06-07 07:48:04 +00:00
Bart Van Assche
fc5921fa59 drd/tests/std_thread: Enable this test program
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14001
2014-06-07 07:31:56 +00:00
Bart Van Assche
f879a52027 drd: Add semaphore annotations (#333072)
This is a slightly modified version of a patch from Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13984
2014-05-18 19:32:26 +00:00
Bart Van Assche
7c67e90c47 drd/tests/atomic_var: Revert r13876.
r13876 was a workaround for false ordering introduced by platform-specific
(Solaris) code. The conclusion of an off-list discussion was that this has
to be solved in the drd tool itself and not by modifying test programs. Hence
this revert.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13980
2014-05-17 10:44:00 +00:00
Philippe Waroquiers
e122b8d637 Fix a small typo in drd EXTRADIST Makefile.am file list for mips32
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13887
2014-03-29 00:37:51 +00:00
Dejan Jevtic
6107689cd8 mips32: When we are accessing elements via double pointer MIPS compiler can
generate two consecutive 32bit loads instead of one 64bit load. Because of that
in error log we have two conflict loads of size 4 instead of one conflict load
of size 8.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13883
2014-03-20 10:23:43 +00:00
Bart Van Assche
4ce8144dee drd/tests/atomic_var: Avoid that platform-specific code can trigger a false negative
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13876
2014-03-18 08:45:51 +00:00
Bart Van Assche
43aef21f1a drd/tests/thread_namedrd/tests/thread_name: Ensure mutex address uniqueness (see also #331847)
From: Ivo Raisr <ivosh@ivosh.net>


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13854
2014-03-07 14:38:14 +00:00
Bart Van Assche
a18953034d drd/tests/sem_open: Change the semaphore name (#331839)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13853
2014-03-07 07:45:43 +00:00
Bart Van Assche
41cc572c7f drd/tests/trylock: Make this test pass for glibc >= 2.18
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13793
2014-02-08 11:19:12 +00:00
Bart Van Assche
0eeaab895d drd/tests/std_atomic: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13756
2013-12-10 17:56:20 +00:00
Bart Van Assche
87ebe0d5a4 drd: Follow-up for r13749
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13752
2013-12-07 09:16:02 +00:00
Bart Van Assche
d8d62e85f5 drd: Add a test for the strmem intercepts
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13697
2013-10-25 12:30:46 +00:00
Bart Van Assche
86ed37d6f5 drd/tests: Add std_list and std_string test programs
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13680
2013-10-23 12:37:44 +00:00
Florian Krohm
90cba9e6d4 Add a specific configury check to test compilability of the
<thread> C++ header file by the selected compiler.
Suggested by Bart Van Assche.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13628
2013-10-08 13:04:00 +00:00
Florian Krohm
799f480786 Disable drd/tests/std_thread.cpp for clang.
clang 3.3 produces an error message for /usr/include/c++/4.6/chrono
which happens to get included somewhere inside <thread>.
This happens with C++ headers from:
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3. 


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13620
2013-10-04 21:13:16 +00:00
Bart Van Assche
625c6aa3df drd/tests/annotate_smart_pointer: Avoid non-POD variable length arrays
Non-POD variable length arrays are supported by g++ but not by clang.
Hence convert the variable length array in this test program into a vector.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13606
2013-10-02 16:22:23 +00:00
Florian Krohm
abe71bded5 Followup to r13553 which caused some build failures.
(1) Detect availability of pthread_setname_np. Ignore testcases
    memcheck/tests/threadname[_xml] if not available.
(2) Enable _GNU_SOURCE to avold compiler warnings.
(3) In threadname_xml filter out stackframes referring to system
    libraries. Added tests/filter_xml_frames to do that.
(4) Adjust .exp files as needed
(5) Do not ship stdout.exp for memcheck/tests/threadname[_xml].


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13557
2013-09-17 20:15:36 +00:00
Bart Van Assche
d73260d5b0 drd/tests/concurrent_close: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13508
2013-08-24 17:50:38 +00:00
Petar Jovanovic
5a593208b1 add and update exp files for drd/tests/annotate_trace_memory
exp-32bit files needed minor update for the last store, and some mips32
platforms also need additional exp-mips32 due to different way of loading
and storing double values.

This fixes drd/tests/annotate_trace_memory on different 32-bit platforms.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13414
2013-06-02 02:59:07 +00:00
Mark Wielaard
f9b7448882 Revert "Disable drd/tests/annotate_trace_memory[_xml].vgtest on arm and ppc."
The tests have been changed to not depend on atomic 64bit add_and_fetch.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13408
2013-05-22 20:43:25 +00:00
Bart Van Assche
4cbf288c81 drd/tests/annotate_trace_memory no longer depends on 64-bit atomics
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13407
2013-05-22 18:01:16 +00:00
Bart Van Assche
10fb98e91f drd/tests/annotate_trace_memory: Make this test more ARM/PPC friendly (#318643)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13406
2013-05-22 16:30:29 +00:00
Mark Wielaard
cd4df4ef9a Disable drd/tests/annotate_trace_memory[_xml].vgtest on arm and ppc.
Workaround for bug #318643. Disable the tests for now so they don't
go into an infinite loop and fill up the disks on arm, ppc32 or ppc64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13402
2013-05-22 10:21:02 +00:00
Bart Van Assche
a8a84e19e1 drd/tests/annotate_smart_pointer2: Add an expected output file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13322
2013-03-10 13:39:57 +00:00
Bart Van Assche
011cf17d6d drd/tests/sem_wait: Skip on Darwin since sem_init() fails with ENOSYS on Darwin
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13321
2013-03-10 13:38:41 +00:00
Bart Van Assche
ecc22dab2c drd/tests/pth_cond_destroy_busy: Correct expected output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13200
2012-12-24 10:43:15 +00:00
Bart Van Assche
3b50964baa drd/tests/pth_cond_destroy_busy: Add
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13199
2012-12-24 10:23:16 +00:00
Petar Jovanovic
b47835232b Minor style improvement over r13190.
Prerequisite should be non existence of a #define (rather than existence of
#undef in the comments).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13192
2012-12-21 02:15:23 +00:00
Petar Jovanovic
b282550dc1 Use different incorrect value in pth_detached3
The test pth_detached3 will crash on MIPS platform if the value passed to
pthread_detach is not correctly aligned. Thus, we change the value to be still
invalid but aligned.

This fixes the failure of drd/tests/pth_detached3 on MIPS32.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13191
2012-12-20 19:02:17 +00:00
Petar Jovanovic
40644676b1 Introduce DISABLE_PTHREAD_SPINLOCK_INTERCEPT flag
The flag DISABLE_PTHREAD_SPINLOCK_INTERCEPT is set only for MIPS32, and it is
used in DRD and Helgrind as a workaround for the issue #311690.
In short, pthread_spin_lock implementation has local branches to the start of
the function which interferes with the redirection system in Valgrind that
assumes it has to redirect each call/branch to a particular address.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13190
2012-12-20 18:56:57 +00:00
Philippe Waroquiers
35156f7ede fix 310424 --read-var-info does not properly describe static variables
This patch changes the way static variables are
recorded by readdwarf3.c (when giving --read-var-info=yes),
improving the way such variables are described.

Currently:
A static variable does not have the DW_AT_external tag.
So, readdwarf3.c does not consider it a global variable.
It is rather considered a "local" variable.
When it is recorded, it is associated to a range of program counters
(the functions in the file where it is visible).
However, even if the static variable is only visible
in the source file where it is declared, it can in reality
be used by any range of program counters, typically
by having the address of the local variable passed
to other functions.

Such local variable can then only be described
when the program counter is in the range of program
counters for which it has been recorded.
However, this (local) description is obtained
by a kludge in debuginfo.c (around line 3285).

This kludge then produces a strange description,
telling that the variable has been declared in
frame 0 of a thread (see second example below).

The kludge is not always able to describe
the address (if the IP of the tid is in another file than
where the variable has been declared).

I suspect the kludge can sometimes describe the var as being
declared in an unrelated thread
(e.g. if an error is triggered by tid 5, but tid1 is by
luck in an IP corresponding to the recorded range).


The patch changes the way a static variable is recorded:
if DW_AT_external tag is found, a variable is marked as global.
If a variable is not external, but is seen when level is 1,
then we record the variable as a global variable (i.e.
with a full IP range).
This improves the way such static variable are described:
* they are described even if being accessed by other files.
* their description is not in an artificial "thread frame".




First example:
**************
a variable cannot be described because it is
accessed by a function in another file:

with the trunk:
==20410== ----------------------------------------------------------------
==20410==
==20410== Possible data race during read of size 4 at 0x600F54 by thread #1
==20410== Locks held: none
==20410==    at 0x4007E4: a (abc.c:42)
==20410==    by 0x4006BC: main (mabc.c:24)
==20410==
==20410== This conflicts with a previous write of size 4 by thread #2
==20410== Locks held: none
==20410==    at 0x4007ED: a (abc.c:42)
==20410==    by 0x400651: brussels_fn (mabc.c:9)
==20410==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==20410==    by 0x4E348C9: start_thread (pthread_create.c:300)
==20410==
==20410== ----------------------------------------------------------------


with the patch:
==4515== ----------------------------------------------------------------
==4515==
==4515== Possible data race during read of size 4 at 0x600F54 by thread #1
==4515== Locks held: none
==4515==    at 0x4007E4: a (abc.c:42)
==4515==    by 0x4006BC: main (mabc.c:24)
==4515==
==4515== This conflicts with a previous write of size 4 by thread #2
==4515== Locks held: none
==4515==    at 0x4007ED: a (abc.c:42)
==4515==    by 0x400651: brussels_fn (mabc.c:9)
==4515==    by 0x4C2B54E: mythread_wrapper (hg_intercepts.c:219)
==4515==    by 0x4E348C9: start_thread (pthread_create.c:300)
==4515==
==4515== Location 0x600f54 is 0 bytes inside global var "static_global"
==4515== declared at mabc.c:4
==4515==
==4515== ----------------------------------------------------------------


Second example:
***************
When the kludge can describe the variable, it is strangely described
as being declared in a frame of a thread, while for sure the declaration
has nothing to do with a thread
With the trunk:
==20410== Location 0x600f68 is 0 bytes inside local var "static_global_a"
==20410== declared at abc.c:3, in frame #0 of thread 1

With the patch:
==4515== Location 0x600f68 is 0 bytes inside global var "static_global_a"
==4515== declared at abc.c:3

#include <stdio.h>

static int static_global_a = 0; //// <<<< this is abc.c:3




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13153
2012-12-05 21:08:24 +00:00
Florian Krohm
af66466ce4 Changes to allow compilation with -Wwrite-strings. That compiler option
is not used for testcases, just for valgrind proper.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13137
2012-11-23 16:17:43 +00:00
Florian Krohm
d0aa69c331 Fix more Char/HChar mixups. Closing in...
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13119
2012-11-10 22:29:54 +00:00
Florian Krohm
25b18b0aa1 Char/HChar and constness fixes. Mostly cost center
on allocators which is always a const HChar *


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13089
2012-10-27 23:07:42 +00:00