X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Fri, 21 Oct 2011 11:44:28 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Question about Cygwin's select() Message-ID: <20111021094428.GA2979@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4E9ED08B DOT 3080503 AT cornell DOT edu> <20111019144910 DOT GB16351 AT calimero DOT vinschen DOT de> <20111019162219 DOT GB1085 AT ednor DOT casa DOT cgf DOT cx> <4E9F09AE DOT 7090609 AT cornell DOT edu> <4E9F2FE1 DOT 7050003 AT cornell DOT edu> <4EA01079 DOT 5010303 AT cornell DOT edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4EA01079.5010303@cornell.edu> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Oct 20 08:13, Ken Brown wrote: > On 10/19/2011 4:15 PM, Ken Brown wrote: > >I don't have a testcase yet, but I have a clearer idea of what's > >happening. It actually has nothing to do with the gdb subprocess, but > >rather is a problem that can occur whenever emacs is running its main > >command loop. emacs polls for keyboard input while also using select to > >check for output from subprocesses. It's in this setting that select > >often fails with EINTR, even when there are no subprocesses running. I > >wonder if the keyboard polling is doing something that interrupts the > >select call. > > I think this guess is correct. If I start up emacs and do nothing, > strace shows many sequences like the following: > > - emacs calls select > - a timer sends SIGALRM > - select returns -1 with error EINTR > > The EINTR isn't actually visible in the strace output, but I do see > "select_stuff::wait: signal received". A glance at select.cc > indicates that this is the debug output produced by select when it > is about to return -1 with EINTR. > > These sequences always occur in connection with start_thread_socket. > I've appended a typical excerpt from the strace output below. > Please let me know if you need to see more strace output. I didn't > want to spam the list by sending too much. > > You still might need more information, but I can at least refine my > original question: Is it reasonable that select should give up and > return -1 because a timer has sent SIGALRM? If SIGALRM isn't blocked, then, yes. What is setting up the timer? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple