OBS User unknown 2007-12-03 22:48:02 +00:00 committed by Git OBS Bridge
parent 3d7d3e921e
commit e3211ae1ad
13 changed files with 33 additions and 6095 deletions

View File

@ -1,11 +0,0 @@
--- VEX/priv/guest-amd64/toIR.c
+++ VEX/priv/guest-amd64/toIR.c
@@ -8334,7 +8334,7 @@ DisResult disInstr_AMD64_WRK (
as many invalid combinations as possible. */
n_prefixes = 0;
while (True) {
- if (n_prefixes > 5) goto decode_failure;
+ if (n_prefixes > 7) goto decode_failure;
pre = getUChar(delta);
switch (pre) {
case 0x66: pfx |= PFX_66; break;

View File

@ -1,88 +0,0 @@
--- glibc-2.6.supp
+++ glibc-2.6.supp
@@ -42,9 +42,9 @@
{
dl-hack3
Memcheck:Cond
- obj:/lib*/ld-2.6.so*
- obj:/lib*/ld-2.6.so*
- obj:/lib*/ld-2.6.so*
+ obj:/lib*/ld-2.6*.so*
+ obj:/lib*/ld-2.6*.so*
+ obj:/lib*/ld-2.6*.so*
}
##----------------------------------------------------------------------##
@@ -84,9 +84,9 @@
{
glibc-2.6-on-SUSE-10.3-(x86)
Memcheck:Addr4
- obj:/lib/ld-2.6.so
- obj:/lib/ld-2.6.so
- obj:/lib/ld-2.6.so
+ obj:/lib/ld-2.6*.so
+ obj:/lib/ld-2.6*.so
+ obj:/lib/ld-2.6*.so
}
##----------------------------------------------------------------------##
--- xfree-4.supp
+++ xfree-4.supp
@@ -137,7 +137,7 @@
struct with uninitialized paddings - libxcb
Memcheck:Param
writev(vector[...])
- obj:/lib/ld-2.6.so
+ obj:/lib*/libc-2.6*.so
obj:/usr/lib*/libxcb.so.1.0.0
obj:/usr/lib*/libxcb.so.1.0.0
fun:xcb_send_request
@@ -148,7 +148,7 @@
struct with uninitialized paddings - libxcb
Memcheck:Param
writev(vector[...])
- obj:/lib/ld-2.6.so
+ obj:/lib*/libc-2.6*.so
obj:/usr/lib*/libxcb.so.1.0.0
obj:/usr/lib*/libxcb.so.1.0.0
obj:/usr/lib*/libxcb.so.1.0.0
--- glibc-2.6.supp
+++ glibc-2.6.supp
@@ -47,6 +47,16 @@
obj:/lib*/ld-2.6*.so*
}
+{
+ dl-hack3
+ Memcheck:Cond
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/libc-2.6*.so
+ obj:/lib*/libdl-2.6*.so
+ obj:/lib*/ld-2.6*.so
+}
+
##----------------------------------------------------------------------##
{
glibc-2.5.x-on-SUSE-10.2-(PPC)-1
@@ -84,9 +94,17 @@
{
glibc-2.6-on-SUSE-10.3-(x86)
Memcheck:Addr4
- obj:/lib/ld-2.6*.so
- obj:/lib/ld-2.6*.so
- obj:/lib/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so*
+ obj:/lib*/ld-2.6*.so*
+ obj:/lib*/ld-2.6*.so*
+}
+
+{
+ glibc-2.6-on-SUSE-10.3-(x86_64)
+ Memcheck:Addr8
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
}
##----------------------------------------------------------------------##

View File

@ -1,336 +0,0 @@
--- configure.in (revision 6761)
+++ configure.in (working copy)
@@ -359,6 +359,16 @@ AC_EGREP_CPP([GLIBC_25], [
],
glibc="2.5")
+AC_EGREP_CPP([GLIBC_26], [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6)
+ GLIBC_26
+ #endif
+#endif
+],
+glibc="2.6")
+
AC_MSG_CHECKING([the glibc version])
case "${glibc}" in
@@ -386,9 +396,15 @@ case "${glibc}" in
DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
;;
+ 2.6)
+ AC_MSG_RESULT(2.5 family)
+ AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
+ DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
+ ;;
+
*)
AC_MSG_RESULT(unsupported version)
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.5])
+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.6])
;;
esac
--- glibc-2.6.supp (revision 0)
+++ glibc-2.6.supp (revision 0)
@@ -0,0 +1,215 @@
+
+##----------------------------------------------------------------------##
+
+# Errors to suppress by default with glibc 2.4.x
+
+# Format of this file is:
+# {
+# name_of_suppression
+# tool_name:supp_kind
+# (optional extra info for some suppression types)
+# caller0 name, or /name/of/so/file.so
+# caller1 name, or ditto
+# (optionally: caller2 name)
+# (optionally: caller3 name)
+# }
+#
+# For Memcheck, the supp_kinds are:
+#
+# Param Value1 Value2 Value4 Value8 Value16 Jump
+# Free Addr1 Addr2 Addr4 Addr8 Addr16
+# Cond (previously known as Value0)
+#
+# and the optional extra info is:
+# if Param: name of system call param
+
+{
+ dl-hack1
+ Memcheck:Cond
+ fun:_dl_start
+ fun:_start
+}
+
+{
+ dl-hack2
+ Memcheck:Cond
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
+ obj:/lib*/ld-2.6*.so
+}
+
+{
+ dl-hack3
+ Memcheck:Cond
+ obj:/lib*/ld-2.6.so*
+ obj:/lib*/ld-2.6.so*
+ obj:/lib*/ld-2.6.so*
+}
+
+##----------------------------------------------------------------------##
+{
+ glibc-2.5.x-on-SUSE-10.2-(PPC)-1
+ Memcheck:Cond
+ fun:_dl_start_final
+ fun:_dl_start
+ fun:_start
+}
+{
+ glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
+ Memcheck:Cond
+ fun:index
+ obj:*ld-2.6.*.so
+}
+{
+ glibc-2.5.x-on-SuSE-10.2-(PPC)-2b
+ Memcheck:Addr4
+ fun:index
+ fun:expand_dynamic_string_token
+}
+{
+ glibc-2.5.5-on-SuSE-10.2-(PPC)-2c
+ Memcheck:Addr4
+ fun:index
+ obj:*ld-2.6.*.so
+}
+{
+ glibc-2.3.5-on-SuSE-10.1-(PPC)-3
+ Memcheck:Addr4
+ fun:*wordcopy_fwd_dest_aligned*
+ fun:mem*cpy
+ obj:*lib*2.6.*.so
+}
+
+##----------------------------------------------------------------------##
+## Various structure padding things on SUSE 10.2
+##
+{
+ X11-64bit-padding-1a
+ Memcheck:Param
+ write(buf)
+ fun:__write_nocancel
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+ fun:X*
+}
+{
+ X11-64bit-padding-1b
+ Memcheck:Param
+ write(buf)
+ fun:__write_nocancel
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+ fun:_X*
+}
+{
+ X11-64bit-padding-1c
+ Memcheck:Param
+ write(buf)
+ fun:__write_nocancel
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+}
+{
+ X11-64bit-padding-1d
+ Memcheck:Param
+ write(buf)
+ fun:__write_nocancel
+ obj:/usr/lib*/libICE.so*
+ obj:/usr/lib*/libICE.so*
+ obj:/usr/lib*/libICE.so*
+}
+{
+ X11-64bit-padding-2a
+ Memcheck:Param
+ writev(vector[...])
+ fun:do_writev
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+}
+{
+ X11-64bit-padding-2b
+ Memcheck:Param
+ writev(vector[...])
+ fun:do_writev
+ fun:writev
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+}
+
+{
+ glibc24-64bit-padding-1a
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:send
+ fun:get_mapping
+ fun:__nscd_get_map_ref
+ fun:nscd*
+}
+{
+ glibc24-64bit-padding-1b
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:__sendto_nocancel
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+}
+{
+ glibc24-64bit-padding-1c
+ Memcheck:Param
+ socketcall.send(msg)
+ fun:send
+ fun:__nscd_get_map_ref
+ fun:nscd_get*_r
+ fun:*nscd*
+ obj:/*libc-2.6.so
+}
+
+
+{
+ X11-64bit-padding-3a
+ Memcheck:Param
+ write(buf)
+ obj:/*libpthread-2.4.so*
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+ obj:/usr/lib*/libX11.so*
+}
+
+{
+ X11-64bit-padding-4a
+ Memcheck:Param
+ socketcall.sendto(msg)
+ fun:send
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+}
+{
+ X11-64bit-padding-4b
+ Memcheck:Param
+ socketcall.send(msg)
+ fun:send
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+ obj:/*libc-2.6.so
+}
+
+##----------------------------------------------------------------------##
+# MontaVista Linux 4.0.1 on ppc32
+{
+ MVL-401-linuxthreads-pthread_create
+ Memcheck:Param
+ write(buf)
+ fun:pthread_create
+}
+{
+ MVL-401-linuxthreads-pthread_create
+ Memcheck:Param
+ write(buf)
+ obj:/lib/libpthread-0.10.so
+ fun:pthread_create
+}
--- xfree-4.supp
+++ xfree-4.supp
@@ -134,10 +134,33 @@
}
{
+ struct with uninitialized paddings - libxcb
+ Memcheck:Param
+ writev(vector[...])
+ obj:/lib/ld-2.6.so
+ obj:/usr/lib*/libxcb.so.1.0.0
+ obj:/usr/lib*/libxcb.so.1.0.0
+ fun:xcb_send_request
+ fun:_X*
+}
+
+{
+ struct with uninitialized paddings - libxcb
+ Memcheck:Param
+ writev(vector[...])
+ obj:/lib/ld-2.6.so
+ obj:/usr/lib*/libxcb.so.1.0.0
+ obj:/usr/lib*/libxcb.so.1.0.0
+ obj:/usr/lib*/libxcb.so.1.0.0
+ fun:xcb_*
+ fun:_X*
+}
+
+{
another struct with uninitialized paddings
Memcheck:Param
write(buf)
- fun:*
+ obj:*
fun:_IceTransSocketWrite
fun:_IceTransWrite
fun:_IceWrite
@@ -165,17 +188,7 @@
Xorg 6.8.1 ICE uninit __write* padding
Memcheck:Param
write(buf)
- fun:__write*
- fun:_IceTransWrite
- fun:_IceWrite
- fun:IceFlush
-}
-
-{
- Xorg 6.8.1 ICE uninit write padding
- Memcheck:Param
- write(buf)
- fun:write
+ obj:*
fun:_IceTransWrite
fun:_IceWrite
fun:IceFlush
@@ -202,6 +215,8 @@
fun:_XSend
}
+
+
# There's something strange about a % 127 in XftFontOpenInfo
# (hashing) which gcc turns into a multiply by 33818641 and
# some other guff instead. I don't understand it enough to
--- glibc-2.6.supp
+++ glibc-2.6.supp
@@ -81,6 +81,14 @@
obj:*lib*2.6.*.so
}
+{
+ glibc-2.6-on-SUSE-10.3-(x86)
+ Memcheck:Addr4
+ obj:/lib/ld-2.6.so
+ obj:/lib/ld-2.6.so
+ obj:/lib/ld-2.6.so
+}
+
##----------------------------------------------------------------------##
## Various structure padding things on SUSE 10.2
##

View File

@ -1,27 +0,0 @@
--- massif/ms_main.c
+++ massif/ms_main.c
@@ -1669,15 +1669,18 @@ print_summary(ULong total_ST, ULong heap
if (VG_(clo_verbosity) > 1) {
tl_assert(n_xpts > 0); // always have alloc_xpt
VG_(message)(Vg_DebugMsg, " allocs: %u", n_allocs);
- VG_(message)(Vg_DebugMsg, "zeroallocs: %u (%d%%)", n_zero_allocs,
- n_zero_allocs * 100 / n_allocs );
+ if ( n_allocs )
+ VG_(message)(Vg_DebugMsg, "zeroallocs: %u (%d%%)", n_zero_allocs,
+ n_zero_allocs * 100 / n_allocs );
VG_(message)(Vg_DebugMsg, " frees: %u", n_frees);
VG_(message)(Vg_DebugMsg, " XPts: %u (%d B)", n_xpts,
n_xpts*sizeof(XPt));
- VG_(message)(Vg_DebugMsg, " bot-XPts: %u (%d%%)", n_bot_xpts,
- n_bot_xpts * 100 / n_xpts);
- VG_(message)(Vg_DebugMsg, " top-XPts: %u (%d%%)", alloc_xpt->n_children,
- alloc_xpt->n_children * 100 / n_xpts);
+ if ( n_xpts )
+ VG_(message)(Vg_DebugMsg, " bot-XPts: %u (%d%%)", n_bot_xpts,
+ n_bot_xpts * 100 / n_xpts);
+ if ( n_xpts )
+ VG_(message)(Vg_DebugMsg, " top-XPts: %u (%d%%)", alloc_xpt->n_children,
+ alloc_xpt->n_children * 100 / n_xpts);
VG_(message)(Vg_DebugMsg, "c-reallocs: %u", n_children_reallocs);
VG_(message)(Vg_DebugMsg, "snap-frees: %u", n_snapshot_frees);
VG_(message)(Vg_DebugMsg, "atmp censi: %u", n_attempted_censi);

File diff suppressed because it is too large Load Diff

View File

@ -1,65 +0,0 @@
Index: include/vki-amd64-linux.h
===================================================================
--- include/vki-amd64-linux.h (revision 6565)
+++ include/vki-amd64-linux.h (working copy)
@@ -240,6 +240,8 @@ struct vki_sigcontext {
#define VKI_O_NONBLOCK 04000
#define VKI_O_LARGEFILE 0100000
+#define VKI_AT_FDCWD -100
+
#define VKI_F_DUPFD 0 /* dup */
#define VKI_F_GETFD 1 /* get close_on_exec */
#define VKI_F_SETFD 2 /* set/clear close_on_exec */
Index: include/vki-ppc32-linux.h
===================================================================
--- include/vki-ppc32-linux.h (revision 6565)
+++ include/vki-ppc32-linux.h (working copy)
@@ -300,6 +300,8 @@ struct vki_sigcontext {
#define VKI_O_NONBLOCK 04000
#define VKI_O_LARGEFILE 0200000
+#define VKI_AT_FDCWD -100
+
#define VKI_F_DUPFD 0 /* dup */
#define VKI_F_GETFD 1 /* get close_on_exec */
#define VKI_F_SETFD 2 /* set/clear close_on_exec */
Index: include/vki-x86-linux.h
===================================================================
--- include/vki-x86-linux.h (revision 6565)
+++ include/vki-x86-linux.h (working copy)
@@ -272,6 +272,8 @@ struct vki_sigcontext {
#define VKI_O_NONBLOCK 04000
#define VKI_O_LARGEFILE 0100000
+#define VKI_AT_FDCWD -100
+
#define VKI_F_DUPFD 0 /* dup */
#define VKI_F_GETFD 1 /* get close_on_exec */
#define VKI_F_SETFD 2 /* set/clear close_on_exec */
Index: include/vki-ppc64-linux.h
===================================================================
--- include/vki-ppc64-linux.h (revision 6565)
+++ include/vki-ppc64-linux.h (working copy)
@@ -357,6 +357,8 @@ struct vki_sigcontext {
#define VKI_O_NONBLOCK 04000
#define VKI_O_LARGEFILE 0200000
+#define VKI_AT_FDCWD -100
+
#define VKI_F_DUPFD 0 /* dup */
#define VKI_F_GETFD 1 /* get close_on_exec */
#define VKI_F_SETFD 2 /* set/clear close_on_exec */
Index: coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-linux.c (revision 6565)
+++ coregrind/m_syswrap/syswrap-linux.c (working copy)
@@ -2434,7 +2434,7 @@ PRE(sys_openat)
int, dfd, const char *, filename, int, flags);
}
- if (!ML_(fd_allowed)(ARG1, "openat", tid, False))
+ if (ARG1 != VKI_AT_FDCWD && !ML_(fd_allowed)(ARG1, "openat", tid, False))
SET_STATUS_Failure( VKI_EBADF );
else
PRE_MEM_RASCIIZ( "openat(filename)", ARG2 );

View File

@ -1,70 +0,0 @@
--- memcheck/mc_replace_strmem.c
+++ memcheck/mc_replace_strmem.c
@@ -636,6 +636,67 @@ GLIBC25___STPCPY_CHK(m_libc_so_star, __s
GLIBC25_MEMPCPY(m_libc_so_star, mempcpy)
GLIBC25_MEMPCPY(m_ld_so_1, mempcpy) /* ld.so.1 */
+/*------------------------------------------------------------*/
+/*--- Improve definedness checking of process environment ---*/
+/*------------------------------------------------------------*/
+
+/* putenv */
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, putenv) (char* string);
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, putenv) (char* string)
+{
+ OrigFn fn;
+ int result;
+ const char* p = string;
+ VALGRIND_GET_ORIG_FN(fn);
+ /* Now by walking over the string we magically produce
+ traces when hitting undefined memory. */
+ if (p)
+ while (*p++)
+ ;
+ CALL_FN_W_W(result, fn, string);
+ return result;
+}
+
+/* unsetenv */
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, unsetenv) (const char* name);
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, unsetenv) (const char* name)
+{
+ OrigFn fn;
+ int result;
+ const char* p = name;
+ VALGRIND_GET_ORIG_FN(fn);
+ /* Now by walking over the string we magically produce
+ traces when hitting undefined memory. */
+ if (p)
+ while (*p++)
+ ;
+ CALL_FN_W_W(result, fn, name);
+ return result;
+}
+
+/* setenv */
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, setenv)
+ (const char* name, const char* value, int overwrite);
+int VG_WRAP_FUNCTION_ZU(m_libc_so_star, setenv)
+ (const char* name, const char* value, int overwrite)
+{
+ OrigFn fn;
+ int result;
+ const char* p;
+ VALGRIND_GET_ORIG_FN(fn);
+ /* Now by walking over the string we magically produce
+ traces when hitting undefined memory. */
+ if (name)
+ for (p = name; *p; p++)
+ ;
+ if (value)
+ for (p = value; *p; p++)
+ ;
+ VALGRIND_CHECK_VALUE_IS_DEFINED (overwrite);
+ CALL_FN_W_WWW(result, fn, name, value, overwrite);
+ return result;
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/

View File

@ -1,86 +0,0 @@
Index: glibc-2.7.supp
===================================================================
--- glibc-2.7.supp (revision 0)
+++ glibc-2.7.supp (revision 0)
@@ -0,0 +1,30 @@
+
+# Errors to suppress by default with glibc 2.7.x
+
+# Format of this file is:
+# {
+# name_of_suppression
+# tool_name:supp_kind
+# (optional extra info for some suppression types)
+# caller0 name, or /name/of/so/file.so
+# caller1 name, or ditto
+# (optionally: caller2 name)
+# (optionally: caller3 name)
+# }
+#
+# For Memcheck, the supp_kinds are:
+#
+# Param Value1 Value2 Value4 Value8 Value16 Jump
+# Free Addr1 Addr2 Addr4 Addr8 Addr16
+# Cond (previously known as Value0)
+#
+# and the optional extra info is:
+# if Param: name of system call param
+
+{
+ dl-hack3-1
+ Memcheck:Cond
+ obj:/lib*/ld-2.7*.so*
+ obj:/lib*/ld-2.7*.so*
+ obj:/lib*/ld-2.7*.so*
+}
Index: configure.in
===================================================================
--- configure.in (revision 7225)
+++ configure.in (working copy)
@@ -369,6 +369,16 @@ AC_EGREP_CPP([GLIBC_26], [
],
glibc="2.6")
+AC_EGREP_CPP([GLIBC_27], [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 7)
+ GLIBC_27
+ #endif
+#endif
+],
+glibc="2.7")
+
AC_MSG_CHECKING([the glibc version])
case "${glibc}" in
@@ -401,10 +411,15 @@ case "${glibc}" in
AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
;;
-
+ 2.7)
+ AC_MSG_RESULT(2.7 family)
+ AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
+ DEFAULT_SUPP="glibc-2.7.supp ${DEFAULT_SUPP}"
+ DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ ;;
*)
AC_MSG_RESULT(unsupported version)
- AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.6])
+ AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.7])
;;
esac
Index: Makefile.am
===================================================================
--- Makefile.am (revision 7225)
+++ Makefile.am (working copy)
@@ -18,6 +18,7 @@ DIST_SUBDIRS = $(SUBDIRS)
SUPP_FILES = \
glibc-2.2.supp glibc-2.3.supp glibc-2.4.supp glibc-2.5.supp \
+ glibc-2.6.supp glibc-2.7.supp \
xfree-3.supp xfree-4.supp
dist_val_DATA = $(SUPP_FILES) default.supp

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1bca920527f43fd0c68e8f8eb16a7996b34f415e73af54de0f2cd43a8247c441
size 4016265

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:41aac31caaa92ac563acbf4c853cb169aa6566e7861b10fe6559e67fd89a4e3d
size 4498915

View File

@ -1,867 +0,0 @@
Index: helgrind/hg_main.c
===================================================================
--- helgrind/hg_main.c (revision 6012)
+++ helgrind/hg_main.c (working copy)
@@ -2857,17 +2857,17 @@
/* Do nothing */
}
-static void hg_pre_mutex_lock(ThreadId tid, void* void_mutex)
+static void hg_pre_mutex_lock(ThreadId tid, Addr client_mutex)
{
- Mutex *mutex = get_mutex((Addr)void_mutex);
+ Mutex *mutex = get_mutex(client_mutex);
test_mutex_state(mutex, MxLocked, tid);
}
-static void hg_post_mutex_lock(ThreadId tid, void* void_mutex)
+static void hg_post_mutex_lock(ThreadId tid, Addr client_mutex)
{
static const Bool debug = False;
- Mutex *mutex = get_mutex((Addr)void_mutex);
+ Mutex *mutex = get_mutex(client_mutex);
const LockSet* ls;
set_mutex_state(mutex, MxLocked, tid);
@@ -2898,11 +2898,11 @@
}
-static void hg_post_mutex_unlock(ThreadId tid, void* void_mutex)
+static void hg_post_mutex_unlock(ThreadId tid, Addr client_mutex)
{
static const Bool debug = False;
Int i = 0;
- Mutex *mutex = get_mutex((Addr)void_mutex);
+ Mutex *mutex = get_mutex(client_mutex);
const LockSet *ls;
test_mutex_state(mutex, MxUnlocked, tid);
@@ -3259,14 +3259,14 @@
static void bus_lock(void)
{
ThreadId tid = VG_(get_running_tid)();
- hg_pre_mutex_lock(tid, &__BUS_HARDWARE_LOCK__);
- hg_post_mutex_lock(tid, &__BUS_HARDWARE_LOCK__);
+ hg_pre_mutex_lock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
+ hg_post_mutex_lock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
}
static void bus_unlock(void)
{
ThreadId tid = VG_(get_running_tid)();
- hg_post_mutex_unlock(tid, &__BUS_HARDWARE_LOCK__);
+ hg_post_mutex_unlock(tid, (Addr)&__BUS_HARDWARE_LOCK__);
}
/*--------------------------------------------------------------------*/
Index: include/pub_tool_tooliface.h
===================================================================
--- include/pub_tool_tooliface.h (revision 6012)
+++ include/pub_tool_tooliface.h (working copy)
@@ -411,20 +411,32 @@
void VG_(track_post_thread_join) (void(*f)(ThreadId joiner, ThreadId joinee));
/* Mutex events (not exhaustive)
- "void *mutex" is really a pthread_mutex *
+ "Addr mutex" is really a pthread_mutex_t *
+*/
- Called before a thread can block while waiting for a mutex (called
+void VG_(track_post_mutex_init)(void(*f)(ThreadId tid, Addr mutex, SizeT size));
+void VG_(track_pre_mutex_destroy)(void(*f)(ThreadId tid, Addr mutex, SizeT size));
+
+/* Called before a thread can block while waiting for a mutex (called
regardless of whether the thread will block or not). */
-void VG_(track_pre_mutex_lock)(void(*f)(ThreadId tid, void* mutex));
+void VG_(track_pre_mutex_lock)(void(*f)(ThreadId tid, Addr mutex));
/* Called once the thread actually holds the mutex (always paired with
pre_mutex_lock). */
-void VG_(track_post_mutex_lock)(void(*f)(ThreadId tid, void* mutex));
+void VG_(track_post_mutex_lock)(void(*f)(ThreadId tid, Addr mutex));
-/* Called after a thread has released a mutex (no need for a corresponding
- pre_mutex_unlock, because unlocking can't block). */
-void VG_(track_post_mutex_unlock)(void(*f)(ThreadId tid, void* mutex));
+/* Called before a thread releases a mutex. */
+void VG_(track_pre_mutex_unlock)(void(*f)(ThreadId tid, Addr mutex));
+/* Called after a thread has released a mutex. */
+void VG_(track_post_mutex_unlock)(void(*f)(ThreadId tid, Addr mutex));
+
+void VG_(track_post_cond_init)(void(*f)(ThreadId tid, Addr cond, SizeT size));
+void VG_(track_pre_cond_destroy)(void(*f)(ThreadId tid, Addr cond, SizeT size));
+void VG_(track_pre_cond_wait)(void(*f)(ThreadId tid, Addr cond, Addr mutex));
+void VG_(track_post_cond_wait)(void(*f)(ThreadId tid, Addr cond, Addr mutex));
+
+
/* Signal events (not exhaustive)
... pre_send_signal, post_send_signal ...
@@ -437,6 +449,7 @@
handler longjmps, this won't be called. */
void VG_(track_post_deliver_signal)(void(*f)(ThreadId tid, Int sigNo));
+
/* Others... condition variables...
...
*/
Index: include/pub_tool_threadstate.h
===================================================================
--- include/pub_tool_threadstate.h (revision 6012)
+++ include/pub_tool_threadstate.h (working copy)
@@ -46,6 +46,10 @@
/* Get the TID of the thread which currently has the CPU. */
extern ThreadId VG_(get_running_tid) ( void );
+Int VG_(get_tid_lwp)(ThreadId const tid);
+ThreadId VG_(get_thread_id)(PosixThreadId const posixthreadid);
+PosixThreadId VG_(get_pthread_id)(ThreadId const tid);
+
#endif // __PUB_TOOL_THREADSTATE_H
/*--------------------------------------------------------------------*/
Index: include/pub_tool_libcprint.h
===================================================================
--- include/pub_tool_libcprint.h (revision 6012)
+++ include/pub_tool_libcprint.h (working copy)
@@ -39,15 +39,27 @@
* --log-fd/--log-file/--log-socket argument, which defaults to 2 (stderr).
* Hence no need for VG_(fprintf)().
*/
-extern UInt VG_(printf) ( const HChar *format, ... );
+extern UInt VG_(printf) ( const HChar *format, ... )
+#if defined(__GNUC__) && defined(CHECK_FORMAT_STRINGS)
+ __attribute__((format(printf, 1, 2)))
+#endif
+ ;
extern UInt VG_(vprintf) ( const HChar *format, va_list vargs );
/* too noisy ... __attribute__ ((format (printf, 1, 2))) ; */
-extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... );
+extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... )
+#if defined(__GNUC__) && defined(CHECK_FORMAT_STRINGS)
+ __attribute__((format(printf, 2, 3)))
+#endif
+ ;
extern UInt VG_(vsprintf) ( Char* buf, const HChar* format, va_list vargs );
extern UInt VG_(snprintf) ( Char* buf, Int size,
- const HChar *format, ... );
+ const HChar *format, ... )
+#if defined(__GNUC__) && defined(CHECK_FORMAT_STRINGS)
+ __attribute__((format(printf, 3, 4)))
+#endif
+ ;
extern UInt VG_(vsnprintf)( Char* buf, Int size,
const HChar *format, va_list vargs );
@@ -74,7 +86,11 @@
VgMsgKind;
/* Send a single-part message. Appends a newline. */
-extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... );
+extern UInt VG_(message) ( VgMsgKind kind, const HChar* format, ... )
+#if defined(__GNUC__) && defined(CHECK_FORMAT_STRINGS)
+ __attribute__((format(printf, 2, 3)))
+#endif
+ ;
extern UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs );
#endif // __PUB_TOOL_LIBCPRINT_H
Index: include/pub_tool_debuginfo.h
===================================================================
--- include/pub_tool_debuginfo.h (revision 6012)
+++ include/pub_tool_debuginfo.h (working copy)
@@ -135,6 +135,9 @@
extern VgSectKind VG_(seginfo_sect_kind)(Addr);
+extern Char* VG_(seginfo_sect_kind_name)(Addr a, Char* buf, UInt n_buf);
+
+
#endif // __PUB_TOOL_DEBUGINFO_H
/*--------------------------------------------------------------------*/
Index: include/valgrind.h
===================================================================
--- include/valgrind.h (revision 6012)
+++ include/valgrind.h (working copy)
@@ -2298,6 +2298,48 @@
VG_USERREQ__STACK_REGISTER = 0x1501,
VG_USERREQ__STACK_DEREGISTER = 0x1502,
VG_USERREQ__STACK_CHANGE = 0x1503,
+
+
+ /* To tell the core the POSIX thread ID */
+ VG_USERREQ__SET_PTHREAD_SELF = 0x3000,
+ /* args: pthread_t (thread ID of running thread) */
+
+ /* To notify the core of pthread_thread_join calls */
+ VG_USERREQ__POST_PTHREAD_JOIN = 0x3010,
+ /* args: pthread_t (joinee) */
+
+ /* To notify the core of a pthread_mutex_init call */
+ VG_USERREQ__POST_MUTEX_INIT = 0x3020,
+ /* args: Addr, SizeT */
+ /* To notify the core of a pthread_mutex_destroy call */
+ VG_USERREQ__PRE_MUTEX_DESTROY = 0x3021,
+ /* args: Addr, SizeT */
+ /* To notify the core of pthread_mutex_lock calls */
+ VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK = 0x3022,
+ /* args: pthread_mutex_t* */
+ VG_USERREQ__POST_PTHREAD_MUTEX_LOCK = 0x3023,
+ /* args: pthread_mutex_t* */
+ /* To notify the core of pthread_mutex_unlock calls */
+ VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK = 0x3024,
+ /* args: pthread_mutex_t* */
+ /* To notify the core of pthread_mutex_unlock calls */
+ VG_USERREQ__POST_PTHREAD_MUTEX_UNLOCK = 0x3025,
+ /* args: pthread_mutex_t* */
+
+
+ /* To notify the core of a pthread_cond_init call */
+ VG_USERREQ__POST_PTHREAD_COND_INIT = 0x3028,
+ /* args: Addr, SizeT */
+ /* To notify the core of a pthread_cond_destroy call */
+ VG_USERREQ__PRE_PTHREAD_COND_DESTROY = 0x3029,
+ /* args: Addr, SizeT */
+ /* To notify the core of a pthread_cond_wait call */
+ VG_USERREQ__PRE_PTHREAD_COND_WAIT = 0x302a,
+ /* args: Addr cond, Addr mutex */
+ /* To notify the core of a pthread_cond_wait call */
+ VG_USERREQ__POST_PTHREAD_COND_WAIT = 0x302b,
+ /* args: Addr cond, Addr mutex */
+
} Vg_ClientRequest;
#if !defined(__GNUC__)
Index: include/pub_tool_basics.h
===================================================================
--- include/pub_tool_basics.h (revision 6012)
+++ include/pub_tool_basics.h (working copy)
@@ -97,6 +97,16 @@
/* ThreadIds are simply indices into the VG_(threads)[] array. */
typedef UInt ThreadId;
+/* A PosixThreadId uniquely identifies a POSIX thread in the client. This
+ datatype must be able to represent any client pthread_t value. The only
+ operations performed on this datatype are copying and comparison (==).
+ Note: the POSIX standard specifies that POSIX thread IDs may be implemented
+ as a struct, and that these must be compared by calling pthread_equal().
+ Representing POSIX thread IDs by an integer, and comparing these IDs via
+ "==" is a shortcut that works (at least) on Linux.
+ */
+typedef UWord PosixThreadId;
+
/* An abstraction of syscall return values.
When .isError == False, val holds the return value.
When .isError == True, val holds the error code.
Index: configure.in
===================================================================
--- configure.in (revision 6012)
+++ configure.in (working copy)
@@ -738,6 +738,9 @@
none/tests/ppc64/Makefile
none/tests/x86/Makefile
none/docs/Makefile
+ drd/Makefile
+ drd/docs/Makefile
+ drd/tests/Makefile
)
cat<<EOF
Index: Makefile.am
===================================================================
--- Makefile.am (revision 6012)
+++ Makefile.am (working copy)
@@ -8,6 +8,7 @@
callgrind \
massif \
lackey \
+ drd \
none
# Temporary: we want to compile Helgrind, but not regtest it.
Index: coregrind/vg_preloaded.c
===================================================================
--- coregrind/vg_preloaded.c (revision 6012)
+++ coregrind/vg_preloaded.c (working copy)
@@ -71,8 +71,6 @@
/*--- end ---*/
/*--------------------------------------------------------------------*/
-#if 0
-
#define PTH_FUNC(ret_ty, f, args...) \
ret_ty VG_WRAP_FUNCTION_ZZ(libpthreadZdsoZd0,f)(args); \
ret_ty VG_WRAP_FUNCTION_ZZ(libpthreadZdsoZd0,f)(args)
@@ -80,34 +78,157 @@
#include <stdio.h>
#include <pthread.h>
+typedef struct
+{
+ void* (*start)(void*);
+ void* arg;
+#if 0
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+#else
+ int wrapper_started;
+#endif
+} VgPosixThreadArgs;
+
+static void* vg_thread_wrapper(void* arg)
+{
+ VgPosixThreadArgs* const arg_ptr = (VgPosixThreadArgs*)arg;
+ VgPosixThreadArgs const arg_copy = *arg_ptr;
+ int res;
+
+#if 0
+ pthread_mutex_lock(arg_ptr->mutex);
+ pthread_cond_signal(arg_ptr->cond);
+ pthread_mutex_unlock(arg_ptr->mutex);
+#else
+ arg_ptr->wrapper_started = 1;
+#endif
+
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREAD_SELF,
+ pthread_self(), 0, 0, 0, 0);
+ return (arg_copy.start)(arg_copy.arg);
+}
+
// pthread_create
PTH_FUNC(int, pthreadZucreateZAZa, // pthread_create@*
pthread_t *thread, const pthread_attr_t *attr,
void *(*start) (void *), void *arg)
{
- int ret;
- void* fn;
- VALGRIND_GET_NRADDR(fn);
- fprintf(stderr, "<< pthread_create wrapper"); fflush(stderr);
+ int res;
+ int ret;
+ OrigFn fn;
+ VgPosixThreadArgs vgargs;
+ VALGRIND_GET_ORIG_FN(fn);
+ // Make sure that Valgrind knows about the main thread's POSIX thread ID.
+ // To do: move this statement to another place such that it is only called
+ // once during startup, instead of during every pthread_create() call.
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__SET_PTHREAD_SELF,
+ pthread_self(), 0, 0, 0, 0);
+ vgargs.start = start;
+ vgargs.arg = arg;
+ vgargs.wrapper_started = 0;
+#if 0
+ pthread_mutex_init(&vgargs.mutex, 0);
+ pthread_cond_init(&vgargs.cond, 0);
+ pthread_mutex_lock(&vgargs.mutex);
+#endif
+ CALL_FN_W_WWWW(ret, fn, thread, attr, vg_thread_wrapper, &vgargs);
+#if 0
+ pthread_cond_wait(&vgargs.cond, &vgargs.mutex);
+ pthread_mutex_unlock(&vgargs.mutex);
+ pthread_cond_destroy(&vgargs.cond);
+ pthread_mutex_destroy(&vgargs.mutex);
+#else
+ // Yes, you see it correctly, busy waiting ... The problem is that
+ // POSIX threads functions cannot be called here -- the functions defined
+ // in this file (vg_preloaded.c) would be called instead of those in
+ // libpthread.so.
+ while (! vgargs.wrapper_started)
+ ;
+#endif
+ return ret;
+}
- CALL_FN_W_WWWW(ret, fn, thread,attr,start,arg);
+// pthread_join
+PTH_FUNC(int, pthreadZujoin, // pthread_join
+ pthread_t thread, void **thread_return)
+{
+ int ret;
+ int res;
+ OrigFn fn;
- fprintf(stderr, " -> %d >>\n", ret);
+ VALGRIND_GET_ORIG_FN(fn);
+ CALL_FN_W_WW(ret, fn, thread, thread_return);
+ if (ret == 0)
+ {
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_PTHREAD_JOIN,
+ thread, 0, 0, 0, 0);
+ }
return ret;
}
+// pthread_mutex_init
+PTH_FUNC(int, pthreadZumutexZuinit,
+ pthread_mutex_t *mutex,
+ pthread_mutexattr_t const* attr)
+{
+ int ret;
+ int res;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ CALL_FN_W_WW(ret, fn, mutex, attr);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_MUTEX_INIT,
+ mutex, sizeof(*mutex), 0, 0, 0);
+ return ret;
+}
+
+// pthread_mutex_destroy
+PTH_FUNC(int, pthreadZumutexZudestroy,
+ pthread_mutex_t *mutex)
+{
+ int ret;
+ int res;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_MUTEX_DESTROY,
+ mutex, sizeof(*mutex), 0, 0, 0);
+ CALL_FN_W_W(ret, fn, mutex);
+ return ret;
+}
+
// pthread_mutex_lock
PTH_FUNC(int, pthreadZumutexZulock, // pthread_mutex_lock
pthread_mutex_t *mutex)
{
int ret;
- void* fn;
+ int res;
+ OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
- fprintf(stderr, "<< pthread_mxlock %p", mutex); fflush(stderr);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK,
+ mutex, 0, 0, 0, 0);
+ CALL_FN_W_W(ret, fn, mutex);
+ if (ret == 0)
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_PTHREAD_MUTEX_LOCK,
+ mutex, 0, 0, 0, 0);
+ return ret;
+}
+// pthread_mutex_trylock
+PTH_FUNC(int, pthreadZumutexZutrylock, // pthread_mutex_trylock
+ pthread_mutex_t *mutex)
+{
+ int ret;
+ int res;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK,
+ mutex, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
-
- fprintf(stderr, " -> %d >>\n", ret);
+ if (ret == 0)
+ {
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_PTHREAD_MUTEX_LOCK,
+ mutex, 0, 0, 0, 0);
+ }
return ret;
}
@@ -116,15 +237,44 @@
pthread_mutex_t *mutex)
{
int ret;
- void* fn;
+ int res;
+ OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
-
- fprintf(stderr, "<< pthread_mxunlk %p", mutex); fflush(stderr);
-
+ VALGRIND_DO_CLIENT_REQUEST(res, -1,
+ VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK,
+ mutex, 0, 0, 0, 0);
CALL_FN_W_W(ret, fn, mutex);
+ if (ret == 0)
+ {
+ VALGRIND_DO_CLIENT_REQUEST(res, -1,
+ VG_USERREQ__POST_PTHREAD_MUTEX_UNLOCK,
+ mutex, 0, 0, 0, 0);
+ }
+ return ret;
+}
- fprintf(stderr, " -> %d >>\n", ret);
+// pthread_cond_wait
+PTH_FUNC(int, pthreadZucontZuwait, // pthread_cond_wait
+ pthread_cond_t *cond,
+ pthread_mutex_t *mutex)
+{
+ int ret;
+ int res;
+ OrigFn fn;
+ VALGRIND_GET_ORIG_FN(fn);
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__PRE_PTHREAD_COND_WAIT,
+ cond, mutex, 0, 0, 0);
+ CALL_FN_W_WW(ret, fn, cond, mutex);
+ if (ret == 0)
+ {
+ VALGRIND_DO_CLIENT_REQUEST(res, -1, VG_USERREQ__POST_PTHREAD_COND_WAIT,
+ cond, mutex, 0, 0, 0);
+ }
return ret;
}
-#endif
+/*
+ * Local variables:
+ * c-basic-offset: 3
+ * End:
+ */
Index: coregrind/m_syswrap/syswrap-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-linux.c (revision 6012)
+++ coregrind/m_syswrap/syswrap-linux.c (working copy)
@@ -164,7 +164,7 @@
assembler. */
#if defined(VGP_x86_linux)
asm volatile (
- "movl %1, %0\n" /* set tst->status = VgTs_Empty */
+ // "movl %1, %0\n" /* set tst->status = VgTs_Empty */
"movl %2, %%eax\n" /* set %eax = __NR_exit */
"movl %3, %%ebx\n" /* set %ebx = tst->os_state.exitcode */
"int $0x80\n" /* exit(tst->os_state.exitcode) */
@@ -172,7 +172,7 @@
: "n" (VgTs_Empty), "n" (__NR_exit), "m" (tst->os_state.exitcode));
#elif defined(VGP_amd64_linux)
asm volatile (
- "movl %1, %0\n" /* set tst->status = VgTs_Empty */
+ // "movl %1, %0\n" /* set tst->status = VgTs_Empty */
"movq %2, %%rax\n" /* set %rax = __NR_exit */
"movq %3, %%rdi\n" /* set %rdi = tst->os_state.exitcode */
"syscall\n" /* exit(tst->os_state.exitcode) */
@@ -181,7 +181,7 @@
#elif defined(VGP_ppc32_linux) || defined(VGP_ppc64_linux)
{ UInt vgts_empty = (UInt)VgTs_Empty;
asm volatile (
- "stw %1,%0\n\t" /* set tst->status = VgTs_Empty */
+ // "stw %1,%0\n\t" /* set tst->status = VgTs_Empty */
"li 0,%2\n\t" /* set r0 = __NR_exit */
"lwz 3,%3\n\t" /* set r3 = tst->os_state.exitcode */
"sc\n\t" /* exit(tst->os_state.exitcode) */
Index: coregrind/m_tooliface.c
===================================================================
--- coregrind/m_tooliface.c (revision 6012)
+++ coregrind/m_tooliface.c (working copy)
@@ -326,13 +326,21 @@
DEF(track_post_thread_create, ThreadId, ThreadId)
DEF(track_post_thread_join, ThreadId, ThreadId)
-DEF(track_pre_mutex_lock, ThreadId, void*)
-DEF(track_post_mutex_lock, ThreadId, void*)
-DEF(track_post_mutex_unlock, ThreadId, void*)
+DEF(track_post_mutex_init, ThreadId, Addr, SizeT)
+DEF(track_pre_mutex_destroy, ThreadId, Addr, SizeT)
+DEF(track_pre_mutex_lock, ThreadId, Addr)
+DEF(track_post_mutex_lock, ThreadId, Addr)
+DEF(track_pre_mutex_unlock, ThreadId, Addr)
+DEF(track_post_mutex_unlock, ThreadId, Addr)
DEF(track_pre_deliver_signal, ThreadId, Int sigNo, Bool)
DEF(track_post_deliver_signal, ThreadId, Int sigNo)
+DEF(track_post_cond_init, ThreadId, Addr, SizeT);
+DEF(track_pre_cond_destroy, ThreadId, Addr, SizeT);
+DEF(track_pre_cond_wait, ThreadId, Addr, Addr);
+DEF(track_post_cond_wait, ThreadId, Addr, Addr);
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Index: coregrind/pub_core_tooliface.h
===================================================================
--- coregrind/pub_core_tooliface.h (revision 6012)
+++ coregrind/pub_core_tooliface.h (working copy)
@@ -205,10 +205,18 @@
void (*track_post_thread_create)(ThreadId, ThreadId);
void (*track_post_thread_join) (ThreadId, ThreadId);
- void (*track_pre_mutex_lock) (ThreadId, void*);
- void (*track_post_mutex_lock) (ThreadId, void*);
- void (*track_post_mutex_unlock)(ThreadId, void*);
+ void (*track_post_mutex_init) (ThreadId, Addr, SizeT);
+ void (*track_pre_mutex_destroy)(ThreadId, Addr, SizeT);
+ void (*track_pre_mutex_lock) (ThreadId, Addr);
+ void (*track_post_mutex_lock) (ThreadId, Addr);
+ void (*track_pre_mutex_unlock) (ThreadId, Addr);
+ void (*track_post_mutex_unlock)(ThreadId, Addr);
+ void (*track_post_cond_init) (ThreadId, Addr, SizeT);
+ void (*track_pre_cond_destroy) (ThreadId, Addr, SizeT);
+ void (*track_pre_cond_wait) (ThreadId, Addr, Addr);
+ void (*track_post_cond_wait) (ThreadId, Addr, Addr);
+
void (*track_pre_deliver_signal) (ThreadId, Int sigNo, Bool);
void (*track_post_deliver_signal)(ThreadId, Int sigNo);
Index: coregrind/m_debuginfo/debuginfo.c
===================================================================
--- coregrind/m_debuginfo/debuginfo.c (revision 6012)
+++ coregrind/m_debuginfo/debuginfo.c (working copy)
@@ -912,6 +912,35 @@
return ret;
}
+Char* VG_(seginfo_sect_kind_name)(Addr a, Char* buf, UInt n_buf)
+{
+ switch (VG_(seginfo_sect_kind)(a))
+ {
+ case Vg_SectUnknown:
+ VG_(snprintf)(buf, n_buf, "Unknown");
+ break;
+ case Vg_SectText:
+ VG_(snprintf)(buf, n_buf, "Text");
+ break;
+ case Vg_SectData:
+ VG_(snprintf)(buf, n_buf, "Data");
+ break;
+ case Vg_SectBSS:
+ VG_(snprintf)(buf, n_buf, "BSS");
+ break;
+ case Vg_SectGOT:
+ VG_(snprintf)(buf, n_buf, "GOT");
+ break;
+ case Vg_SectPLT:
+ VG_(snprintf)(buf, n_buf, "PLT");
+ break;
+ default:
+ VG_(snprintf)(buf, n_buf, "???");
+ vg_assert(0);
+ }
+ return buf;
+}
+
Int VG_(seginfo_syms_howmany) ( const SegInfo *si )
{
return si->symtab_used;
Index: coregrind/m_threadmodel.c
===================================================================
--- coregrind/m_threadmodel.c (revision 6012)
+++ coregrind/m_threadmodel.c (working copy)
@@ -807,7 +807,7 @@
if (mx->state == MX_Locked && mx->owner == tid) /* deadlock */
mutex_report(tid, mutexp, MXE_Deadlock, "trylocking");
- VG_TRACK( pre_mutex_lock, tid, (void *)mutexp );
+ VG_TRACK( pre_mutex_lock, tid, mutexp );
}
/* Give up waiting for a mutex. Fails if:
@@ -834,7 +834,7 @@
switch(mx->state) {
case MX_Unlocking: /* ownership transfer or relock */
- VG_TRACK( post_mutex_unlock, mx->owner, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, mx->owner, mutexp );
if (mx->owner != tid)
thread_unblock_mutex(tid, mx, "acquiring mutex");
break;
@@ -846,7 +846,7 @@
case MX_Locked:
if (debug_mutex)
VG_(printf)("mutex=%p mx->state=%s\n", mutexp, pp_mutexstate(mx));
- VG_TRACK( post_mutex_unlock, mx->owner, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, mx->owner, mutexp );
mutex_report(tid, mutexp, MXE_Locked, "acquiring");
thread_unblock_mutex(tid, mx, "acquiring mutex");
break;
@@ -859,7 +859,7 @@
mx->owner = tid;
mutex_setstate(tid, mx, MX_Locked);
- VG_TRACK( post_mutex_lock, tid, (void *)mutexp );
+ VG_TRACK( post_mutex_lock, tid, mutexp );
}
/* Try unlocking a lock. This will move it into a state where it can
@@ -968,7 +968,7 @@
case MX_Unlocking:
/* OK - we need to complete the unlock */
- VG_TRACK( post_mutex_unlock, tid, (void *)mutexp );
+ VG_TRACK( post_mutex_unlock, tid, mutexp );
mutex_setstate(tid, mx, MX_Free);
break;
Index: coregrind/m_scheduler/scheduler.c
===================================================================
--- coregrind/m_scheduler/scheduler.c (revision 6012)
+++ coregrind/m_scheduler/scheduler.c (working copy)
@@ -364,7 +364,10 @@
VG_(sigemptyset)(&VG_(threads)[tid].sig_mask);
VG_(sigemptyset)(&VG_(threads)[tid].tmp_sig_mask);
- os_state_clear(&VG_(threads)[tid]);
+ // Do NOT clear the OS state record here -- this data is still accessed
+ // after the thread exited from within vg_preloaded.c (pthread_join()
+ // wrapper).
+ // os_state_clear(&VG_(threads)[tid]);
/* start with no altstack */
VG_(threads)[tid].altstack.ss_sp = (void *)0xdeadbeef;
@@ -1215,6 +1218,72 @@
SET_CLREQ_RETVAL( tid, 0 ); /* return value is meaningless */
break; }
+ case VG_USERREQ__SET_PTHREAD_SELF: {
+ VG_(set_pthread_id)(VG_(get_running_tid)(), (PosixThreadId)(arg[1]));
+ break;
+ }
+
+ case VG_USERREQ__POST_PTHREAD_JOIN: {
+ ThreadId const joinee = VG_(get_thread_id)(arg[1]);
+ // VG_(printf)("joinee = %d -> %d\n", arg[1], joinee);
+ vg_assert(joinee);
+ VG_TRACK(post_thread_join,
+ VG_(get_running_tid)(),
+ joinee);
+ if (joinee)
+ {
+ ThreadState *tst;
+ tst = VG_(get_ThreadState)(joinee);
+ vg_assert(tst);
+ vg_assert(tst->status == VgTs_Zombie);
+ tst->status = VgTs_Empty;
+ }
+ break; }
+
+ case VG_USERREQ__POST_MUTEX_INIT:
+ VG_TRACK(post_mutex_init, VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
+ case VG_USERREQ__PRE_MUTEX_DESTROY:
+ VG_TRACK(pre_mutex_destroy, VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
+ case VG_USERREQ__PRE_PTHREAD_MUTEX_LOCK:
+ VG_TRACK(pre_mutex_lock, VG_(get_running_tid)(), arg[1]);
+ break;
+
+ case VG_USERREQ__POST_PTHREAD_MUTEX_LOCK:
+ VG_TRACK(post_mutex_lock, VG_(get_running_tid)(), arg[1]);
+ break;
+
+ case VG_USERREQ__PRE_PTHREAD_MUTEX_UNLOCK:
+ VG_TRACK(pre_mutex_unlock, VG_(get_running_tid)(), arg[1]);
+ break;
+
+ case VG_USERREQ__POST_PTHREAD_MUTEX_UNLOCK:
+ VG_TRACK(post_mutex_unlock, VG_(get_running_tid)(), arg[1]);
+ break;
+
+ case VG_USERREQ__POST_PTHREAD_COND_INIT:
+ VG_TRACK(post_cond_init,
+ VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
+ case VG_USERREQ__PRE_PTHREAD_COND_DESTROY:
+ VG_TRACK(pre_cond_destroy,
+ VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
+ case VG_USERREQ__PRE_PTHREAD_COND_WAIT:
+ VG_TRACK(pre_cond_wait,
+ VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
+ case VG_USERREQ__POST_PTHREAD_COND_WAIT:
+ VG_TRACK(post_cond_wait,
+ VG_(get_running_tid)(), arg[1], arg[2]);
+ break;
+
case VG_USERREQ__GET_MALLOCFUNCS: {
struct vg_mallocfunc_info *info = (struct vg_mallocfunc_info *)arg[1];
@@ -1380,3 +1449,10 @@
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
+
+
+/*
+ * Local variables:
+ * c-basic-offset: 3
+ * End:
+ */
Index: coregrind/m_threadstate.c
===================================================================
--- coregrind/m_threadstate.c (revision 6012)
+++ coregrind/m_threadstate.c (working copy)
@@ -123,6 +123,41 @@
return VG_INVALID_THREADID;
}
+Int VG_(get_tid_lwp)(ThreadId const tid)
+{
+ vg_assert(1 <= tid && tid < VG_N_THREADS
+ && VG_(threads)[tid].status != VgTs_Empty);
+ return VG_(threads)[tid].os_state.lwpid;
+}
+
+ThreadId VG_(get_thread_id)(PosixThreadId const posixthreadid)
+{
+ ThreadId tid;
+ for(tid = 1; tid < VG_N_THREADS; tid++)
+ {
+ if (VG_(threads)[tid].status != VgTs_Empty
+ && VG_(threads)[tid].os_state.posixthreadid == posixthreadid)
+ {
+ return tid;
+ }
+ }
+ return VG_INVALID_THREADID;
+}
+
+PosixThreadId VG_(get_pthread_id)(ThreadId const tid)
+{
+ vg_assert(1 <= tid && tid < VG_N_THREADS
+ && VG_(threads)[tid].status != VgTs_Empty);
+ return VG_(threads)[tid].os_state.posixthreadid;
+}
+
+void VG_(set_pthread_id)(ThreadId const tid, PosixThreadId const posixthreadid)
+{
+ vg_assert(1 <= tid && tid < VG_N_THREADS
+ && VG_(threads)[tid].status != VgTs_Empty);
+ VG_(threads)[tid].os_state.posixthreadid = posixthreadid;
+}
+
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Index: coregrind/pub_core_threadstate.h
===================================================================
--- coregrind/pub_core_threadstate.h (revision 6012)
+++ coregrind/pub_core_threadstate.h (working copy)
@@ -112,6 +112,7 @@
struct {
/* who we are */
Int lwpid; // PID of kernel task
+ PosixThreadId posixthreadid; // pthread_t, in case of a POSIX thread.
Int threadgroup; // thread group id
ThreadId parent; // parent tid (if any)
@@ -242,6 +243,14 @@
ThreadId */
extern ThreadId VG_(get_lwp_tid)(Int lwpid);
+ThreadId VG_(get_thread_id)(PosixThreadId const posixthreadid);
+
+PosixThreadId VG_(get_pthread_id)(ThreadId const tid);
+
+void VG_(set_pthread_id)(ThreadId const tid,
+ PosixThreadId const posixthreadid);
+
+
#endif // __PUB_CORE_THREADSTATE_H
/*--------------------------------------------------------------------*/

View File

@ -1,4 +1,16 @@
-------------------------------------------------------------------
Mon Dec 3 21:37:39 CET 2007 - dmueller@suse.de
- update to 3.3.0 RC1:
- Helgrind works again
- Massif has been majorly overhauled
- Cachegrind now does branch-prediction profiling
- New experimental tools Omega and DRD
- Many small refinements to stability, scalability and performance
- Somewhat restructured documentation
- Many bug fixes
------------------------------------------------------------------
Mon Nov 26 16:14:00 CET 2007 - dmueller@suse.de
- fix build against glibc 2.7

View File

@ -1,5 +1,5 @@
#
# spec file for package valgrind (Version 3.2.3)
# spec file for package valgrind (Version 3.3.0)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -25,23 +25,14 @@ License: GPL v2 only
Group: Development/Tools/Debuggers
Summary: Valgrind Suite of Tools for Debugging and Profiling
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Version: 3.2.3
Release: 71
Source0: %{name}-%{version}.tar.bz2
Version: 3.3.0
Release: 1
Source0: %{name}-%{version}.RC1.tar.bz2
# svn di svn://svn.valgrind.org/valgrind/tags/VALGRIND_3_2_1 svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_2_BRANCH > 3_2_BRANCH.diff
# svn di svn://svn.valgrind.org/vex/tags/VEX_3_2_1 svn://svn.valgrind.org/vex/branches/VEX_3_2_BRANCH > VEX_3_2_BRANCH.diff
Patch3: valgrind-6012.patch
Patch4: openat-handling.diff
Patch5: omega_RC_01.patch
Patch6: putenv-wrapper.diff
Patch7: glibc-2.6.diff
Patch8: jit-runtime-support.diff
Patch9: glibc-2.6.1.diff
Patch10: amd64-nop-prefixes.diff
Patch11: massif-fixes.diff
Patch12: r7181.diff
Provides: callgrind
Obsoletes: callgrind
Provides: callgrind = %version
Obsoletes: callgrind < %version
ExclusiveArch: %ix86 x86_64 ppc ppc64
%description
@ -118,20 +109,11 @@ Authors:
Robert Walsh
%prep
%setup -q -n %{name}-%{version}
%setup -q -n %{name}-%{version}.RC1
cd VEX
cd ..
%ifarch %ix86 x86_64
%patch5
%endif
%patch4
%patch6
%patch7
%patch8
%patch9
%patch10
%patch11
%patch12
# does not apply anymore
#%patch8
%build
export CFLAGS="$RPM_OPT_FLAGS"
@ -161,6 +143,15 @@ mv $RPM_BUILD_ROOT/usr/share/doc/valgrind $RPM_BUILD_ROOT/usr/share/doc/packages
%_libdir/valgrind/*/*.a
%changelog
* Mon Dec 03 2007 - dmueller@suse.de
- update to 3.3.0 RC1:
- Helgrind works again
- Massif has been majorly overhauled
- Cachegrind now does branch-prediction profiling
- New experimental tools Omega and DRD
- Many small refinements to stability, scalability and performance
- Somewhat restructured documentation
- Many bug fixes
* Mon Nov 26 2007 - dmueller@suse.de
- fix build against glibc 2.7
* Fri Sep 14 2007 - dmueller@suse.de