785 Commits

Author SHA1 Message Date
Bart Van Assche
038beeccc0 drd: Fix bug #323905
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13511
2013-08-24 17:53:00 +00:00
Bart Van Assche
46135647c9 drd: Add command-line option --trace-sectsuppr
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13509
2013-08-24 17:51:18 +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
Philippe Waroquiers
4c9052b4d6 fix incorrect lineno in supp error msgs+ -v give filename+lineno of used supp.
If a suppression file contains an error, the lineno reported could be wrong.
Also, give filename and lineno of the used suppressions in -v debugging output.

The fix consists in ensuring that tool specific read_extra function gets
the Int* lineno pointer, together with other VG_(get_line) parameters.






git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13469
2013-07-22 22:00:13 +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
Mark Wielaard
b81e3c86b6 Fix double 'the the' in documentation.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13363
2013-04-05 13:19:12 +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
0cca640bd4 drd: Fix stack growth tracking. Hopefully this is the proper fix for #297147.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13316
2013-03-10 11:02:32 +00:00
Bart Van Assche
7b44c91302 drd: Fix a 4x slowdown for certain applications (#316181)
This commit reverts r12629 ("drd: Don't sporadically report false positives on
newly allocated memory. Fixes #297147").


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13315
2013-03-10 10:43:11 +00:00
Petar Jovanovic
5dd4c02e39 mips: adding MIPS64LE support to Valgrind
Necessary changes to Valgrind to support MIPS64LE on Linux.
Minor cleanup/style changes embedded in the patch as well.
The change corresponds to r2687 in VEX.
Patch written by Dejan Jevtic and Petar Jovanovic.

More information about this issue:
https://bugs.kde.org/show_bug.cgi?id=313267


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13292
2013-02-27 23:17:33 +00:00
Bart Van Assche
0ab171e889 drd: Make --trace-addr trace all loads for the specified address
Thanks to Florian for reporting this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13271
2013-01-27 10:58:47 +00:00
Bart Van Assche
9816dee903 drd: Avoid that Coverity complains about a dead assignment
Thanks to Florian for reporting this.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13270
2013-01-27 10:56:04 +00:00
Julian Seward
661c1c2b7b Merge, from branches/COMEM, revisions 13139 to 13235.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13236
2013-01-17 14:24:35 +00:00
Julian Seward
eca44c4855 Teach DRD about IRLoadG and IRStoreG. Includes small bug fix from
trunk r13209.


git-svn-id: svn://svn.valgrind.org/valgrind/branches/COMEM@13210
2012-12-27 17:47:09 +00:00
Julian Seward
bcf0ffc341 is_stack_access: don't iterate over possibly non-existent stmts. This
has been observed to cause the JIT to segfault when using DRD on ARM.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13209
2012-12-27 17:46:10 +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
Bart Van Assche
7b1a5978c9 drd: Handle pthread_cond_destroy() failure properly
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13198
2012-12-24 10:22:14 +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
Florian Krohm
5337376bf2 More Char/HChar fixes and constification.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13088
2012-10-27 18:39:11 +00:00
Florian Krohm
79b79d6388 First round of Char/HChar fixups for coregrind and memcheck.
Little bit of ripple in tools, too.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13074
2012-10-21 19:43:43 +00:00
Florian Krohm
4d1f391529 Fix compile errors following function prototype change.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13040
2012-10-14 02:58:42 +00:00
Florian Krohm
7d59048401 This is the 2nd installment of the cache info reorganisation.
The host's VexArchInfo is passed to the tool instrumentation
functions. Purely mechanic patch.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13031
2012-10-07 21:59:42 +00:00
Bart Van Assche
2f907e6480 drd: Suppress race reports on .got sections too
This is a slightly modified version of a patch provided by Petar Jovanovic
<petar.jovanovic@rt-rk.com>.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12960
2012-09-06 14:08:26 +00:00
Bart Van Assche
b7ff000e27 drd/tests: Add a test that verifies whether the pthread_cancel() intercept works
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12908
2012-08-28 18:17:27 +00:00
Bart Van Assche
7f409138b2 drd: Re-enable the pthread_cancel() intercept now that the CALL_FN_*() ABI
violation has been fixed (r12811).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12907
2012-08-28 17:57:09 +00:00
Bart Van Assche
342cac3d59 drd: Correct semaphore tracing in case sem_*wait() did not wait. See also #305690.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12898
2012-08-25 07:25:00 +00:00
Bart Van Assche
023e92dc22 drd: Handle non-zero sem_*wait() return values correctly. Fixes #305690.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12897
2012-08-24 17:59:03 +00:00
Bart Van Assche
04a00aa879 drd/tests: Add test program that makes sem_trywait() return a non-zero value
(provided by Graham Whitted <7wz69ejteg@snkmail.com> - see also #305690).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12896
2012-08-24 17:57:44 +00:00
Julian Seward
4a3633e266 Update copyright dates to include 2012.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12843
2012-08-05 15:46:46 +00:00
Bart Van Assche
6c92e97588 drd: Avoid that invoking pthread_cancel() from a program analyzed with DRD triggers a crash on Fedora 17
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12800
2012-07-28 14:35:48 +00:00
Bart Van Assche
24d9acaac7 drd: Revert r12651 because it didn't change drd's behavior on any platform
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12799
2012-07-28 14:32:03 +00:00
Bart Van Assche
2a476a846f drd/tests/filter_stderr: Remove a space and two backslashes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12713
2012-07-05 16:21:49 +00:00
Bart Van Assche
adcdb6b0fb drd/tests/tc04_free_lock: Use drd/tests/filter_stderr
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12708
2012-07-04 10:43:12 +00:00
Bart Van Assche
1a2d5e0c03 drd/tests: Make the expected output match the actual output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12702
2012-07-03 07:53:34 +00:00
Bart Van Assche
0eec2595ca drd/tests: Follow-up for r12690
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12700
2012-07-02 18:47:44 +00:00
Bart Van Assche
8b1be3d95c drd/tests: Rework r12662 as suggested by Florian Krohm
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12690
2012-06-30 18:00:08 +00:00
Bart Van Assche
9d97e3e6c7 drd: Add yet another expected output file
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12662
2012-06-23 10:15:17 +00:00
Bart Van Assche
7d201ff42b drd: Make sure that frame unwind information is generated for DRD intercepts
such that pthread_cancel() works properly. See also Ulrich Drepper, Cancellation
and C++ Exceptions, 2010 (http://udrepper.livejournal.com/21541.html).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12651
2012-06-17 08:46:32 +00:00