From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: wait_reading_process_ouput hangs in certain cases (w/ patches) Date: Fri, 16 Feb 2018 18:01:38 +0200 Message-ID: <83tvugdiu5.fsf@gnu.org> References: <83inemrqid.fsf@gnu.org> <398f8d17-b727-d5d6-4a31-772448c7ca0d@binary-island.eu> <56e722a6-95a4-0e42-185c-f26845d4f4bf@binary-island.eu> <21237e45-a353-92f9-01ec-7b51640d2031@cs.ucla.edu> <83vaickfu2.fsf@gnu.org> <83tvxwkexg.fsf@gnu.org> <03261534-6bf5-1a5d-915f-d3c55aaa35e9@binary-island.eu> <206ebefa-7583-f049-140c-c8fd041b0719@cs.ucla.edu> <709614e8-1937-07c1-f554-b453ed4f3d4a@binary-island.eu> <7550438b-9fd4-d374-e571-8bb16456cad5@cs.ucla.edu> <797d0e16-1bae-50c2-35f8-05489ffce935@binary-island.eu> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1518796948 7830 195.159.176.226 (16 Feb 2018 16:02:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Feb 2018 16:02:28 +0000 (UTC) Cc: eggert@cs.ucla.edu, emacs-devel@gnu.org To: Matthias Dahl Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 16 17:02:24 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emiSf-0000qw-16 for ged-emacs-devel@m.gmane.org; Fri, 16 Feb 2018 17:02:09 +0100 Original-Received: from localhost ([::1]:35364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emiUh-0006HV-3b for ged-emacs-devel@m.gmane.org; Fri, 16 Feb 2018 11:04:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emiSE-0004Sw-Nx for emacs-devel@gnu.org; Fri, 16 Feb 2018 11:01:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1emiSB-0003el-N6 for emacs-devel@gnu.org; Fri, 16 Feb 2018 11:01:42 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37051) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1emiSB-0003eb-JP; Fri, 16 Feb 2018 11:01:39 -0500 Original-Received: from [176.228.60.248] (port=2492 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1emiSA-0000mk-W5; Fri, 16 Feb 2018 11:01:39 -0500 In-reply-to: <797d0e16-1bae-50c2-35f8-05489ffce935@binary-island.eu> (message from Matthias Dahl on Tue, 13 Feb 2018 15:25:44 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:222822 Archived-At: > Cc: emacs-devel@gnu.org > From: Matthias Dahl > Date: Tue, 13 Feb 2018 15:25:44 +0100 > > after some unexpected / unintended prolonged delay due to personal > reasons, for which I apologize, attached the v2 of my patches. > > Basically I have gone a somewhat different route. While working in > some of the requested changes, I noticed that there were still some > pathological cases that were not covered and fixing that would make > things even more convoluted. > > So, in this version, the return value is calculated (if necessary) > strategically right before we return from the function call, thus it > cannot be missed and we will always properly signal if data was read > from a wait_proc (either directly or indirectly). > > And instead of messing with got_some_output, we exit the loop when we > got some data (directly or indirectly) for our wait_proc if there is > no data to be read for this iteration. This leaves the whole function > logic alone -- except for this key point. > > I have addressed the remaining issues, if they still applied. And I > have not been able to trigger a single hang with these patches. > > I appreciate any comments and suggestions. Thanks for your work and perseverance. I've now pushed this to the master branch.