From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id IPPhCnOqUmZ9VgAAqHPOHw:P1 (envelope-from ) for ; Sun, 26 May 2024 05:20:19 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id IPPhCnOqUmZ9VgAAqHPOHw (envelope-from ) for ; Sun, 26 May 2024 05:20:19 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=MG0URkAL; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=JuJ3KyI7; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1716693619; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4HO8bYsQTpbrS1vsTrxrVwjcZyfq3sNMeAqc78Z1zxU=; b=ta8ZhiXQ4Cs+A3Bb1Cmih6A0NDUQn7zA/cPWi719FE9C8uVnGMjbhYiKGRCMO5RvyZBzf0 W9lanIto5oTqFzsiu6aOW6yJB6NZVzE7LfaME1Qb98UkhSxeXe89TyeM4/k54YqVGwimxk OsIQL5zcN2hSKOJ4uwYfqXOQENq7lVczhULQVGpghBvmdpw+K7ROFlJ2RwcV2VKXRhuU6r KYGY1t3PLKUzQl7U9Ez+D9ggt0yiagE1+IGrZ8SGqz+cbKBr6glVGypgxd0CReC7NUoPXu 1Cayn7sHvIHhp7tE+uik1ee0gGolaqaQLHRfueLW5kuQkX3/in6hKqwlc42gnw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b=MG0URkAL; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=JuJ3KyI7; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1716693619; a=rsa-sha256; cv=none; b=tffb3iu3G+qTxzjyJr0uuEl9vpCSgBhZ/U4P6CVmlOD8eNm+pv+eMhngI33/MY1nV8PYV7 vDTm2ThMy0gqfMjqBuvD9WNC8EhopJ93abdT91yXt8qaM68dKHmVB8dmjcYBThkr+gN74c quCYx28MqK0v7IqMEMY5doGEpoVUpMOdiPFeskJavazH8gAojElRFJVlQyoqpESuvTzyPD cvJNh0v6eGdBjpVpRtrxGn5qovCH7ea7JX3ZBe1/YbDbv2NJieDCqlRjydGy4NHVTDFDyC NS376fmkI0DE0tN1Wv8avixcyEXYk9CZGZjw7/I5upAsiwedDChntJ0vURejQA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 80BE8257B3 for ; Sun, 26 May 2024 05:20:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB4QO-0006Tk-Dp; Sat, 25 May 2024 23:19:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sB4QM-0006T0-Rq for guix-patches@gnu.org; Sat, 25 May 2024 23:19:54 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sB4QM-00010O-GK for guix-patches@gnu.org; Sat, 25 May 2024 23:19:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sB4QU-0008Lq-BA; Sat, 25 May 2024 23:20:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71203] [PATCH 3/3] gnu: chez-scheme: Backport test fix. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: philip@philipmcgrath.com, guix-patches@gnu.org Resent-Date: Sun, 26 May 2024 03:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71203 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71203@debbugs.gnu.org Cc: Philip McGrath X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by submit@debbugs.gnu.org id=B.171669354431980 (code B ref -1); Sun, 26 May 2024 03:20:02 +0000 Received: (at submit) by debbugs.gnu.org; 26 May 2024 03:19:04 +0000 Received: from localhost ([127.0.0.1]:38114 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB4PX-0008Jj-Re for submit@debbugs.gnu.org; Sat, 25 May 2024 23:19:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:52488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB4PT-0008Ip-QU for submit@debbugs.gnu.org; Sat, 25 May 2024 23:19:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sB4PL-0006Gq-IL for guix-patches@gnu.org; Sat, 25 May 2024 23:18:51 -0400 Received: from wfout1-smtp.messagingengine.com ([64.147.123.144]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sB4PJ-0000uL-9i for guix-patches@gnu.org; Sat, 25 May 2024 23:18:51 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.west.internal (Postfix) with ESMTP id 29A271C000D0 for ; Sat, 25 May 2024 23:18:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sat, 25 May 2024 23:18:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:content-transfer-encoding:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1716693527; x=1716779927; bh=4HO8bYsQTpbrS1vsTrxrVwjcZyfq3sNM eAqc78Z1zxU=; b=MG0URkALRhNpjC2iQAeuiY+SqU/xYqb25yWGIsChuigcQ0v/ mKMM/S+LHR7TqNIJ+7kYHrHeFGPrf2m40d62vAHCkFN4K4fWgBMukRTR6iahIk3k OUyCTcZkPNfcrSzMhT1VmROxQ/JNt+X1diwQcA0n/s1skcznFZZPQqj1rnP2Yh9r TKyqwkoWVmwkJT6CcFu0UDurwSRmdvek8+bduecIgzn7bFZ0J2b35GJS1WUliBaT 9uLjojNYbBpqUKo3PVR/2Mi88iIHrWmXXKvV6Y07cEsedwy0dCcpu5jvnlRPWVfD Z7GJK9g4/9MLdMrXF0V6w3l+E34nm0sEqPpfdA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1716693527; x=1716779927; bh=4HO8bYsQTpbrS 1vsTrxrVwjcZyfq3sNMeAqc78Z1zxU=; b=JuJ3KyI7iO9fbSB9eXLsSXY+fjcVr /Ibn0KpUjIQ7wirsS1b42/d8MuOpu+8PuZoAgtxD4QhAFMer7ADs0hk8fnIl9J6i /0+Jd2NhZjcc02/T1/xXFZuvbd5I6Kw0c0Z4OrZlDJwCxsSB48AzcRaBZYnzUBIA 5Cz5G1t4cvxe2G8vd7s9xW46K+PDnbwvAZt6G3ujUtBy7H2tzvPUOiZ5Ex2PfWuj 7xcYnIjXsH1c5oakqPJRJ8Y/G4AXGnL3KAo1pBnuHnnUJWxMP8mmq4H560yYtoxS uXt+c8FOBsyVsNd5g1XqaTgHC0W7J1odo0Ji33E1ZKqMpjk3VYj0rbTJA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdejuddgieekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheprfhhihhlihhpucfotgfirhgrthhhuceophhhihhlihhpsehp hhhilhhiphhmtghgrhgrthhhrdgtohhmqeenucggtffrrghtthgvrhhnpedukefhveeile fhkeevgeeghfdvgfevvdefgeeiudfgveevffejteethfelgffftdenucffohhmrghinhep ghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhhihhlihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 25 May 2024 23:18:47 -0400 (EDT) From: Philip McGrath Date: Sat, 25 May 2024 23:18:43 -0400 Message-ID: <3610d2d5d8141d4be1dae8faa1b5ede61e2ff882.1716692931.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.147.123.144; envelope-from=philip@philipmcgrath.com; helo=wfout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: 2.66 X-Migadu-Queue-Id: 80BE8257B3 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 2.66 X-TUID: woJLUixyHMuP The backported commit fixes crashes when signals are delivered to non-Scheme threads, including GC worker threads and threads created by foreign libraries. This appears to have been the cause of the intermittent test failures we have experienced. * gnu/packages/patches/chez-scheme-backport-signal.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/chez-scheme.scm (chez-scheme)[source]: Use it. (chez-scheme-for-racket, chez-scheme): Enable tests. Change-Id: Ifd87ca0d1707ef6ad067d883772a5b42803ead94 --- gnu/local.mk | 1 + gnu/packages/chez.scm | 3 +- .../patches/chez-scheme-backport-signal.patch | 87 +++++++++++++++++++ 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 gnu/packages/patches/chez-scheme-backport-signal.patch diff --git a/gnu/local.mk b/gnu/local.mk index 5136c92bcf..190e4bd27b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1026,6 +1026,7 @@ dist_patch_DATA = \ %D%/packages/patches/ccextractor-autoconf-tesseract.patch \ %D%/packages/patches/ccextractor-fix-ocr.patch \ %D%/packages/patches/chez-scheme-backport-configure.patch \ + %D%/packages/patches/chez-scheme-backport-signal.patch \ %D%/packages/patches/chez-scheme-bin-sh.patch \ %D%/packages/patches/circos-remove-findbin.patch \ %D%/packages/patches/cdparanoia-fpic.patch \ diff --git a/gnu/packages/chez.scm b/gnu/packages/chez.scm index dd98966c78..8c52bbb188 100644 --- a/gnu/packages/chez.scm +++ b/gnu/packages/chez.scm @@ -329,8 +329,6 @@ (define-public chez-scheme-for-racket (ice-9 match) (srfi srfi-34)) #:out-of-source? #t - ;; Intermittent failures: https://github.com/cisco/ChezScheme/issues/809 - #:tests? #f #:test-target "test" ; test-one test-some-fast test-some test test-more #:configure-flags #~`(,@(let* ((chez+version (strip-store-file-name #$output)) @@ -509,6 +507,7 @@ (define-public chez-scheme "1q66vafhiwk617z51qkm1v64r3bxqhhf5lzrmsa4l9d5yhvlyk09")) (file-name (git-file-name name version)) (patches (search-patches "chez-scheme-backport-configure.patch" + "chez-scheme-backport-signal.patch" "chez-scheme-bin-sh.patch")) (snippet #~(begin (use-modules (guix build utils)) diff --git a/gnu/packages/patches/chez-scheme-backport-signal.patch b/gnu/packages/patches/chez-scheme-backport-signal.patch new file mode 100644 index 0000000000..1fee32b167 --- /dev/null +++ b/gnu/packages/patches/chez-scheme-backport-signal.patch @@ -0,0 +1,87 @@ +From e416651d8b53fa2eca6edde764a9131d128cd166 Mon Sep 17 00:00:00 2001 +From: Matthew Flatt +Date: Sat, 2 Mar 2024 07:18:41 -0700 +Subject: [PATCH] constrain signal delivery to Scheme to the main thread (#813) + +The intent is to avoid crashes when a signal gets delimited to a +thread that might not even be a Scheme thread. Also, we don't try to +queue the event directly in the main thread's context, because then +we'd need more of a lock (while signal handling is otherwise an +implicit lock). + +(cherry picked from commit fc081fc447a786dd53286e5d7314b7217631cb68) +--- + +Notes: + This should fix intermittent test failures experienced by Guix: + see . + + c/globals.h | 1 + + c/schsig.c | 10 ++++++++++ + c/thread.c | 1 + + csug/system.stex | 2 ++ + 4 files changed, 14 insertions(+) + +diff --git a/c/globals.h b/c/globals.h +index d2a08299..eb2965c5 100644 +--- a/c/globals.h ++++ b/c/globals.h +@@ -49,6 +49,7 @@ EXTERN int S_num_preserve_ownership_threads; + # ifdef IMPLICIT_ATOMIC_AS_EXPLICIT + EXTERN s_thread_mutex_t S_implicit_mutex; + # endif ++EXTERN s_thread_t S_main_thread_id; + #endif + + /* segment.c */ +diff --git a/c/schsig.c b/c/schsig.c +index a89ab62a..04677730 100644 +--- a/c/schsig.c ++++ b/c/schsig.c +@@ -666,6 +666,16 @@ ptr S_dequeue_scheme_signals(ptr tc) { + static void forward_signal_to_scheme(INT sig) { + ptr tc = get_thread_context(); + ++#ifdef PTHREADS ++ /* deliver signals to the main thread, only; depending ++ on the threads that are running, `tc` might even be NULL */ ++ if (tc != TO_PTR(&S_G.thread_context)) { ++ pthread_kill(S_main_thread_id, sig); ++ RESET_SIGNAL ++ return; ++ } ++#endif ++ + if (enqueue_scheme_signal(tc, sig)) { + SIGNALINTERRUPTPENDING(tc) = Strue; + SOMETHINGPENDING(tc) = Strue; +diff --git a/c/thread.c b/c/thread.c +index 9a341b22..f130f44d 100644 +--- a/c/thread.c ++++ b/c/thread.c +@@ -40,6 +40,7 @@ void S_thread_init(void) { + s_thread_cond_init(&S_terminated_cond); + S_alloc_mutex.owner = 0; + S_alloc_mutex.count = 0; ++ S_main_thread_id = s_thread_self(); + + # ifdef IMPLICIT_ATOMIC_AS_EXPLICIT + s_thread_mutex_init(&S_implicit_mutex); +diff --git a/csug/system.stex b/csug/system.stex +index d4f2bcbb..bb89f419 100644 +--- a/csug/system.stex ++++ b/csug/system.stex +@@ -547,6 +547,8 @@ After a signal handler for a given signal has been registered, receipt + of the specified signal results in a call to the handler. + The handler is passed the signal number, allowing the same handler to + be used for different signals while differentiating among them. ++In a threaded version of the system, signals are always delivered to ++the main thread. + + Signals handled in this fashion are treated like keyboard interrupts in + that the handler is not called immediately when the signal is delivered + +base-commit: 253230f7dfbb4fe777277d6bbf93f39f9567f086 +-- +2.41.0 + -- 2.41.0