Subject: Re: bug#15683: [critical] ERROR: ... close-pipe: pipe not in table

From: Mark H Weaver <[email-masked]>
Date: Sun, 17 Nov 2013 06:29:12 -0500

To gain some confidence in these patches, I wrote a little test program:

--8<---------------cut here---------------start------------->8---
(use-modules (ice-9 popen))
(define threads
  (map (lambda (_)
         (call-with-new-thread
           (lambda ()
             (let loop ()
               (let ((pipe (open-pipe* OPEN_READ "echo" "foo")))
                 (read pipe)
                 (close-pipe pipe))
               (loop)))))
       (iota 4)))
--8<---------------cut here---------------end--------------->8---

Replace the '4' with the number of cores in your machine.  The code
above will create the requested number of threads, which run in the
background forever, rapidly creating and closing pipes.

The above program is able to reproduce the bug within a few seconds on
both of the multicore machines I have access to (a dual-core x86_64 box
and a 4-core MIPS-compatible Loongson 3A box).

With my patches applied, the above program runs indefinitely without a
problem (I let it run for several minutes).

Please try the code above on the largest machines you have access to.

     Thanks,
       Mark