From f8063c7acaff2bd130be3936b8ba2051c28874d240cf4d008efee2c3228323aa Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sun, 28 Jan 2018 13:07:19 +0000 Subject: [PATCH] Accepting request 569531 from home:jirislaby:branches:devel:tools - add update-futex-test-in-accordance-with-kernel-s-v4.15-.patch OBS-URL: https://build.opensuse.org/request/show/569531 OBS-URL: https://build.opensuse.org/package/show/devel:tools/strace?expand=0&rev=81 --- strace.changes | 5 + strace.spec | 2 + ...t-in-accordance-with-kernel-s-v4.15-.patch | 121 ++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 update-futex-test-in-accordance-with-kernel-s-v4.15-.patch diff --git a/strace.changes b/strace.changes index 844bd83..b104135 100644 --- a/strace.changes +++ b/strace.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 25 15:04:49 UTC 2018 - jslaby@suse.com + +- add update-futex-test-in-accordance-with-kernel-s-v4.15-.patch + ------------------------------------------------------------------- Tue Nov 14 17:30:50 UTC 2017 - schwab@linux-m68k.org diff --git a/strace.spec b/strace.spec index 20f35a1..0e2c082 100644 --- a/strace.spec +++ b/strace.spec @@ -29,6 +29,7 @@ Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.x Source2: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz.asc Source3: %{name}.keyring Source4: baselibs.conf +Patch0: update-futex-test-in-accordance-with-kernel-s-v4.15-.patch BuildRequires: haveged BuildRequires: libacl-devel BuildRequires: libaio-devel @@ -54,6 +55,7 @@ and processes can be seen. Child processes can also be tracked. %prep %setup -q +%patch0 -p1 %build %configure diff --git a/update-futex-test-in-accordance-with-kernel-s-v4.15-.patch b/update-futex-test-in-accordance-with-kernel-s-v4.15-.patch new file mode 100644 index 0000000..85fff02 --- /dev/null +++ b/update-futex-test-in-accordance-with-kernel-s-v4.15-.patch @@ -0,0 +1,121 @@ +From: Eugene Syromyatnikov +Date: Wed, 24 Jan 2018 09:55:50 -0500 +Subject: Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83 +Patch-mainline: yes +References: fix new kernels + +* futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions. +(main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit +being set, check that the existing behaviour preserved with VALP/VAL2P +where higher bit is unset. + +Signed-off-by: Jiri Slaby +--- + tests/futex.c | 54 +++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 43 insertions(+), 11 deletions(-) + +diff --git a/tests/futex.c b/tests/futex.c +index 41e9d1bf048e..833a20f9591c 100644 +--- a/tests/futex.c ++++ b/tests/futex.c +@@ -152,14 +152,20 @@ void invalid_op(int *val, int op, uint32_t argmask, ...) + } while (0) + + /* Value which differs from one stored in int *val */ +-# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +-# define VAL_PR ((unsigned) VAL) ++# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) ++# define VAL_PR ((unsigned) VAL) + +-# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +-# define VAL2_PR ((unsigned) VAL2) ++# define VALP ((unsigned long) 0xbadda7a01acefeedLLU) ++# define VALP_PR ((unsigned) VALP) + +-# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +-# define VAL3_PR ((unsigned) VAL3) ++# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) ++# define VAL2_PR ((unsigned) VAL2) ++ ++# define VAL2P ((unsigned long) 0xbadda7a07a7b100dLLU) ++# define VAL2P_PR ((unsigned) VAL2P) ++ ++# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) ++# define VAL3_PR ((unsigned) VAL3) + + int + main(int argc, char *argv[]) +@@ -419,16 +425,26 @@ main(int argc, char *argv[]) + + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, +- (rc == 0)); ++ (rc == 0) || ((rc == -1) && (errno == EINVAL))); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + ++ CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VALP, VAL2P, uaddr2, VAL3, ++ (rc == 0)); ++ printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", ++ uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); ++ + /* Trying to re-queue some processes but there's nothing to re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, +- uaddr2, VAL3, (rc == 0)); ++ uaddr2, VAL3, (rc == 0) || ((rc == -1) && (errno == EINVAL))); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + ++ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VALP, ++ VAL2P, uaddr2, VAL3, (rc == 0)); ++ printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", ++ uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); ++ + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", + "%#lx"); + +@@ -445,22 +461,38 @@ main(int argc, char *argv[]) + + /* Comparison re-queue with wrong val value */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, +- (rc == -1) && (errno == EAGAIN)); ++ (rc == -1) && (errno == EAGAIN || errno == EINVAL)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + ++ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, VAL3, ++ (rc == -1) && (errno == EAGAIN)); ++ printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", ++ uaddr, VALP_PR, VAL2P_PR, uaddr2, VAL3_PR, sprintrc(rc)); ++ + /* Successful comparison re-queue */ + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, +- (rc == 0)); ++ (rc == 0) || ((rc == -1) && (errno == EINVAL))); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + ++ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, *uaddr, ++ (rc == 0)); ++ printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", ++ uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); ++ + /* Successful comparison re-queue */ + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, +- VAL2, uaddr2, *uaddr, (rc == 0)); ++ VAL2, uaddr2, *uaddr, ++ (rc == 0) || ((rc == -1) && (errno == EINVAL))); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + ++ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VALP, ++ VAL2P, uaddr2, *uaddr, (rc == 0)); ++ printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", ++ uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); ++ + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, + "%u", "%u", "%#lx", "%u"); + +-- +2.16.1 +