This commit is contained in:
Jakub Jelinek 2007-06-27 14:18:26 +00:00
parent d0c7c972bc
commit 6e8885ac94
3 changed files with 472 additions and 2 deletions

View File

@ -0,0 +1,435 @@
--- valgrind-3.2.3/glibc-2.5.supp.jj 2007-01-07 06:39:15.000000000 +0100
+++ valgrind-3.2.3/glibc-2.5.supp 2007-06-27 16:10:34.000000000 +0200
@@ -1,7 +1,7 @@
##----------------------------------------------------------------------##
-# Errors to suppress by default with glibc 2.4.x
+# Errors to suppress by default with glibc 2.5.x
# Format of this file is:
# {
@@ -43,9 +43,9 @@
{
dl-hack3
Memcheck:Cond
- obj:/lib*/ld-2.5*so*
- obj:/lib*/ld-2.5*so*
- obj:/lib*/ld-2.5*so*
+ obj:/lib*/ld-2.5*.so
+ obj:/lib*/ld-2.5*.so
+ obj:/lib*/ld-2.5*.so
}
##----------------------------------------------------------------------##
@@ -60,7 +60,7 @@
glibc-2.5.x-on-SUSE-10.2-(PPC)-2a
Memcheck:Cond
fun:index
- obj:*ld-2.5.*.so
+ obj:*ld-2.5*.so
}
{
glibc-2.5.x-on-SuSE-10.2-(PPC)-2b
@@ -72,14 +72,14 @@
glibc-2.5.5-on-SuSE-10.2-(PPC)-2c
Memcheck:Addr4
fun:index
- obj:*ld-2.5.*.so
+ obj:*ld-2.5*.so
}
{
glibc-2.3.5-on-SuSE-10.1-(PPC)-3
Memcheck:Addr4
fun:*wordcopy_fwd_dest_aligned*
fun:mem*cpy
- obj:*lib*2.5.*.so
+ obj:*lib*2.5*.so
}
##----------------------------------------------------------------------##
@@ -154,9 +154,9 @@
Memcheck:Param
socketcall.sendto(msg)
fun:__sendto_nocancel
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
}
{
glibc24-64bit-padding-1c
@@ -166,7 +166,7 @@
fun:__nscd_get_map_ref
fun:nscd_get*_r
fun:*nscd*
- obj:/*libc-2.5.so
+ obj:/*libc-2.5*.so
}
@@ -174,7 +174,7 @@
X11-64bit-padding-3a
Memcheck:Param
write(buf)
- obj:/*libpthread-2.4.so*
+ obj:/*libpthread-2.5*.so*
obj:/usr/lib*/libX11.so*
obj:/usr/lib*/libX11.so*
obj:/usr/lib*/libX11.so*
@@ -185,18 +185,18 @@
Memcheck:Param
socketcall.sendto(msg)
fun:send
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
}
{
X11-64bit-padding-4b
Memcheck:Param
socketcall.send(msg)
fun:send
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
- obj:/*libc-2.5.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
+ obj:/*libc-2.5*.so
}
##----------------------------------------------------------------------##
--- valgrind-3.2.3/configure.in.jj 2007-06-27 12:22:59.000000000 +0200
+++ valgrind-3.2.3/configure.in 2007-06-27 16:03:45.000000000 +0200
@@ -361,6 +361,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
@@ -388,9 +398,15 @@ case "${glibc}" in
DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
;;
+ 2.6)
+ AC_MSG_RESULT(2.6 family)
+ AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.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
--- valgrind-3.2.3/config.h.in.jj 2007-01-02 15:55:38.000000000 +0100
+++ valgrind-3.2.3/config.h.in 2007-06-27 16:08:37.000000000 +0200
@@ -18,6 +18,9 @@
/* Define to 1 if you're using glibc 2.5.x */
#undef GLIBC_2_5
+/* Define to 1 if you're using glibc 2.6.x */
+#undef GLIBC_2_6
+
/* Define to 1 if as supports mtocrf/mfocrf. */
#undef HAVE_AS_PPC_MFTOCRF
--- valgrind-3.2.3/configure.jj 2007-06-27 12:22:59.000000000 +0200
+++ valgrind-3.2.3/configure 2007-06-27 16:08:16.000000000 +0200
@@ -4391,8 +4391,30 @@ fi
rm -f conftest*
-echo "$as_me:$LINENO: checking the glibc version" >&5
-echo $ECHO_N "checking the glibc version... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ == 6)
+ GLIBC_26
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "GLIBC_26" >/dev/null 2>&1; then
+ glibc="2.6"
+fi
+rm -f conftest*
+
+
+{ echo "$as_me:$LINENO: checking the glibc version" >&5
+echo $ECHO_N "checking the glibc version... $ECHO_C" >&6; }
case "${glibc}" in
2.2)
@@ -4439,11 +4461,22 @@ _ACEOF
DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
;;
+ 2.6)
+ echo "$as_me:$LINENO: result: 2.6 family" >&5
+echo "${ECHO_T}2.6 family" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define GLIBC_2_6 1
+_ACEOF
+
+ DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
+ ;;
+
*)
- echo "$as_me:$LINENO: result: unsupported version" >&5
-echo "${ECHO_T}unsupported version" >&6
- { { echo "$as_me:$LINENO: error: Valgrind requires glibc version 2.2 - 2.5" >&5
-echo "$as_me: error: Valgrind requires glibc version 2.2 - 2.5" >&2;}
+ { echo "$as_me:$LINENO: result: unsupported version" >&5
+echo "${ECHO_T}unsupported version" >&6; }
+ { { echo "$as_me:$LINENO: error: Valgrind requires glibc version 2.2 - 2.6" >&5
+echo "$as_me: error: Valgrind requires glibc version 2.2 - 2.6" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
--- valgrind-3.2.3/glibc-2.6.supp.jj 2007-06-27 16:09:55.000000000 +0200
+++ valgrind-3.2.3/glibc-2.6.supp 2007-06-27 16:10:20.000000000 +0200
@@ -0,0 +1,216 @@
+
+##----------------------------------------------------------------------##
+
+# Errors to suppress by default with glibc 2.6.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
+# Free Addr1 Addr2 Addr4 Addr8 Addr16
+# Cond (previously known as Value0)
+#
+# and the optional extra info is:
+# if Param: name of system call param
+# if Free: name of free-ing fn)
+
+{
+ 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.6*.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
+}

View File

@ -0,0 +1,26 @@
--- valgrind-3.2.3/coregrind/m_syswrap/syswrap-linux.c.jj 2007-06-27 12:22:59.000000000 +0200
+++ valgrind-3.2.3/coregrind/m_syswrap/syswrap-linux.c 2007-06-27 12:37:18.000000000 +0200
@@ -1213,16 +1213,18 @@ POST(sys_io_setup)
PRE(sys_io_destroy)
{
struct vki_aio_ring *r;
- SizeT size;
-
+ SizeT size = 0;
+
PRINT("sys_io_destroy ( %llu )", (ULong)ARG1);
PRE_REG_READ1(long, "io_destroy", vki_aio_context_t, ctx);
// If we are going to seg fault (due to a bogus ARG1) do it as late as
// possible...
- r = (struct vki_aio_ring *)ARG1;
- size = VG_PGROUNDUP(sizeof(struct vki_aio_ring) +
- r->nr*sizeof(struct vki_io_event));
+ if (ML_(safe_to_deref)( (void*)ARG1, sizeof(struct vki_aio_ring))) {
+ r = (struct vki_aio_ring *)ARG1;
+ size = VG_PGROUNDUP(sizeof(struct vki_aio_ring) +
+ r->nr*sizeof(struct vki_io_event));
+ }
SET_STATUS_from_SysRes( VG_(do_syscall1)(SYSNO, ARG1) );

View File

@ -1,12 +1,14 @@
Summary: Tool for finding memory management bugs in programs
Name: valgrind
Version: 3.2.3
Release: 2
Release: 3
Epoch: 1
Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2
Patch1: valgrind-3.2.3-openat.patch
Patch2: valgrind-3.2.3-cachegrind-improvements.patch
Patch3: valgrind-3.2.3-pkg-config.patch
Patch4: valgrind-3.2.3-glibc2_6.patch
Patch5: valgrind-3.2.3-io_destroy.patch
License: GPL
URL: http://www.valgrind.org/
Group: Development/Debuggers
@ -38,6 +40,8 @@ find/diagnose.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
%ifarch x86_64 ppc64
@ -52,7 +56,7 @@ touch libgcc/libgcc_s_32.a
# Force a specific set of default suppressions
echo -n > default.supp
for file in glibc-2.5.supp xfree-4.supp ; do
for file in glibc-2.6.supp xfree-4.supp ; do
cat $file >> default.supp
done
@ -121,6 +125,11 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/valgrind*
%changelog
* Wed Jun 27 2007 Jakub Jelinek <jakub@redhat.com> 3.2.3-3
- add suppressions for glibc >= 2.6
- avoid valgrind internal error if io_destroy syscall is
passed a bogus argument
* Tue Feb 13 2007 Jakub Jelinek <jakub@redhat.com> 3.2.3-2
- fix valgrind.pc again