This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

problem running make 3.77.94 inside bash with the 19990830 snap-shot


Hello,

I have solved my previous problems with cygnus B20.1 regarding the hanging 
processes (see my previous note...)  using the 19990830 snap-shot.

Now I have another strange problem with this level of tools.

I got the following error message when I run the make (rel. 3.77.94)

>/cygdrive/d/Y2K/990915/prod/w32-ix86>make build-tree
>C:/gk/bin/sh.exe -c "init-build-tree d:/Y2K/990915/src/. "
>process_easy: DuplicateHandle(In) failed (e=6)
>make: Interrupt/Exception caught (code = 0xc0000005, addr = >0x416554)
>/cygdrive/d/Y2K/990915/prod/w32-ix86>

It appears that new cygwin.dll or bash.exe is causing
some problem with console handling. In the case above, bash
is run inside a command shell window and then make is launched
as a child process of the shell. The error above appears
to be related to handling of stdin. What should happen is
that make is trying to duplicate a copy of stdin to pass to
child process as default stdin for the child. However, the
call to DuplicateHandle() (a WIN32 API) is failing because
of an e=6. This is

>//
>// MessageId: ERROR_INVALID_HANDLE
>//
>// MessageText:
>//
>//  The handle is invalid.
>//
>#define ERROR_INVALID_HANDLE             6
>

So, somehow bash and/or cygwin is incorrectly closing or
otherwise damaging the stdin handle for child processes. This means that
pure WIN32 programs that wish to use stdin (as in
the case above) will fail.

the code which is failing, seems to be the following:

>HANDLE
>process_easy(
>     char **argv,
>     char **envp)
>{
>   HANDLE hIn;
>   HANDLE hOut;
>   HANDLE hErr;
>   HANDLE hProcess;
>
>   if (DuplicateHandle(GetCurrentProcess(),
>                       GetStdHandle(STD_INPUT_HANDLE),
>                       GetCurrentProcess(),
>                       &hIn,
>                       0,
>                       TRUE,
>                       DUPLICATE_SAME_ACCESS) == FALSE) {
>     fprintf(stderr,
>             "process_easy: DuplicateHandle(In) failed (e=%d)\n",
>             GetLastError());
>     return INVALID_HANDLE_VALUE;
>   }


Thanks in advance for your precious help.

Ciao Luca

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]