public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* _pinfo::dup_proc_pipe: DuplicateHandle failed
@ 2008-05-21 15:01 Relson, David
  2008-05-21 16:20 ` Hugh Sasse
  0 siblings, 1 reply; 7+ messages in thread
From: Relson, David @ 2008-05-21 15:01 UTC (permalink / raw)
  To: cygwin

G'day,

Yesterday I reopened a project from 3 years ago.  Its makefiles allowed
me to build the code for an embedded project and the tools for
communicating from a PC to the microcontroller.  The embedded code is
68HC11 assembly code for Metrowerks CodeWarrior and the communication
tools are C++ for Borland C++.

The makefiles needed some minor tweaking (notably changing "\" to "\\"
in some paths), which isn't a problem.  However, running "make -f
makefile.gnu" also produces errors of form:

  8 [main] bash 4988! _pinfo::dup_proc_pipe: DuplicateHandle failed, 
  pid 4988, hProcess 0x68D, wr_proc_pipe 0x750, Win32 error 6

I've got cygwin-1.5.25-11, make-3.81-2, and bash 3.2.33-18 installed.  I
presume these have all been updated since I last built the project in
2005. Reading the mailing list archives I've seen several reports of
"dup_proc_pipe DuplicateHandle failed" but don't see any indications of
workarounds or fixes.

Does anybody have a workaround or a fix???

Thanks.

David


--
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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: _pinfo::dup_proc_pipe: DuplicateHandle failed
  2008-05-21 15:01 _pinfo::dup_proc_pipe: DuplicateHandle failed Relson, David
@ 2008-05-21 16:20 ` Hugh Sasse
       [not found]   ` <91FA647A1A781F41BBB0359765C90C159AE3F4@mailsvr.orion-sys.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Hugh Sasse @ 2008-05-21 16:20 UTC (permalink / raw)
  To: Relson, David; +Cc: cygwin

On Wed, 21 May 2008, Relson, David wrote:

> G'day,
> 
> Yesterday I reopened a project from 3 years ago.  Its makefiles allowed
> me to build the code for an embedded project and the tools for
        [...]
> The makefiles needed some minor tweaking (notably changing "\" to "\\"
> in some paths), which isn't a problem.  However, running "make -f
> makefile.gnu" also produces errors of form:
> 
>   8 [main] bash 4988! _pinfo::dup_proc_pipe: DuplicateHandle failed, 
>   pid 4988, hProcess 0x68D, wr_proc_pipe 0x750, Win32 error 6
> 
> I've got cygwin-1.5.25-11, make-3.81-2, and bash 3.2.33-18 installed.  I

I don't have the answer you want, but wonder if you can narrow it down
any more with, maybe, 

  make -d -f makefile.gnu

which should give spadefuls of debugging output, before it goes pop.

Meanwhile, I'll shut up and hope that someone more familiar with your
case can help.

        Hugh

--
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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: _pinfo::dup_proc_pipe: DuplicateHandle failed
       [not found]   ` <91FA647A1A781F41BBB0359765C90C159AE3F4@mailsvr.orion-sys.com>
@ 2008-05-22 11:30     ` Hugh Sasse
  2008-05-22 11:48       ` Dave Korn
  0 siblings, 1 reply; 7+ messages in thread
From: Hugh Sasse @ 2008-05-22 11:30 UTC (permalink / raw)
  To: Relson, David; +Cc: cygwin

On Wed, 21 May 2008, Relson, David wrote:

> Hi Hugh,
> 
> I'm not an expert (else I'd solve this myself), but it seems not to be a

when it comes to windows, neither am I, but since nobody else is coming
in on this thread I'll see if I can get you any further forward.

> problem with make, but a general problem in duplicating handles for
> subprocesses.  To test that, I entered a classic "Hello World" program
> and created a 2 line script named hello.sh to build it:
> 
> relsondt1--> cat ./hello.sh
> #!/bin/sh -x
> Bcc +BccDos.cfg -c -Ic:/BC45/INCLUDE -D -oHELLO.OBJ HELLO.CPP

This is the sort of narrowing down that helps.
> 
> 
> relsondt1--> ./hello.sh
> + Bcc +BccDos.cfg -c -Ic:/BC45/INCLUDE -D -oHELLO.OBJ HELLO.CPP
>   7 [main] bash 5564! _pinfo::dup_proc_pipe: DuplicateHandle failed, \
>     pid   5564, hProcess 0x6DD, wr_proc_pipe 0x750, Win32 error 6

That Win32 error looks more like it is to do with Windows than Cygwin
per se.   So what is "Win32 error 6" (apart from a very unintuitive 
error message?  Google points me at various things, including this:

http://www.freeerrorscan.net/landing/error/error-6.php?t202kw=error%206&m=p&c=3&lpip=538&gclid=CKrViK32uZMCFQ88QwodgQR3DA

which says there are problems with your registry if you get this.
I'm not in a position to give advice on how to fix this.  I don't 
really know what the best cleanup programs are or how to test their
trustworthiness.  But  I'd like to know.  Also, I don't know whether
to trust that source as being accurate.

> Borland C++ 4.52 Copyright (c) 1987, 1994 Borland International
> hello.cpp:
> Warning hello.cpp 8: Parameter 'argc' is never used in function \
>    main(int,char * *)
> Warning hello.cpp 8: Parameter 'argv' is never used in function \
>    main(int,char * *)
> 
> As can be seen, the message is displayed _and_ the compiler is run.

this would seem to fit with the hypothesis that this is something amiss
which is not directly related to Cygwin or your program, because the script
does its job.  But I wouldn't say it counts as proof.
> 
> Note that I've used " \" and indentation to indicate wrapped/continued
> lines.
> 
> HTH,
> 
> David
> 
        Hugh

--
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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: _pinfo::dup_proc_pipe: DuplicateHandle failed
  2008-05-22 11:30     ` Hugh Sasse
@ 2008-05-22 11:48       ` Dave Korn
  2009-01-19  2:50         ` Hermann Kleier
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Korn @ 2008-05-22 11:48 UTC (permalink / raw)
  To: cygwin

Hugh Sasse wrote on 22 May 2008 12:08:

>> relsondt1--> ./hello.sh
>> + Bcc +BccDos.cfg -c -Ic:/BC45/INCLUDE -D -oHELLO.OBJ HELLO.CPP
>>   7 [main] bash 5564! _pinfo::dup_proc_pipe: DuplicateHandle failed, \
>>     pid   5564, hProcess 0x6DD, wr_proc_pipe 0x750, Win32 error 6
> 
> That Win32 error looks more like it is to do with Windows than Cygwin
> per se.   So what is "Win32 error 6"

http://msdn.microsoft.com/en-us/library/ms681382(VS.85).aspx

ERROR_INVALID_HANDLE

> which says there are problems with your registry if you get this.

  No, it's what you'd expect if you try and dup a handle that's already been
closed - an indication that the child exited prematurely.  This is one of
those semi-generic fork failures that could be BLODA, but another
possibility is that because this is a non-cygwin app being launched from
cygwin, it might be pulling in a dll that causes a rebase conflict.

  Following the rebaseall procedure described in the "Usage:" section of
/usr/share/doc/Cygwin/rebase-2.4.3.README might help as is, or it might be
necessary to find a list of the dlls being pulled in by the borland compiler
and rebase them too by adding a -T option pointing to a file that lists the
(cygwin-style posix) paths to the BC45 dlls.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: _pinfo::dup_proc_pipe: DuplicateHandle failed
  2008-05-22 11:48       ` Dave Korn
@ 2009-01-19  2:50         ` Hermann Kleier
  0 siblings, 0 replies; 7+ messages in thread
From: Hermann Kleier @ 2009-01-19  2:50 UTC (permalink / raw)
  To: cygwin



Hugh Sasse wrote on 22 May 2008 12:08:

>> relsondt1--> ./hello.sh
>> + Bcc +BccDos.cfg -c -Ic:/BC45/INCLUDE -D -oHELLO.OBJ HELLO.CPP
>>   7 [main] bash 5564! _pinfo::dup_proc_pipe: DuplicateHandle failed, \
>>     pid   5564, hProcess 0x6DD, wr_proc_pipe 0x750, Win32 error 6
> 
> That Win32 error looks more like it is to do with Windows than Cygwin
> per se.   So what is "Win32 error 6"

http://msdn.microsoft.com/en-us/library/ms681382(VS.85).aspx

ERROR_INVALID_HANDLE

> which says there are problems with your registry if you get this.

  No, it's what you'd expect if you try and dup a handle that's already been
closed - an indication that the child exited prematurely.  This is one of
those semi-generic fork failures that could be BLODA, but another
possibility is that because this is a non-cygwin app being launched from
cygwin, it might be pulling in a dll that causes a rebase conflict.

  Following the rebaseall procedure described in the "Usage:" section of
/usr/share/doc/Cygwin/rebase-2.4.3.README might help as is, or it might be
necessary to find a list of the dlls being pulled in by the borland compiler
and rebase them too by adding a -T option pointing to a file that lists the
(cygwin-style posix) paths to the BC45 dlls.

We've got the same problem using BORLAND C 4.52.  I tried the
rebasing-procedure as described including the bc45 DLLs.  But anyway, the
problem persists.  Ebereythiong worked fine with cygwin 1.5.19 and failed
after upgrading to 1.5.25.  After a couple of days of searching for a
kludge, I'm really frustrated. There's a high timely pressure on the
project.  I'd like to downgrade to 1.5.19 just to get it running again.  But
where can we get precedent revisions? Or is there anything else that I could
try?

Hermann Kleier
-- 
View this message in context: http://www.nabble.com/_pinfo%3A%3Adup_proc_pipe%3A-DuplicateHandle-failed-tp17367978p21534876.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
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/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: _pinfo::dup_proc_pipe: DuplicateHandle failed
  2011-02-16 11:30 Kaltenberger, Stefan
@ 2011-02-16 16:33 ` Christopher Faylor
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Faylor @ 2011-02-16 16:33 UTC (permalink / raw)
  To: cygwin

On Wed, Feb 16, 2011 at 11:30:45AM +0000, Kaltenberger, Stefan wrote:
>The sample uses the Microsoft C/C++ compiler but I guess it should work with other compilers too - just adapt binary and flags (e.g. the GNU C/C++ comiler takes '-E' for the flags).

Ouch.

>Please keep me on the CC list as I'm not subscribed to the mailing list.

Double ouch.

Please use the current version of Cygwin and, if at all possible, strive to produce a test
case which does not involve downloading a Microsoft compiler.

And, please subscribe to the mailing list if you want answers rather than expecting people
to remember to cc you.

cgf

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* _pinfo::dup_proc_pipe: DuplicateHandle failed
@ 2011-02-16 11:30 Kaltenberger, Stefan
  2011-02-16 16:33 ` Christopher Faylor
  0 siblings, 1 reply; 7+ messages in thread
From: Kaltenberger, Stefan @ 2011-02-16 11:30 UTC (permalink / raw)
  To: cygwin

Hi,

I'm using Cygwin for executing build scripts. Thereby I encounter the following error sporadically:

44 [main] bash 21136! _pinfo::dup_proc_pipe: DuplicateHandle failed, pid 21136, hProcess 0x158, wr_proc_pipe 0xF8, Win32 error 5

The mailing list archives also know about the problem (but I didn't found a solution), see

_pinfo::dup_proc_pipe: DuplicateHandle failed
<http://lists-archives.org/cygwin/35191-_pinfo-dup_proc_pipe-duplicatehandle-failed.html>

[1.7.0-49] DuplicateHandle failed
<http://lists-archives.org/cygwin/45068-duplicatehandle-failed.html>

I can reproduce the problem using the following shell script:

test.sh:
01	#!/bin/bash
02	
03	PATH="${PATH}:$(cygpath -u "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin")"
04	CC="cl"
05	CFLAGS="-nologo -EP"
06	TEMPLATE="test.tc"
07	RUNS=3000
08	
09	i=0
10	while [ $i -lt ${RUNS} ]; do
11	  (
12	    ${CC} ${CFLAGS} ${TEMPLATE} > test${i}.c
13	    rm -f test${i}.tc
14	  ) &
15	  (( i++ ))
16	done
17	wait

The template contains only the following include statement to keep the compiler somewhat busy:

test.tc:
01	#include <stdio.h>

The sample uses the Microsoft C/C++ compiler but I guess it should work with other compilers too - just adapt binary and flags (e.g. the GNU C/C++ comiler takes '-E' for the flags).

Please keep me on the CC list as I'm not subscribed to the mailing list.

Regards,

Stefan Kaltenberger

BTW: I'm currently using Cygwin version 1.5 on Windows Server 2008 R2 x64:

$ cygcheck -s

Cygwin Configuration Diagnostics
Current System Time: Wed Feb 16 11:34:57 2011

Windows Longhorn/Vista (not yet supported!) Ver 6.1 Build 7600

Running under WOW64 on AMD64

Running in Terminal Service session

Path:   c:\home\bin
[...]
CYGWIN = 'nontsec'
[...]
    Cygwin DLL version info:
        DLL version: 1.5.25
        DLL epoch: 19
        DLL bad signal mask: 19005
        DLL old termios: 5
        DLL malloc env: 28
        API major: 0
        API minor: 156
        Shared data: 4
        DLL identifier: cygwin1
[...]
Cygwin Package Information
Package              Version
_update-info-dir     00811-1
alternatives         1.3.30c-2
ash                  20040127-4
base-files           3.7-1
base-passwd          2.2-1
bash                 3.2.48-21
bzip2                1.0.5-3
coreutils            6.10-2
crypt                1.1-1
csih                 0.1.8-1
cygrunsrv            1.34-1
cygutils             1.3.2-1
cygwin               1.5.25-15
cygwin-doc           1.4-4
diffutils            2.8.7-1
editrights           1.01-2
findutils            4.4.0-3
gawk                 3.1.6-1
grep                 2.5.3-1
groff                1.19.2-2
gzip                 1.3.12-2
less                 382-1
libbz2_1             1.0.5-3
libiconv2            1.12-1
libintl2             0.12.1-3
libintl3             0.14.5-1
libintl8             0.17-3
libncurses8          5.5-4
libpcre0             7.8-1
libpopt0             1.6.4-4
libreadline6         5.2.13-11
libwrap0             7.6-4
login                1.9-8
man                  1.6e-1
minires              1.02-1
openssh              5.1p1-10
openssl              0.9.8j-1
patch                2.5.8-9
rebase               2.4.4-1
run                  1.1.10-1
sed                  4.1.5-2
tar                  1.21-1
termcap              20050421-1
terminfo             5.7_20090228-1
terminfo0            5.5_20061104-2
texinfo              4.8a-1
tzcode               2008h-1
unzip                5.52-3
which                2.20-1
zip                  3.0-2
zlib                 1.2.3-3
zlib-devel           1.2.3-3
zlib0                1.2.3-3

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-02-16 16:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-21 15:01 _pinfo::dup_proc_pipe: DuplicateHandle failed Relson, David
2008-05-21 16:20 ` Hugh Sasse
     [not found]   ` <91FA647A1A781F41BBB0359765C90C159AE3F4@mailsvr.orion-sys.com>
2008-05-22 11:30     ` Hugh Sasse
2008-05-22 11:48       ` Dave Korn
2009-01-19  2:50         ` Hermann Kleier
2011-02-16 11:30 Kaltenberger, Stefan
2011-02-16 16:33 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).