[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Crash with recursive make

From: John Hall
Subject: RE: Crash with recursive make
Date: Fri, 6 Oct 2006 11:23:58 +0100

On 06 October 2006 11:11> From: John Hall 

> Investigating further, make is crashing in windows32_openpipe while
> evaluating the expression:
>       VERSION_STRING = $(shell cat $(VERSION_TXT))
> where cat is a Windows native version of cat from unxutils
> (
> The call to CreatePipe succeeds, but the second call to
> _open_osfhandle fails, with EBADF and ERROR_INVALID_HANDLE. The code
> does not currently check the return code to either of the calls to
> _open_osfhandle.
> I'm not sure why it should fail - perhaps cat closes its stdin or has
> already exited - but given this is possible perhaps my fix is the
> correct one.

Actually that comment about stdin is clearly nonsense as we're dealing
with cat's stdout. More likely is that by this point cat has already
exited and so the pipe handle is no longer valid, since the other end
has been closed.

If you move the calls to _open_osfhandle up in the function to before
the process is created (but after the pipe has been created obviously)
then they succeed and everything is happy. In the debugger, you still
get some complaints from _close when it calls CloseHandle later when it
closes pipedes[1], since the handle refers to a closed pipe, but it does
not cause a crash.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]