GNU bug report logs - #9767
24.0.90; gdb initialization on Cygwin

Previous Next

Package: emacs;

Reported by: Ken Brown <kbrown <at> cornell.edu>

Date: Sun, 16 Oct 2011 16:05:02 UTC

Severity: normal

Found in version 24.0.90

Done: Ken Brown <kbrown <at> cornell.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ken Brown <kbrown <at> cornell.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Andreas Schwab <schwab <at> linux-m68k.org>, 9767 <at> debbugs.gnu.org
Subject: bug#9767: 24.0.90; gdb initialization on Cygwin
Date: Fri, 21 Oct 2011 16:47:52 -0400
On 10/19/2011 10:11 PM, Ken Brown wrote:
> On 10/19/2011 6:02 PM, Eli Zaretskii wrote:
>>> From: Andreas Schwab<schwab <at> linux-m68k.org>
>>> Cc: Eli Zaretskii<eliz <at> gnu.org>, 9767 <at> debbugs.gnu.org
>>> Date: Wed, 19 Oct 2011 23:03:23 +0200
>>>
>>> Ken Brown<kbrown <at> cornell.edu> writes:
>>>
>>>> No, wait_reading_process_output treats EINTR as though it meant
>>>> there's no
>>>> input available.
>>>
>>> Which is correct because an interrupted select does not report anything.
>>> And then the loop will be restarted to call select again.
>>
>> Yes, that's what I thought should be happening. Sorry if that was
>> unclear.
>
> You were clear. I was the one who muddied the waters by misreading the
> code, and Andreas correctly pointed out that I was wrong.
>
>> So the question is still why no input is being reported, although
>> wait_reading_process_output should loop and call `select' again.
>
> Yes, that's the question. I'll have to go back to my debugging.

OK, I figured out what's happening, and it is related to SIGALRM after 
all.  In line 4406 of process.c, wait_reading_process_output reduces the 
timeout for the select call (under certain circumstances) in an attempt 
to prevent select from being interrupted by SIGALRM.  This seems to me 
to be inherently unreliable, and, in particular, it consistently fails 
on Cygwin.  In other words, the SIGALRM is delivered before select times 
out, causing select to get interrupted.  So wait_reading_process_output 
does indeed loop, and select fails every time (except when a key is 
pressed).

If I block SIGALRM before the call to select (in the situation where the 
timeout was reduced), the problem is solved.  I need to do some more 
testing, but so far I don't see any sign that this causes other problems.

One tricky thing is that blocking SIGALRM has to be done right before 
the call to the *system* select.  In the build with GTK support, this 
call is inside xg_select, and things break if SIGALRM is blocked before 
the call to xg_select.  So I'm not sure what's the best way to handle 
this.  I'll keep thinking about it, but suggestions are welcome.

Ken




This bug report was last modified 13 years and 219 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.