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
(12) |
2
(11) |
3
(8) |
|
4
(9) |
5
(10) |
6
(18) |
7
(8) |
8
(12) |
9
(23) |
10
(14) |
|
11
(15) |
12
(31) |
13
(45) |
14
(28) |
15
(20) |
16
(16) |
17
(9) |
|
18
(18) |
19
(26) |
20
(49) |
21
(14) |
22
(18) |
23
(24) |
24
(28) |
|
25
(39) |
26
(17) |
27
(27) |
28
(27) |
29
(14) |
30
(44) |
|
|
From: <sv...@va...> - 2005-09-20 23:09:02
|
Author: sewardj
Date: 2005-09-21 00:09:00 +0100 (Wed, 21 Sep 2005)
New Revision: 4714
Log:
The static linking scheme broke --trace-children=3Dyes, because there
was no way to convey to the stage2's the identity of stage1 (the
launcher) for the recursive process starts.
Therefore do this by passing the name of the launcher in
VALGRINDSTAGE1.
This makes it possible to run OOo on memcheck again.
Modified:
branches/ASPACEM/coregrind/m_launcher.c
branches/ASPACEM/coregrind/m_libcproc.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/pub_core_libcproc.h
Modified: branches/ASPACEM/coregrind/m_launcher.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_launcher.c 2005-09-20 23:06:34 UTC (rev =
4713)
+++ branches/ASPACEM/coregrind/m_launcher.c 2005-09-20 23:09:00 UTC (rev =
4714)
@@ -48,20 +48,33 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <assert.h>
=20
=20
+#define PATH_MAX 4096 /* POSIX refers to this a lot but I dunno
+ where it is defined */
+
+static void barf ( char* str )
+{
+ fprintf(stderr, "valgrind: Cannot continue: %s\n", str );
+ exit(1);
+}
+
/* Where we expect to find all our aux files */
static const char *valgrind_lib =3D VG_LIBDIR;
=20
int main(int argc, char** argv, char** envp)
{
- int i, loglevel;
+ int i, j, loglevel, r;
Int vg_argc;
Char **vg_argv;
char **cl_argv;
const char *toolname =3D NULL;
const char *cp;
char *toolfile;
+ char stage1_name[PATH_MAX+1];
+ char* new_line;
+ char** new_env;
=20
/* Start the debugging-log system ASAP. First find out how many=20
"-d"s were specified. This is a pre-scan of the command line. */
@@ -96,19 +109,53 @@
toolname =3D "memcheck";
}
=20
+ /* Figure out the name of this executable, so we can tell
+ stage2. */
+ memset(stage1_name, 0, PATH_MAX+1);
+ r =3D readlink("/proc/self/exe", stage1_name, PATH_MAX);
+ if (r =3D=3D -1)
+ barf("readlink(\"/proc/self/exe\") failed.");
+
+ r =3D setenv(VALGRINDSTAGE1, stage1_name, 1/*overwrite*/);
+ if (r !=3D 0)
+ barf("setenv(VALGRINDSTAGE1) failed.");
+
+ /* tediously augment the env: VALGRINDSTAGE1=3Dstage1_name */
+ new_line =3D malloc(strlen(VALGRINDSTAGE1) + 1=20
+ + strlen(stage1_name) + 1);
+ if (new_line =3D=3D NULL)
+ barf("malloc of new_line failed.");
+ strcpy(new_line, VALGRINDSTAGE1);
+ strcat(new_line, "=3D");
+ strcat(new_line, stage1_name);
+
+ for (j =3D 0; envp[j]; j++)
+ ;
+ new_env =3D malloc((j+2) * sizeof(char*));
+ if (new_env =3D=3D NULL)
+ barf("malloc of new_env failed.");
+ for (i =3D 0; i < j; i++)
+ new_env[i] =3D envp[i];
+ new_env[i++] =3D new_line;
+ new_env[i++] =3D NULL;
+ assert(i =3D=3D j+2);
+
+
cp =3D getenv(VALGRINDLIB);
=20
if (cp !=3D NULL)
valgrind_lib =3D cp;
=20
toolfile =3D malloc(strlen(valgrind_lib) + strlen(toolname) + 2);
+ if (toolfile =3D=3D NULL)
+ barf("malloc of toolfile failed.");
sprintf(toolfile, "%s/%s", valgrind_lib, toolname);
=20
VG_(debugLog)(1, "stage1", "launching %s\n", toolfile);
=20
- execve(toolfile, argv, envp);
+ execve(toolfile, argv, new_env);
=20
- fprintf(stderr, "valgrind: failed to start %s: %s\n",
+ fprintf(stderr, "valgrind: failed to start tool '%s': %s\n",
toolname, strerror(errno));
=20
exit(1);
Modified: branches/ASPACEM/coregrind/m_libcproc.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_libcproc.c 2005-09-20 23:06:34 UTC (rev =
4713)
+++ branches/ASPACEM/coregrind/m_libcproc.c 2005-09-20 23:09:00 UTC (rev =
4714)
@@ -216,6 +216,9 @@
// Remove VALGRIND_CLO variable.
VG_(env_unsetenv)(envp, VALGRINDCLO);
=20
+ // Remove VALGRIND_STAGE1 variable.
+ VG_(env_unsetenv)(envp, VALGRINDSTAGE1);
+
// XXX if variable becomes empty, remove it completely?
=20
VG_(arena_free)(VG_AR_CORE, buf);
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 23:06:34 UTC (rev 4713=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 23:09:00 UTC (rev 4714=
)
@@ -90,15 +90,6 @@
#define AT_SECURE 23 /* secure mode boolean */
#endif /* AT_SECURE */
=20
-/* redzone gap between client address space and shadow */
-#define REDZONE_SIZE (1 * 1024*1024)
-
-/* size multiple for client address space */
-#define CLIENT_SIZE_MULTIPLE (1 * 1024*1024)
-
-/* Proportion of client space for its heap (rest is for mmaps + stack) *=
/
-#define CLIENT_HEAP_PROPORTION 0.333
-
/* Number of file descriptors that Valgrind tries to reserve for
it's own use - just a small constant. */
#define N_RESERVED_FDS (10)
@@ -113,8 +104,8 @@
Startup stuff =20
------------------------------------------------------------------ */
=20
-/* stage1 (main) executable */
-static Int vgexecfd =3D -1;
+/* The name of the stage1 (main) executable */
+static HChar* name_of_stage1 =3D NULL;
=20
/* our argc/argv */
static Int vg_argc;
@@ -1672,10 +1663,8 @@
// Build "/proc/self/fd/<execfd>".
Char* VG_(build_child_exename)( void )
{
- Char* exename =3D VG_(arena_malloc)(VG_AR_CORE, 64);
- vg_assert(NULL !=3D exename);
- VG_(sprintf)(exename, "/proc/self/fd/%d", vgexecfd);
- return exename;
+ vg_assert(name_of_stage1);
+ return VG_(arena_strdup)(VG_AR_CORE, name_of_stage1);
}
=20
=20
@@ -1707,8 +1696,6 @@
/* Update the soft limit. */
VG_(setrlimit)(VKI_RLIMIT_NOFILE, &rl);
=20
- if (vgexecfd !=3D -1)
- vgexecfd =3D VG_(safe_fd)( vgexecfd );
if (VG_(clexecfd) !=3D -1)
VG_(clexecfd) =3D VG_(safe_fd)( VG_(clexecfd) );
}
@@ -2055,6 +2042,16 @@
}
VG_(debugLog)(1, "main", "Dynamic memory manager is running\n");
=20
+ //--------------------------------------------------------------
+ // Extract the stage1 name from the environment.
+ VG_(debugLog)(1, "main", "Getting stage1's name\n");
+ name_of_stage1 =3D VG_(getenv)(VALGRINDSTAGE1);
+ if (name_of_stage1 =3D=3D NULL) {
+ VG_(printf)("valgrind: You cannot run the tool binary directly.\n"=
);
+ VG_(printf)("valgrind: You should use $prefix/bin/valgrind.\n");
+ VG_(exit)(1);
+ }
+
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
// Command line argument handling order:
// * If --help/--help-debug are present, show usage message=20
Modified: branches/ASPACEM/coregrind/pub_core_libcproc.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-09-20 23:06:34 UT=
C (rev 4713)
+++ branches/ASPACEM/coregrind/pub_core_libcproc.h 2005-09-20 23:09:00 UT=
C (rev 4714)
@@ -39,7 +39,8 @@
#include "pub_tool_libcproc.h"
=20
/* The directory we look for all our auxillary files in. Useful for
- running Valgrind out of a build tree without having to do "make insta=
ll". */
+ running Valgrind out of a build tree without having to do "make
+ install". */
#define VALGRINDLIB "VALGRINDLIB"
=20
/* Additional command-line arguments; they are overridden by actual
@@ -47,6 +48,12 @@
is no quoting mechanism. */
#define VALGRINDOPTS "VALGRIND_OPTS"
=20
+/* The full name of Valgrind's stage1 (launcher) executable. This is
+ set by stage1 and read by stage2, and is used for recursive
+ invokations of Valgrind on child processes. */
+#define VALGRINDSTAGE1 "VALGRIND_STAGE1"
+
+
/* If this variable is present in the environment, then valgrind will
not parse the command line for options at all; all options come
from this variable. Arguments are terminated by ^A (\001). There
|
|
From: <sv...@va...> - 2005-09-20 23:06:36
|
Author: sewardj
Date: 2005-09-21 00:06:34 +0100 (Wed, 21 Sep 2005)
New Revision: 4713
Log:
PRE(sys_execve): move debugging printing to a more useful place.
Modified:
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 23:=
04:49 UTC (rev 4712)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 23:=
06:34 UTC (rev 4713)
@@ -2455,16 +2455,6 @@
=20
VG_(debugLog)(1, "syswrap", "Exec of %s\n", (HChar*)ARG1);
=20
- if (0) {
- Char **cpp;
-
- VG_(printf)("exec: %s\n", (Char *)ARG1);
- for(cpp =3D (Char **)ARG2; cpp && *cpp; cpp++)
- VG_(printf)("argv: %s\n", *cpp);
- for(cpp =3D (Char **)ARG3; cpp && *cpp; cpp++)
- VG_(printf)("env: %s\n", *cpp);
- }
-
/* restore the DATA rlimit for the child */
VG_(setrlimit)(VKI_RLIMIT_DATA, &VG_(client_rlimit_data));
=20
@@ -2509,6 +2499,15 @@
VG_(sigprocmask)(VKI_SIG_SETMASK, &tst->sig_mask, NULL);
}
=20
+ if (0) {
+ Char **cpp;
+ VG_(printf)("exec: %s\n", (Char *)path);
+ for (cpp =3D (Char **)ARG2; cpp && *cpp; cpp++)
+ VG_(printf)("argv: %s\n", *cpp);
+ for (cpp =3D (Char **)ARG3; cpp && *cpp; cpp++)
+ VG_(printf)("env: %s\n", *cpp);
+ }
+
SET_STATUS_from_SysRes(=20
VG_(do_syscall3)(__NR_execve, (UWord)path, ARG2, ARG3)=20
);
|
|
From: <sv...@va...> - 2005-09-20 23:04:57
|
Author: sewardj
Date: 2005-09-21 00:04:49 +0100 (Wed, 21 Sep 2005)
New Revision: 4712
Log:
Remove extraneous \ns in messages.
Modified:
branches/ASPACEM/coregrind/m_scheduler/scheduler.c
Modified: branches/ASPACEM/coregrind/m_scheduler/scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-09-20 21:14:2=
4 UTC (rev 4711)
+++ branches/ASPACEM/coregrind/m_scheduler/scheduler.c 2005-09-20 23:04:4=
9 UTC (rev 4712)
@@ -944,7 +944,7 @@
case VG_USERREQ__CLIENT_CALL0: {
UWord (*f)(ThreadId) =3D (void*)arg[1];
if (f =3D=3D NULL)
- VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL0: func=3D%p\n", =
f);
+ VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL0: func=3D%p", f)=
;
else
SET_CLCALL_RETVAL(tid, f ( tid ), (Addr)f);
break;
@@ -952,7 +952,7 @@
case VG_USERREQ__CLIENT_CALL1: {
UWord (*f)(ThreadId, UWord) =3D (void*)arg[1];
if (f =3D=3D NULL)
- VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL1: func=3D%p\n", =
f);
+ VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL1: func=3D%p", f)=
;
else
SET_CLCALL_RETVAL(tid, f ( tid, arg[2] ), (Addr)f );
break;
@@ -960,7 +960,7 @@
case VG_USERREQ__CLIENT_CALL2: {
UWord (*f)(ThreadId, UWord, UWord) =3D (void*)arg[1];
if (f =3D=3D NULL)
- VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=3D%p\n", =
f);
+ VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL2: func=3D%p", f)=
;
else
SET_CLCALL_RETVAL(tid, f ( tid, arg[2], arg[3] ), (Addr)f );
break;
@@ -968,7 +968,7 @@
case VG_USERREQ__CLIENT_CALL3: {
UWord (*f)(ThreadId, UWord, UWord, UWord) =3D (void*)arg[1];
if (f =3D=3D NULL)
- VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL3: func=3D%p\n", =
f);
+ VG_(message)(Vg_DebugMsg, "VG_USERREQ__CLIENT_CALL3: func=3D%p", f)=
;
else
SET_CLCALL_RETVAL(tid, f ( tid, arg[2], arg[3], arg[4] ), (Addr)f )=
;
break;
@@ -1076,7 +1076,7 @@
if (c2 =3D=3D 0) c2 =3D '_';
VG_(message)(Vg_UserMsg, "Warning:\n"
" unhandled client request: 0x%x (%c%c+0x%x). Perha=
ps\n"=20
- " VG_(needs).client_requests should be set?\n",
+ " VG_(needs).client_requests should be set?",
arg[0], c1, c2, arg[0] & 0xffff);
whined =3D True;
}
|
|
From: <sv...@va...> - 2005-09-20 21:14:28
|
Author: njn
Date: 2005-09-20 22:14:24 +0100 (Tue, 20 Sep 2005)
New Revision: 4711
Log:
comment-only changes
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 20:46:12 UTC (rev 4710=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 21:14:24 UTC (rev 4711=
)
@@ -2106,6 +2106,7 @@
VG_(get_command_line)(argc, argv, &vg_argc, &vg_argv, &cl_argv);
pre_process_cmd_line_options(&need_help, &tool, &exec);
=20
+ // TODO: this should be done in pre_process_cmd_line_options().
/* If this process was created by exec done by another Valgrind
process, the arguments will only show up at this point. Hence
we need to also snoop around in vg_argv to see if anyone is
@@ -2171,6 +2172,7 @@
// Setup client data (brk) segment. Initially a 1-page segment
// which abuts a shrinkable reservation.=20
// p: load_client() [for 'info' and hence VG_(brk_base)]
+ //--------------------------------------------------------------
VG_(debugLog)(1, "main", "Setup client data (brk) segment\n");
{=20
SizeT m1 =3D 1024 * 1024;
|
|
From: <sv...@va...> - 2005-09-20 20:46:17
|
Author: njn
Date: 2005-09-20 21:46:12 +0100 (Tue, 20 Sep 2005)
New Revision: 4710
Log:
wibble
Modified:
branches/ASPACEM/coregrind/m_mallocfree.c
Modified: branches/ASPACEM/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-20 20:15:54 UTC (re=
v 4709)
+++ branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-20 20:46:12 UTC (re=
v 4710)
@@ -567,8 +567,8 @@
sb->n_payload_bytes =3D cszB - sizeof(Superblock);
a->bytes_mmaped +=3D cszB;
VG_(debugLog)(1, "mallocfree",
- "newSuperblock at %p (pszB %7lld) owner %s/%s\n",=20
- sb, (Long)sb->n_payload_bytes,=20
+ "newSuperblock at %p (pszB %7ld) owner %s/%s\n",=20
+ sb, sb->n_payload_bytes,=20
a->clientmem ? "CLIENT" : "VALGRIND", a->name );
return sb;
}
|
|
From: <sv...@va...> - 2005-09-20 20:15:57
|
Author: sewardj
Date: 2005-09-20 21:15:54 +0100 (Tue, 20 Sep 2005)
New Revision: 4709
Log:
PRE(sys_execve): correctly get the syscall error code when it fails.
Modified:
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 18:=
32:52 UTC (rev 4708)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 20:=
15:54 UTC (rev 4709)
@@ -2516,7 +2516,7 @@
/* If we got here, then the execve failed. We've already made too
much of a mess of ourselves to continue, so we have to abort. */
VG_(message)(Vg_UserMsg, "execve(%p(%s), %p, %p) failed, errno %d",
- ARG1, ARG1, ARG2, ARG3, -RES);
+ ARG1, ARG1, ARG2, ARG3, RES_unchecked);
VG_(message)(Vg_UserMsg, "EXEC FAILED: I can't recover from "
"execve() failing, so I'm dying.");
VG_(message)(Vg_UserMsg, "Add more stringent tests in PRE(sys_execve)=
, "
|
|
From: Greg P. <gp...@us...> - 2005-09-20 18:55:22
|
Julian Seward writes: > Perhaps a better way to say what we're > looking for is: go look for places where the kernel and V disagree about > whether a given page is mapped or not. (even though the segment > boundaries may disagree, V and K should agree on a page-by-page basis > both about mappedness and about the permissions, and the identity and > offset into any associated file). I did exactly this for a quick checker on Darwin. It simply iterated through address space a page at a time, and asked both Valgrind and the kernel what was at that address. (It was actually a little smarter than that, to avoid making 4 million requests, but it never tried to match Valgrind segments to kernel regions.) Running the checker after syscalls is a great way to find RPC calls that change the memory map behind Valgrind's back. I only checked mappedness. It looks like the kernel's rwx permissions don't tell the whole story (have to work on that later), and I don't have a region->file mechanism yet. -- Greg Parker gp...@us... |
|
From: <sv...@va...> - 2005-09-20 18:32:55
|
Author: sewardj
Date: 2005-09-20 19:32:52 +0100 (Tue, 20 Sep 2005)
New Revision: 4708
Log:
ML_(generic_POST_sys_shmat): don't pass non-page-aligned lengths to
VG_(am_notify_client_mmap).
Modified:
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 18:=
18:58 UTC (rev 4707)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 18:=
32:52 UTC (rev 4708)
@@ -1626,7 +1626,7 @@
=20
if (!(arg2 & 010000)) /* =3D SHM_RDONLY */
prot &=3D ~VKI_PROT_WRITE;
- VG_(am_notify_client_mmap)( res, segmentSize,=20
+ VG_(am_notify_client_mmap)( res, VG_PGROUNDUP(segmentSize),=20
prot, VKI_MAP_ANONYMOUS, 0,0);
}
}
|
|
From: <sv...@va...> - 2005-09-20 18:19:01
|
Author: sewardj
Date: 2005-09-20 19:18:58 +0100 (Tue, 20 Sep 2005)
New Revision: 4707
Log:
Get rid of VG_(client_mapbase), which now seems redundant.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/pub_core_aspacemgr.h
branches/ASPACEM/coregrind/pub_core_ume.h
branches/ASPACEM/memcheck/tests/vgtest_ume.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 18:10:3=
3 UTC (rev 4706)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 18:18:5=
8 UTC (rev 4707)
@@ -65,7 +65,7 @@
/* Client address space, lowest to highest (see top of ume.c) */
Addr VG_(client_base); /* client address space limits */
Addr VG_(client_end);
-Addr VG_(client_mapbase);
+
Addr VG_(clstk_base);
Addr VG_(clstk_end);
UWord VG_(clstk_id);
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 18:10:33 UTC (rev 4706=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 18:18:58 UTC (rev 4707=
)
@@ -825,7 +825,6 @@
}
=20
VG_(memset)(info, 0, sizeof(*info));
- info->map_base =3D VG_(client_mapbase);
info->exe_base =3D VG_(client_base);
info->exe_end =3D VG_(client_end);
info->argv =3D cl_argv;
Modified: branches/ASPACEM/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-20 18:10:33 U=
TC (rev 4706)
+++ branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-20 18:18:58 U=
TC (rev 4707)
@@ -44,7 +44,7 @@
// Address space globals
extern Addr VG_(client_base); // client address space limits
extern Addr VG_(client_end);
-extern Addr VG_(client_mapbase); // base of mappings
+
extern Addr VG_(clstk_base); // client stack range
extern Addr VG_(clstk_end);
extern UWord VG_(clstk_id); // client stack id
Modified: branches/ASPACEM/coregrind/pub_core_ume.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_ume.h 2005-09-20 18:10:33 UTC (re=
v 4706)
+++ branches/ASPACEM/coregrind/pub_core_ume.h 2005-09-20 18:18:58 UTC (re=
v 4707)
@@ -76,7 +76,6 @@
// inputs/outputs of do_exec().
struct exeinfo
{
- Addr map_base; // IN: if non-zero, base address of mappings
char** argv; // IN: the original argv
=20
Addr exe_base; // INOUT: lowest (allowed) address of exe
Modified: branches/ASPACEM/memcheck/tests/vgtest_ume.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/memcheck/tests/vgtest_ume.c 2005-09-20 18:10:33 UTC =
(rev 4706)
+++ branches/ASPACEM/memcheck/tests/vgtest_ume.c 2005-09-20 18:18:58 UTC =
(rev 4707)
@@ -101,7 +101,6 @@
info.argv =3D NULL;
info.exe_base =3D 0x50000000;
info.exe_end =3D 0x50ffffff;
- info.map_base =3D 0x51000000;
=20
fprintf(stderr, "Calling VG_(do_exec)(\"hello\")\n");
err =3D VG_(do_exec)("hello", &info);
|
|
From: <sv...@va...> - 2005-09-20 18:10:38
|
Author: sewardj
Date: 2005-09-20 19:10:33 +0100 (Tue, 20 Sep 2005)
New Revision: 4706
Log:
Prettify the printing of huge numbers when showing the segment array.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 17:42:4=
5 UTC (rev 4705)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 18:10:3=
3 UTC (rev 4706)
@@ -38,8 +38,7 @@
=20
#include "pub_core_debuglog.h" // VG_(debugLog)
=20
-#include "pub_core_libcbase.h" // TODO: rm
- // VG_(strlen), VG_(strcmp)
+#include "pub_core_libcbase.h" // VG_(strlen), VG_(strcmp)
// VG_IS_PAGE_ALIGNED
// VG_PGROUNDDN, VG_PGROUNDUP
=20
@@ -468,12 +467,26 @@
{
HChar* fmt;
ULong a =3D (ULong)aA;
- if (a >=3D 10000000ULL) {
+
+ if (a < 10*1000*1000ULL) {
+ fmt =3D "%7llu";
+ }=20
+ else if (a < 999999ULL * (1ULL<<20)) {
fmt =3D "%6llum";
- a /=3D 1024*1024ULL;
- } else {
- fmt =3D "%7llu";
+ a >>=3D 20;
}
+ else if (a < 999999ULL * (1ULL<<30)) {
+ fmt =3D "%6llug";
+ a >>=3D 30;
+ }
+ else if (a < 999999ULL * (1ULL<<40)) {
+ fmt =3D "%6llut";
+ a >>=3D 40;
+ }
+ else {
+ fmt =3D "%6llue";
+ a >>=3D 50;
+ }
aspacem_sprintf(buf, fmt, a);
}
=20
@@ -511,7 +524,7 @@
case SkFree:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s\n",
+ "%3d: %s %010llx-%010llx %s\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf
);
@@ -520,7 +533,7 @@
case SkAnonC: case SkAnonV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c\n",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
@@ -531,7 +544,7 @@
case SkFileC: case SkFileV:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c d=3D0x%03llx "
+ "%3d: %s %010llx-%010llx %s %c%c%c%c d=3D0x%03llx "
"i=3D%-7lld o=3D%-7lld (%d)\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
@@ -544,7 +557,7 @@
case SkResvn:
VG_(debugLog)(
logLevel, "aspacem",
- "%3d: %s %08llx-%08llx %s %c%c%c%c %s\n",
+ "%3d: %s %010llx-%010llx %s %c%c%c%c %s\n",
segNo, show_SegKind(seg->kind),
(ULong)seg->start, (ULong)seg->end, len_buf,
seg->hasR ? 'r' : '-', seg->hasW ? 'w' : '-',=20
@@ -1343,19 +1356,19 @@
aspacem_assert(VG_IS_PAGE_ALIGNED(suggested_clstack_top + 1));
=20
VG_(debugLog)(2, "aspacem",=20
- " minAddr =3D 0x%08llx (computed)\n",=20
+ " minAddr =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_minAddr);
VG_(debugLog)(2, "aspacem",=20
- " maxAddr =3D 0x%08llx (computed)\n",=20
+ " maxAddr =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_maxAddr);
VG_(debugLog)(2, "aspacem",=20
- " cStart =3D 0x%08llx (computed)\n",=20
+ " cStart =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_cStart);
VG_(debugLog)(2, "aspacem",=20
- " vStart =3D 0x%08llx (computed)\n",=20
+ " vStart =3D 0x%010llx (computed)\n",=20
(ULong)aspacem_vStart);
VG_(debugLog)(2, "aspacem",=20
- "suggested_clstack_top =3D 0x%08llx (computed)\n",=20
+ "suggested_clstack_top =3D 0x%010llx (computed)\n",=20
(ULong)suggested_clstack_top);
=20
if (aspacem_cStart > Addr_MIN) {
|
|
From: <sv...@va...> - 2005-09-20 17:42:52
|
Author: sewardj
Date: 2005-09-20 18:42:45 +0100 (Tue, 20 Sep 2005)
New Revision: 4705
Log:
When printing a log message that a new superblock has been allocated,
also show which arena it belongs to. From this observe many
allocations for VG_AR_EXECTXT and hence quadruple the minimum
allocation size for that arena.
Modified:
branches/ASPACEM/coregrind/m_mallocfree.c
Modified: branches/ASPACEM/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-20 17:24:19 UTC (re=
v 4704)
+++ branches/ASPACEM/coregrind/m_mallocfree.c 2005-09-20 17:42:45 UTC (re=
v 4705)
@@ -476,7 +476,7 @@
arena_init ( VG_AR_TOOL, "tool", 4, 1048=
576 );
arena_init ( VG_AR_SYMTAB, "symtab", 4, 1048=
576 );
arena_init ( VG_AR_DEMANGLE, "demangle", 4, 65=
536 );
- arena_init ( VG_AR_EXECTXT, "exectxt", 4, 65=
536 );
+ arena_init ( VG_AR_EXECTXT, "exectxt", 4, 262=
144 );
arena_init ( VG_AR_ERRORS, "errors", 4, 65=
536 );
nonclient_inited =3D True;
}
@@ -567,9 +567,9 @@
sb->n_payload_bytes =3D cszB - sizeof(Superblock);
a->bytes_mmaped +=3D cszB;
VG_(debugLog)(1, "mallocfree",
- "newSuperblock at %p, for %s, %lld payload bytes\n",=
=20
- sb, a->clientmem ? "CLIENT" : "VALGRIND",
- (Long)sb->n_payload_bytes);
+ "newSuperblock at %p (pszB %7lld) owner %s/%s\n",=20
+ sb, (Long)sb->n_payload_bytes,=20
+ a->clientmem ? "CLIENT" : "VALGRIND", a->name );
return sb;
}
=20
|
|
From: <sv...@va...> - 2005-09-20 17:24:36
|
Author: sewardj
Date: 2005-09-20 18:24:19 +0100 (Tue, 20 Sep 2005)
New Revision: 4704
Log:
Initialise TT/TC after the tool's pre_clo_init is done, so as to
get the correct VG_(details).avg_translation_sizeB.
Modified:
branches/ASPACEM/coregrind/m_main.c
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 13:33:56 UTC (rev 4703=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 17:24:19 UTC (rev 4704=
)
@@ -2034,7 +2034,6 @@
VG_(exit)(1);
}
=20
-
//--------------------------------------------------------------
// Start up the address space manager, and determine the
// approximate location of the client's stack
@@ -2124,19 +2123,7 @@
VG_(debugLog_startup)(loglevel, "Stage 2 (second go)");
}
=20
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(malloc)() and VG_(arena_malloc)() only after load_tool=
()
- // -- redzone size is now set. This is checked by vg_malloc2.c.
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- =20
//--------------------------------------------------------------
- // Finalise address space layout
- // p: load_tool() [probably?]
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Laying out remaining space\n");
- //layout_remaining_space( (Addr) & argc, VG_(tool_info).shadow_ratio =
);
-
- //--------------------------------------------------------------
// Load client executable, finding in $PATH if necessary
// p: pre_process_cmd_line_options() [for 'exec', 'need_help']
// p: layout_remaining_space [so there's space]
@@ -2145,14 +2132,6 @@
load_client(cl_argv, exec, need_help, &info, &initial_client_IP);
=20
//--------------------------------------------------------------
- // Everything in place, remove padding done by stage1
- // p: layout_remaining_space() [everything must be mapped in befor=
e now] =20
- // p: load_client() [ditto]=20
- //--------------------------------------------------------------
- //as_unpad((void *)VG_(shadow_end), (void *)~0, padfile);
- //as_closepadfile(padfile); // no more padding
-
- //--------------------------------------------------------------
// Set up client's environment
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options [for tool]
@@ -2213,8 +2192,27 @@
//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=20
//--------------------------------------------------------------
+ // Init tool part 1: pre_clo_init
+ // p: setup_client_stack() [for 'VG_(client_arg[cv]']
+ // p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
+ // p: parse_procselfmaps [so VG segments are setup so tool c=
an
+ // call VG_(malloc)]
+ //--------------------------------------------------------------
+ {
+ Char* s;
+ Bool ok;
+ VG_(debugLog)(1, "main", "Initialise the tool part 1 (pre_clo_init=
)\n");
+ (VG_(tool_info).tl_pre_clo_init)();
+ ok =3D VG_(sanity_check_needs)( &s );
+ if (!ok) {
+ VG_(tool_panic)(s);
+ }
+ }
+
+ //--------------------------------------------------------------
// Initialise translation table and translation cache
- // p: aspacem
+ // p: aspacem [??]
+ // p: pre_clo_init [for 'VG_(details).avg_translation_sizeB']
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise TT/TC\n");
VG_(init_tt_tc)();
@@ -2237,34 +2235,14 @@
setup_file_descriptors();
=20
//--------------------------------------------------------------
- // Build segment map (Valgrind segments only)
- // p: tl_pre_clo_init() [to setup new_mem_startup tracker]
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 1)\n");
- //VG_(parse_procselfmaps) ( build_valgrind_map_callback );
-
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(arena_malloc)() with non-CORE arena after segments set=
up
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
- //--------------------------------------------------------------
- // Init tool: pre_clo_init, process cmd line, post_clo_init
+ // Init tool part 2: pre_clo_init
// p: setup_client_stack() [for 'VG_(client_arg[cv]']
// p: setup_file_descriptors() [for 'VG_(fd_xxx_limit)']
// p: parse_procselfmaps [so VG segments are setup so tool c=
an
// call VG_(malloc)]
//--------------------------------------------------------------
- {
- Char* s;
- Bool ok;
- VG_(debugLog)(1, "main", "Initialise the tool\n");
- (VG_(tool_info).tl_pre_clo_init)();
- ok =3D VG_(sanity_check_needs)( &s );
- if (!ok) {
- VG_(tool_panic)(s);
- }
- }
=20
+ VG_(debugLog)(1, "main", "Initialise the tool part 2 (post_clo_init)\=
n");
// If --tool and --help/--help-debug was given, now give the core+too=
l
// help message
if (need_help) {
@@ -2275,21 +2253,6 @@
VG_TDICT_CALL(tool_post_clo_init);
=20
//--------------------------------------------------------------
- // Build segment map (all segments)
- // p: shadow/redzone segments
- // p: setup_client_stack() [for 'sp_at_startup']
- // p: init tool [for 'new_mem_startup']
- //--------------------------------------------------------------
- //VG_(debugLog)(1, "main", "Parse /proc/self/maps (round 2)\n");
- //sp_at_startup___global_arg =3D sp_at_startup;
- //VG_(parse_procselfmaps) ( build_segment_map_callback ); /* everyth=
ing */
- //sp_at_startup___global_arg =3D 0;
-
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
- // Can use VG_(map)() after segments set up
- //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
-
- //--------------------------------------------------------------
// Allow GDB attach
// p: process_cmd_line_options() [for VG_(clo_wait_for_gdb)]
//--------------------------------------------------------------
|
|
From: Nicholas N. <nj...@cs...> - 2005-09-20 15:07:21
|
On Tue, 20 Sep 2005, Julian Seward wrote: > I don't think I have the details right yet .. the comparer will have to > cope with both multiple kernel segs associated with one aspacem seg, > and the other way around too. During comparison, shouldn't you just merge any mergeable, adjacent segments in both lists? Then they should match. Nick |
|
From: Kewal <ke...@gm...> - 2005-09-20 14:53:48
|
don't send me mail plz On 9/20/05, js...@ac... <js...@ac...> wrote: >=20 >=20 > Nightly build on phoenix ( SuSE 9.1 ) started at 2005-09-20 03:30:00 BST >=20 > Checking out vex source tree ... done > Building vex ... done > Checking out valgrind source tree ... done > Configuring valgrind ... done > Building valgrind ... done > Running regression tests ... failed >=20 > Regression test results follow >=20 > =3D=3D 185 tests, 2 stderr failures, 0 stdout failures =3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > none/tests/faultstatus (stderr) > none/tests/x86/int (stderr) >=20 >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your ver= y > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |
|
From: Julian S. <js...@ac...> - 2005-09-20 13:50:50
|
> > ( 0) /home/sewardj/VgASPACEM/aspacem/Inst/lib/valgrind/memcheck > > 11: FILE 70000000-7001EFFF 126976 r-x- d=0x302 i=555480 o=0 (0) > > 12: file 7001F000-7001FFFF 4096 r-x- d=0x302 i=555480 o=126976 (0) > > 13: FILE 70020000-7012DFFF 1105920 r-x- d=0x302 i=555480 o=131072 (0) > > > > (where "FILE" == SkAnonV, "file" == SkAnonC), which is as expected. > > The problem with that is that the segment list no longs matches > the kernel mapping list, so running with --sanity-level=3 gives: This is true. But I noticed a couple of days back that the comparison scheme is flawed anyway: after doing a suitable series of mprotects, the kernel's map winds up with two adjacent mappings which (afaics) could be merged but aren't, whereas the segment list does merge them. So the comparer needs a redesign anyway, and I'm hoping that that will fix this problem too. The (vague) idea I had in mind was to change VG_(read_procselfmaps) so that it not only passes to the callback all the segments it reads, but also all the spaces in between them. The result is that the callback would see the kernel's account of the entire address space. For each presented kernel segment-or-hole, the callback snoops around the segment array to find not just one, but possibly a set of NSegments which cover the presented range with the correct permissions. So it's more robust. I don't think I have the details right yet .. the comparer will have to cope with both multiple kernel segs associated with one aspacem seg, and the other way around too. Perhaps a better way to say what we're looking for is: go look for places where the kernel and V disagree about whether a given page is mapped or not. (even though the segment boundaries may disagree, V and K should agree on a page-by-page basis both about mappedness and about the permissions, and the identity and offset into any associated file). It would be great to have the sanity checker working robustly again. It did help me find some bugs in mremap handling but I rapidly abandoned it because of these problems. If you have enthusiasm .. J |
|
From: <sv...@va...> - 2005-09-20 13:34:04
|
Author: tom
Date: 2005-09-20 14:33:56 +0100 (Tue, 20 Sep 2005)
New Revision: 4703
Log:
Setup the address for shmat correctly.
Modified:
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 13:=
31:44 UTC (rev 4702)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-20 13:=
33:56 UTC (rev 4703)
@@ -1605,7 +1605,7 @@
if (arg1 =3D=3D 0) {
tmp =3D VG_(am_get_advisory_client_simple)(0, segmentSize, &ok);
if (ok)
- arg1 =3D ok;
+ arg1 =3D tmp;
}
else if (!ML_(valid_client_addr)(arg1, segmentSize, tid, "shmat"))
arg1 =3D 0;
|
|
From: <sv...@va...> - 2005-09-20 13:31:46
|
Author: sewardj
Date: 2005-09-20 14:31:44 +0100 (Tue, 20 Sep 2005)
New Revision: 4702
Log:
Speed up a common-case use of is_valid_for_client.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 13:06:3=
2 UTC (rev 4701)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 13:31:4=
4 UTC (rev 4702)
@@ -1032,7 +1032,19 @@
needX =3D toBool(prot & VKI_PROT_EXEC);
=20
iLo =3D find_nsegment_idx(start);
- iHi =3D find_nsegment_idx(start + len - 1);
+ aspacem_assert(start >=3D nsegments[iLo].start);
+
+ if (start+len-1 <=3D nsegments[iLo].end) {
+ /* This is a speedup hack which avoids calling find_nsegment_idx
+ a second time when possible. It is always correct to just
+ use the "else" clause below, but is_valid_for_client is
+ called a lot by the leak checker, so avoiding pointless calls
+ to find_nsegment_idx, which can be expensive, is helpful. */
+ iHi =3D iLo;
+ } else {
+ iHi =3D find_nsegment_idx(start + len - 1);
+ }
+
for (i =3D iLo; i <=3D iHi; i++) {
if ( (nsegments[i].kind =3D=3D SkFileC=20
|| nsegments[i].kind =3D=3D SkAnonC
|
|
From: Julian S. <js...@ac...> - 2005-09-20 13:30:27
|
> Seems to work for me too. After adding the same for x86 I now > get this on amd64: > > == 160 tests, 16 stderr failures, 6 stdout failures ================= > > and this on x86: > > == 182 tests, 17 stderr failures, 5 stdout failures ================= Cool! That looks like progress to me! J |
|
From: Tom H. <to...@co...> - 2005-09-20 13:29:05
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> I just put 4k of ud2s before and after it, so the alignment then
> doesn't matter (anything for a simple life :-). Resulting maps then
> are:
>
> ( 0) /home/sewardj/VgASPACEM/aspacem/Inst/lib/valgrind/memcheck
> 11: FILE 70000000-7001EFFF 126976 r-x- d=0x302 i=555480 o=0 (0)
> 12: file 7001F000-7001FFFF 4096 r-x- d=0x302 i=555480 o=126976 (0)
> 13: FILE 70020000-7012DFFF 1105920 r-x- d=0x302 i=555480 o=131072 (0)
>
> (where "FILE" == SkAnonV, "file" == SkAnonC), which is as expected.
The problem with that is that the segment list no longs matches
the kernel mapping list, so running with --sanity-level=3 gives:
--9783:0:aspacem sync_check_callback: segment mismatch: V's seg:
--9783:0:aspacem NSegment{FILE, start=0x70000000, end=0x70020FFF, smode=SmFixed, dev=64768, ino=3965434, offset=0, fnIdx=0, hasR=1, hasW=0, hasX=1, hasT=0, mark=0}
--9783:0:aspacem sync_check_callback: segment mismatch: kernel's seg:
--9783:0:aspacem start=0x70000000 end=0x70136FFF dev=64768 ino=3965434 offset=0--9783:0:aspacem sync check at aspacemgr.c:1537 (vgPlain_am_get_advisory): FAILED
--9783:0:aspacem
--9783:0:aspacem Valgrind: FATAL: aspacem assertion failed:
--9783:0:aspacem do_sync_check(__PRETTY_FUNCTION__, __FILE__,__LINE__)
--9783:0:aspacem at aspacemgr.c:1537 (vgPlain_am_get_advisory)
--9783:0:aspacem Exiting now.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Nicholas N. <nj...@cs...> - 2005-09-20 13:21:23
|
On Tue, 20 Sep 2005, Tom Hughes wrote: >> Easy enough to do (r4699). This gets me down to >> == 160 tests, 15 stderr failures, 5 stdout failures ================= >> on amd64, which is not bad. > > Seems to work for me too. After adding the same for x86 I now > get this on amd64: > > == 160 tests, 16 stderr failures, 6 stdout failures ================= > > and this on x86: > > == 182 tests, 17 stderr failures, 5 stdout failures ================= I have this on x86: == 181 tests, 15 stderr failures, 6 stdout failures ================= memcheck/tests/execve2 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/x86/scalar (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/map_unmap (stdout) none/tests/map_unmap (stderr) none/tests/mremap2 (stdout) none/tests/sigstackgrowth (stdout) none/tests/sigstackgrowth (stderr) none/tests/stackgrowth (stdout) none/tests/stackgrowth (stderr) none/tests/x86/int (stderr) Nick |
|
From: Tom H. <to...@co...> - 2005-09-20 13:10:42
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> Easy enough to do (r4699). This gets me down to
> == 160 tests, 15 stderr failures, 5 stdout failures =================
> on amd64, which is not bad.
Seems to work for me too. After adding the same for x86 I now
get this on amd64:
== 160 tests, 16 stderr failures, 6 stdout failures =================
and this on x86:
== 182 tests, 17 stderr failures, 5 stdout failures =================
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: <sv...@va...> - 2005-09-20 13:06:39
|
Author: tom
Date: 2005-09-20 14:06:32 +0100 (Tue, 20 Sep 2005)
New Revision: 4701
Log:
Make the change in ownership of the trampoline area apply to all
platforms as it is not an amd64 specific problem.
Modified:
branches/ASPACEM/coregrind/m_redir.c
branches/ASPACEM/coregrind/m_trampoline.S
Modified: branches/ASPACEM/coregrind/m_redir.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_redir.c 2005-09-20 12:48:45 UTC (rev 470=
0)
+++ branches/ASPACEM/coregrind/m_redir.c 2005-09-20 13:06:32 UTC (rev 470=
1)
@@ -366,6 +366,14 @@
(Addr)&VG_(amd64_linux_REDIR_FOR_vtime)=20
);
=20
+#elif defined(VGP_ppc32_linux)
+
+ //CAB: TODO
+
+#else
+# error Unknown platform
+#endif
+
{ Addr co_start =3D VG_PGROUNDDN( (Addr)&VG_(trampoline_stuff_start=
) );
Addr co_endPlus =3D VG_PGROUNDUP( (Addr)&VG_(trampoline_stuff_end) =
);
VG_(debugLog)(1,"redir",
@@ -374,14 +382,6 @@
return=20
VG_(am_change_ownership_v_to_c)( co_start, co_endPlus - co_start=
);
}
-
-#elif defined(VGP_ppc32_linux)
-
- //CAB: TODO
-
-#else
-# error Unknown platform
-#endif
}
=20
/* Z-decode a symbol into library:func form, eg=20
Modified: branches/ASPACEM/coregrind/m_trampoline.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_trampoline.S 2005-09-20 12:48:45 UTC (re=
v 4700)
+++ branches/ASPACEM/coregrind/m_trampoline.S 2005-09-20 13:06:32 UTC (re=
v 4701)
@@ -37,6 +37,15 @@
This code runs on the simulated CPU.
*/
=20
+# define UD2_16 ud2 ; ud2 ; ud2 ; ud2 ;ud2 ; ud2 ; ud2 ; ud2
+# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
+# define UD2_256 UD2_64 ; UD2_64 ; UD2_64 ; UD2_64
+# define UD2_1024 UD2_256 ; UD2_256 ; UD2_256 ; UD2_256
+# define UD2_PAGE UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024 =20
+
+ /* a leading page of unexecutable code */
+ UD2_PAGE
+=09
/*---------------- x86-linux ----------------*/
#if defined(VGP_x86_linux)
=20
@@ -73,15 +82,6 @@
#else
#if defined(VGP_amd64_linux)
=20
-# define UD2_16 ud2 ; ud2 ; ud2 ; ud2 ;ud2 ; ud2 ; ud2 ; ud2
-# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
-# define UD2_256 UD2_64 ; UD2_64 ; UD2_64 ; UD2_64
-# define UD2_1024 UD2_256 ; UD2_256 ; UD2_256 ; UD2_256
-# define UD2_PAGE UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024 =20
-
- /* a leading page of unexecutable code */
- UD2_PAGE
-=09
.global VG_(trampoline_stuff_start)
VG_(trampoline_stuff_start):
=20
@@ -108,16 +108,7 @@
.global VG_(trampoline_stuff_end)
VG_(trampoline_stuff_end):
=20
- /* and a trailing page of unexecutable code */
- UD2_PAGE
=20
-# undef UD2_16
-# undef UD2_64
-# undef UD2_256
-# undef UD2_1024
-# undef UD2_PAGE
-
-
/*---------------- ppc32-linux ----------------*/
#else
#if defined(VGP_ppc32_linux)
@@ -138,9 +129,16 @@
#endif
#endif
=20
-tramp_code_end:
+ /* and a trailing page of unexecutable code */
+ UD2_PAGE
=20
+# undef UD2_16
+# undef UD2_64
+# undef UD2_256
+# undef UD2_1024
+# undef UD2_PAGE
=20
+
/* Let the linker know we don't need an executable stack */
.section .note.GNU-stack,"",@progbits
=09
|
|
From: <sv...@va...> - 2005-09-20 12:48:53
|
Author: sewardj
Date: 2005-09-20 13:48:45 +0100 (Tue, 20 Sep 2005)
New Revision: 4700
Log:
Reinstate garbage collection of string table slots.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 12:07:1=
4 UTC (rev 4699)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 12:48:4=
5 UTC (rev 4700)
@@ -755,7 +755,7 @@
=20
static Bool preen_nsegments ( void )
{
- Int i, r, w, nsegments_used_old =3D nsegments_used;
+ Int i, j, r, w, nsegments_used_old =3D nsegments_used;
=20
/* Pass 1: check the segment array covers the entire address space
exactly once, and also that each segment is sane. */
@@ -785,6 +785,27 @@
aspacem_assert(w > 0 && w <=3D nsegments_used);
nsegments_used =3D w;
=20
+ /* Pass 3: free up unused string table slots */
+ /* clear mark bits */
+ for (i =3D 0; i < segnames_used; i++)
+ segnames[i].mark =3D False;
+ /* mark */
+ for (i =3D 0; i < nsegments_used; i++) {
+ j =3D nsegments[i].fnIdx;
+ aspacem_assert(j >=3D -1 && j < segnames_used);
+ if (j >=3D 0) {
+ aspacem_assert(segnames[j].inUse);
+ segnames[j].mark =3D True;
+ }
+ }
+ /* release */
+ for (i =3D 0; i < segnames_used; i++) {
+ if (segnames[i].mark =3D=3D False) {
+ segnames[i].inUse =3D False;
+ segnames[i].fname[0] =3D 0;
+ }
+ }
+
return nsegments_used !=3D nsegments_used_old;
}
=20
|
|
From: Julian S. <js...@ac...> - 2005-09-20 12:33:11
|
> > That's a bit awkward because of the offsets. Another possibility > > is to find the one page which these routines occupy and change its > > ownership from V to C. In order to ensure that the client didn't > > inadvertantly acquire execute permission for any other bits of V > > which happened to lie on that one page, we could put 4096 bytes > > worth of ud2s immediately before and after the routines. That > > would guarantee that the only useful stuff in the page is the > > routines themselves. Easy enough to do (r4699). This gets me down to == 160 tests, 15 stderr failures, 5 stdout failures ================= on amd64, which is not bad. > You would also have to make sure the trampoline code was at the > start of a page or put 4096 bytes of ud2s before it as well... I just put 4k of ud2s before and after it, so the alignment then doesn't matter (anything for a simple life :-). Resulting maps then are: ( 0) /home/sewardj/VgASPACEM/aspacem/Inst/lib/valgrind/memcheck 11: FILE 70000000-7001EFFF 126976 r-x- d=0x302 i=555480 o=0 (0) 12: file 7001F000-7001FFFF 4096 r-x- d=0x302 i=555480 o=126976 (0) 13: FILE 70020000-7012DFFF 1105920 r-x- d=0x302 i=555480 o=131072 (0) (where "FILE" == SkAnonV, "file" == SkAnonC), which is as expected. Does it work for you? J |
|
From: <sv...@va...> - 2005-09-20 12:07:19
|
Author: sewardj
Date: 2005-09-20 13:07:14 +0100 (Tue, 20 Sep 2005)
New Revision: 4699
Log:
amd64-linux: transfer ownership of the (incorrectly named) trampoline
area from V to C, so translations can be made from it.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_main.c
branches/ASPACEM/coregrind/m_redir.c
branches/ASPACEM/coregrind/m_trampoline.S
branches/ASPACEM/coregrind/pub_core_aspacemgr.h
branches/ASPACEM/coregrind/pub_core_redir.h
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 12:05:3=
9 UTC (rev 4698)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-20 12:07:1=
4 UTC (rev 4699)
@@ -2069,7 +2069,47 @@
return am_munmap_both_wrk( start, len, False/*valgrind*/ );
}
=20
+/* Let (start,len) denote an area within a single Valgrind-owned
+ segment (anon or file). Change the ownership of [start, start+len)
+ to the client instead. Fails if (start,len) does not denote a
+ suitable segment. */
=20
+Bool VG_(am_change_ownership_v_to_c)( Addr start, SizeT len )
+{
+ Int i, iLo, iHi;
+
+ if (len =3D=3D 0)
+ return True;
+ if (start + len < start)
+ return False;
+ if (!VG_IS_PAGE_ALIGNED(start) || !VG_IS_PAGE_ALIGNED(len))
+ return False;
+
+ i =3D find_nsegment_idx(start);
+ if (nsegments[i].kind !=3D SkFileV && nsegments[i].kind !=3D SkAnonV)
+ return False;
+ if (start+len-1 > nsegments[i].end)
+ return False;
+
+ aspacem_assert(start >=3D nsegments[i].start);
+ aspacem_assert(start+len-1 <=3D nsegments[i].end);
+
+ /* This scheme is like how mprotect works: split the to-be-changed
+ range into its own segment(s), then mess with them (it). There
+ should be only one. */
+ split_nsegments_lo_and_hi( start, start+len-1, &iLo, &iHi );
+ aspacem_assert(iLo =3D=3D iHi);
+ switch (nsegments[iLo].kind) {
+ case SkFileV: nsegments[iLo].kind =3D SkFileC; break;
+ case SkAnonV: nsegments[iLo].kind =3D SkAnonC; break;
+ default: aspacem_assert(0); /* can't happen - guarded above */
+ }
+
+ preen_nsegments();
+ return True;
+}
+
+
/* --- --- --- reservations --- --- --- */
=20
/* Create a reservation from START .. START+LENGTH-1, with the given
Modified: branches/ASPACEM/coregrind/m_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_main.c 2005-09-20 12:05:39 UTC (rev 4698=
)
+++ branches/ASPACEM/coregrind/m_main.c 2005-09-20 12:07:14 UTC (rev 4699=
)
@@ -2222,9 +2222,12 @@
//--------------------------------------------------------------
// Initialise the redirect table.
// p: init_tt_tc [so it can call VG_(search_transtab) safely]
+ // p: aspacem [so can change ownership of sysinfo pages]
//--------------------------------------------------------------
VG_(debugLog)(1, "main", "Initialise redirects\n");
- VG_(setup_code_redirect_table)();
+ { Bool setup_redirects_succeeded =3D VG_(setup_code_redirect_table)()=
;
+ vg_assert(setup_redirects_succeeded);
+ }
=20
//--------------------------------------------------------------
// setup file descriptors
Modified: branches/ASPACEM/coregrind/m_redir.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_redir.c 2005-09-20 12:05:39 UTC (rev 469=
8)
+++ branches/ASPACEM/coregrind/m_redir.c 2005-09-20 12:07:14 UTC (rev 469=
9)
@@ -31,6 +31,8 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_debuglog.h"
+#include "pub_core_aspacemgr.h" // VG_(am_change_ownership_v_to_c)
#include "pub_core_debuginfo.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
@@ -340,7 +342,7 @@
return r->to_addr;
}
=20
-void VG_(setup_code_redirect_table) ( void )
+Bool VG_(setup_code_redirect_table) ( void )
{
#if defined(VGP_x86_linux)
/* Redirect _dl_sysinfo_int80, which is glibc's default system call
@@ -364,6 +366,15 @@
(Addr)&VG_(amd64_linux_REDIR_FOR_vtime)=20
);
=20
+ { Addr co_start =3D VG_PGROUNDDN( (Addr)&VG_(trampoline_stuff_start=
) );
+ Addr co_endPlus =3D VG_PGROUNDUP( (Addr)&VG_(trampoline_stuff_end) =
);
+ VG_(debugLog)(1,"redir",
+ "transfer ownership V -> C of 0x%llx .. 0x%llx\n",
+ (ULong)co_start, (ULong)co_endPlus-1 );
+ return=20
+ VG_(am_change_ownership_v_to_c)( co_start, co_endPlus - co_start=
);
+ }
+
#elif defined(VGP_ppc32_linux)
=20
//CAB: TODO
Modified: branches/ASPACEM/coregrind/m_trampoline.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_trampoline.S 2005-09-20 12:05:39 UTC (re=
v 4698)
+++ branches/ASPACEM/coregrind/m_trampoline.S 2005-09-20 12:07:14 UTC (re=
v 4699)
@@ -73,6 +73,15 @@
#else
#if defined(VGP_amd64_linux)
=20
+# define UD2_16 ud2 ; ud2 ; ud2 ; ud2 ;ud2 ; ud2 ; ud2 ; ud2
+# define UD2_64 UD2_16 ; UD2_16 ; UD2_16 ; UD2_16
+# define UD2_256 UD2_64 ; UD2_64 ; UD2_64 ; UD2_64
+# define UD2_1024 UD2_256 ; UD2_256 ; UD2_256 ; UD2_256
+# define UD2_PAGE UD2_1024 ; UD2_1024 ; UD2_1024 ; UD2_1024 =20
+
+ /* a leading page of unexecutable code */
+ UD2_PAGE
+=09
.global VG_(trampoline_stuff_start)
VG_(trampoline_stuff_start):
=20
@@ -99,7 +108,16 @@
.global VG_(trampoline_stuff_end)
VG_(trampoline_stuff_end):
=20
+ /* and a trailing page of unexecutable code */
+ UD2_PAGE
=20
+# undef UD2_16
+# undef UD2_64
+# undef UD2_256
+# undef UD2_1024
+# undef UD2_PAGE
+
+
/*---------------- ppc32-linux ----------------*/
#else
#if defined(VGP_ppc32_linux)
Modified: branches/ASPACEM/coregrind/pub_core_aspacemgr.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-20 12:05:39 U=
TC (rev 4698)
+++ branches/ASPACEM/coregrind/pub_core_aspacemgr.h 2005-09-20 12:07:14 U=
TC (rev 4699)
@@ -230,6 +230,12 @@
accordingly. This fails if the range isn't valid for valgrind. */
extern SysRes VG_(am_munmap_valgrind)( Addr start, SizeT length );
=20
+/* Let (start,len) denote an area within a single Valgrind-owned
+ segment (anon or file). Change the ownership of [start, start+len)
+ to the client instead. Fails if (start,len) does not denote a
+ suitable segment. */
+extern Bool VG_(am_change_ownership_v_to_c)( Addr start, SizeT len );
+
/* --- --- --- reservations --- --- --- */
=20
/* Create a reservation from START .. START+LENGTH-1, with the given
Modified: branches/ASPACEM/coregrind/pub_core_redir.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/pub_core_redir.h 2005-09-20 12:05:39 UTC (=
rev 4698)
+++ branches/ASPACEM/coregrind/pub_core_redir.h 2005-09-20 12:07:14 UTC (=
rev 4699)
@@ -68,8 +68,9 @@
// before translating a basic block.
extern Addr VG_(code_redirect) ( Addr orig );
=20
-/* Set up some default redirects */
-extern void VG_(setup_code_redirect_table) ( void );
+/* Set up some default redirects. Returns False if failed, in which
+ case the start-up of Valgrind can be considered to have failed. */
+extern Bool VG_(setup_code_redirect_table) ( void );
=20
extern void VG_(resolve_existing_redirs_with_seginfo)(SegInfo *si);
=20
|