From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matthias Dahl Newsgroups: gmane.emacs.devel Subject: Re: wait_reading_process_ouput hangs in certain cases (w/ patches) Date: Tue, 27 Feb 2018 16:02:38 +0100 Message-ID: References: <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> <83tvugdiu5.fsf@gnu.org> <877er5s0xv.fsf@gmail.com> <4e4c72bb-295d-81e1-e4ed-cad256bca83c@binary-island.eu> <87zi3v9461.fsf@gmail.com> <87k1uy8x68.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------E8B3DB631D4B8508201E0C3F" X-Trace: blaine.gmane.org 1519744326 746 195.159.176.226 (27 Feb 2018 15:12:06 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Feb 2018 15:12:06 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: Lars Ingebrigtsen , eggert@cs.ucla.edu, Eli Zaretskii , emacs-devel@gnu.org To: =?UTF-8?Q?andr=c3=a9s_ram=c3=adrez?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 27 16:12:01 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 1eqgv8-0007xH-Vn for ged-emacs-devel@m.gmane.org; Tue, 27 Feb 2018 16:11:59 +0100 Original-Received: from localhost ([::1]:37926 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgx9-00088V-Pl for ged-emacs-devel@m.gmane.org; Tue, 27 Feb 2018 10:14:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgmG-000822-2C for emacs-devel@gnu.org; Tue, 27 Feb 2018 10:02:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqgmC-0005mb-S7 for emacs-devel@gnu.org; Tue, 27 Feb 2018 10:02:48 -0500 Original-Received: from ud19.udmedia.de ([194.117.254.59]:59002 helo=mail.ud19.udmedia.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eqgmC-0005jL-ET for emacs-devel@gnu.org; Tue, 27 Feb 2018 10:02:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=binary-island.eu; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=k1; bh=NqpjYOPTwC3jqAJjfY5TEmvg+j5d lWWBuSVTU8a0l4w=; b=JO6pKH6jxx/6EHZt4K1xkuT6P6p4if/pTtGMjKX+dLpV X1jYepRsG5fPsTPDjSal360epi5aw3qFXyHjm34nYaGPr9mL35WEnKHkD6kk2VZ1 gMpU7XxLffNPNFH9f4CaQIwykJZtl3woekUAxmCNw+xzm7a9woCMNnCqkXiLYNk= Original-Received: (qmail 14422 invoked from network); 27 Feb 2018 16:02:42 +0100 Original-Received: from unknown (HELO ?IPv6:2a02:810b:c540:234:36aa:25b9:ca8f:d05f?) (ud19?126p1@2a02:810b:c540:234:36aa:25b9:ca8f:d05f) by mail.ud19.udmedia.de with ESMTPSA (ECDHE-RSA-AES128-GCM-SHA256 encrypted, authenticated); 27 Feb 2018 16:02:42 +0100 Openpgp: id=1E87ADA02EFE759EFC20B2D1042F47D273AA780C In-Reply-To: <87k1uy8x68.fsf@gmail.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 194.117.254.59 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:223124 Archived-At: This is a multi-part message in MIME format. --------------E8B3DB631D4B8508201E0C3F Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hello Andrés and Lars... Could you both try the attached patch on master? It is just a quick test to test a theory. I spent most of the afternoon digging in the depths of the Emacs sources (in and close around wait_reading_...) to try to find other bugs that could be related to your hangs. I have a suspicion that what you are seeing is related to the GnuTLS handling. Let's see what happens with this patch. I should note: This is just a test and not a production-ready patch. It should work fine but might have unforeseen other side-effects since we exit wait_reading_... now as early as possible if data has been read from wait_proc. This is just to test a theory. It might very well also increase the rate of hangs you see... which would be interesting as well. Thanks a lot, Matthias -- Dipl.-Inf. (FH) Matthias Dahl | Software Engineer | binary-island.eu --------------E8B3DB631D4B8508201E0C3F Content-Type: text/x-patch; name="wait_reading_process_output-wait_proc-exit-early.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="wait_reading_process_output-wait_proc-exit-early.patch" diff --git a/src/process.c b/src/process.c index 6ba27a33f4..5763101cbf 100644 --- a/src/process.c +++ b/src/process.c @@ -5458,6 +5458,9 @@ wait_reading_process_output (intmax_t time_limit, i= nt nsecs, int read_kbd, /* If we woke up due to SIGWINCH, actually change size now. */ do_pending_window_change (0); =20 + if (wait_proc->nbytes_read !=3D prev_wait_proc_nbytes_read) + break; + if (nfds =3D=3D 0) { /* Exit the main loop if we've passed the requested timeout, --------------E8B3DB631D4B8508201E0C3F--