From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex =?UTF-8?Q?Benn=C3=A9e?= Newsgroups: gmane.emacs.bugs Subject: bug#16737: Question about wait_reading_process_output Date: Mon, 15 Jun 2015 17:15:59 +0100 Message-ID: <87pp4xeym8.fsf@linaro.org> References: <874mmmbi2p.fsf@linaro.org> <831thdowis.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1434385030 14080 80.91.229.3 (15 Jun 2015 16:17:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jun 2015 16:17:10 +0000 (UTC) Cc: 16737@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 15 18:16:59 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z4X4C-0004RM-KT for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jun 2015 18:16:56 +0200 Original-Received: from localhost ([::1]:35294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4X4C-0007sG-2e for geb-bug-gnu-emacs@m.gmane.org; Mon, 15 Jun 2015 12:16:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32890) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4X3O-0006sQ-5c for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2015 12:16:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4X3L-0000JF-EE for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2015 12:16:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40441) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4X3L-0000J9-1r for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2015 12:16:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z4X3K-0000Q7-MI for bug-gnu-emacs@gnu.org; Mon, 15 Jun 2015 12:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex =?UTF-8?Q?Benn=C3=A9e?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jun 2015 16:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16737 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 16737-submit@debbugs.gnu.org id=B16737.14343849381572 (code B ref 16737); Mon, 15 Jun 2015 16:16:02 +0000 Original-Received: (at 16737) by debbugs.gnu.org; 15 Jun 2015 16:15:38 +0000 Original-Received: from localhost ([127.0.0.1]:54901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4X2v-0000PF-AF for submit@debbugs.gnu.org; Mon, 15 Jun 2015 12:15:37 -0400 Original-Received: from mail-wi0-f170.google.com ([209.85.212.170]:35754) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4X2s-0000P2-UF for 16737@debbugs.gnu.org; Mon, 15 Jun 2015 12:15:35 -0400 Original-Received: by wiga1 with SMTP id a1so83061745wig.0 for <16737@debbugs.gnu.org>; Mon, 15 Jun 2015 09:15:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-type:content-transfer-encoding; bh=a5CV1F/mSpWUsdraueXyIaJ+s55RMpuVxMkA424rNxg=; b=A22gxQeg7bLhRWY25wrE6ZxjCdsjhpoXZcsQRUc/kpflQ3PAek5I5m2V5MBVjbdcEl w454fOCWy5HRvhsq8tm2XxnnPpi2UmCbf7WPcRdvhuWE5wo7y52/6Nh8S/Wtc+jQfMAz hCwtkkI94BQt9RwLuTMWoJYMdA8vBognoJvkZUHoS+oKCxrB6XRtj9BgirWPdkWFRa/7 LQp3ZGVmupzNtOV5ZH1wZAtkQPwQdfs9BV+pmP4h81QW3Zm4gMx0lL6xTzRz7oeeyjju 8Xnjp5YzLafxvqPix+2H2syE7EvsnK5MBWgDJCeQK/jq4LWH7cQ6Fso7vMcwc3ttv0cI KNvg== X-Gm-Message-State: ALoCoQkxqqkTMdsH+SvEW0w/SmCDX1Dgwe/j59ElhmdAIdNkwCEPwignMBjJ0VBmeMQxpJ8av20O X-Received: by 10.180.104.167 with SMTP id gf7mr33618803wib.3.1434384929253; Mon, 15 Jun 2015 09:15:29 -0700 (PDT) Original-Received: from zen.linaro.local ([81.128.185.34]) by mx.google.com with ESMTPSA id be3sm16534232wib.21.2015.06.15.09.15.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jun 2015 09:15:28 -0700 (PDT) Original-Received: from zen.linaro.local (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTPS id 285723E09D3; Mon, 15 Jun 2015 17:15:59 +0100 (BST) In-reply-to: <831thdowis.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103968 Archived-At: Eli Zaretskii writes: >> From: Stefan Monnier >> Date: Sun, 14 Jun 2015 23:47:42 -0400 >> Cc: emacs-devel >> >> > I've been digging into the code trying to get an idea of why bug#16737 >> > fires. My question is where in wait_reading_process_output does it >> > ensure the various terminal socket reads are run? >> >> I see noone replied yet. I can't really help you because I don't know >> this code at all, but I really hope someone else will come along to >> help, > > I will try. > > The terminal socket reads are run in gobble_input, which is called > from detect_input_pending (via a few intermediaries). Emacs calls > detect_input_pending when the pselect call in > wait_reading_process_output finds that some input has arrived, and > wait_reading_process_output was called with READ_KBD or WAIT_FOR_CELL > arguments having values that tell it to do so. > > Does this answer your question? Sort of. One thing that's confusing is there are two pselect() calls in the function: if ((pselect (max (max_process_desc, max_input_desc) + 1, &Atemp, #ifdef NON_BLOCKING_CONNECT (num_pending_connects > 0 ? &Ctemp : NULL), #else NULL, #endif NULL, &timeout, NULL) <= 0)) and #if defined (HAVE_NS) nfds = ns_select #elif defined (HAVE_GLIB) nfds = xg_select #else nfds = pselect #endif (max (max_process_desc, max_input_desc) + 1, &Available, (check_write ? &Writeok : 0), NULL, &timeout, NULL); Why the two? Could there be a case where one is triggering handling so that the second never gets evaluated? Am I right in thinking all incoming X messages (such as those associated with cut/paste) will come in via the X terminals gobble_input? -- Alex Bennée