From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#9767: 24.0.90; gdb initialization on Cygwin Date: Wed, 19 Oct 2011 16:43:06 -0400 Message-ID: <4E9F365A.9060207@cornell.edu> References: <4E9B0033.2070506@cornell.edu> <4E9B63F0.5040409@cornell.edu> <4E9F2C49.4060307@cornell.edu> <83ipnku3rb.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1319057051 2496 80.91.229.12 (19 Oct 2011 20:44:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 Oct 2011 20:44:11 +0000 (UTC) Cc: 9767@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 19 22:44:05 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RGczb-0006mi-Hl for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2011 22:44:03 +0200 Original-Received: from localhost ([::1]:36486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGcza-0007PT-TN for geb-bug-gnu-emacs@m.gmane.org; Wed, 19 Oct 2011 16:44:02 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGczX-0007P8-Nq for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:44:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGczW-0002qj-DP for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:43:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGczW-0002qf-AW for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:43:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RGd0Y-0003fp-KU for bug-gnu-emacs@gnu.org; Wed, 19 Oct 2011 16:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Oct 2011 20:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9767 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9767-submit@debbugs.gnu.org id=B9767.131905705614055 (code B ref 9767); Wed, 19 Oct 2011 20:45:02 +0000 Original-Received: (at 9767) by debbugs.gnu.org; 19 Oct 2011 20:44:16 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGczn-0003ee-Mu for submit@debbugs.gnu.org; Wed, 19 Oct 2011 16:44:16 -0400 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RGczk-0003eU-GO for 9767@debbugs.gnu.org; Wed, 19 Oct 2011 16:44:13 -0400 Original-Received: from [128.84.234.241] (dhcp241.math.cornell.edu [128.84.234.241]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id p9JKh6tU012021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 19 Oct 2011 16:43:07 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <83ipnku3rb.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 19 Oct 2011 16:45:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:52876 Archived-At: On 10/19/2011 4:26 PM, Eli Zaretskii wrote: >> Date: Wed, 19 Oct 2011 16:00:09 -0400 >> From: Ken Brown >> CC: 9767@debbugs.gnu.org >> >> After M-x gdb finishes its initialization, emacs goes into its command >> loop. read_char calls sit_for with a timeout of 30 seconds, and sit_for >> calls wait_reading_process_output, which calls select. The call to >> select fails immediately with EINTR. I don't understand the command >> loop well enough to know what's interrupting the select call. > > EINTR means that some signal arrived (assuming that Cygwin's `select' > is Posix-ish enough). The question is, which signal? Does Cygwin > provide any tools to see which signals were delivered to a program? There's a program called strace that produces lots of debugging information like this. I'll give it a try. > Also, the fact that `select' is interrupted doesn't necessarily mean > that the input arrival is ignored, does it? Doesn't > wait_reading_process_output loop around and examines the input > descriptors again? If not, why not? IOW, why should EINTR become a > failure? No, wait_reading_process_output treats EINTR as though it meant there's no input available. Here's the relevant code from process.c, line 4638. if (nfds < 0) { if (xerrno == EINTR) no_avail = 1; Even worse, xg_select (which is what the Cygwin build uses) deliberately returns -1 and sets errno = EINTR whenever the actual select call returns 0. Here's the code from xg_select.c, line 141: /* To not have to recalculate timeout, return like this. */ if (retval == 0) { retval = -1; errno = EINTR; } I don't know the rationale for treating EINTR the same as no input available, but I agree that it doesn't seem right. >> The code in keyboard.c is full of alarms and timers, presumably related >> to polling for keyboard input. Could this polling be doing something >> that interrupts the select call under some circumstances? > > Atimers (those which are responsible for the "busy cursor" display) > could deliver SIGALRM, yes. But again, I don't see why this should > fail the loop that waits for input, and then only in this particular > case. Something else is at work here.