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
(5) |
2
(5) |
|
3
(5) |
4
(6) |
5
(6) |
6
(10) |
7
(10) |
8
(10) |
9
(10) |
|
10
(6) |
11
(6) |
12
(8) |
13
(33) |
14
(19) |
15
(6) |
16
(15) |
|
17
(8) |
18
(29) |
19
(23) |
20
(20) |
21
(8) |
22
(6) |
23
(6) |
|
24
(6) |
25
(22) |
26
(21) |
27
(9) |
28
(21) |
29
(11) |
30
(7) |
|
31
(16) |
|
|
|
|
|
|
|
From: Josef W. <Jos...@gm...> - 2004-10-13 20:43:28
|
On Wednesday 13 October 2004 18:40, Tom Hughes wrote:
> > typedef enum { Vg_CacheI1Size, Vg_CacheI1Assoc,
> > VG_CacheI1LineSize, ... } VgArchFeature;
> > extern int VG_(get_arch_feature)(VgArchFeature, char* resultBuffer, int
> > len);
>
> I have to say that I'm not a huge fan of an interface as loosely
> typed as that...
Yes, you are right. Probably an interface similar to cachegrind/cg_arch.h
typedef struct { int size, assoc, line_size; } cache_t;
typedef enum { Vg_I1, Vg_L1, Vg_L2 } VgCacheType;
cache_t get_cache_config(VgCacheType);
is better. But this seems to specific to be moved to Valgrind core.
Perhaps putting functions handy for similar tools into own libraries, linking
these tools to them, and doing some dependency check with meanful error
messages at startup (like version checking). Especially if these functions
are architecture/platform specific, this would ease testing of tools
dependent on common functionality.
>> > And regarding arch-abstraction, it would be cool to get rid of the
> > arch-specifics in tools whenever possible: E.g. in cachegrind (and
> > calltree also), there is the MMX/SSE stuff. Perhaps some functions could
> > be added providing additional high level properties for UOps like if it
> > is accessing memory and so on. Prove of concept would be a cachegrind
> > with same source for PowerPC, x86 and x86_64.
>
> I think that sort of thing comes under the heading of reworking UCode
> for better platform independence which I believe Julian is working on?
Yes, but reworking UCode is quite difficult to get it right. But this seems to
be a worthwhile short-term goal. Perhaps here also, a library between
Valgrind and the tool (as proposed above) is the best for this kind of thing.
Josef
>
> Tom
|
|
From: Tom H. <th...@cy...> - 2004-10-13 18:29:57
|
CVS commit by thughes:
Implement pthread_mutexattr_gettype.
CCMAIL: 911...@bu...
M +11 -0 vg_libpthread.c 1.164
M +2 -2 vg_libpthread_unimp.c 1.47
--- valgrind/coregrind/vg_libpthread.c #1.163:1.164
@@ -1277,4 +1277,14 @@ int __pthread_mutexattr_settype(pthread_
}
+int __pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type)
+{
+ vg_pthread_mutexattr_t* vg_attr;
+ CONVERT(mutexattr, attr, vg_attr);
+
+ *type = vg_attr->__vg_mutexkind;
+
+ return 0;
+}
+
int __pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
{
@@ -3352,4 +3362,5 @@ strong_alias(__pthread_mutex_unlock, pth
strong_alias(__pthread_mutexattr_init, pthread_mutexattr_init)
weak_alias(__pthread_mutexattr_settype, pthread_mutexattr_settype)
+ weak_alias(__pthread_mutexattr_gettype, pthread_mutexattr_gettype)
weak_alias(__pthread_mutexattr_setpshared, pthread_mutexattr_setpshared)
strong_alias(__pthread_mutex_init, pthread_mutex_init)
--- valgrind/coregrind/vg_libpthread_unimp.c #1.46:1.47
@@ -226,6 +226,6 @@ __attribute__((weak)) void pthread_mutex
__attribute__((weak)) void pthread_mutexattr_getpshared ( void )
{ vgPlain_unimp("pthread_mutexattr_getpshared"); }
-__attribute__((weak)) void pthread_mutexattr_gettype ( void )
- { vgPlain_unimp("pthread_mutexattr_gettype"); }
+//__attribute__((weak)) void pthread_mutexattr_gettype ( void )
+// { vgPlain_unimp("pthread_mutexattr_gettype"); }
__attribute__((weak)) void pthread_mutexattr_setkind_np ( void )
{ vgPlain_unimp("pthread_mutexattr_setkind_np"); }
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 17:58:45
|
CVS commit by nethercote:
Rename hoops() as main() -- much clearer.
M +2 -2 stage1.c 1.23
--- valgrind/coregrind/stage1.c #1.22:1.23
@@ -249,5 +249,5 @@ static int prmap(char *start, char *end,
}
-static void hoops(void)
+static void main2(void)
{
int err, padfile;
@@ -312,5 +312,5 @@ int main(void)
/* move onto another stack so we can play with the main one */
- jmp_with_stack((addr_t)hoops, (addr_t)stack + sizeof(stack));
+ jmp_with_stack((addr_t)main2, (addr_t)stack + sizeof(stack));
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 17:55:43
|
CVS commit by nethercote:
Some combined cleaning up and arch-abstraction, involving UME and start-up:
- removed some assumptions that arch==x86 in Makefile.am files
- removed ume_arch.h; moved its contents into ume.h. There was no need for
these to be separate.
- moved ume_go.c into an x86/ subdir; gave it the more meaningful name
jmp_with_stack.c in the process (the corresponding function also got the name
change)
A x86/jmp_with_stack.c 1.1 [GPL (v2+)]
M +5 -5 Makefile.am 1.88
M +2 -4 stage1.c 1.22
M +2 -1 ume.c 1.31
M +14 -4 ume.h 1.11
M +0 -1 vg_main.c 1.215
M +3 -3 x86/Makefile.am 1.12
R ume_arch.h 1.2
R x86/ume_go.c 1.3
--- valgrind/coregrind/Makefile.am #1.87:1.88
@@ -30,8 +30,9 @@
valgrind_SOURCES = \
- stage1.c \
ume.c \
- x86/ume_entry.S \
- x86/ume_go.c
+ ${VG_ARCH}/ume_entry.S \
+ \
+ stage1.c \
+ ${VG_ARCH}/jmp_with_stack.c
valgrind_DEPENDENCIES =
valgrind_LDFLAGS=-static -g -Wl,-e,_ume_entry
@@ -46,5 +47,5 @@
stage2_SOURCES = \
ume.c \
- x86/ume_entry.S \
+ ${VG_ARCH}/ume_entry.S \
\
vg_scheduler.c \
@@ -142,5 +143,4 @@
core_asm.h \
ume.h \
- ume_arch.h \
vg_symtab2.h \
vg_symtypes.h \
--- valgrind/coregrind/stage1.c #1.21:1.22
@@ -43,7 +43,5 @@
#include "core.h"
-
#include "ume.h"
-#include "ume_arch.h"
static int stack[SIGSTKSZ*4];
@@ -294,5 +292,5 @@ static void hoops(void)
}
- ume_go(info.init_eip, (addr_t)esp);
+ jmp_with_stack(info.init_eip, (addr_t)esp);
}
@@ -314,5 +312,5 @@ int main(void)
/* move onto another stack so we can play with the main one */
- ume_go((addr_t)hoops, (addr_t)stack + sizeof(stack));
+ jmp_with_stack((addr_t)hoops, (addr_t)stack + sizeof(stack));
}
--- valgrind/coregrind/ume.c #1.30:1.31
@@ -1,5 +1,6 @@
/*--------------------------------------------------------------------*/
-/*--- User-mode execve() ume.c ---*/
+/*--- User-mode execve(), and other stuff shared between stage1 ---*/
+/*--- and stage2. ume.c ---*/
/*--------------------------------------------------------------------*/
--- valgrind/coregrind/ume.h #1.10:1.11
@@ -45,8 +45,4 @@ void foreach_map(int (*fn)(char *start,
void* extra);
-/*------------------------------------------------------------*/
-/*--- Loading ELF files ---*/
-/*------------------------------------------------------------*/
-
#if ELFSZ == 64
#define ESZ(x) Elf64_##x
@@ -60,4 +56,18 @@ void foreach_map(int (*fn)(char *start,
typedef ESZ(Addr) addr_t;
+extern void *ume_exec_esp; /* esp on entry at exec time */
+
+// Jump to a new 'ip' with the stack 'sp'.
+void jmp_with_stack(addr_t ip, addr_t sp) __attribute__((noreturn));
+
+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 ---*/
+/*------------------------------------------------------------*/
+
// Info needed to load and run a program. IN/INOUT/OUT refers to the
// inputs/outputs of do_exec().
--- valgrind/coregrind/vg_main.c #1.214:1.215
@@ -33,5 +33,4 @@
#include "core.h"
#include "ume.h"
-#include "ume_arch.h"
#include <dirent.h>
--- valgrind/coregrind/x86/Makefile.am #1.11:1.12
@@ -11,7 +11,7 @@
noinst_LIBRARIES = libarch.a
-EXTRA_DIST = \
- ume_entry.S \
- ume_go.c
+EXTRA_DIST = \
+ jmp_with_stack.c \
+ ume_entry.S
BUILT_SOURCES = stage2.lds
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 17:29:07
|
CVS commit by nethercote:
Cleaned up ume.h by moving some functions around.
M +90 -0 stage1.c 1.21 [POSSIBLY UNSAFE: printf]
M +1 -127 ume.c 1.30 [POSSIBLY UNSAFE: printf]
M +9 -19 ume.h 1.10
M +66 -1 vg_main.c 1.214
--- valgrind/coregrind/stage1.c #1.20:1.21
@@ -31,4 +31,5 @@
#define _FILE_OFFSET_BITS 64
+#include <errno.h>
#include <stdio.h>
#include <string.h>
@@ -37,5 +38,7 @@
#include <signal.h>
#include <fcntl.h>
+#include <sys/mman.h>
#include <sys/resource.h>
+#include <unistd.h>
#include "core.h"
@@ -52,4 +55,8 @@ static const char *valgrind_lib = VG_LIB
static const char stage2[] = "stage2";
+/*------------------------------------------------------------*/
+/*--- Auxv modification ---*/
+/*------------------------------------------------------------*/
+
/* Modify the auxv the kernel gave us to make it look like we were
execed as the shared object.
@@ -154,4 +161,87 @@ static void *fix_auxv(void *v_init_esp,
}
+
+/*------------------------------------------------------------*/
+/*--- Address space padding ---*/
+/*------------------------------------------------------------*/
+
+static void check_mmap(void* res, void* base, int len)
+{
+ if ((void*)-1 == res) {
+ fprintf(stderr, "valgrind: padding mmap(%p, %d) failed during startup.\n"
+ "valgrind: is there a hard virtual memory limit set?\n",
+ base, len);
+ exit(1);
+ }
+}
+
+typedef struct {
+ char* fillgap_start;
+ char* fillgap_end;
+ int fillgap_padfile;
+} fillgap_extra;
+
+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 (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);
+ }
+ extra->fillgap_start = segend;
+
+ return 1;
+}
+
+// Choose a name for the padfile, open it.
+int as_openpadfile(void)
+{
+ char buf[256];
+ int padfile;
+ int seq = 1;
+ do {
+ 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) {
+ fprintf(stderr, "valgrind: couldn't open padfile\n");
+ exit(44);
+ }
+ } while(padfile == -1);
+
+ return padfile;
+}
+
+// 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;
+
+ 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);
+ }
+}
+
+
+/*------------------------------------------------------------*/
+/*--- main() and related pieces ---*/
+/*------------------------------------------------------------*/
+
static int prmap(char *start, char *end, const char *perm, off_t off, int maj,
int min, int ino, void* dummy) {
--- valgrind/coregrind/ume.c #1.29:1.30
@@ -56,7 +56,5 @@ static void check_mmap(void* res, void*
{
if ((void*)-1 == res) {
- fprintf(stderr, "valgrind: mmap(%p, %d) failed during startup.\n"
- "valgrind: is there a hard virtual memory limit set?\n",
- base, len);
+ fprintf(stderr, "valgrind: mmap(%p, %d) failed in UME.\n", base, len);
exit(1);
}
@@ -113,128 +111,4 @@ void foreach_map(int (*fn)(char *start,
}
-typedef struct {
- char* fillgap_start;
- char* fillgap_end;
- int fillgap_padfile;
-} fillgap_extra;
-
-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 (segstart > extra->fillgap_start) {
- void* res = mmap(extra->fillgap_start, segstart - extra->fillgap_start,
- PROT_NONE, MAP_FIXED|MAP_PRIVATE|MAP_NORESERVE,
- extra->fillgap_padfile, 0);
- check_mmap(res, extra->fillgap_start, segstart - extra->fillgap_start);
- }
- extra->fillgap_start = segend;
-
- return 1;
-}
-
-// Choose a name for the padfile, open it.
-int as_openpadfile(void)
-{
- char buf[256];
- int padfile;
- int seq = 1;
- do {
- 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) {
- fprintf(stderr, "valgrind: couldn't open padfile\n");
- exit(44);
- }
- } while(padfile == -1);
-
- return padfile;
-}
-
-// 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;
-
- 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|MAP_NORESERVE, padfile, 0);
- check_mmap(res, extra.fillgap_start,
- extra.fillgap_end - extra.fillgap_start);
- }
-}
-
-typedef struct {
- char* killpad_start;
- char* killpad_end;
- struct stat* killpad_padstat;
-} killpad_extra;
-
-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;
-
- assert(NULL != extra->killpad_padstat);
-
- if (extra->killpad_padstat->st_dev != makedev(maj, min) ||
- extra->killpad_padstat->st_ino != ino)
- return 1;
-
- if (segend <= extra->killpad_start || segstart >= extra->killpad_end)
- return 1;
-
- if (segstart <= extra->killpad_start)
- b = extra->killpad_start;
- else
- b = segstart;
-
- if (segend >= extra->killpad_end)
- e = extra->killpad_end;
- else
- e = segend;
-
- res = munmap(b, (char *)e-(char *)b);
- assert(0 == res);
-
- return 1;
-}
-
-// Remove padding of 'padfile' from a range of address space.
-void as_unpad(void *start, void *end, int padfile)
-{
- static struct stat padstat;
- killpad_extra extra;
- int res;
-
- assert(padfile > 0);
-
- res = fstat(padfile, &padstat);
- assert(0 == res);
- extra.killpad_padstat = &padstat;
- extra.killpad_start = start;
- extra.killpad_end = end;
- foreach_map(killpad, &extra);
-}
-
-void as_closepadfile(int padfile)
-{
- int res = close(padfile);
- assert(0 == res);
-}
-
/*------------------------------------------------------------*/
/*--- Finding auxv on the stack ---*/
--- valgrind/coregrind/ume.h #1.9:1.10
@@ -40,4 +40,13 @@
/*------------------------------------------------------------*/
+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 ---*/
+/*------------------------------------------------------------*/
+
#if ELFSZ == 64
#define ESZ(x) Elf64_##x
@@ -51,13 +60,4 @@
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 ---*/
-/*------------------------------------------------------------*/
-
// Info needed to load and run a program. IN/INOUT/OUT refers to the
// inputs/outputs of do_exec().
@@ -89,14 +89,4 @@ int do_exec(const char *exe, struct exei
/*------------------------------------------------------------*/
-/*--- Address space padding ---*/
-/*------------------------------------------------------------*/
-
-// Padding functions used at startup to force things where we want them.
-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);
-
-/*------------------------------------------------------------*/
/*--- Finding and dealing with auxv ---*/
/*------------------------------------------------------------*/
--- valgrind/coregrind/vg_main.c #1.213:1.214
@@ -1401,4 +1401,69 @@ static void load_client(char* cl_argv[],
}
+/*====================================================================*/
+/*=== Address space unpadding ===*/
+/*====================================================================*/
+
+typedef struct {
+ char* killpad_start;
+ char* killpad_end;
+ struct stat* killpad_padstat;
+} killpad_extra;
+
+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;
+
+ vg_assert(NULL != extra->killpad_padstat);
+
+ if (extra->killpad_padstat->st_dev != makedev(maj, min) ||
+ extra->killpad_padstat->st_ino != ino)
+ return 1;
+
+ if (segend <= extra->killpad_start || segstart >= extra->killpad_end)
+ return 1;
+
+ if (segstart <= extra->killpad_start)
+ b = extra->killpad_start;
+ else
+ b = segstart;
+
+ if (segend >= extra->killpad_end)
+ e = extra->killpad_end;
+ else
+ e = segend;
+
+ res = munmap(b, (char *)e-(char *)b);
+ vg_assert(0 == res);
+
+ return 1;
+}
+
+// Remove padding of 'padfile' from a range of address space.
+void as_unpad(void *start, void *end, int padfile)
+{
+ static struct stat padstat;
+ killpad_extra extra;
+ int res;
+
+ vg_assert(padfile > 0);
+
+ res = fstat(padfile, &padstat);
+ vg_assert(0 == res);
+ extra.killpad_padstat = &padstat;
+ extra.killpad_start = start;
+ extra.killpad_end = end;
+ foreach_map(killpad, &extra);
+}
+
+void as_closepadfile(int padfile)
+{
+ int res = close(padfile);
+ vg_assert(0 == res);
+}
+
/*====================================================================*/
@@ -2571,5 +2636,5 @@ int main(int argc, char **argv)
//--------------------------------------------------------------
- // Everything in place, unpad us
+ // Everything in place, remove padding done by stage1
// p: layout_remaining_space() [everything must be mapped in before now]
// p: load_client() [ditto]
|
|
From: Tom H. <th...@cy...> - 2004-10-13 16:49:32
|
CVS commit by thughes:
Add alternate results for some tests that use mmap.
A corecheck/tests/as_mmap.stderr.exp2 1.1
A memcheck/tests/zeropage.stderr.exp2 1.1
M +1 -0 corecheck/tests/Makefile.am 1.21
M +1 -1 memcheck/tests/Makefile.am 1.43
--- valgrind/corecheck/tests/Makefile.am #1.20:1.21
@@ -8,4 +8,5 @@
EXTRA_DIST = $(noinst_SCRIPTS) \
+ as_mmap.stderr.exp as_mmap.stderr.exp2 as_mmap.vgtest \
erringfds.stderr.exp erringfds.stdout.exp erringfds.vgtest \
fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \
--- valgrind/memcheck/tests/Makefile.am #1.42:1.43
@@ -77,5 +77,5 @@
threadederrno.vgtest \
writev.stderr.exp writev.vgtest \
- zeropage.stderr.exp zeropage.vgtest
+ zeropage.stderr.exp zeropage.stderr.exp2 zeropage.vgtest
check_PROGRAMS = \
|
|
From: Tom H. <th...@cy...> - 2004-10-13 16:41:11
|
In message <200...@gm...>
Josef Weidendorfer <Jos...@gm...> wrote:
> In Cachegrind, you added a x86 subdirectory for the CPUID stuff. I think it
> would be good to move this to Valgrind itself and add a general function to
> the tool API for requesting architecture features like cache sizes.
>
> typedef enum { Vg_CacheI1Size, Vg_CacheI1Assoc,
> VG_CacheI1LineSize, ... } VgArchFeature;
> extern int VG_(get_arch_feature)(VgArchFeature, char* resultBuffer, int len);
I have to say that I'm not a huge fan of an interface as loosely
typed as that...
> And regarding arch-abstraction, it would be cool to get rid of the
> arch-specifics in tools whenever possible: E.g. in cachegrind (and calltree
> also), there is the MMX/SSE stuff. Perhaps some functions could be added
> providing additional high level properties for UOps like if it is accessing
> memory and so on. Prove of concept would be a cachegrind with same source for
> PowerPC, x86 and x86_64.
I think that sort of thing comes under the heading of reworking UCode
for better platform independence which I believe Julian is working on?
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 16:37:57
|
CVS commit by nethercote:
Stage2 doesn't need ume_go.c.
M +0 -1 Makefile.am 1.87
--- valgrind/coregrind/Makefile.am #1.86:1.87
@@ -47,5 +47,4 @@
ume.c \
x86/ume_entry.S \
- x86/ume_go.c \
\
vg_scheduler.c \
|
|
From: Josef W. <Jos...@gm...> - 2004-10-13 16:34:17
|
On Wednesday 13 October 2004 16:26, Nicholas Nethercote wrote:
> > --- valgrind.pc.in.orig 2004-10-13 16:05:14.343322440 +0200
> > +++ valgrind.pc.in 2004-10-13 16:05:34.859203552 +0200
> > @@ -8,4 +8,4 @@
> > Version: @VERSION@
> > Requires:
> > Libs:
> > -Cflags: -I${includedir}
> > +Cflags: -I${includedir} -I${includedir}/@VG_ARCH@
>
> So that's the only change I need to put into Valgrind to make you happy?
> If so, that's no problem.
Thanks.
Further wishes: -)
In Cachegrind, you added a x86 subdirectory for the CPUID stuff. I think it
would be good to move this to Valgrind itself and add a general function to
the tool API for requesting architecture features like cache sizes.
typedef enum { Vg_CacheI1Size, Vg_CacheI1Assoc,
VG_CacheI1LineSize, ... } VgArchFeature;
extern int VG_(get_arch_feature)(VgArchFeature, char* resultBuffer, int len);
And regarding arch-abstraction, it would be cool to get rid of the
arch-specifics in tools whenever possible: E.g. in cachegrind (and calltree
also), there is the MMX/SSE stuff. Perhaps some functions could be added
providing additional high level properties for UOps like if it is accessing
memory and so on. Prove of concept would be a cachegrind with same source for
PowerPC, x86 and x86_64.
> (I think I'll need -I${includedir}/@VG_PLATFORM@ too, now).
Probably.
Josef
>
> N
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 14:58:07
|
CVS commit by nethercote: Allow for test output files. M +4 -6 .cvsignore 1.4 --- valgrind/helgrind/tests/.cvsignore #1.3:1.4 @@ -2,13 +2,11 @@ Makefile allok -allok.stderr.diff -allok.stderr.out deadlock -deadlock.stderr.out -deadlock.stdout.out inherit race race2 readshared -inherit.stderr.diff -inherit.stderr.out +*.stdout.diff +*.stderr.diff +*.stdout.out +*.stderr.out |
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 14:52:03
|
CVS commit by nethercote:
Arch-abstraction:
- whoops, missed one ucontext use in last commit
M +3 -3 vg_signals.c 1.92
--- valgrind/coregrind/vg_signals.c #1.91:1.92
@@ -1830,5 +1830,5 @@ void vg_sync_signalhandler ( Int sigNo,
it was actually generated by Valgrind internally.
*/
- struct vki_sigcontext *sc = &uc->uc_mcontext;
+ Addr context_ip = UCONTEXT_INSTR_PTR(uc);
Char buf[1024];
@@ -1838,5 +1838,5 @@ void vg_sync_signalhandler ( Int sigNo,
buf[0] = 0;
- if (1 && !VG_(get_fnname)(sc->eip, buf+2, sizeof(buf)-5)) {
+ if (1 && !VG_(get_fnname)(context_ip, buf+2, sizeof(buf)-5)) {
Int len;
@@ -1850,5 +1850,5 @@ void vg_sync_signalhandler ( Int sigNo,
VG_(message)(Vg_DebugMsg,
"si_code=%x Fault EIP: %p%s; Faulting address: %p",
- info->si_code, sc->eip, buf, info->_sifields._sigfault._addr);
+ info->si_code, context_ip, buf, info->_sifields._sigfault._addr);
if (0)
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 14:44:14
|
CVS commit by nethercote:
Arch-abstraction:
- factor out differences in ucontext types across different archs.
M +1 -1 core.h 1.34
M +6 -9 vg_proxylwp.c 1.22
M +9 -6 vg_signals.c 1.91
M +7 -0 x86-linux/core_platform.h 1.4
--- valgrind/coregrind/core.h #1.33:1.34
@@ -1362,5 +1362,5 @@ void VG_(sanity_check_proxy)(void);
__attribute__ ((__noreturn__))
extern void VG_(proxy_handlesig)( const vki_ksiginfo_t *siginfo,
- const struct vki_sigcontext *sigcontext );
+ Addr ip, Int sysnum );
/* ---------------------------------------------------------------------
--- valgrind/coregrind/vg_proxylwp.c #1.21:1.22
@@ -403,11 +403,8 @@ void VG_(proxy_shutdown)(void)
there to make sure they stay masked until the application thread is
ready to run its signal handler. */
-void VG_(proxy_handlesig)(const vki_ksiginfo_t *siginfo,
- const struct vki_sigcontext *sigcontext)
+void VG_(proxy_handlesig)(const vki_ksiginfo_t *siginfo, Addr ip, Int sysnum)
{
UChar local;
ProxyLWP *px = LWP_TSD(&local);
- Addr eip = sigcontext->eip;
- Int eax = sigcontext->eax;
vg_assert(siginfo->si_signo != 0);
@@ -424,5 +421,5 @@ void VG_(proxy_handlesig)(const vki_ksig
/* First look to see if the EIP is within our interesting ranges
near a syscall to work out what should happen. */
- if (sys_before <= eip && eip <= sys_restarted) {
+ if (sys_before <= ip && ip <= sys_restarted) {
/* We are before the syscall actually ran, or it did run and
wants to be restarted. Either way, set the return code to
@@ -432,13 +429,13 @@ void VG_(proxy_handlesig)(const vki_ksig
vg_assert(px->state == PXS_RunSyscall);
vg_assert(PLATFORM_SYSCALL_RET(px->tst->arch) == -VKI_ERESTARTSYS);
- } else if (sys_after <= eip && eip <= sys_done) {
+ } else if (sys_after <= ip && ip <= sys_done) {
/* We're after the syscall. Either it was interrupted by the
signal, or the syscall completed normally. In either case
- eax contains the correct syscall return value, and the new
- state is effectively PXS_SysDone. */
+ the usual register contains the correct syscall return value, and
+ the new state is effectively PXS_SysDone. */
vg_assert(px->state == PXS_RunSyscall ||
px->state == PXS_SysDone);
px->state = PXS_SysDone;
- PLATFORM_SYSCALL_RET(px->tst->arch) = eax;
+ PLATFORM_SYSCALL_RET(px->tst->arch) = sysnum;
}
px_printf(" signalled in state %s\n", pxs_name(px->state));
--- valgrind/coregrind/vg_signals.c #1.90:1.91
@@ -1653,5 +1653,6 @@ void vg_async_signalhandler ( Int sigNo,
vg_assert(VG_(gettid)() != VG_(main_pid));
- VG_(proxy_handlesig)(info, &uc->uc_mcontext);
+ VG_(proxy_handlesig)(info, UCONTEXT_INSTR_PTR(uc),
+ UCONTEXT_SYSCALL_NUM(uc));
}
@@ -1680,5 +1681,6 @@ void vg_sync_signalhandler ( Int sigNo,
vg_assert(info->si_code <= VKI_SI_USER);
- VG_(proxy_handlesig)(info, &uc->uc_mcontext);
+ VG_(proxy_handlesig)(info, UCONTEXT_INSTR_PTR(uc),
+ UCONTEXT_SYSCALL_NUM(uc));
return;
}
@@ -1853,7 +1855,7 @@ void vg_sync_signalhandler ( Int sigNo,
VG_(kill_self)(sigNo); /* generate a core dump */
VG_(core_panic_at)("Killed by fatal signal",
- VG_(get_ExeContext2)(uc->uc_mcontext.eip,
- uc->uc_mcontext.ebp,
- uc->uc_mcontext.esp,
+ VG_(get_ExeContext2)(UCONTEXT_INSTR_PTR(uc),
+ UCONTEXT_FRAME_PTR(uc),
+ UCONTEXT_STACK_PTR(uc),
VG_(valgrind_last)));
}
@@ -1877,5 +1879,6 @@ static void proxy_sigvg_handler(int sign
vg_assert(si->_sifields._kill._pid == VG_(main_pid));
- VG_(proxy_handlesig)(si, &uc->uc_mcontext);
+ VG_(proxy_handlesig)(si, UCONTEXT_INSTR_PTR(uc),
+ UCONTEXT_SYSCALL_NUM(uc));
}
}
--- valgrind/coregrind/x86-linux/core_platform.h #1.3:1.4
@@ -85,5 +85,12 @@ extern Int VG_(sys_get_thread_area) ( Th
extern Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr );
+/* ---------------------------------------------------------------------
+ ucontext stuff
+ ------------------------------------------------------------------ */
+#define UCONTEXT_INSTR_PTR(uc) ((uc)->uc_mcontext.eip)
+#define UCONTEXT_STACK_PTR(uc) ((uc)->uc_mcontext.esp)
+#define UCONTEXT_FRAME_PTR(uc) ((uc)->uc_mcontext.ebp)
+#define UCONTEXT_SYSCALL_NUM(uc) ((uc)->uc_mcontext.eax)
/*--------------------------------------------------------------------*/
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 14:28:14
|
On Wed, 13 Oct 2004, Josef Weidendorfer wrote:
> 2.4) External tool uses `pkg-config --cflags valgrind`
>
> For all 2.x) solutions: Is the assumption correct that Valgrind installations
> are for one architecture only? I think so.
Certainly in the short and medium term.
> If yes, I am for 2.4).
>
> Proposed patch for valgrind.pc.in
> --- valgrind.pc.in.orig 2004-10-13 16:05:14.343322440 +0200
> +++ valgrind.pc.in 2004-10-13 16:05:34.859203552 +0200
> @@ -8,4 +8,4 @@
> Version: @VERSION@
> Requires:
> Libs:
> -Cflags: -I${includedir}
> +Cflags: -I${includedir} -I${includedir}/@VG_ARCH@
So that's the only change I need to put into Valgrind to make you happy?
If so, that's no problem.
(I think I'll need -I${includedir}/@VG_PLATFORM@ too, now).
N
|
|
From: Josef W. <Jos...@gm...> - 2004-10-13 14:09:51
|
Hi,
with the arch-abstraction, a $PREFIX/include/valgrind/x86/tool_arch.h was
introduced, which is included by tool.h. This breaks compiling of at least my
external tool, which (currently) only has $PREFIX/include/valgrind in the
include path.
What is the best way to solve this?
1) The tool has to find out the architecture itself, and adds the needed
include path.
2) Valgrind installs an architecture specific include configuration.
2.1) Install tool_arch.h into $PREFIX/include/valgrind.
2.2) Symlink to $PREFIX/include/valgrind/x86/tool_arch.h
2.3) Modify tool.h to include "x86/tool_arch.h"
2.4) External tool uses `pkg-config --cflags valgrind`
For all 2.x) solutions: Is the assumption correct that Valgrind installations
are for one architecture only? I think so.
If yes, I am for 2.4).
Proposed patch for valgrind.pc.in
--- valgrind.pc.in.orig 2004-10-13 16:05:14.343322440 +0200
+++ valgrind.pc.in 2004-10-13 16:05:34.859203552 +0200
@@ -8,4 +8,4 @@
Version: @VERSION@
Requires:
Libs:
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${includedir}/@VG_ARCH@
Josef
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 13:51:42
|
CVS commit by nethercote:
Preparing for powerpc inclusion, one day.
M +6 -0 configure.in 1.128
--- valgrind/configure.in #1.127:1.128
@@ -75,4 +75,10 @@
;;
+ powerpc*)
+ AC_MSG_RESULT([no (${host_cpu})])
+ VG_ARCH="powerpc"
+ AC_MSG_ERROR([PowerPC not supported. Sorry])
+ ;;
+
*)
AC_MSG_RESULT([no (${host_cpu})])
|
|
From: Tom H. <th...@cy...> - 2004-10-13 13:21:22
|
In message <200...@of...>
Nicholas Nethercote <nj...@ca...> wrote:
> - move LDT stuff out of core, into x86-linux specific stuff. Some of it
> (VG_(do_useseg)()?) may be really x86-specific, rather than
> x86/linux-specific, but that can be fixed later if it's really shared with
> another OS.
The actual LDT (and GDT) stuff should be x86 specific, but the general
concept of the set_thread_area and get_thread_area calls is supposed
to be cross-platform as I understand things. The older modify_ldt call
is obviously x86 specific.
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 13:19:05
|
CVS commit by nethercote:
Arch-abstraction: genericise warning about unsupported architectures.
M +1 -1 configure.in 1.127
--- valgrind/configure.in #1.126:1.127
@@ -77,5 +77,5 @@
*)
AC_MSG_RESULT([no (${host_cpu})])
- AC_MSG_ERROR([Valgrind is ix86 specific. Sorry])
+ AC_MSG_ERROR([Unsupported host architecture. Sorry])
;;
esac
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 13:05:34
|
CVS commit by nethercote:
Arch-abstraction:
- move LDT stuff out of core, into x86-linux specific stuff. Some of it
(VG_(do_useseg)()?) may be really x86-specific, rather than
x86/linux-specific, but that can be fixed later if it's really shared with
another OS.
A x86-linux/ldt.c 1.1 [GPL (v2+)]
M +1 -1 Makefile.am 1.86
M +0 -19 core.h 1.33
M +3 -2 x86/core_arch.h 1.10
M +6 -0 x86-linux/Makefile.am 1.3
M +23 -0 x86-linux/core_platform.h 1.3
R vg_ldt.c 1.19
--- valgrind/coregrind/Makefile.am #1.85:1.86
@@ -80,5 +80,4 @@
vg_translate.c \
vg_transtab.c \
- vg_ldt.c \
vg_cpuid.S
stage2_DEPENDENCIES = $(srcdir)/valgrind.vs x86/stage2.lds
@@ -93,4 +92,5 @@
demangle/safe-ctype.o \
${VG_ARCH}/libarch.a \
+ ${VG_PLATFORM}/libplatform.a \
-ldl
--- valgrind/coregrind/core.h #1.32:1.33
@@ -609,23 +609,4 @@ extern Bool VG_(sk_malloc_called_by_sche
/* ---------------------------------------------------------------------
- Exports of vg_ldt.c
- ------------------------------------------------------------------ */
-
-/* Simulate the modify_ldt syscall. */
-extern Int VG_(sys_modify_ldt) ( ThreadId tid,
- Int func, void* ptr, UInt bytecount );
-
-/* Simulate the {get,set}_thread_area syscalls. */
-extern Int VG_(sys_set_thread_area) ( ThreadId tid,
- struct vki_modify_ldt_ldt_s* info );
-extern Int VG_(sys_get_thread_area) ( ThreadId tid,
- struct vki_modify_ldt_ldt_s* info );
-
-/* Called from generated code. Given a segment selector and a virtual
- address, return a linear address, and do limit checks too. */
-extern Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr );
-
-
-/* ---------------------------------------------------------------------
Exports of vg_libpthread.c
------------------------------------------------------------------ */
--- valgrind/coregrind/x86/core_arch.h #1.9:1.10
@@ -194,7 +194,9 @@ extern void VG_(helper_cmpxchg8b);
/* ---------------------------------------------------------------------
- Exports of vg_ldt.c
+ LDT type
------------------------------------------------------------------ */
+// XXX: eventually this will be x86-private, not seen by the core(?)
+
/* This is the hardware-format for a segment descriptor, ie what the
x86 actually deals with. It is 8 bytes long. It's ugly. */
--- valgrind/coregrind/x86-linux/Makefile.am #1.2:1.3
@@ -7,2 +7,8 @@
core_platform.h \
vki_unistd.h
+
+noinst_LIBRARIES = libplatform.a
+
+
+libplatform_a_SOURCES = \
+ ldt.c
--- valgrind/coregrind/x86-linux/core_platform.h #1.2:1.3
@@ -64,4 +64,27 @@
#endif // __X86_LINUX_CORE_PLATFORM_H
+/* ---------------------------------------------------------------------
+ Exports of vg_ldt.c
+ ------------------------------------------------------------------ */
+
+// XXX: eventually all these should be x86-private, and not visible to the
+// core (except maybe do_useseg()?)
+
+/* Simulate the modify_ldt syscall. */
+extern Int VG_(sys_modify_ldt) ( ThreadId tid,
+ Int func, void* ptr, UInt bytecount );
+
+/* Simulate the {get,set}_thread_area syscalls. */
+extern Int VG_(sys_set_thread_area) ( ThreadId tid,
+ struct vki_modify_ldt_ldt_s* info );
+extern Int VG_(sys_get_thread_area) ( ThreadId tid,
+ struct vki_modify_ldt_ldt_s* info );
+
+/* Called from generated code. Given a segment selector and a virtual
+ address, return a linear address, and do limit checks too. */
+extern Addr VG_(do_useseg) ( UInt seg_selector, Addr virtual_addr );
+
+
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 12:13:27
|
CVS commit by nethercote:
We have at least one user in Portugal.
M +1 -1 overview.html 1.15
--- devel-home/valgrind/overview.html #1.14:1.15
@@ -72,5 +72,5 @@
users in over 25 countries, including: Belgium, Czech Republic,
Denmark, Finland, France, Germany, Greece, Hungary, Iceland, Italy, The
- Netherlands, Norway, Poland, Russia, Sweden, Switzerland, UK,
+ Netherlands, Norway, Poland, Portugal, Russia, Sweden, Switzerland, UK,
Argentina, Brazil, Canada, USA, Australia, India, Japan, New Zealand,
Singapore, South Africa and Israel.
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 11:32:06
|
CVS commit by nethercote:
Add a new CPUID cache configuration for more recent Pentiums.
MERGED FROM HEAD
M +1 -0 cg_main.c 1.76.2.1
--- valgrind/cachegrind/cg_main.c #1.76:1.76.2.1
@@ -767,4 +767,5 @@ Int Intel_cache_info(Int level, cache_t*
/* These are sectored, whatever that means */
+ case 0x60: *D1c = (cache_t) { 16, 8, 64 }; break; /* sectored */
case 0x66: *D1c = (cache_t) { 8, 4, 64 }; break; /* sectored */
case 0x67: *D1c = (cache_t) { 16, 4, 64 }; break; /* sectored */
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 11:30:38
|
CVS commit by nethercote:
Add a new CPUID cache configuration for more recent Pentiums.
M +1 -0 cg_arch.c 1.2
--- valgrind/cachegrind/x86/cg_arch.c #1.1:1.2
@@ -126,4 +126,5 @@ Int Intel_cache_info(Int level, cache_t*
/* These are sectored, whatever that means */
+ case 0x60: *D1c = (cache_t) { 16, 8, 64 }; break; /* sectored */
case 0x66: *D1c = (cache_t) { 8, 4, 64 }; break; /* sectored */
case 0x67: *D1c = (cache_t) { 16, 4, 64 }; break; /* sectored */
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 10:29:41
|
On Wed, 13 Oct 2004, Tom Hughes wrote: >> What does the patch look like? > > It's tiny - this is the whole thing: [snip] If you add an explanatory comment, I have no objections to it. N |
|
From: Tom H. <th...@cy...> - 2004-10-13 10:16:00
|
In message <Pin...@he...>
Nicholas Nethercote <nj...@ca...> wrote:
> On Wed, 13 Oct 2004, Tom Hughes wrote:
>
>> The problem is that VG_(gettid) needs to get the ID of the current
>> thread and it assumes that if the gettid system call returns ENOSYS
>> then the getpid system call will do that.
>
> Is that assumption valid?
In principle, yes.
Linux uses a 1-1 model where every thread in the program is a distinct
object at the kernel level. Specifically the kernel treats each thread
pretty much the same as it does a process so it has a slot in the
process table and a process ID value.
Until recently the getpid system call returned the process ID of the
thread which called it. As a result the getpid() function in glibc had
the same behaviour. That is wrong as POSIX says that getpid() should
return the same value for all threads in a process.
As part of the move to the new threading system the getpid system call
was changed to return the process ID of the root thread so that it
behaves as POSIX says it should. At the same time a gettid system call
was added which does what getpid used to do and returns the ID of the
thread which calls it.
Except that it seems there was a small gap between these two steps, or
at least that RedHat released some kernels with the first change patched
in and not the second.
So valgrind's assumption that if gettid doesn't exist then getpid will
do what gettid now does is normally correct except for this small group
of problem kernels.
>> This seems to work, but it is horrible, so what do people think about
>> putting it in? or does anybody have a better way to get the real ID of
>> the current thread on these systems?
>
> What does the patch look like? Is it big, or small but conceptually
> horrible? If the latter, I would say put it in if it works and fixes
> a problem that is affecting a number of people. Just my two cents.
It's tiny - this is the whole thing:
Index: coregrind/vg_mylibc.c
===================================================================
RCS file: /home/kde/valgrind/coregrind/vg_mylibc.c,v
retrieving revision 1.81
diff -u -r1.81 vg_mylibc.c
--- coregrind/vg_mylibc.c 15 Jul 2004 12:59:41 -0000 1.81
+++ coregrind/vg_mylibc.c 19 Jul 2004 13:31:47 -0000
@@ -232,8 +232,14 @@
ret = VG_(do_syscall)(__NR_gettid);
- if (ret == -VKI_ENOSYS)
- ret = VG_(do_syscall)(__NR_getpid);
+ if (ret == -VKI_ENOSYS) {
+ Char pid[16];
+
+ if ((ret = VG_(do_syscall)(__NR_readlink, "/proc/self", pid, sizeof(pid))) >= 0) {
+ pid[ret] = '\0';
+ ret = VG_(atoll)(pid);
+ }
+ }
return ret;
}
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 10:04:57
|
Hi, I don't understand this stuff so well, but here goes anyway... On Wed, 13 Oct 2004, Tom Hughes wrote: > The problem is that VG_(gettid) needs to get the ID of the current > thread and it assumes that if the gettid system call returns ENOSYS > then the getpid system call will do that. Is that assumption valid? > This seems to work, but it is horrible, so what do people think about > putting it in? or does anybody have a better way to get the real ID of > the current thread on these systems? What does the patch look like? Is it big, or small but conceptually horrible? If the latter, I would say put it in if it works and fixes a problem that is affecting a number of people. Just my two cents. N |
|
From: Nicholas N. <nj...@ca...> - 2004-10-13 09:59:02
|
CVS commit by nethercote:
Fix for bug 91162: cope with jumps to bogus addresses when there is a SEGV
signal handler present -- previously, Valgrind would abort unnecessarily on
this case.
Added a regression test for it.
MERGED FROM HEAD
A memcheck/tests/badjump2.c 1.1.2.1 [POSSIBLY UNSAFE: printf] [no copyright]
A memcheck/tests/badjump2.stderr.exp 1.1.2.1
A memcheck/tests/badjump2.vgtest 1.1.2.1
M +1 -1 coregrind/vg_include.h 1.235.2.2
M +17 -5 coregrind/vg_scheduler.c 1.171.2.1
M +4 -2 coregrind/vg_translate.c 1.88.2.1
M +1 -0 memcheck/tests/.cvsignore 1.14.2.1
M +4 -1 memcheck/tests/Makefile.am 1.41.2.1
--- valgrind/coregrind/vg_include.h #1.235.2.1:1.235.2.2
@@ -1161,5 +1161,5 @@ struct _UCodeBlock {
};
-extern void VG_(translate) ( ThreadId tid, Addr orig_addr, Bool debugging );
+extern Bool VG_(translate) ( ThreadId tid, Addr orig_addr, Bool debugging );
extern void VG_(sanity_check_UInstr) ( UInt n, UInstr* u );
--- valgrind/coregrind/vg_scheduler.c #1.171:1.171.2.1
@@ -1022,15 +1022,27 @@ VgSchedReturnCode do_scheduler ( Int* ex
if (trc == VG_TRC_INNER_FASTMISS) {
+ Addr ip = VG_(threads)[tid].m_eip;
+
vg_assert(VG_(dispatch_ctr) > 0);
/* Trivial event. Miss in the fast-cache. Do a full
lookup for it. */
- trans_addr = VG_(search_transtab) ( VG_(threads)[tid].m_eip );
+ trans_addr = VG_(search_transtab) ( ip );
if (trans_addr == (Addr)0) {
/* Not found; we need to request a translation. */
- VG_(translate)( tid, VG_(threads)[tid].m_eip, /*debug*/False );
- trans_addr = VG_(search_transtab) ( VG_(threads)[tid].m_eip );
+ if (VG_(translate)( tid, ip, /*debug*/False )) {
+ trans_addr = VG_(search_transtab)( ip );
if (trans_addr == (Addr)0)
VG_(core_panic)("VG_TRC_INNER_FASTMISS: missing tt_fast entry");
+ } else {
+ // If VG_(translate)() fails, it's because it had to throw
+ // a signal because the client jumped to a bad address.
+ // This means VG_(deliver_signal)() will have been called
+ // by now, and the program counter will now be pointing to
+ // the start of the signal handler (if there is no
+ // handler, things would have been aborted by now), so do
+ // nothing, and things will work out next time around the
+ // scheduler loop.
+ }
}
continue; /* with this thread */
--- valgrind/coregrind/vg_translate.c #1.88:1.88.2.1
@@ -2429,5 +2429,5 @@ static void vg_realreg_liveness_analysis
'tid' is the identity of the thread needing this block.
*/
-void VG_(translate) ( ThreadId tid, Addr orig_addr,
+Bool VG_(translate) ( ThreadId tid, Addr orig_addr,
Bool debugging_translation )
{
@@ -2485,5 +2485,5 @@ void VG_(translate) ( ThreadId tid, Addr
VG_(synth_fault_mapping)(tid, orig_addr);
- return;
+ return False;
} else
seg->flags |= SF_CODE; /* contains cached code */
@@ -2584,4 +2584,6 @@ void VG_(translate) ( ThreadId tid, Addr
VGP_POPCC(VgpTranslate);
+
+ return True;
}
--- valgrind/memcheck/tests/.cvsignore #1.14:1.14.2.1
@@ -4,4 +4,5 @@
badfree
badjump
+badjump2
badloop
buflen_check
--- valgrind/memcheck/tests/Makefile.am #1.41:1.41.2.1
@@ -16,4 +16,5 @@
badfree.stderr.exp badfree.vgtest \
badjump.stderr.exp badjump.vgtest \
+ badjump2.stderr.exp badjump2.vgtest \
badloop.stderr.exp badloop.vgtest \
badrw.stderr.exp badrw.vgtest \
@@ -79,5 +80,6 @@
check_PROGRAMS = \
- badaddrvalue badfree badjump badloop badrw brk brk2 buflen_check \
+ badaddrvalue badfree badjump badjump2 \
+ badloop badrw brk brk2 buflen_check \
clientperm custom_alloc \
doublefree error_counts errs1 exitprog execve execve2 \
@@ -99,4 +101,5 @@
badfree_SOURCES = badfree.c
badjump_SOURCES = badjump.c
+badjump2_SOURCES = badjump2.c
badloop_SOURCES = badloop.c
badrw_SOURCES = badrw.c
|