From 962a433200dd9d2eb3306799f8ffd03fb11a2c96 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 13 Feb 2017 16:55:58 +0100 Subject: [PATCH] fix race condition in 00-repl-server.test (#1412931) --- guile-repltest.patch | 33 +++++++++++++++++++++++++++++++++ guile.spec | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 guile-repltest.patch 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 +Date: Fri Nov 4 22:45:51 2016 +0100 + + tests: Avoid race condition in REPL server test. + + Fixes . + Reported by Rob Browning . + + * 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