From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Azzarone Newsgroups: gmane.lisp.guile.devel Subject: [PATCH] Fix gc.test "after-gc-hook gets called" failures Date: Thu, 11 Apr 2019 16:43:23 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="226046"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Apr 11 18:32:11 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hEccS-000wde-Me for guile-devel@m.gmane.org; Thu, 11 Apr 2019 18:32:08 +0200 Original-Received: from localhost ([127.0.0.1]:51928 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEccR-0002iX-1X for guile-devel@m.gmane.org; Thu, 11 Apr 2019 12:32:07 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53738) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hEbrV-0004VD-LT for guile-devel@gnu.org; Thu, 11 Apr 2019 11:43:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hEbrU-0001zq-Is for guile-devel@gnu.org; Thu, 11 Apr 2019 11:43:37 -0400 Original-Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:40594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hEbrU-0001wr-2X for guile-devel@gnu.org; Thu, 11 Apr 2019 11:43:36 -0400 Original-Received: by mail-wr1-x443.google.com with SMTP id h4so7983510wre.7 for ; Thu, 11 Apr 2019 08:43:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=f1ohknoAeJZXLxfNpqmGwl1wvJQHsSuqPuxqlO2JXXM=; b=c0mOkkeCqJVK3XyiEDW4AVhB19II18xO9RaiZV6tKJ/jQgCb3Wh1ZTklT/35bNqaNv AR3Ox9Itns9cyGyk4ENQoedklqyIUxBfygZGc7CjPRgzw/ms96gDK8/rbyUZxn3szR5a rTaQUC3k3nd2GhI34ZgfsHiesVpGKWyjvrZQBBJH1/GLVtcXYqH42ysvkYiTt4vQJiKc Sni7FDm1b1YlPp3rRUf7/bzSeDrd16UwzvhlCuuCYGVDZxNz0T5/mIjInYkeZ8fknXsS vcxNChtUi99EXU65K3SQFZKBRA2yaatw0nFtebp/5byjT4oKlLxJDk2Eea6wAv270suk dPyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=f1ohknoAeJZXLxfNpqmGwl1wvJQHsSuqPuxqlO2JXXM=; b=KDVB8nFcXa983yhCy3mAKgcGDe0r0Wo0Rbqo+QaBExWe20S2CRZ91TcGnT29yGA1Qq uYqzhamQzq54/yeMz99UzmtL87zfvCZmx/QsloC8UCvUvwdG/kwZKVMOAkMGrNTl8d9u mFCVTFndOXCNJDk8SU3WNcZjRHUSzDPLbySL0wtEOthYRMYMV3H+QKqssYxXMU3drNor 4HxCs/8eLbOkMVR+4x/H/MfbTMtb9F7URzaRhjDbXBRo+OgHa5hbf1WYSgxVnFywN9tv 9fhEzeQrGLIoSggYD0wyWYd+lPIsf5nvjSx1r6qJd/rXrxGwAfl+NZlFpcv13KNMu1RW xK9g== X-Gm-Message-State: APjAAAUPRayh5FphtT6lWg0+7mWijkoXxIxJoM6vYISN8AoiDnIJeXBu Lj5iGZEe295zvtVBUQ0hqsgz8bVr7nMOsxieTkTYrAJ5dzEF3A== X-Google-Smtp-Source: APXvYqyzr+zWEl5lhQRBondwfFyQwtzkgJrtgYsvpYFcXgtruFUUjE44dQciY1Cvz03yXJglyx80eYWCEedwHIZosrU= X-Received: by 2002:a5d:4a4d:: with SMTP id v13mr32805056wrs.169.1554997413948; Thu, 11 Apr 2019 08:43:33 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 X-Mailman-Approved-At: Thu, 11 Apr 2019 12:31:47 -0400 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19887 Archived-At: 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 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