Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Sat, 28 May 2005 22:48:21 -0700 From: Yitzchak Scott-Thoennes To: cygwin AT cygwin DOT com Subject: Re: 1.5.16: DuplicateHandle(Out) failed (e=6) Message-ID: <20050529054820.GA3024@efn.org> References: <1117157441 DOT 475ed70cnlm24 AT email DOT byu DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1117157441.475ed70cnlm24@email.byu.edu> User-Agent: Mutt/1.4.2.1i X-IsSubscribed: yes On Thu, May 26, 2005 at 07:30:41PM -0600, Nathan L Mullen wrote: > I recently upgraded from Cygwin 1.5.6-1 to 1.5.16-1. Does it still happen with 1.5.17-1? Did you upgrade perl at the same time? If so, do you know what the old version was? > I received the following error from GNU make 3.80 when I ran ???mk??? in Cygwin 1.5.16: > > process_easy: DuplicateHandle(Out) failed (e=6) > t:/make/380/bin/make: interrupt/Exception caught (code = 0xc0000005, addr = 0x417344) system() returned code 65280: exit code 255 > > As both mk and make 3.80 are big (and don???t have a lot to do with Cygwin), I have spent some time narrowing down the problem. I have produced a set of small files that produce the same error. A very specific script structure is needed to reproduce the error (a bash script must call a perl script, which in turn must use back-ticks to run an executable that has a call to DuplicateHandle(Out)) (that is the same script structure that mk uses--and that causes DuplicateHandle(Out) to fail). > > Here are the 3 necessary files to reproduce the error (showProb.sh, showProb.pl, showProb.c): > > > showProb.sh: ########################################### > #!/bin/sh > perl -S showProb.pl That's not a bash script. Is the -S necessary? (= search for perl script on your path) > showProb.pl: ########################################## > system("showProb.exe"); #this DupHandle works correctly > $cwd = `pwd`; # This completes successfully > system("showProb.exe"); #now DupHandle does _NOT_ work > > > > showProb.c: ########################################### > /* > * Description: A very stripped-down version of process_easy in > * GNU make 3.80 (make/380/w32/subproc/sub_proc.c) > */ > #include > #include > #include /* for msvc _beginthreadex, _endthreadex */ > #include > int main(){ > HANDLE hOut; > if (DuplicateHandle(GetCurrentProcess(), > GetStdHandle(STD_OUTPUT_HANDLE), > GetCurrentProcess(), > &hOut, > 0, > TRUE, > DUPLICATE_SAME_ACCESS) == FALSE) { > > fprintf(stderr, "\nprocess_easy: DuplicateHandle(Out) failed (e=%d)\n", GetLastError()); > /*return INVALID_HANDLE_VALUE;*/ > } > else{ > fprintf(stderr, "\nprocess_easy: DuplicateHandle(Out) SUCCESS\n"); > } > CloseHandle(hOut); > return 0; > } > > > > I used cl to compile showProb.c: ???cl showProb.c ???o showProb.exe???. Does it fail for you compiled with: gcc -o showProb.exe -mno-cygwin showProb.c It doesn't for me, on cygwin 1.5.17-1. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/