Another pipe-related problem?
Takashi Yano
takashi.yano@nifty.ne.jp
Tue Nov 9 23:29:32 GMT 2021
On Wed, 10 Nov 2021 08:22:45 +0900
Takashi Yano wrote:
> On Tue, 9 Nov 2021 09:11:28 -0500
> Ken Brown wrote:
> > I'll have to reproduce the hang myself in order to test this (or maybe you could
> > test it), but I now have a new guess: If the read call above keeps failing with
> > EINTR, then we're in an infinite loop. This could happen because of the
> > following code in fhandler_pipe::raw_read:
> >
> > DWORD waitret = cygwait (read_mtx, timeout);
> > switch (waitret)
> > {
> > case WAIT_OBJECT_0:
> > break;
> > case WAIT_TIMEOUT:
> > set_errno (EAGAIN);
> > len = (size_t) -1;
> > return;
> > default:
> > set_errno (EINTR);
> > len = (size_t) -1;
> > return;
> > }
> >
> > Takashi, is EINTR really the appropriate errno in the default case? Isn't
> > cygwait supposed to handle signals?
>
> I assume cygwait() returns WAIT_SIGNALED when signalled
> by SIGINT, SIGTERM, SIGTSTP, etc... In this case, EINTR
> should return I think.
>
> Is it wrong?
Ah, if SA_RESTART is set, we should continue to read even
if signalled...
--
Takashi Yano <takashi.yano@nifty.ne.jp>
More information about the Cygwin
mailing list