You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(10) |
2
(3) |
3
(25) |
4
(8) |
|
5
(13) |
6
(8) |
7
(9) |
8
(10) |
9
(8) |
10
(13) |
11
(12) |
|
12
|
13
(7) |
14
(8) |
15
(11) |
16
(13) |
17
(13) |
18
(11) |
|
19
(13) |
20
(7) |
21
(1) |
22
(1) |
23
(1) |
24
(8) |
25
(15) |
|
26
(16) |
27
(20) |
28
(17) |
29
(10) |
30
(2) |
|
|
|
From: <sv...@va...> - 2011-06-07 22:59:23
|
Author: sewardj
Date: 2011-06-07 23:54:32 +0100 (Tue, 07 Jun 2011)
New Revision: 11803
Log:
Add a simple but (to me, at least) useful thing, if (0)'d by default,
to print a line of text approximately every 20 million SBs. This is
useful for monitoring the progress of long running programs.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
Modified: trunk/coregrind/m_scheduler/scheduler.c
===================================================================
--- trunk/coregrind/m_scheduler/scheduler.c 2011-06-07 22:53:21 UTC (rev 11802)
+++ trunk/coregrind/m_scheduler/scheduler.c 2011-06-07 22:54:32 UTC (rev 11803)
@@ -160,7 +160,22 @@
VG_(message)(Vg_DebugMsg, " SCHED[%d]: %s\n", tid, what );
}
+/* For showing SB counts, if the user asks to see them. */
+#define SHOW_SBCOUNT_EVERY (20ULL * 1000 * 1000)
+static ULong bbs_done_lastcheck = 0;
+
static
+void maybe_show_sb_counts ( void )
+{
+ Long delta = bbs_done - bbs_done_lastcheck;
+ vg_assert(delta >= 0);
+ if (UNLIKELY(delta >= SHOW_SBCOUNT_EVERY)) {
+ VG_(umsg)("%'lld superblocks executed\n", bbs_done);
+ bbs_done_lastcheck = bbs_done;
+ }
+}
+
+static
HChar* name_of_sched_event ( UInt event )
{
switch (event) {
@@ -1347,6 +1362,9 @@
break;
} /* switch (trc) */
+
+ if (0)
+ maybe_show_sb_counts();
}
if (VG_(clo_trace_sched))
|
|
From: <sv...@va...> - 2011-06-07 22:58:12
|
Author: tom
Date: 2011-06-07 23:53:21 +0100 (Tue, 07 Jun 2011)
New Revision: 11802
Log:
Define _GNU_SOURCE for access to CLONE_XXX flags with gibc 2.14 headers.
Based on patch from Dmitry Djachenko <di...@gm...>.
Modified:
trunk/memcheck/tests/linux/stack_switch.c
trunk/memcheck/tests/x86-linux/scalar.c
trunk/memcheck/tests/x86-linux/scalar.stderr.exp
Modified: trunk/memcheck/tests/linux/stack_switch.c
===================================================================
--- trunk/memcheck/tests/linux/stack_switch.c 2011-06-07 22:44:09 UTC (rev 11801)
+++ trunk/memcheck/tests/linux/stack_switch.c 2011-06-07 22:53:21 UTC (rev 11802)
@@ -1,5 +1,6 @@
#define _XOPEN_SOURCE 600
#define _BSD_SOURCE
+#define _GNU_SOURCE
#include <stdio.h>
Modified: trunk/memcheck/tests/x86-linux/scalar.c
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar.c 2011-06-07 22:44:09 UTC (rev 11801)
+++ trunk/memcheck/tests/x86-linux/scalar.c 2011-06-07 22:53:21 UTC (rev 11802)
@@ -1,3 +1,5 @@
+#define _GNU_SOURCE
+
#include "../../memcheck.h"
#include "scalar.h"
#include <unistd.h>
Modified: trunk/memcheck/tests/x86-linux/scalar.stderr.exp
===================================================================
--- trunk/memcheck/tests/x86-linux/scalar.stderr.exp 2011-06-07 22:44:09 UTC (rev 11801)
+++ trunk/memcheck/tests/x86-linux/scalar.stderr.exp 2011-06-07 22:53:21 UTC (rev 11802)
@@ -578,25 +578,25 @@
...
Address 0x........ is 0 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param sigaction(act->sa_mask) points to unaddressable byte(s)
...
Address 0x........ is 4 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param sigaction(act->sa_flags) points to unaddressable byte(s)
...
Address 0x........ is 8 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param sigaction(oldact) points to unaddressable byte(s)
...
Address 0x........ is 0 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
-----------------------------------------------------
68: __NR_sgetmask n/a
@@ -1228,13 +1228,13 @@
...
Address 0x........ is 0 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param sigprocmask(oldset) points to unaddressable byte(s)
...
Address 0x........ is 0 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
-----------------------------------------------------
127: __NR_create_module ni
@@ -1747,7 +1747,7 @@
...
Address 0x........ is 4 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param rt_sigaction(act->sa_mask) points to unaddressable byte(s)
...
@@ -1757,13 +1757,13 @@
...
Address 0x........ is 8 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
Syscall param rt_sigaction(oldact) points to unaddressable byte(s)
...
Address 0x........ is 4 bytes after a block of size 4 alloc'd
at 0x........: malloc (vg_replace_malloc.c:...)
- by 0x........: main (scalar.c:28)
+ by 0x........: main (scalar.c:30)
-----------------------------------------------------
175: __NR_rt_sigprocmask 4s 2m
|
|
From: <sv...@va...> - 2011-06-07 22:49:03
|
Author: sewardj
Date: 2011-06-07 23:44:09 +0100 (Tue, 07 Jun 2011)
New Revision: 11801
Log:
Fix the computation of debuginfo bias values, in the case where the
debuginfo object has been not been prelinked but the main object has.
Fixes a segfault observed running any C++ application (eg,
drd/tests/annotate_smart_pointer) on Fedora 14 (32-bit), when the
debuginfo RPM for libstdc++ is installed.
Modified:
trunk/coregrind/m_debuginfo/readelf.c
Modified: trunk/coregrind/m_debuginfo/readelf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2011-06-07 21:52:26 UTC (rev 11800)
+++ trunk/coregrind/m_debuginfo/readelf.c 2011-06-07 22:44:09 UTC (rev 11801)
@@ -2179,8 +2179,15 @@
shdr_strtab_dimg + shdr->sh_name)) { \
vg_assert(di->sec##_size == shdr->sh_size); \
vg_assert(di->sec##_avma + shdr->sh_addr + seg##_dbias); \
+ /* Assume we have a correct value for the main */ \
+ /* object's bias. Use that to derive the debuginfo */ \
+ /* object's bias, by adding the difference in SVMAs */ \
+ /* for the corresponding sections in the two files. */ \
+ /* That should take care of all prelinking effects. */ \
di->sec##_debug_svma = shdr->sh_addr; \
- di->sec##_debug_bias = seg##_dbias; \
+ di->sec##_debug_bias \
+ = di->sec##_bias + \
+ di->sec##_svma - di->sec##_debug_svma; \
TRACE_SYMTAB("acquiring ." #sec " debug svma = %#lx .. %#lx\n", \
di->sec##_debug_svma, \
di->sec##_debug_svma + di->sec##_size - 1); \
|
|
From: <sv...@va...> - 2011-06-07 21:57:17
|
Author: tom
Date: 2011-06-07 22:52:26 +0100 (Tue, 07 Jun 2011)
New Revision: 11800
Log:
Add glibc 2.14 support. Patch from Dmitry Djachenko <di...@gm...>.
Modified:
trunk/configure.in
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2011-06-07 21:42:07 UTC (rev 11799)
+++ trunk/configure.in 2011-06-07 21:52:26 UTC (rev 11800)
@@ -779,6 +779,13 @@
DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
;;
+ 2.14)
+ AC_MSG_RESULT(2.14 family)
+ AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
+ DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ ;;
aix5)
AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3)
AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3])
@@ -792,7 +799,7 @@
*)
AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.13])
+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14])
AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION])
AC_MSG_ERROR([or Darwin libc])
;;
|
|
From: <sv...@va...> - 2011-06-07 21:46:58
|
Author: sewardj
Date: 2011-06-07 22:42:07 +0100 (Tue, 07 Jun 2011)
New Revision: 11799
Log:
find_nsegment_idx: double size of the lookup cache in an attempt
to mitigate the probable increase in miss rates resulting from
r11798 (which causes increased numbers of such queries).
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2011-06-07 21:39:28 UTC (rev 11798)
+++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2011-06-07 21:42:07 UTC (rev 11799)
@@ -1146,7 +1146,7 @@
inline static Int find_nsegment_idx ( Addr a )
{
-# define N_CACHE 63
+# define N_CACHE 131 /*prime*/
static Addr cache_pageno[N_CACHE];
static Int cache_segidx[N_CACHE];
static Bool cache_inited = False;
|
|
From: <sv...@va...> - 2011-06-07 21:44:20
|
Author: sewardj
Date: 2011-06-07 22:39:28 +0100 (Tue, 07 Jun 2011)
New Revision: 11798
Log:
Add a fourth --smc-check= variant, --smc-check=all-non-file. This
adds self-modifying-code checks to all guest code taken from mappings
which are not file backed, but omits checks in code from file backed
mappings. This has the effect of giving complete smc-coverage of JIT
generated code -- since that is invariably generated into anonymous
mapped areas -- without burdening non-JIT generated code with such
checks. Running Firefox 6, --smc-check=all-non-file reduces by a
factor of between 3 and 10 the number of translations requiring a self
check, compared to --smc-check=all. These changes depend on the vex
interface changes in r2158.
Modified:
trunk/NEWS
trunk/coregrind/m_main.c
trunk/coregrind/m_translate.c
trunk/coregrind/pub_core_options.h
trunk/docs/xml/manual-core.xml
trunk/none/tests/cmdline1.stdout.exp
trunk/none/tests/cmdline2.stdout.exp
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/NEWS 2011-06-07 21:39:28 UTC (rev 11798)
@@ -4,6 +4,7 @@
- Added the --mod-funcname option to cg_diff.
- Further reduction in overheads caused by --smc-check=all, especially
on 64-bit targets.
+- new variant --smc-check=all-non-file
* IBM z/Architecture (s390x) running Linux
Valgrind can analyse 64-bit programs running on z/Architecture.
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/coregrind/m_main.c 2011-06-07 21:39:28 UTC (rev 11798)
@@ -171,8 +171,10 @@
" part of the path after 'string'. Allows removal\n"
" of path prefixes. Use this flag multiple times\n"
" to specify a set of prefixes to remove.\n"
-" --smc-check=none|stack|all checks for self-modifying code: none,\n"
-" only for code found in stacks, or all [stack]\n"
+" --smc-check=none|stack|all|all-non-file [stack]\n"
+" checks for self-modifying code: none, only for\n"
+" code found in stacks, for all code, or for all\n"
+" code except that from file-backed mappings\n"
" --read-var-info=yes|no read debug info on stack and global variables\n"
" and use it to print better error messages in\n"
" tools that make use of it (Memcheck, Helgrind,\n"
@@ -519,6 +521,9 @@
Vg_SmcStack);
else if VG_XACT_CLO(arg, "--smc-check=all", VG_(clo_smc_check),
Vg_SmcAll);
+ else if VG_XACT_CLO(arg, "--smc-check=all-non-file",
+ VG_(clo_smc_check),
+ Vg_SmcAllNonFile);
else if VG_STR_CLO (arg, "--kernel-variant", VG_(clo_kernel_variant)) {}
Modified: trunk/coregrind/m_translate.c
===================================================================
--- trunk/coregrind/m_translate.c 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/coregrind/m_translate.c 2011-06-07 21:39:28 UTC (rev 11798)
@@ -729,41 +729,87 @@
}
-/* Is a self-check required for a translation of a guest address
- inside segment SEG when requested by thread TID ? */
+/* Produce a bitmask stating which of the supplied extents needs a
+ self-check. See documentation of
+ VexTranslateArgs::needs_self_check for more details about the
+ return convention. */
-static Bool self_check_required ( NSegment const* seg, ThreadId tid )
+static UInt needs_self_check ( void* closureV,
+ VexGuestExtents* vge )
{
-#if defined(VGO_darwin)
- // GrP fixme hack - dyld i386 IMPORT gets rewritten
- // to really do this correctly, we'd need to flush the
- // translation cache whenever a segment became +WX
- if (seg->hasX && seg->hasW) {
- return True;
+ VgCallbackClosure* closure = (VgCallbackClosure*)closureV;
+ UInt i, bitset;
+
+ vg_assert(vge->n_used >= 1 && vge->n_used <= 3);
+ bitset = 0;
+
+ for (i = 0; i < vge->n_used; i++) {
+ Bool check = False;
+ Addr addr = (Addr)vge->base[i];
+ SizeT len = (SizeT)vge->len[i];
+ NSegment const* segA = NULL;
+
+# if defined(VGO_darwin)
+ // GrP fixme hack - dyld i386 IMPORT gets rewritten.
+ // To really do this correctly, we'd need to flush the
+ // translation cache whenever a segment became +WX.
+ segA = VG_(am_find_nsegment)(addr);
+ if (segA && segA->hasX && segA->hasW)
+ check = True;
+# endif
+
+ if (!check) {
+ switch (VG_(clo_smc_check)) {
+ case Vg_SmcNone:
+ /* never check (except as per Darwin hack above) */
+ break;
+ case Vg_SmcAll:
+ /* always check */
+ check = True;
+ break;
+ case Vg_SmcStack: {
+ /* check if the address is in the same segment as this
+ thread's stack pointer */
+ Addr sp = VG_(get_SP)(closure->tid);
+ if (!segA) {
+ segA = VG_(am_find_nsegment)(addr);
+ }
+ NSegment const* segSP = VG_(am_find_nsegment)(sp);
+ if (segA && segSP && segA == segSP)
+ check = True;
+ break;
+ }
+ case Vg_SmcAllNonFile: {
+ /* check if any part of the extent is not in a
+ file-mapped segment */
+ if (!segA) {
+ segA = VG_(am_find_nsegment)(addr);
+ }
+ if (segA && segA->kind == SkFileC && segA->start <= addr
+ && (len == 0 || addr + len <= segA->end + 1)) {
+ /* in a file-mapped segment; skip the check */
+ } else {
+ check = True;
+ }
+ break;
+ }
+ default:
+ vg_assert(0);
+ }
+ }
+
+ if (check)
+ bitset |= (1 << i);
}
-#endif
- switch (VG_(clo_smc_check)) {
- case Vg_SmcNone: return False;
- case Vg_SmcAll: return True;
- case Vg_SmcStack:
- return seg
- ? (seg->start <= VG_(get_SP)(tid)
- && VG_(get_SP)(tid)+sizeof(Word)-1 <= seg->end)
- : False;
- break;
- default:
- vg_assert2(0, "unknown VG_(clo_smc_check) value");
- }
+
+ return bitset;
}
/* This is a callback passed to LibVEX_Translate. It stops Vex from
chasing into function entry points that we wish to redirect.
Chasing across them obviously defeats the redirect mechanism, with
- bad effects for Memcheck, Addrcheck, and possibly others.
-
- Also, we must stop Vex chasing into blocks for which we might want
- to self checking.
+ bad effects for Memcheck, Helgrind, DRD, Massif, and possibly others.
*/
static Bool chase_into_ok ( void* closureV, Addr64 addr64 )
{
@@ -1284,7 +1330,6 @@
Addr64 addr;
T_Kind kind;
Int tmpbuf_used, verbosity, i;
- Bool do_self_check;
Bool (*preamble_fn)(void*,IRSB*);
VexArch vex_arch;
VexArchInfo vex_archinfo;
@@ -1392,9 +1437,6 @@
return False;
}
- /* Do we want a self-checking translation? */
- do_self_check = self_check_required( seg, tid );
-
/* True if a debug trans., or if bit N set in VG_(clo_trace_codegen). */
verbosity = 0;
if (debugging_translation) {
@@ -1509,7 +1551,7 @@
vta.finaltidy = VG_(needs).final_IR_tidy_pass
? VG_(tdict).tool_final_IR_tidy_pass
: NULL;
- vta.do_self_check = do_self_check;
+ vta.needs_self_check = needs_self_check;
vta.traceflags = verbosity;
/* Set up the dispatch-return info. For archs without a link
@@ -1557,7 +1599,8 @@
/* Sheesh. Finally, actually _do_ the translation! */
tres = LibVEX_Translate ( &vta );
- vg_assert(tres == VexTransOK);
+ vg_assert(tres.status == VexTransOK);
+ vg_assert(tres.n_sc_extents >= 0 && tres.n_sc_extents <= 3);
vg_assert(tmpbuf_used <= N_TMPBUF);
vg_assert(tmpbuf_used > 0);
@@ -1594,7 +1637,7 @@
nraddr,
(Addr)(&tmpbuf[0]),
tmpbuf_used,
- do_self_check );
+ tres.n_sc_extents > 0 );
} else {
VG_(add_to_unredir_transtab)( &vge,
nraddr,
Modified: trunk/coregrind/pub_core_options.h
===================================================================
--- trunk/coregrind/pub_core_options.h 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/coregrind/pub_core_options.h 2011-06-07 21:39:28 UTC (rev 11798)
@@ -228,7 +228,9 @@
Vg_SmcNone, // never generate self-checking translations
Vg_SmcStack, // generate s-c-t's for code found in stacks
// (this is the default)
- Vg_SmcAll // make all translations self-checking.
+ Vg_SmcAll, // make all translations self-checking.
+ Vg_SmcAllNonFile // make all translations derived from
+ // non-file-backed memory self checking
}
VgSmc;
Modified: trunk/docs/xml/manual-core.xml
===================================================================
--- trunk/docs/xml/manual-core.xml 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/docs/xml/manual-core.xml 2011-06-07 21:39:28 UTC (rev 11798)
@@ -1444,7 +1444,7 @@
<varlistentry id="opt.smc-check" xreflabel="--smc-check">
<term>
- <option><![CDATA[--smc-check=<none|stack|all> [default: stack] ]]></option>
+ <option><![CDATA[--smc-check=<none|stack|all|all-non-file> [default: stack] ]]></option>
</term>
<listitem>
<para>This option controls Valgrind's detection of self-modifying
@@ -1453,33 +1453,50 @@
continue to execute the translations it made for the old code. This
will likely lead to incorrect behaviour and/or crashes.</para>
- <para>Valgrind has three levels of self-modifying code detection:
+ <para>Valgrind has four levels of self-modifying code detection:
no detection, detect self-modifying code on the stack (which is used by
- GCC to implement nested functions), or detect self-modifying code
- everywhere. Note that the default option will catch the vast majority
+ GCC to implement nested functions), detect self-modifying code
+ everywhere, and detect self-modifying code everywhere except in
+ file-backed mappings.
+
+ Note that the default option will catch the vast majority
of cases. The main case it will not catch is programs such as JIT
compilers that dynamically generate code <emphasis>and</emphasis>
subsequently overwrite part or all of it. Running with
- <varname>all</varname> will slow Valgrind down noticeably. Running with
+ <varname>all</varname> will slow Valgrind down noticeably.
+ Running with
<varname>none</varname> will rarely speed things up, since very little
code gets put on the stack for most programs. The
- <function>VALGRIND_DISCARD_TRANSLATIONS</function> client request is
- an alternative to <option>--smc-check=all</option> that requires more
- effort but is much faster.
+ <function>VALGRIND_DISCARD_TRANSLATIONS</function> client
+ request is an alternative to <option>--smc-check=all</option>
+ that requires more programmer effort but allows Valgrind to run
+ your program faster, by telling it precisely when translations
+ need to be re-made.
<!-- commented out because it causes broken links in the man page
; see <xref
linkend="manual-core-adv.clientreq"/> for more details.
-->
</para>
+ <para><option>--smc-check=all-non-file</option> provides a
+ cheaper but more limited version
+ of <option>--smc-check=all</option>. It adds checks to any
+ translations that do not originate from file-backed memory
+ mappings. Typical applications that generate code, for example
+ JITs in web browsers, generate code into anonymous mmaped areas,
+ whereas the "fixed" code of the browser always lives in
+ file-backed mappings. <option>--smc-check=all-non-file</option>
+ takes advantage of this observation, limiting the overhead of
+ checking to code which is likely to be JIT generated.</para>
+
<para>Some architectures (including ppc32, ppc64 and ARM) require
programs which create code at runtime to flush the instruction
cache in between code generation and first use. Valgrind
observes and honours such instructions. Hence, on ppc32/Linux,
ppc64/Linux and ARM/Linux, Valgrind always provides complete, transparent
support for self-modifying code. It is only on platforms such as
- x86/Linux, AMD64/Linux and x86/Darwin that you need to use this
- option.</para>
+ x86/Linux, AMD64/Linux, x86/Darwin and AMD64/Darwin
+ that you need to use this option.</para>
</listitem>
</varlistentry>
Modified: trunk/none/tests/cmdline1.stdout.exp
===================================================================
--- trunk/none/tests/cmdline1.stdout.exp 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/none/tests/cmdline1.stdout.exp 2011-06-07 21:39:28 UTC (rev 11798)
@@ -57,8 +57,10 @@
part of the path after 'string'. Allows removal
of path prefixes. Use this flag multiple times
to specify a set of prefixes to remove.
- --smc-check=none|stack|all checks for self-modifying code: none,
- only for code found in stacks, or all [stack]
+ --smc-check=none|stack|all|all-non-file [stack]
+ checks for self-modifying code: none, only for
+ code found in stacks, for all code, or for all
+ code except that from file-backed mappings
--read-var-info=yes|no read debug info on stack and global variables
and use it to print better error messages in
tools that make use of it (Memcheck, Helgrind,
Modified: trunk/none/tests/cmdline2.stdout.exp
===================================================================
--- trunk/none/tests/cmdline2.stdout.exp 2011-06-05 10:01:48 UTC (rev 11797)
+++ trunk/none/tests/cmdline2.stdout.exp 2011-06-07 21:39:28 UTC (rev 11798)
@@ -57,8 +57,10 @@
part of the path after 'string'. Allows removal
of path prefixes. Use this flag multiple times
to specify a set of prefixes to remove.
- --smc-check=none|stack|all checks for self-modifying code: none,
- only for code found in stacks, or all [stack]
+ --smc-check=none|stack|all|all-non-file [stack]
+ checks for self-modifying code: none, only for
+ code found in stacks, for all code, or for all
+ code except that from file-backed mappings
--read-var-info=yes|no read debug info on stack and global variables
and use it to print better error messages in
tools that make use of it (Memcheck, Helgrind,
|
|
From: <sv...@va...> - 2011-06-07 21:33:30
|
Author: sewardj
Date: 2011-06-07 22:28:38 +0100 (Tue, 07 Jun 2011)
New Revision: 2158
Log:
Change the interface to LibVEX_Translate slightly, so as to make the
generation of self-modifying-code checks more flexible. With this
change, the decision about which parts (extents) of the newly created
IRSB need self-checks is deferred until after the IRSB has been
created. This allows the caller to decide, for each extent
individually, whether it needs a self-check, and the caller can make
those decisions based on the addresses of the guest instructions in
the extents.
Modified:
trunk/priv/guest_generic_bb_to_IR.c
trunk/priv/guest_generic_bb_to_IR.h
trunk/priv/main_main.c
trunk/pub/libvex.h
trunk/test_main.c
Modified: trunk/priv/guest_generic_bb_to_IR.c
===================================================================
--- trunk/priv/guest_generic_bb_to_IR.c 2011-06-06 10:17:46 UTC (rev 2157)
+++ trunk/priv/guest_generic_bb_to_IR.c 2011-06-07 21:28:38 UTC (rev 2158)
@@ -112,9 +112,17 @@
dis_instr_fn is the arch-specific fn to disassemble on function; it
is this that does the real work.
- do_self_check indicates that the caller needs a self-checking
- translation.
+ needs_self_check is a callback used to ask the caller which of the
+ extents, if any, a self check is required for. The returned value
+ is a bitmask with a 1 in position i indicating that the i'th extent
+ needs a check. Since there can be at most 3 extents, the returned
+ values must be between 0 and 7.
+ The number of extents which did get a self check (0 to 3) is put in
+ n_sc_extents. The caller already knows this because it told us
+ which extents to add checks for, via the needs_self_check callback,
+ but we ship the number back out here for the caller's convenience.
+
preamble_function is a callback which allows the caller to add
its own IR preamble (following the self-check, if any). May be
NULL. If non-NULL, the IRSB under construction is handed to
@@ -132,27 +140,31 @@
(In fact it's a VgInstrumentClosure.)
*/
-IRSB* bb_to_IR ( /*OUT*/VexGuestExtents* vge,
- /*IN*/ void* callback_opaque,
- /*IN*/ DisOneInstrFn dis_instr_fn,
- /*IN*/ UChar* guest_code,
- /*IN*/ Addr64 guest_IP_bbstart,
- /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
- /*IN*/ Bool host_bigendian,
- /*IN*/ VexArch arch_guest,
- /*IN*/ VexArchInfo* archinfo_guest,
- /*IN*/ VexAbiInfo* abiinfo_both,
- /*IN*/ IRType guest_word_type,
- /*IN*/ Bool do_self_check,
- /*IN*/ Bool (*preamble_function)(void*,IRSB*),
- /*IN*/ Int offB_TISTART,
- /*IN*/ Int offB_TILEN )
+IRSB* bb_to_IR (
+ /*OUT*/VexGuestExtents* vge,
+ /*OUT*/UInt* n_sc_extents,
+ /*IN*/ void* callback_opaque,
+ /*IN*/ DisOneInstrFn dis_instr_fn,
+ /*IN*/ UChar* guest_code,
+ /*IN*/ Addr64 guest_IP_bbstart,
+ /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
+ /*IN*/ Bool host_bigendian,
+ /*IN*/ VexArch arch_guest,
+ /*IN*/ VexArchInfo* archinfo_guest,
+ /*IN*/ VexAbiInfo* abiinfo_both,
+ /*IN*/ IRType guest_word_type,
+ /*IN*/ UInt (*needs_self_check)(void*,VexGuestExtents*),
+ /*IN*/ Bool (*preamble_function)(void*,IRSB*),
+ /*IN*/ Int offB_TISTART,
+ /*IN*/ Int offB_TILEN
+ )
{
Long delta;
Int i, n_instrs, first_stmt_idx;
Bool resteerOK, need_to_put_IP, debug_print;
DisResult dres;
IRStmt* imark;
+ IRStmt* nop;
static Int n_resteers = 0;
Int d_resteers = 0;
Int selfcheck_idx = 0;
@@ -165,11 +177,6 @@
debug_print = toBool(vex_traceflags & VEX_TRACE_FE);
- /* Note: for adler32 to work without % operation for the self
- check, need to limit length of stuff it scans to 5552 bytes.
- Therefore limiting the max bb len to 100 insns seems generously
- conservative. */
-
/* check sanity .. */
vassert(sizeof(HWord) == sizeof(void*));
vassert(vex_control.guest_max_insns >= 1);
@@ -182,6 +189,7 @@
vge->n_used = 1;
vge->base[0] = guest_IP_bbstart;
vge->len[0] = 0;
+ *n_sc_extents = 0;
/* And a new IR superblock to dump the result into. */
irsb = emptyIRSB();
@@ -191,24 +199,21 @@
delta = 0;
n_instrs = 0;
- /* Guest addresses as IRConsts. Used in the two self-checks
- generated. */
- if (do_self_check) {
- guest_IP_bbstart_IRConst
- = guest_word_type==Ity_I32
- ? IRConst_U32(toUInt(guest_IP_bbstart))
- : IRConst_U64(guest_IP_bbstart);
- }
+ /* Guest addresses as IRConsts. Used in self-checks to specify the
+ restart-after-discard point. */
+ guest_IP_bbstart_IRConst
+ = guest_word_type==Ity_I32
+ ? IRConst_U32(toUInt(guest_IP_bbstart))
+ : IRConst_U64(guest_IP_bbstart);
- /* If asked to make a self-checking translation, leave 15 spaces in
- which to put the check statements (up to 3 extents, and 5 stmts
- required for each). We'll fill them in later when we know the
- extents and checksums of the areas to check. */
- if (do_self_check) {
- selfcheck_idx = irsb->stmts_used;
- for (i = 0; i < 3 * 5; i++)
- addStmtToIRSB( irsb, IRStmt_NoOp() );
- }
+ /* Leave 15 spaces in which to put the check statements for a self
+ checking translation (up to 3 extents, and 5 stmts required for
+ each). We won't know until later the extents and checksums of
+ the areas, if any, that need to be checked. */
+ nop = IRStmt_NoOp();
+ selfcheck_idx = irsb->stmts_used;
+ for (i = 0; i < 3 * 5; i++)
+ addStmtToIRSB( irsb, nop );
/* If the caller supplied a function to add its own preamble, use
it now. */
@@ -218,7 +223,7 @@
/* The callback has completed the IR block without any guest
insns being disassembled into it, so just return it at
this point, even if a self-check was requested - as there
- is nothing to self-check. The five self-check no-ops will
+ is nothing to self-check. The 15 self-check no-ops will
still be in place, but they are harmless. */
return irsb;
}
@@ -423,7 +428,8 @@
done:
/* We're done. The only thing that might need attending to is that
- a self-checking preamble may need to be created.
+ a self-checking preamble may need to be created. If so it gets
+ placed in the 15 slots reserved above.
The scheme is to compute a rather crude checksum of the code
we're making a translation of, and add to the IR a call to a
@@ -432,23 +438,26 @@
match. This is obviously very expensive and considerable
efforts are made to speed it up:
- * the checksum is computed from all the 32-bit words that
- overlap the translated code. That means it could depend on up
- to 3 bytes before and 3 bytes after which aren't part of the
- translated area, and so if those change then we'll
- unnecessarily have to discard and retranslate. This seems
- like a pretty remote possibility and it seems as if the
- benefit of not having to deal with the ends of the range at
- byte precision far outweigh any possible extra translations
- needed.
+ * the checksum is computed from all the naturally aligned
+ host-sized words that overlap the translated code. That means
+ it could depend on up to 7 bytes before and 7 bytes after
+ which aren't part of the translated area, and so if those
+ change then we'll unnecessarily have to discard and
+ retranslate. This seems like a pretty remote possibility and
+ it seems as if the benefit of not having to deal with the ends
+ of the range at byte precision far outweigh any possible extra
+ translations needed.
* there's a generic routine and 12 specialised cases, which
handle the cases of 1 through 12-word lengths respectively.
They seem to cover about 90% of the cases that occur in
practice.
+
+ We ask the caller, via needs_self_check, which of the 3 vge
+ extents needs a check, and only generate check code for those
+ that do.
*/
- if (do_self_check) {
-
+ {
Addr64 base2check;
UInt len2check;
HWord expectedhW;
@@ -462,13 +471,29 @@
UInt host_word_szB = sizeof(HWord);
IRType host_word_type = Ity_INVALID;
+ VexGuestExtents vge_tmp = *vge;
+ UInt extents_needing_check
+ = needs_self_check(callback_opaque, &vge_tmp);
+
if (host_word_szB == 4) host_word_type = Ity_I32;
if (host_word_szB == 8) host_word_type = Ity_I64;
vassert(host_word_type != Ity_INVALID);
vassert(vge->n_used >= 1 && vge->n_used <= 3);
+
+ /* Caller shouldn't claim that nonexistent extents need a
+ check. */
+ vassert((extents_needing_check >> vge->n_used) == 0);
+
for (i = 0; i < vge->n_used; i++) {
+ /* Do we need to generate a check for this extent? */
+ if ((extents_needing_check & (1 << i)) == 0)
+ continue;
+
+ /* Tell the caller */
+ (*n_sc_extents)++;
+
/* the extent we're generating a check for */
base2check = vge->base[i];
len2check = vge->len[i];
@@ -491,7 +516,7 @@
vassert(hWs_to_check > 0
&& hWs_to_check < 1004/*arbitrary*/ / host_word_szB);
- /* vex_printf("%lx %lx %ld\n", first_w32, last_w32, w32s_to_check); */
+ /* vex_printf("%lx %lx %ld\n", first_hW, last_hW, hWs_to_check); */
if (host_word_szB == 8) {
fn_generic = (VEX_REGPARM(2) HWord(*)(HWord, HWord))
@@ -662,7 +687,7 @@
failure actually happened in. */
guest_IP_bbstart_IRConst
);
- }
+ } /* for (i = 0; i < vge->n_used; i++) */
}
return irsb;
Modified: trunk/priv/guest_generic_bb_to_IR.h
===================================================================
--- trunk/priv/guest_generic_bb_to_IR.h 2011-06-06 10:17:46 UTC (rev 2157)
+++ trunk/priv/guest_generic_bb_to_IR.h 2011-06-07 21:28:38 UTC (rev 2158)
@@ -158,21 +158,24 @@
/* See detailed comment in bb_to_IR.c. */
extern
-IRSB* bb_to_IR ( /*OUT*/VexGuestExtents* vge,
- /*IN*/ void* closure_opaque,
- /*IN*/ DisOneInstrFn dis_instr_fn,
- /*IN*/ UChar* guest_code,
- /*IN*/ Addr64 guest_IP_bbstart,
- /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
- /*IN*/ Bool host_bigendian,
- /*IN*/ VexArch arch_guest,
- /*IN*/ VexArchInfo* archinfo_guest,
- /*IN*/ VexAbiInfo* abiinfo_both,
- /*IN*/ IRType guest_word_type,
- /*IN*/ Bool do_self_check,
- /*IN*/ Bool (*preamble_function)(void*,IRSB*),
- /*IN*/ Int offB_TISTART,
- /*IN*/ Int offB_TILEN );
+IRSB* bb_to_IR (
+ /*OUT*/VexGuestExtents* vge,
+ /*OUT*/UInt* n_sc_extents,
+ /*IN*/ void* callback_opaque,
+ /*IN*/ DisOneInstrFn dis_instr_fn,
+ /*IN*/ UChar* guest_code,
+ /*IN*/ Addr64 guest_IP_bbstart,
+ /*IN*/ Bool (*chase_into_ok)(void*,Addr64),
+ /*IN*/ Bool host_bigendian,
+ /*IN*/ VexArch arch_guest,
+ /*IN*/ VexArchInfo* archinfo_guest,
+ /*IN*/ VexAbiInfo* abiinfo_both,
+ /*IN*/ IRType guest_word_type,
+ /*IN*/ UInt (*needs_self_check)(void*,VexGuestExtents*),
+ /*IN*/ Bool (*preamble_function)(void*,IRSB*),
+ /*IN*/ Int offB_TISTART,
+ /*IN*/ Int offB_TILEN
+ );
#endif /* ndef __VEX_GUEST_GENERIC_BB_TO_IR_H */
Modified: trunk/priv/main_main.c
===================================================================
--- trunk/priv/main_main.c 2011-06-06 10:17:46 UTC (rev 2157)
+++ trunk/priv/main_main.c 2011-06-07 21:28:38 UTC (rev 2158)
@@ -483,6 +483,11 @@
vpanic("LibVEX_Translate: unsupported guest insn set");
}
+ /* Set up result struct. */
+ VexTranslateResult res;
+ res.status = VexTransOK;
+ res.n_sc_extents = 0;
+
/* yet more sanity checks ... */
if (vta->arch_guest == vta->arch_host) {
/* doesn't necessarily have to be true, but if it isn't it means
@@ -499,6 +504,7 @@
"------------------------\n\n");
irsb = bb_to_IR ( vta->guest_extents,
+ &res.n_sc_extents,
vta->callback_opaque,
disInstrFn,
vta->guest_bytes,
@@ -509,7 +515,7 @@
&vta->archinfo_guest,
&vta->abiinfo_both,
guest_word_type,
- vta->do_self_check,
+ vta->needs_self_check,
vta->preamble_function,
offB_TISTART,
offB_TILEN );
@@ -520,7 +526,7 @@
/* Access failure. */
vexSetAllocModeTEMP_and_clear();
vex_traceflags = 0;
- return VexTransAccessFail;
+ res.status = VexTransAccessFail; return res;
}
vassert(vta->guest_extents->n_used >= 1 && vta->guest_extents->n_used <= 3);
@@ -636,7 +642,10 @@
}
/* HACK */
- if (0) { *(vta->host_bytes_used) = 0; return VexTransOK; }
+ if (0) {
+ *(vta->host_bytes_used) = 0;
+ res.status = VexTransOK; return res;
+ }
/* end HACK */
if (vex_traceflags & VEX_TRACE_VCODE)
@@ -684,7 +693,10 @@
}
/* HACK */
- if (0) { *(vta->host_bytes_used) = 0; return VexTransOK; }
+ if (0) {
+ *(vta->host_bytes_used) = 0;
+ res.status = VexTransOK; return res;
+ }
/* end HACK */
/* Assemble */
@@ -713,7 +725,8 @@
if (out_used + j > vta->host_bytes_size) {
vexSetAllocModeTEMP_and_clear();
vex_traceflags = 0;
- return VexTransOutputFull;
+ res.status = VexTransOutputFull;
+ return res;
}
for (k = 0; k < j; k++) {
vta->host_bytes[out_used] = insn_bytes[k];
@@ -728,7 +741,8 @@
vexSetAllocModeTEMP_and_clear();
vex_traceflags = 0;
- return VexTransOK;
+ res.status = VexTransOK;
+ return res;
}
Modified: trunk/pub/libvex.h
===================================================================
--- trunk/pub/libvex.h 2011-06-06 10:17:46 UTC (rev 2157)
+++ trunk/pub/libvex.h 2011-06-07 21:28:38 UTC (rev 2158)
@@ -456,10 +456,12 @@
/* Describes the outcome of a translation attempt. */
typedef
- enum {
- VexTransOK,
- VexTransAccessFail,
- VexTransOutputFull
+ struct {
+ /* overall status */
+ enum { VexTransOK,
+ VexTransAccessFail, VexTransOutputFull } status;
+ /* The number of extents that have a self-check (0 to 3) */
+ UInt n_sc_extents;
}
VexTranslateResult;
@@ -535,8 +537,13 @@
IRSB* (*finaltidy) ( IRSB* );
- /* IN: should this translation be self-checking? default: False */
- Bool do_self_check;
+ /* IN: a callback used to ask the caller which of the extents,
+ if any, a self check is required for. The returned value is
+ a bitmask with a 1 in position i indicating that the i'th
+ extent needs a check. Since there can be at most 3 extents,
+ the returned values must be between 0 and 7. */
+ UInt (*needs_self_check)( /*callback_opaque*/void*,
+ VexGuestExtents* );
/* IN: optionally, a callback which allows the caller to add its
own IR preamble following the self-check and any other
Modified: trunk/test_main.c
===================================================================
--- trunk/test_main.c 2011-06-06 10:17:46 UTC (rev 2157)
+++ trunk/test_main.c 2011-06-07 21:28:38 UTC (rev 2158)
@@ -84,7 +84,12 @@
IRType gWordTy, IRType hWordTy );
#endif
-static Bool chase_into_not_ok ( void* opaque, Addr64 dst ) { return False; }
+static Bool chase_into_not_ok ( void* opaque, Addr64 dst ) {
+ return False;
+}
+static UInt needs_self_check ( void* opaque, VexGuestExtents* vge ) {
+ return 0;
+}
int main ( int argc, char** argv )
{
@@ -210,11 +215,12 @@
vta.instrument1 = mc_instrument;
vta.instrument2 = NULL;
#endif
- vta.do_self_check = False;
+ vta.needs_self_check = needs_self_check;
vta.preamble_function = NULL;
vta.traceflags = TEST_FLAGS;
#if 1 /* x86, amd64 hosts */
- vta.dispatch = (void*)0x12345678;
+ vta.dispatch_unassisted = (void*)0x12345678;
+ vta.dispatch_assisted = (void*)0x12345678;
#else /* ppc32, ppc64 hosts */
vta.dispatch = NULL;
#endif
@@ -224,9 +230,10 @@
for (i = 0; i < TEST_N_ITERS; i++)
tres = LibVEX_Translate ( &vta );
- if (tres != VexTransOK)
- printf("\ntres = %d\n", (Int)tres);
- assert(tres == VexTransOK);
+ if (tres.status != VexTransOK)
+ printf("\ntres = %d\n", (Int)tres.status);
+ assert(tres.status == VexTransOK);
+ assert(tres.n_sc_extents == 0);
assert(vge.n_used == 1);
assert((UInt)(vge.len[0]) == orig_nbytes);
|
|
From: Дмитрий Д. <di...@gm...> - 2011-06-07 19:15:33
|
Fedora 15 / glibc-2.14 'make regtest' FAIL with err.message: gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../include -I../../../coregrind -I../../../include -I../../../VEX/pub -DVGA_amd64=1 -DVGO_linux=1 -DVGP_amd64_linux=1 -Winline -Wall -Wshadow -g -m64 -Wno-long-long -Wno-pointer-sign -fno-stack-protector -MT stack_switch.o -MD -MP -MF .deps/stack_switch.Tpo -c -o stack_switch.o stack_switch.c stack_switch.c: In function 'main': stack_switch.c:47:4: warning: implicit declaration of function 'clone' [-Wimplicit-function-declaration] stack_switch.c:47:51: error: 'CLONE_VM' undeclared (first use in this function) stack_switch.c:47:51: note: each undeclared identifier is reported only once for each function it appears in stack_switch.c:47:60: error: 'CLONE_FS' undeclared (first use in this function) stack_switch.c:47:69: error: 'CLONE_FILES' undeclared (first use in this function) stack_switch.c:47:81: error: 'CLONE_SIGHAND' undeclared (first use in this function) stack_switch.c:36:10: warning: variable 'pid' set but not used [-Wunused-but-set-variable] make[5]: *** [stack_switch.o] Error 1 i don't know about root of problem. May be update to glibc-2.14... i try to build valgrind-trunk only today after update to glibc-2.14 Trivial patch solve problem for me. https://bugs.kde.org/show_bug.cgi?id=275151 $ svn diff Index: memcheck/tests/linux/stack_switch.c =================================================================== --- memcheck/tests/linux/stack_switch.c (revision 11797) +++ memcheck/tests/linux/stack_switch.c (working copy) @@ -1,5 +1,6 @@ #define _XOPEN_SOURCE 600 #define _BSD_SOURCE +#define _GNU_SOURCE #include <stdio.h> |
|
From: Дмитрий Д. <di...@gm...> - 2011-06-07 18:52:19
|
Fedora 15 after last update (2011-jun-07) has glibc-2.14. configure.in has no support for glibc-2.14 and FAIL Bug filed: https://bugs.kde.org/show_bug.cgi?id=275148 Patch is trivial and similar to rev.11534 (add glibc-2.13 support)\ With this patch i can configure and build V. Dmitry $ svn diff Index: configure.in =================================================================== --- configure.in (revision 11797) +++ configure.in (working copy) @@ -779,6 +779,13 @@ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" ;; + 2.14) + AC_MSG_RESULT(2.14 family) + AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x]) + DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}" + DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}" + ;; aix5) AC_MSG_RESULT(AIX 5.1 or 5.2 or 5.3) AC_DEFINE([AIX5_LIBC], 1, [Define to 1 if you're using AIX 5.1 or 5.2 or 5.3]) @@ -792,7 +799,7 @@ *) AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}]) - AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.13]) + AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.14]) AC_MSG_ERROR([or AIX 5.1 or 5.2 or 5.3 GLIBC_VERSION]) AC_MSG_ERROR([or Darwin libc]) ;; |