Subject: bug#17212: tests/utils.scm failures on Debian Wheezy i686 with Guile 2.0.5

From: Mark H Weaver <[email-masked]>
Date: Sun, 06 Apr 2014 20:01:39 -0400

I see two 'fcntl-lock' related failures with current master on an i686
Debian Wheezy system with Debian's Guile 2.0.5 package.  See below for
the relevant excerpts from utils.log.

     Mark

--8<---------------cut here---------------start------------->8---
Test begin:
  test-name: "fcntl-flock wait"
  source-file: "tests/utils.scm"
  source-line: 177
  source-form: (test-equal "fcntl-flock wait" 42 (let ((file (open-file temp-file "w0"))) (fcntl-flock file (quote write-lock)) (match (primitive-fork) (0 (dynamic-wind (const #t) (lambda () (let ((file (open-file temp-file "r"))) (fcntl-flock file (quote read-lock)) (primitive-exit (read file))) (primitive-exit 1)) (lambda () (primitive-exit 2)))) (pid (display "hello, world!" file) (force-output file) (sleep 1) (seek file 0 SEEK_SET) (truncate-file file 0) (write 42 file) (force-output file) (fcntl-flock file (quote unlock)) (match (waitpid pid) ((_ . status) (let ((result (status:exit-val status))) (close-port file) result)))))))
Test end:
  result-kind: fail
  actual-value: 2
  expected-value: 42
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
Test begin:
  test-name: "fcntl-flock non-blocking"
  source-file: "tests/utils.scm"
  source-line: 216
  source-form: (test-equal "fcntl-flock non-blocking" EAGAIN (match (pipe) ((input . output) (match (primitive-fork) (0 (dynamic-wind (const #t) (lambda () (close-port output) (read-char input) (let ((file (open-file temp-file "w"))) (catch (quote flock-error) (lambda () (fcntl-flock file (quote write-lock) #:wait? #f)) (lambda (key errno) (primitive-exit errno)))) (primitive-exit -1)) (lambda () (primitive-exit -2)))) (pid (close-port input) (let ((file (open-file temp-file "w"))) (fcntl-flock file (quote write-lock)) (write (quote green-light) output) (force-output output) (match (waitpid pid) ((_ . status) (let ((result (status:exit-val status))) (fcntl-flock file (quote unlock)) (close-port file) result)))))))))
t) (lambda () (close-port output) (read-char input) (let ((file (open-file temp-file "w"))) (catch (quote flock-error) (lambda () (fcntl-flock file (quote write-lock) #:wait? #f)) (lambda (key errno) (primitive-exit errno)))) (primitive-exit -1)) (lambda () (primitive-exit -2)))) (pid (close-port input) (let ((file (open-file temp-file "w"))) (fcntl-flock file (quote write-lock)) (write (quote green-light) output) (force-output output) (match (waitpid pid) ((_ . status) (let ((result (status:exit-val status))) (fcntl-flock file (quote unlock)) (close-port file) result)))))))))
Test end:
  result-kind: fail
  actual-value: 0
  expected-value: 11
--8<---------------cut here---------------end--------------->8---