Subject: Re: bug#37822: guile-fibers build failure
From: Christopher Baines <[email-masked]>
To: [email-masked]
Date: Sun, 20 Oct 2019 13:50:09 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Christopher Baines <[email-masked]> writes:

> The guile-fibers package seems to fail to build on some machines.
>
> starting phase `check'
> make  check-am
> make[1]: Entering directory '/tmp/guix-build-guile-fibers-1.0.0.drv-0/fibers-1.0.0'
> make  check-TESTS
> make[2]: Entering directory '/tmp/guix-build-guile-fibers-1.0.0.drv-0/fibers-1.0.0'
> assert #f equal to #f: ok
> assert #t terminates: ok
> assert (false-if-exception (begin (run-fibers) #t)) equal to #f: ok
> assert terminates: (run-fibers (lambda () (sleep 1)) #:drain? #t): ok (1.044672258 s)
> assert terminates: (run-fibers (lambda () (do-times 1 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.034571671 s)
> assert terminates: (run-fibers (lambda () (do-times 10 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.05742899 s)
> assert terminates: (run-fibers (lambda () (do-times 100 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.022090434 s)
> assert terminates: (run-fibers (lambda () (do-times 1000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.110914993 s)
> assert terminates: (run-fibers (lambda () (do-times 10000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.110751905 s)
> assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.747805854 s)
> assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber (lambda () #t) #:parallel? #t))) #:drain? #t): ok (1.116078927 s)
> assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber loop-to-1e4))) #:drain? #t): ok (396.536024374 s)
> assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber loop-to-1e4 #:parallel? #t))) #:drain? #t): ok (67.471703208 s)
> assert terminates: (run-fibers (lambda () (do-times 1 (spawn-fiber (lambda () (sleep 1))))) #:drain? #t): ok (1.027788168 s)
> assert terminates: (run-fibers (lambda () (do-times 10 (spawn-fiber (lambda () (sleep 1))))) #:drain? #t): /gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7/bin/bash: line 5:  2
> 445 Aborted                 top_srcdir="/tmp/guix-build-guile-fibers-1.0.0.drv-0/fibers-1.0.0" ./env /gnu/store/1mkkv2caiqbdbbd256c4dirfi4kwsacv-guile-2.2.6/bin/guile -s ${dir}$tst
> FAIL: tests/basic.scm
>
>
> This is from milano-guix-1, which has 32 cores. I'm a bit confused as to
> what is actually causing the test to fail. I'm guessing it could be
> timing out, but I can't see anything looking at the time the test takes
> to run.

I've now tried running the tests using Guix immediately prior to the
recent core-updates merge (d57660c54907cc6fba8b0adf6295fd2311ada6cf),
and immediately after the merge
(cf3d1763ede1a329c2bc932c84591ab594bb6c96) and the tests passed before,
and failed afterwards.

I've also tried running the tests manually, I did see a couple of times
a failure that mentioned about "Too many open files" [1].

I then attempted to raise the limit for open files, I think using
prlimit like `prlimit --nofile=8096:8096 --pid GUIX_DAEMON_PID` did the
trick, and that meant that I built the package sucessfully.

I'm thinking now that there's a relationship between the number of cores
the tests are run with, and the required file descriptors. Also, I'm
pretty sure this behaviour changed when core-updates was merged.

I'll close this bug for now, as I've found a way to build the package.

1:
make  check-TESTS
make[2]: Entering directory '/home/cbaines/fibers-1.0.0'
assert #f equal to #f: ok
assert #t terminates: ok
assert (false-if-exception (begin (run-fibers) #t)) equal to #f: ok
assert terminates: (run-fibers (lambda () (sleep 1)) #:drain? #t): ok (1.065373625 s)
assert terminates: (run-fibers (lambda () (do-times 1 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.099213566 s)
assert terminates: (run-fibers (lambda () (do-times 10 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.25544907 s)
assert terminates: (run-fibers (lambda () (do-times 100 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.072169616 s)
assert terminates: (run-fibers (lambda () (do-times 1000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.02872572 s)
assert terminates: (run-fibers (lambda () (do-times 10000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.099789859 s)
assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber (lambda () #t)))) #:drain? #t): ok (0.560994013 s)
assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber (lambda () #t) #:parallel? #t))) #:drain? #t): ok (0.913570257 s)
assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber loop-to-1e4))) #:drain? #t): ok (7.429164661 s)
assert terminates: (run-fibers (lambda () (do-times 100000 (spawn-fiber loop-to-1e4 #:parallel? #t))) #:drain? #t): ok (1.135422681 s)
assert terminates: (run-fibers (lambda () (do-times 1 (spawn-fiber (lambda () (sleep 1))))) #:drain? #t): ok (1.020960002 s)
assert terminates: (run-fibers (lambda () (do-times 10 (spawn-fiber (lambda () (sleep 1))))) #:drain? #t): ok (1.065859212 s)
assert terminates: (run-fibers (lambda () (do-times 100 (spawn-fiber (lambda () (sleep 1))))) #:drain? #t): Backtrace:
In ice-9/boot-9.scm:
   222:29 19 (map1 (15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30))
   222:29 18 (map1 (16 17 18 19 20 21 22 23 24 25 26 27 28 29 30))
   222:29 17 (map1 (17 18 19 20 21 22 23 24 25 26 27 28 29 30))
   222:29 16 (map1 (18 19 20 21 22 23 24 25 26 27 28 29 30))
   222:29 15 (map1 (19 20 21 22 23 24 25 26 27 28 29 30))
   222:29 14 (map1 (20 21 22 23 24 25 26 27 28 29 30))
   222:29 13 (map1 (21 22 23 24 25 26 27 28 29 30))
   222:29 12 (map1 (22 23 24 25 26 27 28 29 30))
   222:29 11 (map1 (23 24 25 26 27 28 29 30))
   222:29 10 (map1 (24 25 26 27 28 29 30))
   222:29  9 (map1 (25 26 27 28 29 30))
   222:29  8 (map1 (26 27 28 29 30))
   222:29  7 (map1 (27 28 29 30))
   222:29  6 (map1 (28 29 30))
   222:29  5 (map1 (29 30))
   222:17  4 (map1 (30))
In fibers/internal.scm:
   149:14  3 (make-scheduler #:parallelism _ #:prompt-tag _)
In fibers/epoll.scm:
    94:31  2 (epoll-create #:close-on-exec? _ #:maxevents _)
    53:14  1 (make-wake-pipe)
In unknown file:
           0 (pipe)

ERROR: In procedure pipe:
In procedure pipe: Too many open files
FAIL: tests/basic.scm