From patchwork Tue Nov 14 01:06:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 79793 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA78938618EA for ; Tue, 14 Nov 2023 01:06:40 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 5C7B43858407 for ; Tue, 14 Nov 2023 01:06:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C7B43858407 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C7B43858407 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.77.166.138 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699923986; cv=none; b=cByGTeYLoDbWUuo+TRHPyP6CtEj7MzR0IOiQ/YrYJ4IA1T1tKMl8gm6tFJBaSc0W1TH/2Iop6Xe8kWKaQLjCJU26/xK4kWBJvQ6fDoNcOz/PstOR1NM4wYvOovkLhtBqYO7HDC9ad4O99ByhJs5KWALVxoHzNYWJOJaG35PkLk0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699923986; c=relaxed/simple; bh=YRWhmEtg68GtkUHc7eOPv13r0IN+oF16Y9mjLtADWCo=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=lApYWbzt/uX/CTZ3QCa/r+Ygu1iLnuU798d906A1lAxqZ1ziUz2SFjOrODTiph7UiUOxFHa9ALa/3AGiUOpnWvQEyLO/ir913mO+BPhwfBvZZ/vKIKZBcHSL+mLV9JxImYR/1c+RU0usGSCYyMuCAhxKZ+OD/UUUQauy1vQ69Ao= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 3B0342017C; Tue, 14 Nov 2023 02:06:24 +0100 (CET) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yEfmzpgkbY76; Tue, 14 Nov 2023 02:06:24 +0100 (CET) Received: from begin (aamiens-653-1-111-57.w83-192.abo.wanadoo.fr [83.192.234.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id F30D520174; Tue, 14 Nov 2023 02:06:23 +0100 (CET) Received: from samy by begin with local (Exim 4.97) (envelope-from ) id 1r2hsl-00000002hok-2Msj; Tue, 14 Nov 2023 02:06:23 +0100 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [hurd, commited] hurd: Make _hurd_intr_rpc_mach_msg avoid returning MACH_SEND_INTERRUPTED Date: Tue, 14 Nov 2023 02:06:23 +0100 Message-ID: <20231114010623.645083-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org When the given options do not include MACH_SEND_INTERRUPT, _hurd_intr_rpc_mach_msg (aka mach_msg) is not supposed to return MACH_SEND_INTERRUPTED. In such a case we thus have to retry sending the message. This was observed to fix various occurrences of spurious "(ipc/send) interrupted" errors when running haskell programs. --- hurd/intr-msg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hurd/intr-msg.c b/hurd/intr-msg.c index bc1f43d383..98f588f206 100644 --- a/hurd/intr-msg.c +++ b/hurd/intr-msg.c @@ -143,6 +143,12 @@ _hurd_intr_rpc_mach_msg (mach_msg_header_t *msg, XXX */ goto retry_receive; } + if (!(option & MACH_SEND_INTERRUPT)) + { + option = user_option; + timeout = user_timeout; + goto message; + } /* FALLTHROUGH */ /* These are the other codes that mean a pseudo-receive modified