guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix gc.test "after-gc-hook gets called" failures


From: Andrea Azzarone
Subject: [PATCH] Fix gc.test "after-gc-hook gets called" failures
Date: Thu, 11 Apr 2019 16:43:23 +0100

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 <address@hidden>
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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]