From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailsrv.cs.umass.edu (mailsrv.cs.umass.edu [128.119.240.136]) by sourceware.org (Postfix) with ESMTPS id 906C839518B5 for ; Thu, 13 Jan 2022 13:42:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 906C839518B5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.umass.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.umass.edu Received: from [192.168.50.148] (c-24-62-201-179.hsd1.ma.comcast.net [24.62.201.179]) by mailsrv.cs.umass.edu (Postfix) with ESMTPSA id 5251740F2677; Thu, 13 Jan 2022 08:42:01 -0500 (EST) Reply-To: moss@cs.umass.edu Subject: Re: proc_waiter: error on read of child wait pipe 0x0, Win32 error 6 To: Jay K , "cygwin@sourceware.org" References: From: Eliot Moss Message-ID: Date: Thu, 13 Jan 2022 08:42:01 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2022 13:42:02 -0000 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 > Sent: Wednesday, January 12, 2022 6:27 AM > To: 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 > #include > #include > > 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