From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id wDGOLy5QcGY23AAA62LTzQ:P1 (envelope-from ) for ; Mon, 17 Jun 2024 15:03:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id wDGOLy5QcGY23AAA62LTzQ (envelope-from ) for ; Mon, 17 Jun 2024 17:03:10 +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="x/T2Ast4"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="X AkjvwO"; dmarc=none; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1718636590; a=rsa-sha256; cv=none; b=VeWCFTRRvdJ8tbPjxdLW/FZvMUKjkzUrENj+UXPHEdkex3cDiaKJb/emQbwBU/VR346vzh glYxIXtJB0Cv08eGG2lXuvCT0qMTlnEdCdLh848w8Tc4sLTj0rCNeogHO9syY/7/16vCEc oYs4Or+YNLOIk2aLmNGRtWCVBzawKEFeT3AOAQaqSIM0OcDwMntFdb6I00QlneN6wr87PK wwv1cI+yBI0Fpw6Gd0DiwJqkC4YZ8dIuafZWagPf7PrAatSRqI6ecUWshlVP8p9vNzMGD4 Au3m5Rn1QYVQjy1FkbfgbLGFMxl2xEMpqzJRxHGfdII7XRnP6i0DYFyAUCXrIQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm1 header.b="x/T2Ast4"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b="X AkjvwO"; dmarc=none; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1718636590; 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=0KwuUWn7JZYn+RAqprpjzjgheULTH/L4cx61oqx0xUo=; b=tUjcuTlchXrCOH2v2thY/me2qVO8xhlqHBU5CwCQfuznicGA8x5rqzGKLWYxKSFq2XHc93 Y7Imt1K7nLdoa7HFAoOO417O8LjElgv0UQvgDGRjcOMrwhRyQkscRGWHdHio8QiXoLSlf8 UqpkadouhDAe7aA/Ugi13Xr389wYDLm2WLWsU1Zigu96ZXB5qwn8ZIx0yYR3c2B82f3B0A Y0/XbnuW6wslBCP7LuwJS8xLsRA9mYMWa9EnfCcCgxhv257vvbBObDCxwXnUmqTLWkhAo8 F9GEzvvv7KI/MOoPub80niT61UuhIDBzmOU1ZMm0zUp/O/S+k52xor7pv3YAmQ== 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 6ECEA1469C for ; Mon, 17 Jun 2024 17:03:10 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJDsv-0006nu-Jj; Mon, 17 Jun 2024 11:03:05 -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 1sJDsr-0006kS-I1 for guix-patches@gnu.org; Mon, 17 Jun 2024 11:03:01 -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 1sJDsp-0002co-NW for guix-patches@gnu.org; Mon, 17 Jun 2024 11:03:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJDsr-00005s-N3; Mon, 17 Jun 2024 11:03:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71203] [PATCH v2 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: Mon, 17 Jun 2024 15:03:01 +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 , Philip McGrath X-Debbugs-Original-Xcc: Philip McGrath Received: via spool by 71203-submit@debbugs.gnu.org id=B71203.171863652332753 (code B ref 71203); Mon, 17 Jun 2024 15:03:01 +0000 Received: (at 71203) by debbugs.gnu.org; 17 Jun 2024 15:02:03 +0000 Received: from localhost ([127.0.0.1]:35087 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJDru-0008WC-Vf for submit@debbugs.gnu.org; Mon, 17 Jun 2024 11:02:03 -0400 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]:51917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJDrs-0008VY-FO for 71203@debbugs.gnu.org; Mon, 17 Jun 2024 11:02:01 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 481DC1380242; Mon, 17 Jun 2024 11:01:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 17 Jun 2024 11:01:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc: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=1718636513; x=1718722913; bh=0KwuUWn7JZYn+RAqprpjz jgheULTH/L4cx61oqx0xUo=; b=x/T2Ast4IJva47SBYrusKDnzP6EJUHwcFKaqg vVSwkKMUj+MnWN8M40BqCi/GynfIw7BcU13I5PlqIfaxPYJ4Rqna0Yj7+RqdqPZU BAVDYvAoDmW1xKEcITOt5CINsF7iSZ9+HAe5ZzkNpQ03wHWwlsfxvbAv0RxVu5Sw 4o5TjHberoE5pjOclH+ITwZkiYDhisBwjgIpgFKQcSK5Q0Sp1gQleokrzwFIsO8k 82jCBTjO14EoiiFzcqmI8KkrFDhLjztSeBB1KoJs9ZhRuAxMkJL5fCh8SkFdGW+/ Ga3s4t+QLAK59onfdr4iJWaphovy5qwoQitWQwAY8aZRrpWxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1718636513; x= 1718722913; bh=0KwuUWn7JZYn+RAqprpjzjgheULTH/L4cx61oqx0xUo=; b=X AkjvwOdiiEzqtEajXHNYhGbx9wz03kaeuL26km2K9WuN7aW/JWwDZSWC23N20lWo 5nvfWOM7x2e8Fmh7h0jF12PN7fSLuNZfmLgqfeBwI5n7tVkJd52MHXspTS/Yj+LL qBM4Z5neZYYK7joO1ovIYd7qfkfo47VcECUxdS5FNBZW9/ZwEueNmet6jxdLWzj/ OkL0mfq8xpA0Y6PWQeH59Uv7MZo6Q0kR1r7DvfoeGiVtsDtorgB2l3HBYPSxapxS YEc1176xHggYBjlvF3uCg+GUUYVGalbOQOOWc0Yzgg0crp2mCwKplOqJiQuQB8+9 dFCIPUK+Ty7S1b8V3uc+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedvhedgkedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefrhhhilhhiphcuofgtifhrrghthhcuoehphhhilhhiphes phhhihhlihhpmhgtghhrrghthhdrtghomheqnecuggftrfgrthhtvghrnhepudehvdefje etfffffeektdehtdetudfhtdfhuddtueeukefhveehhfehvdfhheffnecuffhomhgrihhn pehgihhthhhusgdrtghomhenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmh grihhlfhhrohhmpehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtghomh X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 17 Jun 2024 11:01:52 -0400 (EDT) From: Philip McGrath Date: Mon, 17 Jun 2024 11:00:11 -0400 Message-ID: X-Mailer: git-send-email 2.45.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -3.96 X-Migadu-Scanner: mx12.migadu.com X-Spam-Score: -3.96 X-Migadu-Queue-Id: 6ECEA1469C X-TUID: KFPLzkR+uiQM 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 d2423aa93c..059bcdc842 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1028,6 +1028,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.45.1