This commit is contained in:
Jakub Jelinek 2009-07-28 10:47:08 +00:00
parent 8f71f2c7ac
commit da701c02b1
2 changed files with 119 additions and 2 deletions

112
valgrind-3.4.1-futex.patch Normal file
View File

@ -0,0 +1,112 @@
--- valgrind/include/vki/vki-linux.h.jj 2009-07-28 11:14:49.000000000 +0200
+++ valgrind/include/vki/vki-linux.h 2009-07-28 11:37:12.000000000 +0200
@@ -1150,7 +1150,7 @@ struct vki_seminfo {
#define VKI_MREMAP_FIXED 2
//----------------------------------------------------------------------
-// From linux-2.6.10-rc3-mm1/include/linux/futex.h
+// From linux-2.6.31-rc4/include/linux/futex.h
//----------------------------------------------------------------------
#define VKI_FUTEX_WAIT (0)
@@ -1158,7 +1158,16 @@ struct vki_seminfo {
#define VKI_FUTEX_FD (2)
#define VKI_FUTEX_REQUEUE (3)
#define VKI_FUTEX_CMP_REQUEUE (4)
+#define VKI_FUTEX_WAKE_OP (5)
+#define VKI_FUTEX_LOCK_PI (6)
+#define VKI_FUTEX_UNLOCK_PI (7)
+#define VKI_FUTEX_TRYLOCK_PI (8)
+#define VKI_FUTEX_WAIT_BITSET (9)
+#define VKI_FUTEX_WAKE_BITSET (10)
+#define VKI_FUTEX_WAIT_REQUEUE_PI (11)
+#define VKI_FUTEX_CMP_REQUEUE_PI (12)
#define VKI_FUTEX_PRIVATE_FLAG (128)
+#define VKI_FUTEX_CLOCK_REALTIME (256)
struct vki_robust_list {
struct vki_robust_list __user *next;
--- valgrind/coregrind/m_syswrap/syswrap-linux.c.jj 2009-07-28 11:14:50.000000000 +0200
+++ valgrind/coregrind/m_syswrap/syswrap-linux.c 2009-07-28 12:00:09.000000000 +0200
@@ -865,31 +865,43 @@ PRE(sys_futex)
ARG6 - int val3 CMP_REQUEUE
*/
PRINT("sys_futex ( %#lx, %ld, %ld, %#lx, %#lx )", ARG1,ARG2,ARG3,ARG4,ARG5);
- switch(ARG2) {
+ switch(ARG2 & ~(VKI_FUTEX_PRIVATE_FLAG|VKI_FUTEX_CLOCK_REALTIME)) {
case VKI_FUTEX_CMP_REQUEUE:
- case VKI_FUTEX_CMP_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
+ case VKI_FUTEX_WAKE_OP:
+ case VKI_FUTEX_CMP_REQUEUE_PI:
PRE_REG_READ6(long, "futex",
vki_u32 *, futex, int, op, int, val,
struct timespec *, utime, vki_u32 *, uaddr2, int, val3);
break;
case VKI_FUTEX_REQUEUE:
- case VKI_FUTEX_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
+ case VKI_FUTEX_WAIT_REQUEUE_PI:
PRE_REG_READ5(long, "futex",
vki_u32 *, futex, int, op, int, val,
struct timespec *, utime, vki_u32 *, uaddr2);
break;
+ case VKI_FUTEX_WAIT_BITSET:
+ PRE_REG_READ6(long, "futex",
+ vki_u32 *, futex, int, op, int, val,
+ struct timespec *, utime, int, dummy, int, val3);
+ break;
+ case VKI_FUTEX_WAKE_BITSET:
+ PRE_REG_READ6(long, "futex",
+ vki_u32 *, futex, int, op, int, val,
+ int, dummy, int, dummy2, int, val3);
+ break;
case VKI_FUTEX_WAIT:
- case VKI_FUTEX_WAIT | VKI_FUTEX_PRIVATE_FLAG:
+ case VKI_FUTEX_LOCK_PI:
PRE_REG_READ4(long, "futex",
vki_u32 *, futex, int, op, int, val,
struct timespec *, utime);
break;
case VKI_FUTEX_WAKE:
- case VKI_FUTEX_WAKE | VKI_FUTEX_PRIVATE_FLAG:
case VKI_FUTEX_FD:
+ case VKI_FUTEX_TRYLOCK_PI:
PRE_REG_READ3(long, "futex",
vki_u32 *, futex, int, op, int, val);
break;
+ case VKI_FUTEX_UNLOCK_PI:
default:
PRE_REG_READ2(long, "futex", vki_u32 *, futex, int, op);
break;
@@ -899,23 +911,27 @@ PRE(sys_futex)
*flags |= SfMayBlock;
- switch(ARG2) {
+ switch(ARG2 & ~(VKI_FUTEX_PRIVATE_FLAG|VKI_FUTEX_CLOCK_REALTIME)) {
case VKI_FUTEX_WAIT:
- case VKI_FUTEX_WAIT | VKI_FUTEX_PRIVATE_FLAG:
+ case VKI_FUTEX_LOCK_PI:
+ case VKI_FUTEX_WAIT_BITSET:
+ case VKI_FUTEX_WAIT_REQUEUE_PI:
if (ARG4 != 0)
PRE_MEM_READ( "futex(timeout)", ARG4, sizeof(struct vki_timespec) );
break;
case VKI_FUTEX_REQUEUE:
- case VKI_FUTEX_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
case VKI_FUTEX_CMP_REQUEUE:
- case VKI_FUTEX_CMP_REQUEUE | VKI_FUTEX_PRIVATE_FLAG:
+ case VKI_FUTEX_CMP_REQUEUE_PI:
+ case VKI_FUTEX_WAKE_OP:
PRE_MEM_READ( "futex(futex2)", ARG5, sizeof(Int) );
break;
case VKI_FUTEX_WAKE:
- case VKI_FUTEX_WAKE | VKI_FUTEX_PRIVATE_FLAG:
case VKI_FUTEX_FD:
+ case VKI_FUTEX_WAKE_BITSET:
+ case VKI_FUTEX_TRYLOCK_PI:
+ case VKI_FUTEX_UNLOCK_PI:
/* no additional pointers */
break;

View File

@ -1,7 +1,7 @@
Summary: Tool for finding memory management bugs in programs
Name: valgrind
Version: 3.4.1
Release: 6
Release: 7
Epoch: 1
Source0: http://www.valgrind.org/downloads/valgrind-%{version}.tar.bz2
Patch1: valgrind-3.4.1-cachegrind-improvements.patch
@ -11,6 +11,7 @@ Patch4: valgrind-3.4.1-glibc-2.10.1.patch
Patch5: valgrind-3.4.1-dwarf3.patch
Patch6: valgrind-3.4.1-dwarf-cfa-remember-state1.patch
Patch7: valgrind-3.4.1-dwarf-cfa-remember-state2.patch
Patch8: valgrind-3.4.1-futex.patch
License: GPLv2
URL: http://www.valgrind.org/
Group: Development/Debuggers
@ -71,6 +72,7 @@ or valgrind plugins.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
%ifarch x86_64 ppc64
@ -161,7 +163,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/*
%changelog
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1:3.4.1-6
* Tue Jul 28 2009 Jakub Jelinek <jakub@redhat.com> 3.4.1-7
- handle futex ops newly added during last 4 years (#512121)
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> 3.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Mon Jul 13 2009 Jakub Jelinek <jakub@redhat.com> 3.4.1-5