Hi, "after-gc-hook gets called" test randomly fails as reported downstream, for example: - https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31776 - https://bugs.launchpad.net/ubuntu/+source/guile-2.2/+bug/1823459
I'm attaching a patch that seems to fix the failures. >From 2efba337d5b636cd975260f19ea74e27ecf0ca17 Mon Sep 17 00:00:00 2001 From: Andrea Azzarone <andrea.azzar...@canonical.com> Date: Thu, 11 Apr 2019 16:30:58 +0100 Subject: Fix gc.test "after-gc-hook gets called" failures * libguile/scmsigs.c: Call scm_async_tick to give any pending asyncs a chance to run before we block indefinitely waiting for a signal to arrive. --- libguile/scmsigs.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c index b4bd380be..4e1594a29 100644 --- a/libguile/scmsigs.c +++ b/libguile/scmsigs.c @@ -182,6 +182,14 @@ signal_delivery_thread (void *data) { struct signal_pipe_data sigdata; + /* This tick gives any pending asyncs a chance to run before we block + indefinitely waiting for a signal to arrive. For example it can happen + that the garbage collector is triggered while marking the signal + handler for for future execution. Due to the way the after-gc-hook + is designed, without a call to scm_async_tick, the after-gc-hook will + not be triggered. */ + scm_async_tick (); + scm_without_guile (read_signal_pipe_data, &sigdata); sig = sigdata.sigbyte; -- 2.20.1