Accepting request 176188 from Base:System

- Try to fix nap() races in gnulib-tests.
  (coreutils-gnulib-tests-fix-nap-race.patch: add upstream patch)
  (coreutils-gnulib-tests-fix-nap-race-obs.patch: add openSUSE patch for OBS) (forwarded request 176187 from bernhard-voelker)

OBS-URL: https://build.opensuse.org/request/show/176188
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/coreutils?expand=0&rev=89
This commit is contained in:
Stephan Kulow 2013-05-27 07:43:30 +00:00 committed by Git OBS Bridge
parent 55951f179f
commit 66c1d681c3
6 changed files with 1160 additions and 2 deletions

View File

@ -0,0 +1,37 @@
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Mon, 20 May 2013 00:03:20 +0200
Subject: [PATCH] tests/nap.h: increase delay multiplier to avoid problems in
VMs like OBS
The gnulib change http://git.sv.gnu.org/cgit/gnulib.git/commit/?id=5191133e
(available upstreams with >= 8.22, applied to openSUSE's coreutils
package with "coreutils-gnulib-tests-fix-nap-race.patch", decreased the
probability of lost races to about a third, however such problems could
still be observed in virtual machines like OBS.
Increasing the factor from 1.125 to 3 seems to close the race window.
* tests/nap.h (nap): Change the multiplier for the delay from 1.125
to 3.
---
gnulib-tests/nap.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Index: gnulib-tests/nap.h
===================================================================
--- gnulib-tests/nap.h.orig
+++ gnulib-tests/nap.h
@@ -126,9 +126,11 @@ nap (void)
/* Multiply by 1.125 (rounding up), to avoid problems if the
file system's clock is a bit slower than nanosleep's.
+ OBS: use 3 as multiplier to avoid this race a bit better
+ which is even more likely in VMs.
Ceiling it at INT_MAX, though. */
- int delta = (d >> 3) + ((d & 7) != 0);
- d = delta < INT_MAX - d ? d + delta : INT_MAX;
+ int d2 = 3 * d;
+ d = d2 < INT_MAX ? d2 : INT_MAX;
delay.tv_sec = d / 1000000000;
delay.tv_nsec = d % 1000000000;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon May 20 15:38:30 UTC 2013 - mail@bernhard-voelker.de
- Try to fix nap() races in gnulib-tests.
(coreutils-gnulib-tests-fix-nap-race.patch: add upstream patch)
(coreutils-gnulib-tests-fix-nap-race-obs.patch: add openSUSE patch for OBS)
-------------------------------------------------------------------
Wed May 15 11:26:29 UTC 2013 - mhrusecky@suse.com
- Provides: /bin/{kill,su}
* for compatibility with programs requiring these (like lsb) until these will
be provided by util-linux
-------------------------------------------------------------------
Thu Apr 4 23:25:17 UTC 2013 - mail@bernhard-voelker.de

View File

@ -44,6 +44,8 @@ BuildRequires: valgrind
Provides: %{name} = %{version}
%if "%{name}" == "coreutils"
Provides: /bin/kill
Provides: /bin/su
Provides: fileutils = %{version}
Provides: mktemp = %{version}
Provides: sh-utils = %{version}
@ -95,6 +97,13 @@ Patch16: coreutils-invalid-ids.patch
Patch100: coreutils-build-timeout-as-pie.patch
Patch101: coreutils-su.patch
# Fix gnulib-test failures related to gnulib-tests/nap.h.
Patch200: coreutils-gnulib-tests-fix-nap-race.patch
# Fix gnulib-test failures: increase nap() delay multiplier even
# a bit more to avoid failures on OBS.
Patch201: coreutils-gnulib-tests-fix-nap-race-obs.patch
# ================================================
%description
These are the GNU core utilities. This package is the union of
@ -131,6 +140,9 @@ receiving util-linux package available which comes with the new binaries.
%patch100
%patch101
%patch200
%patch201
xz -dc %{S:4} >po/de.po
#???## We need to statically link to gmp, otherwise we have a build loop
@ -159,7 +171,6 @@ make all %{?_smp_mflags} V=1
%if "%{name}" == "coreutils-testsuite"
# Make our multi-byte test for sort executable
chmod a+x tests/misc/sort-mb-tests.sh
# Avoid parallel make, because otherwise some timeout based tests like
# rm/ext3-perf may fail due to high CPU or IO load.
make check-very-expensive \

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Mon May 20 15:38:30 UTC 2013 - mail@bernhard-voelker.de
- Try to fix nap() races in gnulib-tests.
(coreutils-gnulib-tests-fix-nap-race.patch: add upstream patch)
(coreutils-gnulib-tests-fix-nap-race-obs.patch: add openSUSE patch for OBS)
-------------------------------------------------------------------
Wed May 15 11:26:29 UTC 2013 - mhrusecky@suse.com
- Provides: /bin/{kill,su}
* for compatibility with programs requiring these (like lsb) until these will
be provided by util-linux
-------------------------------------------------------------------
Thu Apr 4 23:25:17 UTC 2013 - mail@bernhard-voelker.de

View File

@ -44,6 +44,8 @@ BuildRequires: valgrind
Provides: %{name} = %{version}
%if "%{name}" == "coreutils"
Provides: /bin/kill
Provides: /bin/su
Provides: fileutils = %{version}
Provides: mktemp = %{version}
Provides: sh-utils = %{version}
@ -95,6 +97,13 @@ Patch16: coreutils-invalid-ids.patch
Patch100: coreutils-build-timeout-as-pie.patch
Patch101: coreutils-su.patch
# Fix gnulib-test failures related to gnulib-tests/nap.h.
Patch200: coreutils-gnulib-tests-fix-nap-race.patch
# Fix gnulib-test failures: increase nap() delay multiplier even
# a bit more to avoid failures on OBS.
Patch201: coreutils-gnulib-tests-fix-nap-race-obs.patch
# ================================================
%description
These are the GNU core utilities. This package is the union of
@ -131,6 +140,9 @@ receiving util-linux package available which comes with the new binaries.
%patch100
%patch101
%patch200
%patch201
xz -dc %{S:4} >po/de.po
#???## We need to statically link to gmp, otherwise we have a build loop
@ -159,7 +171,6 @@ make all %{?_smp_mflags} V=1
%if "%{name}" == "coreutils-testsuite"
# Make our multi-byte test for sort executable
chmod a+x tests/misc/sort-mb-tests.sh
# Avoid parallel make, because otherwise some timeout based tests like
# rm/ext3-perf may fail due to high CPU or IO load.
make check-very-expensive \