Commit Graph

535 Commits

Author SHA1 Message Date
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
Petar Jovanovic
3cf56670a2 Another exp file for tc23_bogus_condwait.c.
struct pthread_mutex_t is different on MIPS32 and x86_64, and thus passing a
bogus mutex pthread_cond_wait (line 72) will corrupt memory in a different way
on two platforms. This causes the subsequent call to pthread_cond_wait to fail
on MIPS and i386 but not on x86_64.

This change fixes helgrind/tests/tc23_bogus_condwait on MIPS and i386.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13001
2012-09-19 12:48:09 +00:00
Petar Jovanovic
15da59bfad Adding tc19_shadowmem.stderr.exp-mips32 to match different output.
Writing to a double is done via two store-word instructions on MIPS platforms.
Thus, Helgrind will report "Possible data race during write of size 4" twice on
subsequent locations on MIPS instead of a single "Possible data race during
write of size 8". New exp file is added to cover this case.
This fixes helgrind/tests/tc19_shadowmem on MIPS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13000
2012-09-19 11:51:31 +00:00
Petar Jovanovic
1e2f0de91c Add exp file for tc20_verifywrap due to different errno values on MIPS.
Different error numbers on MIPS require us to add an extra exp file for this
test. EDEADLK is 45 on MIPS (and not 35), and EOPNOTSUPP is 122 (and not 95).
Furthermore, sem_post will pass due to different implementation on MIPS (in
comparison to x86_64), and thus one error less has to be reported in the log.

This fixes helgrind/tests/tc20_verifywrap.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12998
2012-09-18 21:02:59 +00:00
Petar Jovanovic
11e3b1f45f Adding new exp file for tc18_semabuse in helgrind.
The existing tc18_semabuse.stderr.exp expects that sem_post on a bogus semaphore
will fail, yet it does not on platforms such as MIPS or ARM. This is specific to
implementation of sem_post for i386/x86_64 that has some assumptions such as that
'private' field is not clobbered. This will eventually result in different
parameter passed to syscall and thus different output is encountered.
This change fixes helgrind/tests/tc18_semabuse for MIPS.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12976
2012-09-15 02:36:21 +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
Philippe Waroquiers
d045b4236a Implement --redzone-size and --core-redzone-size
* For tools replacing the malloc library (e.g. Memcheck, Helgrind, ...),
  the option --redzone-size=<number> allows to control the padding 
  blocks (redzones) added before and after each client allocated block.
  Smaller redzones decrease the memory needed by Valgrind. Bigger
  redzones increase the chance to detect blocks overrun or underrun.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12807
2012-07-31 22:17:28 +00:00
Philippe Waroquiers
9f4932eeec Document Helgrind limitation that old access stack traces have maximum 8 entries
#define N_FRAMES 8
(defined in libhb_core.c:3888)

implies that 'other thread' stack traces are limited to 8,
even with a bigger --num-callers.

=> document this in the manual to avoid that a user believes this is a
bug in the stack trace logic of Valgrind.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12767
2012-07-20 23:40:35 +00:00
Philippe Waroquiers
74bc30c150 295590 Helgrind: Assertion 'cvi->nWaiters > 0' failed when cond var being waited upon destroyed
* when cond var is destroyed, in the PRE, report an error if nwaiters > 0.
* when cond_wait succeeds, get the cond var but do not create one in helgrind
  (it must exist if cond_wait was done).
  Report an error if cond not found (assuming this is caused by a destroy
  done while the thread was cond_wait-ing).
* added a test


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12721
2012-07-06 23:38:24 +00:00
Julian Seward
3e344c57f6 Merge in a port for mips32-linux, by Petar Jovanovic and Dejan Jevtic,
mips-valgrind@rt-rk.com, Bug 270777.

Valgrind: changes to existing files.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12616
2012-06-07 09:13:21 +00:00
Julian Seward
8b6f93641c Add translation chaining support for amd64, x86 and ARM
(Valgrind side).  See #296422.



git-svn-id: svn://svn.valgrind.org/valgrind/branches/TCHAIN@12484
2012-04-02 21:56:03 +00:00
Julian Seward
8f59064ed9 Update the memcpy intercept for Helgrind in accordance with that
for Memcheck.  Fixes #293855.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12468
2012-03-27 16:49:55 +00:00
Philippe Waroquiers
3b8c593619 Modify test so that scheduling events are generated.
Even without fair scheduling, this ensures the progress
of each thread.
This avoids the test looping forever in an outer/inner
setup.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12452
2012-03-19 20:19:23 +00:00
Bart Van Assche
aad3c98711 helgrind: Implement ANNOTATE_BENIGN_RACE_SIZED()
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12434
2012-03-08 18:58:41 +00:00
Philippe Waroquiers
be97cddd7a Fixes 282230 group allocator for small fixed size, use it for MC_Chunk/SEc vbit
* new files include/pub_tool_groupalloc.h and coregrind/m_groupalloc.c
  implementing a group allocator (based on helgrind group alloc).
* include/Makefile.am coregrind/Makefile.am : added pub_tool_groupalloc.h
  and m_groupalloc.c
* helgrind/libhb_core.c : use pub_tool_groupalloc.h/m_groupalloc.c
  instead  of the local implementation.
* include/pub_tool_oset.h coregrind/m_oset.c : new function
  allowing to create an oset that will use a pool allocator.
  new function allowing to clone an oset (so as to share the pool alloc)
* memcheck/tests/unit_oset.c drd/tests/unit_bitmap.c : modified
  so that it compiles with the new m_oset.c
* memcheck/mc_main.c : use group alloc for MC_Chunk
  memcheck/mc_include.h : declare the MC_Chunk group alloc
* memcheck/mc_main.c : use group alloc for the nodes of the secVBitTable OSet
* include/pub_tool_hashtable.h coregrind/m_hashtable.c : pass the free node
  function in the VG_(HT_destruct).
  (needed as the hashtable user can allocate a node with its own alloc,
  the hash table destroy must be able to free the nodes with the user
  own free).
* coregrind/m_gdbserver/m_gdbserver.c : pass free function to VG_(HT_destruct)
* memcheck/mc_replace_strmem.c memcheck/mc_machine.c
  memcheck/mc_malloc_wrappers.c memcheck/mc_leakcheck.c
  memcheck/mc_errors.c memcheck/mc_translate.c : new include needed
  due to group alloc.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12341
2012-01-17 21:16:30 +00:00
Bart Van Assche
908268e4a0 Add command-line option --fair-sched=[no|yes|try]. Use --fair-sched=try
when running the annotate_hbefore regression test. Closes #270006.

To do: update manual.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12280
2011-12-08 16:14:59 +00:00
Florian Krohm
b84e215343 Rewrite test to not use function clock_gettime. The purpose
of this is to not have to link against -lrt because that causes
a different back-trace on certain x86 and s390x environments.
See the thread with subject 
"helgrind/tests/cond_timedwait_invalid failing on x86"
on valgrind-developers for more details.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12246
2011-10-28 00:11:44 +00:00
Julian Seward
084b7cb10b Fix #284384 (clang 3.1 -Wunused-value warnings in valgrind.h,
memcheck.h) by changing a bunch of VALGRIND_DO_CLIENT_REQUEST_EXPR
into VALGRIND_DO_CLIENT_REQUEST_STMT for cases where the return value
of the former would be unused.  (Bart Van Assche, bart.vanassche@gmail.com)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12226
2011-10-24 13:21:57 +00:00
Bart Van Assche
2c9b048a6d helgrind/tests/tc08_hbl2: Avoid busy-waiting
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12216
2011-10-23 13:28:20 +00:00
Bart Van Assche
e3020211d0 helgrind/tests/cond_timedwait_invalid: Update expected output because of r12213
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12215
2011-10-23 12:34:07 +00:00
Bart Van Assche
a37ce6c407 helgrind/tests/cond_timedwait_invalid: Port to Darwin 10.8
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12213
2011-10-23 12:11:15 +00:00
Julian Seward
c96096ab24 Update all copyright dates, from 20xy-2010 to 20xy-2011.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12206
2011-10-23 07:32:08 +00:00
Julian Seward
f552193183 Allow garbage collection of the LAOG data structure(s). This avoids
quadratic growth on some apparently simple test cases.  Fixes #267925.
(Philippe Waroquiers, philippe.waroquiers@skynet.be)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12201
2011-10-22 19:29:51 +00:00
Florian Krohm
086294dbed Add missing filter scripts to Makefile.am so they are included in
the tarball generated by "make dist".
With this change running regtest from the tarball produces the same
results as a regtest on a checked out repository (on x86 that is).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12172
2011-10-20 01:17:12 +00:00
Bart Van Assche
bcfb47cd21 Add missing backslash
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12167
2011-10-19 16:22:50 +00:00
Julian Seward
60c4f86e74 Fix false positive following pthread_cond_timedwait failure.
Fixes #271917.  (Philippe Waroquiers, philippe.waroquiers@skynet.be)


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12164
2011-10-19 05:41:34 +00:00
Bart Van Assche
708a8b0ec4 helgrind/tests/Makefile.am: Add tc22_exit_w_lock.stderr.exp-kfail-x86 to EXTRA_DIST. See also r12079.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12151
2011-10-14 09:28:41 +00:00
Florian Krohm
5f2312e2a9 First round of changes to get make dist working again.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12131
2011-10-09 23:28:47 +00:00
Bart Van Assche
71a513f01a Format functions: change format specifier %t into %pS. Remove the _no_f_c formatting function variants.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12108
2011-10-06 19:08:37 +00:00
Bart Van Assche
c19fbe2e9a helgrind/tests/pth_barrier*: Update expected output after drd/tests/pth_barrier.c changes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12107
2011-10-06 06:39:02 +00:00
Bart Van Assche
4a13377cfc Helgrind and exp-sgcheck, XML error reporting: move the code printing <kind>...</kind> out of a switch statement.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12095
2011-10-04 16:28:42 +00:00
Florian Krohm
8da681a43e Add exp file for x86. This test is known to fail on that platform
by omitting a frame in the backtrace. Hence, the "kfail" in the 
file name.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12079
2011-10-02 00:38:22 +00:00
Florian Krohm
6925f05d35 Change the filtering of helgrind's XML output.
New file helgrind/tests/filter_xml.
Update expected result for tc06_two_races_xml.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12077
2011-10-01 21:07:32 +00:00
Florian Krohm
78be7b727e Make filter_helgrind executable. Should unbreak the build.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12046
2011-09-26 04:35:45 +00:00
Florian Krohm
387089d67d Change the backtrace filtering machinery for the helgrind regression
bucket. Instead of removing what we don't want to see in a backtrace
(e.g. path segments through libc and libpthread), we simply keep what
we do want to see. That way .exp files can be generic.
We need to make sure that GCC inlining does not get in the way. So all
the ..._WRK function in hg_intercepts.c are attributed as noinline.
The backtrace filtering is done in the new filter_helgrind script.
filter_stderr is simplified quite a bit.
Fixes bug #281468. See also the comments #5 and #6 there.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12045
2011-09-26 00:29:44 +00:00
Florian Krohm
88a761ec9e Fix tc23_bogus_condwait.c testcase for s390x.
The testcase used to cause a SIGILL because the address of the bogus
mutex  1 + (char*)&mx[0]  denotes a memory location that will eventually
appear in a compare-and-swap instruction. That insn does not allow
memory operands that are not word-aligned. Hence, the SIGILL.
With this fix both incarnations of this testcase (in helgrind and drd)
pass.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12038
2011-09-18 00:11:12 +00:00
Florian Krohm
68ca6b20d4 This testcase is sensitive to some sleep period. On slower
machines we need to sleep longer. See bugzilla #268623 comment #2.
So let's sleep 500ms instead of 100ms, get rid of the load
barrier and enable the testcase for s390x again.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12031
2011-09-11 14:39:02 +00:00
Florian Krohm
d0813fd49f Add more .exp files for s390 due to GCC's use of the MVC insn.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12030
2011-09-10 21:46:08 +00:00
Florian Krohm
363df00d4b Disable testcase on s390x. Still hangs occasionally.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12019
2011-09-09 20:58:13 +00:00
Florian Krohm
83114a1eb5 Fix testcase for s390x. Provide implementation of XCHG_M_R.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12018
2011-09-09 18:37:55 +00:00
Florian Krohm
ef1b04d947 Add a prerequisite because drd/tests/annotate_smart_pointer is not always
built.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12017
2011-09-09 15:50:45 +00:00
Julian Seward
4bc0e6e01e For intercepts in libc and the dynamic linker (ld.so or dyld), split
the Linux and Darwin definitions so they are in completely separate
ifdefs -- iow, remove any definitions that are common to both.  This
gives some duplication, but the upside is that it is now possible to
edit the Darwin intercepts without fear of breaking the Linux ones.
This will be important when it comes to supporting OSX 10.7.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12009
2011-09-05 20:39:57 +00:00
Florian Krohm
05ee2cb5c9 Avoid hanging on older s390x systems.
See also bugzilla #268623 comment 3.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12008
2011-09-05 15:32:39 +00:00
Bart Van Assche
6699084d9a Follow-up for r11971
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11975
2011-08-14 06:16:17 +00:00
Bart Van Assche
5d9b197088 Update expected output
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11971
2011-08-13 05:57:51 +00:00
Bart Van Assche
72138486c8 Yet another threading tool regression test scheduler sensitivity fix
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11934
2011-07-28 18:46:38 +00:00
Bart Van Assche
d0318b86e1 Yet another regression test scheduling sensitivity fix
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11932
2011-07-28 17:48:48 +00:00
Bart Van Assche
19cbbaf2ae Two more scheduler sensitivity fixes for thread tool regression tests
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11931
2011-07-28 17:41:49 +00:00
Bart Van Assche
5dfad53389 Revert r11916, r11917, r11918 and r11923.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11927
2011-07-28 10:00:38 +00:00
Bart Van Assche
f7c4be8a6a More thread tool regression test scheduler sensitivity fixes
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11923
2011-07-27 08:49:12 +00:00