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
(11) |
2
(13) |
3
(7) |
|
4
(9) |
5
(23) |
6
(19) |
7
(18) |
8
(2) |
9
(7) |
10
(21) |
|
11
(13) |
12
|
13
(8) |
14
(17) |
15
(19) |
16
(25) |
17
(43) |
|
18
(22) |
19
(12) |
20
(19) |
21
(12) |
22
(9) |
23
(12) |
24
(5) |
|
25
(16) |
26
(25) |
27
(24) |
28
(19) |
29
(26) |
30
(25) |
31
(6) |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 23:44:40
|
CVS commit by nethercote: Remove redundant duplicates of stuff in vg_kerneliface.h. M +0 -5 vg_proxylwp.c 1.16 --- valgrind/coregrind/vg_proxylwp.c #1.15:1.16 @@ -880,9 +880,4 @@ static Int do_futex(void *addr, Int op, } -#define VKI_FUTEX_WAIT 0 -#define VKI_FUTEX_WAKE 1 -#define VKI_FUTEX_FD 2 -#define VKI_FUTEX_REQUEUE 3 - static Int have_settid = -1; /* -1 -> unknown */ |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 23:36:49
|
CVS commit by nethercote:
Removed unused VG_AR_CLIENT_STACKBASE_REDZONE_SZW.
M +1 -4 vg_include.h 1.204
--- valgrind/coregrind/vg_include.h #1.203:1.204
@@ -1019,8 +1019,5 @@ extern Int VG_(longjmpd_on_signal);
thread stacks, for paranoia reasons. This can be arbitrary, and
doesn't really need to be set at compile time. */
-#define VG_AR_CLIENT_STACKBASE_REDZONE_SZW 4
-
-#define VG_AR_CLIENT_STACKBASE_REDZONE_SZB \
- (VG_AR_CLIENT_STACKBASE_REDZONE_SZW * VKI_BYTES_PER_WORD)
+#define VG_AR_CLIENT_STACKBASE_REDZONE_SZB 16
/* Junk to fill up a thread's shadow regs with when shadow regs aren't
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 21:50:39
|
CVS commit by nethercote:
Restructured the as_*() functions so they are simpler and there is no implicit
global state -- the state is threaded explicitly through via function arguments
and return values. ume.c now has no global variables, which is nice.
Also removed a redundant as_pad() call in stage2's main() which meant
layout_client_space() could be merged with layout_remaining_space().
Also removed a couple of no-longer-used variables and #defines.
M +10 -7 stage1.c 1.15
M +107 -93 ume.c 1.19 [POSSIBLY UNSAFE: printf]
M +9 -9 ume.h 1.9
M +29 -40 vg_main.c 1.178
--- valgrind/coregrind/stage1.c #1.14:1.15
@@ -62,5 +62,6 @@ static const char stage2[] = "stage2";
padding file, so it can identiry and remove the padding later).
*/
-static void *fix_auxv(void *v_init_esp, const struct exeinfo *info)
+static void *fix_auxv(void *v_init_esp, const struct exeinfo *info,
+ int padfile)
{
struct ume_auxv *auxv;
@@ -91,5 +92,5 @@ static void *fix_auxv(void *v_init_esp,
place when we start it */
auxv[0].a_type = AT_UME_PADFD;
- auxv[0].u.a_val = as_getpadfd();
+ auxv[0].u.a_val = padfile;
/* This will be needed by valgrind itself so that it can
@@ -156,5 +157,6 @@ static void *fix_auxv(void *v_init_esp,
}
-static int prmap(void *start, void *end, const char *perm, off_t off, int maj, int min, int ino) {
+static int prmap(char *start, char *end, const char *perm, off_t off, int maj,
+ int min, int ino, void* dummy) {
printf("mapping %10p-%10p %s %02x:%02x %d\n",
start, end, perm, maj, min, ino);
@@ -164,5 +166,5 @@ static int prmap(void *start, void *end,
static void hoops(void)
{
- int err;
+ int err, padfile;
struct exeinfo info;
extern char _end;
@@ -194,12 +196,13 @@ static void hoops(void)
/* Make sure stage2's dynamic linker can't tromp on the lower part
of the address space. */
- as_pad(0, (void *)info.map_base);
+ padfile = as_openpadfile();
+ as_pad(0, (void *)info.map_base, padfile);
- esp = fix_auxv(ume_exec_esp, &info);
+ esp = fix_auxv(ume_exec_esp, &info, padfile);
if (0) {
printf("---------- launch stage 2 ----------\n");
printf("eip=%p esp=%p\n", (void *)info.init_eip, esp);
- foreach_map(prmap);
+ foreach_map(prmap, /*dummy*/NULL);
}
--- valgrind/coregrind/ume.c #1.18:1.19
@@ -58,9 +58,4 @@ struct elfinfo
};
-static int padfile = -1;
-static struct stat padstat;
-
-extern int kickstart_base; /* linker created */
-
static void check_mmap(void* res, void* base, int len)
{
@@ -73,7 +68,10 @@ static void check_mmap(void* res, void*
}
-void foreach_map(int (*fn)(void *start, void *end,
+// 'extra' allows the caller to pass in extra args to 'fn', like free
+// variables to a closure.
+void foreach_map(int (*fn)(char *start, char *end,
const char *perm, off_t offset,
- int maj, int min, int ino))
+ int maj, int min, int ino, void* extra),
+ void* extra)
{
static char buf[10240];
@@ -115,79 +113,101 @@ void foreach_map(int (*fn)(void *start,
bufptr++; /* skip \n */
- if (!(*fn)(segstart, segend, perm, offset, maj, min, ino))
+ if (!(*fn)(segstart, segend, perm, offset, maj, min, ino, extra))
break;
}
}
-static char *fillgap_addr;
-static char *fillgap_end;
+typedef struct {
+ char* fillgap_start;
+ char* fillgap_end;
+ int fillgap_padfile;
+} fillgap_extra;
-static int fillgap(void *segstart, void *segend, const char *perm, off_t off,
- int maj, int min, int ino) {
- if ((char *)segstart >= fillgap_end)
+static int fillgap(char *segstart, char *segend, const char *perm, off_t off,
+ int maj, int min, int ino, void* e)
+{
+ fillgap_extra* extra = e;
+
+ if (segstart >= extra->fillgap_end)
return 0;
- if ((char *)segstart > fillgap_addr) {
- void* res = mmap(fillgap_addr, (char *)segstart-fillgap_addr, PROT_NONE,
- MAP_FIXED|MAP_PRIVATE, padfile, 0);
- check_mmap(res, fillgap_addr, (char*)segstart - fillgap_addr);
+ if (segstart > extra->fillgap_start) {
+ void* res = mmap(extra->fillgap_start, segstart - extra->fillgap_start,
+ PROT_NONE, MAP_FIXED|MAP_PRIVATE,
+ extra->fillgap_padfile, 0);
+ check_mmap(res, extra->fillgap_start, segstart - extra->fillgap_start);
}
- fillgap_addr = segend;
+ extra->fillgap_start = segend;
return 1;
}
-/* pad all the empty spaces in a range of address space to stop
- interlopers */
-void as_pad(void *start, void *end)
+// Choose a name for the padfile, open it.
+int as_openpadfile(void)
{
- char buf[1024];
-
- if (padfile == -1) {
+ char buf[256];
+ int padfile;
int seq = 1;
do {
- sprintf(buf, "/tmp/.pad.%d.%d", getpid(), seq++);
+ snprintf(buf, 256, "/tmp/.pad.%d.%d", getpid(), seq++);
padfile = open(buf, O_RDWR|O_CREAT|O_EXCL, 0);
unlink(buf);
- if (padfile == -1 && errno != EEXIST)
+ if (padfile == -1 && errno != EEXIST) {
+ fprintf(stderr, "valgrind: couldn't open padfile\n");
exit(44);
- } while(padfile == -1);
- fstat(padfile, &padstat);
}
+ } while(padfile == -1);
- fillgap_addr = start;
- fillgap_end = end;
+ return padfile;
+}
- foreach_map(fillgap);
+// Pad all the empty spaces in a range of address space to stop interlopers.
+void as_pad(void *start, void *end, int padfile)
+{
+ fillgap_extra extra;
+ extra.fillgap_start = start;
+ extra.fillgap_end = end;
+ extra.fillgap_padfile = padfile;
- if (fillgap_addr < fillgap_end) {
- void* res = mmap(fillgap_addr, fillgap_end-fillgap_addr, PROT_NONE,
- MAP_FIXED|MAP_PRIVATE, padfile, 0);
- check_mmap(res, fillgap_addr, fillgap_end - fillgap_addr);
+ foreach_map(fillgap, &extra);
+
+ if (extra.fillgap_start < extra.fillgap_end) {
+ void* res = mmap(extra.fillgap_start,
+ extra.fillgap_end - extra.fillgap_start,
+ PROT_NONE, MAP_FIXED|MAP_PRIVATE, padfile, 0);
+ check_mmap(res, extra.fillgap_start,
+ extra.fillgap_end - extra.fillgap_start);
}
}
-static void *killpad_start;
-static void *killpad_end;
+typedef struct {
+ char* killpad_start;
+ char* killpad_end;
+ struct stat* killpad_padstat;
+} killpad_extra;
-static int killpad(void *segstart, void *segend, const char *perm, off_t off,
- int maj, int min, int ino)
+static int killpad(char *segstart, char *segend, const char *perm, off_t off,
+ int maj, int min, int ino, void* ex)
{
+ killpad_extra* extra = ex;
void *b, *e;
int res;
- if (padstat.st_dev != makedev(maj, min) || padstat.st_ino != ino)
+ assert(NULL != extra->killpad_padstat);
+
+ if (extra->killpad_padstat->st_dev != makedev(maj, min) ||
+ extra->killpad_padstat->st_ino != ino)
return 1;
- if (segend <= killpad_start || segstart >= killpad_end)
+ if (segend <= extra->killpad_start || segstart >= extra->killpad_end)
return 1;
- if (segstart <= killpad_start)
- b = killpad_start;
+ if (segstart <= extra->killpad_start)
+ b = extra->killpad_start;
else
b = segstart;
- if (segend >= killpad_end)
- e = killpad_end;
+ if (segend >= extra->killpad_end)
+ e = extra->killpad_end;
else
e = segend;
@@ -199,35 +219,30 @@ static int killpad(void *segstart, void
}
-/* remove padding from a range of address space - padding is always a
- mapping of padfile*/
-void as_unpad(void *start, void *end)
+// Remove padding of 'padfile' from a range of address space.
+void as_unpad(void *start, void *end, int padfile)
{
- if (padfile == -1) /* no padfile, no padding */
- return;
-
- killpad_start = start;
- killpad_end = end;
+ static struct stat padstat;
+ killpad_extra extra;
+ int res;
- foreach_map(killpad);
-}
+ assert(padfile > 0);
-void as_closepadfile(void)
-{
- /* don't unpad */
- close(padfile);
- padfile = -1;
+ res = fstat(padfile, &padstat);
+ assert(0 == res);
+ extra.killpad_padstat = &padstat;
+ extra.killpad_start = start;
+ extra.killpad_end = end;
+ foreach_map(killpad, &extra);
}
-int as_getpadfd(void)
+void as_closepadfile(int padfile)
{
- return padfile;
+ int res = close(padfile);
+ assert(0 == res);
}
-void as_setpadfd(int fd)
-{
- as_closepadfile();
- padfile = fd;
- fstat(padfile, &padstat);
-}
+/*------------------------------------------------------------*/
+/*--- Finding auxv on the stack ---*/
+/*------------------------------------------------------------*/
struct ume_auxv *find_auxv(int *esp)
@@ -246,4 +261,7 @@ struct ume_auxv *find_auxv(int *esp)
}
+/*------------------------------------------------------------*/
+/*--- Loading ELF files ---*/
+/*------------------------------------------------------------*/
struct elfinfo *readelf(int fd, const char *filename)
@@ -300,6 +318,4 @@ struct elfinfo *readelf(int fd, const ch
}
-#define REMAINS(x, a) ((x) & ((a)-1))
-
/* Map an ELF file. Returns the brk address. */
ESZ(Addr) mapelf(struct elfinfo *e, ESZ(Addr) base)
@@ -381,5 +397,5 @@ ESZ(Addr) mapelf(struct elfinfo *e, ESZ(
}
-
+// Forward declaration.
static int do_exec_inner(const char *exe, struct exeinfo *info);
@@ -391,5 +406,6 @@ static int match_ELF(const char *hdr, in
}
-static int load_ELF(char *hdr, int len, int fd, const char *name, struct exeinfo *info)
+static int load_ELF(char *hdr, int len, int fd, const char *name,
+ struct exeinfo *info)
{
struct elfinfo *e;
@@ -531,5 +547,6 @@ static int match_script(const char *hdr,
}
-static int load_script(char *hdr, int len, int fd, const char *name, struct exeinfo *info)
+static int load_script(char *hdr, int len, int fd, const char *name,
+ struct exeinfo *info)
{
char *interp;
@@ -583,15 +600,4 @@ static int load_script(char *hdr, int le
}
-struct binfmt {
- int (*match)(const char *hdr, int len);
- int (*load) ( char *hdr, int len, int fd, const char *name, struct exeinfo *);
-};
-
-static const struct binfmt formats[] = {
- { match_ELF, load_ELF },
- { match_script, load_script },
-};
-
-
static int do_exec_inner(const char *exe, struct exeinfo *info)
{
@@ -602,4 +608,12 @@ static int do_exec_inner(const char *exe
int ret;
struct stat st;
+ static const struct {
+ int (*match)(const char *hdr, int len);
+ int (*load) ( char *hdr, int len, int fd2, const char *name,
+ struct exeinfo *);
+ } formats[] = {
+ { match_ELF, load_ELF },
+ { match_script, load_script },
+ };
fd = open(exe, O_RDONLY);
--- valgrind/coregrind/ume.h #1.8:1.9
@@ -51,4 +51,9 @@
typedef ESZ(Addr) addr_t;
+void foreach_map(int (*fn)(char *start, char *end,
+ const char *perm, off_t offset,
+ int maj, int min, int ino, void* extra),
+ void* extra);
+
/*------------------------------------------------------------*/
/*--- Loading ELF files ---*/
@@ -87,14 +92,9 @@ int do_exec(const char *exe, struct exei
/*------------------------------------------------------------*/
-void foreach_map(int (*fn)(void *start, void *end,
- const char *perm, off_t offset,
- int maj, int min, int ino));
-
// Padding functions used at startup to force things where we want them.
-void as_pad(void *start, void *end);
-void as_unpad(void *start, void *end);
-void as_closepadfile(void);
-int as_getpadfd(void);
-void as_setpadfd(int);
+int as_openpadfile (void);
+void as_pad (void *start, void *end, int padfile);
+void as_unpad (void *start, void *end, int padfile);
+void as_closepadfile(int padfile);
/*------------------------------------------------------------*/
--- valgrind/coregrind/vg_main.c #1.177:1.178
@@ -456,13 +456,13 @@ static void newpid(ThreadId unused)
/* Look for our AUXV table */
-static void scan_auxv(void)
+int scan_auxv(void)
{
const struct ume_auxv *auxv = find_auxv((int *)ume_exec_esp);
- int found = 0;
+ int padfile = -1, found = 0;
for (; auxv->a_type != AT_NULL; auxv++)
switch(auxv->a_type) {
case AT_UME_PADFD:
- as_setpadfd(auxv->u.a_val);
+ padfile = auxv->u.a_val;
found |= 1;
break;
@@ -478,4 +478,6 @@ static void scan_auxv(void)
exit(127);
}
+ vg_assert(padfile >= 0);
+ return padfile;
}
@@ -485,25 +487,18 @@ static void scan_auxv(void)
/*====================================================================*/
-/* Pad client space so it doesn't get filled in before the right time */
-static void layout_client_space(Addr argc_addr)
-{
- VG_(client_base) = CLIENT_BASE;
- VG_(valgrind_base) = (addr_t)&kickstart_base;
- VG_(valgrind_end) = ROUNDUP(argc_addr, 0x10000); /* stack */
-
- as_pad((void *)VG_(client_base), (void *)VG_(valgrind_base));
-}
-
-static void layout_remaining_space(float ratio)
+static void layout_remaining_space(Addr argc_addr, float ratio)
{
Int ires;
void* vres;
+ addr_t client_size, shadow_size;
- /* This tries to give the client as large as possible address space while
- * taking into account the tool's shadow needs. */
- addr_t client_size = ROUNDDN((VG_(valgrind_base) - REDZONE_SIZE) / (1. + ratio),
- CLIENT_SIZE_MULTIPLE);
- addr_t shadow_size = PGROUNDUP(client_size * ratio);
+ VG_(valgrind_base) = (addr_t)&kickstart_base;
+ VG_(valgrind_end) = ROUNDUP(argc_addr, 0x10000); // stack
+ // This gives the client the largest possible address space while
+ // taking into account the tool's shadow needs.
+ client_size = ROUNDDN((VG_(valgrind_base)-REDZONE_SIZE) / (1.+ratio),
+ CLIENT_SIZE_MULTIPLE);
+ VG_(client_base) = CLIENT_BASE;
VG_(client_end) = VG_(client_base) + client_size;
/* where !FIXED mmap goes */
@@ -511,4 +506,5 @@ static void layout_remaining_space(float
PGROUNDDN((addr_t)(client_size * CLIENT_HEAP_PROPORTION));
+ shadow_size = PGROUNDUP(client_size * ratio);
VG_(shadow_base) = VG_(client_end) + REDZONE_SIZE;
VG_(shadow_end) = VG_(shadow_base) + shadow_size;
@@ -2697,6 +2693,6 @@ void VG_(do_sanity_checks) ( Bool force_
*/
-static int prmap(void *start, void *end, const char *perm, off_t off,
- int maj, int min, int ino) {
+static int prmap(char *start, char *end, const char *perm, off_t off,
+ int maj, int min, int ino, void* dummy) {
printf("mapping %10p-%10p %s %02x:%02x %d\n",
start, end, perm, maj, min, ino);
@@ -2721,4 +2717,5 @@ int main(int argc, char **argv)
Int exitcode = 0;
vki_rlimit zero = { 0, 0 };
+ Int padfile;
//============================================================
@@ -2749,9 +2746,9 @@ int main(int argc, char **argv)
// p: n/a
//--------------------------------------------------------------
- scan_auxv();
+ padfile = scan_auxv();
if (0) {
printf("========== main() ==========\n");
- foreach_map(prmap);
+ foreach_map(prmap, /*dummy*/NULL);
}
@@ -2766,10 +2763,4 @@ int main(int argc, char **argv)
//--------------------------------------------------------------
- // Begin working out address space layout
- // p: n/a
- //--------------------------------------------------------------
- layout_client_space( (Addr) & argc );
-
- //--------------------------------------------------------------
// Get valgrind args + client args (inc. from VALGRIND_OPTS/.valgrindrc).
// Pre-process the command line.
@@ -2786,5 +2777,4 @@ int main(int argc, char **argv)
//--------------------------------------------------------------
// With client padded out, map in tool
- // p: layout_client_space() [for padding]
// p: set-libdir [for VG_(libdir)]
// p: pre_process_cmd_line_options() [for 'tool']
@@ -2799,11 +2789,10 @@ int main(int argc, char **argv)
//--------------------------------------------------------------
// Finalise address space layout
- // p: layout_client_space(), load_tool() [for 'toolinfo']
+ // p: load_tool() [for 'toolinfo']
//--------------------------------------------------------------
- layout_remaining_space( toolinfo->shadow_ratio );
+ layout_remaining_space( (Addr) & argc, toolinfo->shadow_ratio );
//--------------------------------------------------------------
// Load client executable, finding in $PATH if necessary
- // p: layout_client_space() [so there's space]
// p: pre_process_cmd_line_options() [for 'exec', 'need_help']
// p: layout_remaining_space [so there's space]
@@ -2816,6 +2805,6 @@ int main(int argc, char **argv)
// p: load_client() [ditto]
//--------------------------------------------------------------
- as_unpad((void *)VG_(shadow_end), (void *)~0);
- as_closepadfile(); /* no more padding */
+ as_unpad((void *)VG_(shadow_end), (void *)~0, padfile);
+ as_closepadfile(padfile); // no more padding
//--------------------------------------------------------------
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 21:46:52
|
Hi, Continuing the discussions about headers and multiple architectures... for getting the kernel headers at least, I'm imagining a setup like this: Valgrind Linux -------- ----- include/vki_linux.h include/linux/*.h include/vki_asm-generic.h include/asm-generic/*.h include/vki_asm-x86_64.h include/asm-x86_64/*.h include/vki_asm-i386.h include/asm-i386/*.h Here each Valgrind .h file (on the left) represents an entire Linux-source directory (on the right). Because we only use a small fraction of the declarations in the Linux files, it makes sense to compress an entire directory of Linux .h files into a single Valgrind .h file. This setup would work for multiple archs with Linux, but doesn't consider other OSes. I guess Valgrind could use include-linux/, include-freebsd/, etc, or something similar. This is specific to the headers, where it makes great sense to mirror the Linux header structure as closely as possible. The arch- and OS-specific code in Valgrind would be structured differently, possible with arch/, OS/ and arch-OS/ directories under arch/. N |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 21:36:54
|
On Fri, 30 Jul 2004, Jeremy Fitzhardinge wrote: >> And what about vg_unsafe.h? Its presence means that a whole lot of the >> types used in vg_syscalls.c are really the glibc versions, right? This >> stuff seems like a giant mess... > > Yup. vg_unsafe really is unsafe - we shouldn't use it at all (I've been > actively incrementally removing things from it and putting copies into > vg_kerneliface, and certainly not adding anything new to it. > > Of course, some things we're dealing with *are* glibc types (stuff > around malloc, and other intercepted glibc routines, etc), so its > appropriate to use the glibc definitions there. Sure. But vg_unsafe.h is only used by vg_syscalls.c for providing types for talking to syscalls. So it should die a miserable death. > That too requires care, because we're not paying attention to symbol > versioning, and glibc uses it extensively to handle > backwards-compatibility. Oh goody, one more thing to get wrong... is this likely to be a problem in practice for us? N |
|
From: Jeremy F. <je...@go...> - 2004-07-30 19:17:06
|
On Fri, 2004-07-30 at 12:44 +0100, Nicholas Nethercote wrote: > Ok, I will commit this later today unless there are any last-minute > objections. Good. J |
|
From: Jeremy F. <je...@go...> - 2004-07-30 19:16:34
|
On Fri, 2004-07-30 at 10:03 +0100, Tom Hughes wrote: > In message <200...@ac...> > Julian Seward <js...@ac...> wrote: > > >> Why are AT_UCACHEBSIZE, AT_SYSINFO, AT_SYSINFO_EHDR, AT_ICACHEBSIZE, > >> AT_DCACHEBSIZE, and AT_SECURE defined in vg_main.c, rather than > >> vg_kerneliface.h? I recall these are recent additions, but I didn't pay > >> attention/understand at the time and now it's of interest to me :) > > > > Uh, I don't know, but I'm guessing they should be in vg_kerneliface.h, > > along with all the other VKI_AT_* ? > > I agree. There's a right mishmash at the moment - some things use > the AT_ constants and some use the VKI_AT_ ones. Me too. The main reason is that ume.[ch] uses elf.h, which contains the glibc definitions of some of these. It misses out on newer ones like AT_SYSINFO_EHDR, so there's some fill-in definitions in there. But it isn't pretty or the right way to do it. J |
|
From: Jeremy F. <je...@go...> - 2004-07-30 19:14:51
|
On Fri, 2004-07-30 at 17:54 +0100, Nicholas Nethercote wrote: > On Fri, 30 Jul 2004, Nicholas Nethercote wrote: > > >> They're only supposed to match the syscall interface types. Ignore > >> anything in /usr/include (except /usr/include/(linux,asm)/, since that > >> will just mislead you. > > > > Looks like 'struct vki_epoll_event' is really the glibc definition, right? > > And what about vg_unsafe.h? Its presence means that a whole lot of the > types used in vg_syscalls.c are really the glibc versions, right? This > stuff seems like a giant mess... Yup. vg_unsafe really is unsafe - we shouldn't use it at all (I've been actively incrementally removing things from it and putting copies into vg_kerneliface, and certainly not adding anything new to it. Of course, some things we're dealing with *are* glibc types (stuff around malloc, and other intercepted glibc routines, etc), so its appropriate to use the glibc definitions there. That too requires care, because we're not paying attention to symbol versioning, and glibc uses it extensively to handle backwards-compatibility. J |
|
From: Jeremy F. <je...@go...> - 2004-07-30 19:12:30
|
On Thu, 2004-07-29 at 23:44 +0100, Nicholas Nethercote wrote: > On Thu, 29 Jul 2004, Jeremy Fitzhardinge wrote: > > > The libc headers are only vaguely related to the kernel interface > > headers. We could include linux/* headers, but that could into a pretty > > messy tarpit. > > Why is that a messy tarpit? Mostly because you can't mix kernel and libc headers. They define lots of duplicates. That's why glibc has its own set of kernel headers. J |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 16:54:45
|
On Fri, 30 Jul 2004, Nicholas Nethercote wrote: >> They're only supposed to match the syscall interface types. Ignore >> anything in /usr/include (except /usr/include/(linux,asm)/, since that >> will just mislead you. > > Looks like 'struct vki_epoll_event' is really the glibc definition, right? And what about vg_unsafe.h? Its presence means that a whole lot of the types used in vg_syscalls.c are really the glibc versions, right? This stuff seems like a giant mess... N |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 16:11:23
|
On Thu, 29 Jul 2004, Jeremy Fitzhardinge wrote: > They're only supposed to match the syscall interface types. Ignore > anything in /usr/include (except /usr/include/(linux,asm)/, since that > will just mislead you. Looks like 'struct vki_epoll_event' is really the glibc definition, right? N |
|
From: Tom H. <th...@cy...> - 2004-07-30 13:40:22
|
In message <Pin...@he...>
Nicholas Nethercote <nj...@ca...> wrote:
> On Thu, 29 Jul 2004, Jeremy Fitzhardinge wrote:
>
>> They're only supposed to match the syscall interface types. Ignore
>> anything in /usr/include (except /usr/include/(linux,asm)/, since that
>> will just mislead you.
>
> The constants VKI_SEEK_{SET,CUR,END} are in vg_kerneliface.h. I can't
> find SEEK_{SET,CUR,END} in the linux-2.6.7 sources. I can find them
> in /usr/include/fcntl.h.
It looks like the kernel is using magic numbers instead of named
constants... Look at the llseek routines in fs/read_write.c
for the sheer horrible truth.
> Am I missing something obvious, or is this screwy?
Well the kernel using magic numbers is pretty screwy, yes ;-)
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 13:28:40
|
On Thu, 29 Jul 2004, Jeremy Fitzhardinge wrote:
> They're only supposed to match the syscall interface types. Ignore
> anything in /usr/include (except /usr/include/(linux,asm)/, since that
> will just mislead you.
The constants VKI_SEEK_{SET,CUR,END} are in vg_kerneliface.h. I can't
find SEEK_{SET,CUR,END} in the linux-2.6.7 sources. I can find them in
/usr/include/fcntl.h.
Am I missing something obvious, or is this screwy?
N
|
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 11:44:26
|
On Wed, 28 Jul 2004, Nicholas Nethercote wrote: > Here's a more compelling patch: I've rejigged as_*() so that no implicit > state is kept in global variables in ume.c; the padfile fd is now threaded > through explicitly. The as_*() interface has changed from this > > void as_pad(void *start, void *end); > void as_unpad(void *start, void *end); > void as_closepadfile(void); > int as_getpadfd(void); > void as_setpadfd(int); > > to this > > int as_openpadfile (void); > void as_pad (void *start, void *end, int padfile); > void as_unpad (void *start, void *end, int padfile); > void as_closepadfile(int padfile); > > which is a definite improvement. Jeremy, can you check this? If there are > no complaints I'll commit. Ok, I will commit this later today unless there are any last-minute objections. N |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 10:47:00
|
On Thu, 29 Jul 2004, Bob Friesenhahn wrote: > Does it seem to you that valgrind would benefit if part of it was included in > the Linux kernel and glibc environment? Maybe once Linux stablizes a bit > more it can offer a "valgrind" mode. Programs would run faster and valgrind > wouldn't have to replicate so much functionality. It's nice that you say "once Linux stabilizes"... I'd be more concerned about Valgrind stabilising :) Solaris 10 has dtrace in it, which has a lot of similar features to Valgrind. But I can't see Valgrind and Linux merging any time soon. If you ran the idea past a kernel developer, I'd be interested to hear their reaction :) N |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 10:45:07
|
On Thu, 29 Jul 2004, Bob Friesenhahn wrote: >>> The libc headers are only vaguely related to the kernel interface >>> headers. We could include linux/* headers, but that could into a pretty >>> messy tarpit. >> >> Why is that a messy tarpit? > > Probably because the Linux kernel API is necessarily pretty stable but the > kernel header files change with each release. But if we're only using the API parts of the headers, as we are -- only certain types and certain constants -- is that still a problem? N |
|
From: Tom H. <th...@cy...> - 2004-07-30 09:03:24
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
>> Why are AT_UCACHEBSIZE, AT_SYSINFO, AT_SYSINFO_EHDR, AT_ICACHEBSIZE,
>> AT_DCACHEBSIZE, and AT_SECURE defined in vg_main.c, rather than
>> vg_kerneliface.h? I recall these are recent additions, but I didn't pay
>> attention/understand at the time and now it's of interest to me :)
>
> Uh, I don't know, but I'm guessing they should be in vg_kerneliface.h,
> along with all the other VKI_AT_* ?
I agree. There's a right mishmash at the moment - some things use
the AT_ constants and some use the VKI_AT_ ones.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Julian S. <js...@ac...> - 2004-07-30 08:52:35
|
> Why are AT_UCACHEBSIZE, AT_SYSINFO, AT_SYSINFO_EHDR, AT_ICACHEBSIZE, > AT_DCACHEBSIZE, and AT_SECURE defined in vg_main.c, rather than > vg_kerneliface.h? I recall these are recent additions, but I didn't pay > attention/understand at the time and now it's of interest to me :) Uh, I don't know, but I'm guessing they should be in vg_kerneliface.h, along with all the other VKI_AT_* ? J |
|
From: <js...@ac...> - 2004-07-30 03:01:56
|
Nightly build on nemesis ( SuSE 9.1 ) started at 2004-07-30 03:50:01 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 4 stderr failures, 0 stdout failures ================= corecheck/tests/as_mmap (stderr) corecheck/tests/fdleak_fcntl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2004-07-30 02:25:08
|
Nightly build on dunsmere ( Fedora Core 2 ) started at 2004-07-30 03:20:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 7 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) none/tests/exec-sigmask (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-30 02:20:41
|
Nightly build on audi ( Red Hat 9 ) started at 2004-07-30 03:15:03 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 7 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-30 02:13:21
|
Nightly build on ginetta ( Red Hat 8.0 ) started at 2004-07-30 03:10:04 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 3 stderr failures, 0 stdout failures ================= helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Nicholas N. <nj...@ca...> - 2004-07-30 02:11:00
|
Hi, Why are AT_UCACHEBSIZE, AT_SYSINFO, AT_SYSINFO_EHDR, AT_ICACHEBSIZE, AT_DCACHEBSIZE, and AT_SECURE defined in vg_main.c, rather than vg_kerneliface.h? I recall these are recent additions, but I didn't pay attention/understand at the time and now it's of interest to me :) N |
|
From: Tom H. <th...@cy...> - 2004-07-30 02:08:17
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2004-07-30 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 9 stderr failures, 1 stdout failure ================= addrcheck/tests/toobig-allocs (stderr) helgrind/tests/deadlock (stderr) helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/badjump (stderr) memcheck/tests/brk (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/new_nothrow (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-07-30 02:07:44
|
Nightly build on standard ( Red Hat 7.2 ) started at 2004-07-30 03:00:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow rcrl: valgrind ./rcrl readline1: valgrind ./readline1 resolv: valgrind ./resolv rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 0 stderr failures, 0 stdout failures ================= |