Another pipe-related problem?

Ken Brown kbrown@cornell.edu
Wed Nov 10 18:03:09 GMT 2021


On 11/10/2021 12:23 PM, Henry S. Thompson wrote:
> Ken Brown via Cygwin writes:
> 
>> On 11/9/2021 9:53 PM, Ken Brown via Cygwin wrote:
>>> Back to the drawing board.
>>
>> It finally occurred to me to stop looking for a bug in
>> fhandler_pipe::raw_read and instead see if something is in fact
>> repeatedly writing to the pipe, so that drain_signal_event_pipe
>> never finishes.  Putting a breakpoint at fhandler_pipe::raw_write, I
>> found that this is in fact the case.  While the main thread is
>> repeatedly reading from the pipe, a second thread is repeatedly
>> writing to it.  Here's the backtrace of that thread:
> 
> Argh.  Thanks for the hard labour on this.  This is not a part of the
> XEmacs code I have any experience of.  Is there any clue you can give
> about how things changed in all the September commits to
> fhandler_pipe.cc that might have exposed the XEmacs bug?

The main change was that we stopped using Win32 Overlapped I/O 
(https://docs.microsoft.com/en-us/windows/win32/sync/synchronization-and-overlapped-input-and-output) 
and switched to using the NT API.  As a result, pipe I/O became much more 
efficient.  It wouldn't surprise me if the efficiency alone is what exposed the bug.

The good news is that the bug doesn't seem to occur in XEmacs 21.4 (on 32-bit 
Cygwin).  So one way to approach this would be to bisect the XEmacs git repo to 
find the commit that introduced the bug.  You'd probably have to do the work on 
32-bit Cygwin since, if I remember correctly, XEmacs 21.4 didn't build on 64-bit 
Cygwin.

Ken


More information about the Cygwin mailing list