X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=kSDewxfTkXsybOi4 vJV3oGBrrjgC+X5yVTNCE+YXQ/e0Ffv3CCVP50hmdMmqXJ2sxKKQ+8Eb0tHKR0AP 59h3X7IbNGGsYDGP6Q7A83omtaO5C0sm/TBdREYhpzXkztczqH9U6SqucaxwMIpR qwzWkkChIath8HqRPh2/hsQtf1A= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; s=default; bh=RFoLRgO9wKUcz5fdBmPl8T ozfPE=; b=QT0tOf69pddG7J5KPBBqmcs8tWErsX7PgtlRU/FPjf97bqZtxv7JdV cjS4vfS3tqVNz2Zarffpvibr1nroiNMR6Y1KOwDJGVHXm7qum+E96BBTnlx/871t LBUVrotQPtlZtMjovxN6cfsJ93txuIDIQiBi4EF97cnAGu//bCz3U= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_00,BOTNET,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,TW_YG autolearn=no version=3.3.1 Message-id: <51EB43E4.4080104@cygwin.com> Date: Sat, 20 Jul 2013 22:13:56 -0400 From: "Larry Hall (Cygwin)" Reply-to: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 MIME-version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Win32 error in C program using openmp and fork() References: <57302C57257EF2428CCAAF9BA83EC0448222C0EA AT mbx08 DOT adf DOT bham DOT ac DOT uk> In-reply-to: <57302C57257EF2428CCAAF9BA83EC0448222C0EA@mbx08.adf.bham.ac.uk> Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit On 7/20/2013 3:30 PM, Daniel Brown wrote: > Hi, > > So I have some code I am trying to port to Cygwin but I am getting the > error: > > fatal error in forked process - failed to create new win32 semaphore, > Win32 error 87 > > when calling fork() in a C program when openmp code has been used > beforehand. I've got the following test code which reduces the problem > down to as little code as I could: > > #include > #include > #include > > int main(void) > { > pid_t childPID; > > #pragma omp parallel > { > printf("I'm an openmp thread...\n"); > } > > childPID =3D fork(); > > if(childPID >=3D 0) { > if(childPID =3D=3D 0) { > printf("Child fork\n"); > } else { > printf("Parent fork\n"); > } > } else { > printf("Fork failed"); > return 1; > } > > return 0; > } > > To build I just use "gcc -fopenmp para.c" and the output I get is... > > I'm an openmp thread... > I'm an openmp thread... > I'm an openmp thread... > I'm an openmp thread... > Parent fork 0 [main] a 18640 D:\usr\code\c\a.exe: *** fatal error > in forked process - failed to create new win32 semaphore, Win32 error > 87 > > I have tried doing a rebaseall as I had similar error in the past but it > didn't fix it. I have also tried a clean install on a separate Windows > 2008 R2 machine which didn't work either. > > The version of GCC is 4.7.3 and I am on Windows 8 Professional > 64-bit, Cygwin 1.7.20(0.266/5/3). Please send cygcheck output as requested at the link below: > Problem reports: http://cygwin.com/problems.html -- Larry _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple