proc_waiter: error on read of child wait pipe 0x0, Win32 error 6

Eliot Moss moss@cs.umass.edu
Thu Jan 13 13:42:01 GMT 2022


On 1/13/2022 1:40 AM, Jay K wrote:
> I don't know why I didn't get the reply in email, but this is representative of the real world code.
> 
>   - Jay
> 
> 
> From: Jay K <jayk123@hotmail.com>
> Sent: Wednesday, January 12, 2022 6:27 AM
> To: cygwin@sourceware.org <cygwin@sourceware.org>
> Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6
>   
> Ok, here is a small demonstration of the problem.
> 
> #include <stdlib.h>
> #include <stdio.h>
> #include <windows.h>
> 
> unsigned __stdcall thread(void* p)
> {
>    unsigned i;
>    for (i = 0; i < 100; ++i)
>     system("./a.exe");
>    return 0;
> }
> 
> int main()
> {
> unsigned i;
> HANDLE threads[100] = {0};
> FILE* f = fopen("a.c", "w");
> fprintf(f, "int main() { return 0; }\n");
> fclose(f);
> 
> system("g++ a.c");
> 
> for (i = 0; i < 100; ++i)
>   threads[i] = CreateThread(0, 0, thread, 0,0,0);
> 
> for (i = 0; i < 100; ++i)
>   WaitForSingleObject(threads[i], -1);
> 
> }

Again, Cygwin is designed to provide a POSIX-like interface.
Maybe you should just be using a Windows C compiler?

EM


More information about the Cygwin mailing list