summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Lichvar <mlichvar@redhat.com>2017-02-13 16:55:58 +0100
committerMiroslav Lichvar <mlichvar@redhat.com>2017-02-13 17:00:16 +0100
commit962a433200dd9d2eb3306799f8ffd03fb11a2c96 (patch)
tree3c687e2ca363a0b19fc9ae63e070e8474ec65cc5
parentcf59c773fd179406136573be64322332eb0d95ee (diff)
downloadguile-962a433200dd9d2eb3306799f8ffd03fb11a2c96.tar.gz
guile-962a433200dd9d2eb3306799f8ffd03fb11a2c96.tar.xz
guile-962a433200dd9d2eb3306799f8ffd03fb11a2c96.zip
fix race condition in 00-repl-server.test (#1412931)
-rw-r--r--guile-repltest.patch33
-rw-r--r--guile.spec2
2 files changed, 35 insertions, 0 deletions
diff --git a/guile-repltest.patch b/guile-repltest.patch
new file mode 100644
index 0000000..73dadb0
--- /dev/null
+++ b/guile-repltest.patch
@@ -0,0 +1,33 @@
+commit 2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4
+Author: Ludovic Courtès <ludo@gnu.org>
+Date: Fri Nov 4 22:45:51 2016 +0100
+
+ tests: Avoid race condition in REPL server test.
+
+ Fixes <http://bugs.gnu.org/24769>.
+ Reported by Rob Browning <rlb@defaultvalue.org>.
+
+ * test-suite/tests/00-repl-server.test ("simple expression"): Add call
+ to 'select' before 'display'.
+
+diff --git a/test-suite/tests/00-repl-server.test b/test-suite/tests/00-repl-server.test
+index 1f570a9..4b5ec0c 100644
+--- a/test-suite/tests/00-repl-server.test
++++ b/test-suite/tests/00-repl-server.test
+@@ -105,8 +105,14 @@ reached."
+ "scheme@(repl-server)> $1 = 42\n"
+ (with-repl-server socket
+ (read-until-prompt socket %last-line-before-prompt)
+- (display "(+ 40 2)\n(quit)\n" socket)
+- (read-string socket)))
++
++ ;; Wait until 'repl-reader' in boot-9 has written the prompt.
++ ;; Otherwise, if we write too quickly, 'repl-reader' checks for
++ ;; 'char-ready?' and doesn't print the prompt.
++ (match (select (list socket) '() (list socket) 3)
++ (((_) () ())
++ (display "(+ 40 2)\n(quit)\n" socket)
++ (read-string socket)))))
+
+ (pass-if "HTTP inter-protocol attack" ;CVE-2016-8606
+ (with-repl-server socket
diff --git a/guile.spec b/guile.spec
index 1f2e94f..8020815 100644
--- a/guile.spec
+++ b/guile.spec
@@ -15,6 +15,7 @@ Requires(preun): /sbin/install-info
Requires: coreutils
Patch1: guile-multilib.patch
+Patch2: guile-repltest.patch
%description
GUILE (GNU's Ubiquitous Intelligent Language for Extension) is a library
@@ -43,6 +44,7 @@ install the guile package.
%prep
%setup -q -n guile-%version
%patch1 -p1 -b .multilib
+%patch2 -p1 -b .repltest
%build