From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#6074: accept-process-output on listening sockets cause non-interruptible infloop Date: Mon, 14 Sep 2020 15:21:11 +0200 Message-ID: <87o8m8a3zs.fsf@gnus.org> References: <83imruqh62.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21554"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 6074@debbugs.gnu.org To: Pip Cet Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 14 15:22:11 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHoQs-0005RI-Sh for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 15:22:10 +0200 Original-Received: from localhost ([::1]:53764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHoQr-0008Ko-8W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Sep 2020 09:22:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHoQk-0008KJ-Pn for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 09:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHoQk-0008B6-GY for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 09:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kHoQk-00053w-Br for bug-gnu-emacs@gnu.org; Mon, 14 Sep 2020 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Sep 2020 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6074 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 6074-submit@debbugs.gnu.org id=B6074.160008969119407 (code B ref 6074); Mon, 14 Sep 2020 13:22:02 +0000 Original-Received: (at 6074) by debbugs.gnu.org; 14 Sep 2020 13:21:31 +0000 Original-Received: from localhost ([127.0.0.1]:53109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHoQF-00052w-2V for submit@debbugs.gnu.org; Mon, 14 Sep 2020 09:21:31 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:58728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHoQC-00052h-U5 for 6074@debbugs.gnu.org; Mon, 14 Sep 2020 09:21:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=+zeRUD+InaACtj0Kt5AOItkuDUZYXsneLFMiSUkzjB8=; b=t4OEQkWvpqSH5xoGRLs3uUKL6l M4HSAofMCl7SwtvqQ/jLqzRjKJuOyPIP1BhbSJEyAqETnthm3dvf2qYqpv1sXBYBfgvpULZw4VVog V9z2FdXZThK3BqMhaK//TiVsz+/sgkHTOGl/PmAnqMf8IMkP+43S4HadunMQhs7BtVVk=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kHoPx-0001ug-4b; Mon, 14 Sep 2020 15:21:22 +0200 X-Now-Playing: Xiu Xiu's _Girl with Basket of Fruit_: "The Wrong Thing" In-Reply-To: (Pip Cet's message of "Mon, 22 Jul 2019 17:45:18 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188046 Archived-At: Pip Cet writes: > Why would we try again after receiving EINVAL? I believe the right > behavior is to return immediately in this case, just as we do for EIO. > > However, we should probably call rarely_quit inside the loop, anyway, > to catch the case of a kernel bug keeping us busy with EINTRs. How's > this? [...] > { > + unsigned int count = 0; > XSETPROCESS (proc, wait_proc); > > while (true) > { > int nread = read_process_output (proc, wait_proc->infd); > + rarely_quit (++count); > if (nread < 0) > { > - if (errno == EIO || would_block (errno)) > + if (errno != EINTR) > break; > } > else There was no followup on this patch at the time (except Richard chiding you for using forbidden terminology), but I tried the patch now, and it seems to fix the issue, so I've applied it to the trunk now. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no