public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Two processes are always created while running cygwin program(bash, ls, etc) under windows 2003 x64 R2
@ 2011-05-03  8:45 Oh, Choong-Hyun (HPSS-BSM)
  2011-05-03 10:43 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Oh, Choong-Hyun (HPSS-BSM) @ 2011-05-03  8:45 UTC (permalink / raw)
  To: cygwin

Dear all,

I found strange behavior of cywin application under windows 2003 x64 R2 version.
When I run bash, it creates parent bash process and also child bash process as like followings;


cmd.exe
  +- bash.exe
     +- bash.exe

services.exe
  +- cygrunsvr.exe
     +- cygrunsvr.exe


But on Windows 2008 x64 R2 system, it create only one process as like followings;
cmd.exe
  +- bash.exe

services.exe
  +- cygrunsvr.exe

So I am wondering whether it is normal behavior of cygwin on Windows 2003 x64 R2 system or not.
And also if so, what's a cause of this happening.

Thanks and regards,
ChoongHyun.

--
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] 2+ messages in thread

* Re: Two processes are always created while running cygwin program(bash, ls, etc) under windows 2003 x64 R2
  2011-05-03  8:45 Two processes are always created while running cygwin program(bash, ls, etc) under windows 2003 x64 R2 Oh, Choong-Hyun (HPSS-BSM)
@ 2011-05-03 10:43 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2011-05-03 10:43 UTC (permalink / raw)
  To: cygwin

On May  3 08:44, Oh, Choong-Hyun (HPSS-BSM) wrote:
> Dear all,
> 
> I found strange behavior of cywin application under windows 2003 x64 R2 version.
> When I run bash, it creates parent bash process and also child bash process as like followings;
> 
> 
> cmd.exe
>   +- bash.exe
>      +- bash.exe
> 
> services.exe
>   +- cygrunsvr.exe
>      +- cygrunsvr.exe
> 
> 
> But on Windows 2008 x64 R2 system, it create only one process as like followings;

I assume you mean non-64 bit here.

> cmd.exe
>   +- bash.exe
> 
> services.exe
>   +- cygrunsvr.exe
> 
> So I am wondering whether it is normal behavior of cygwin on Windows 2003 x64 R2 system or not.
> And also if so, what's a cause of this happening.

This happens if a Cygwin process (which is 32 bit and thus running in
the WOW64 environment) is called from a 64 bit Windows process.

On the older XP and 2003 64 bit systems, the first WOW64 processes
main thread started from a 64 bit process gets a stack address in the
range where usually the application itself resides.  This in turn
breaks Cygwin's fork.

Therefore a Cygwin process checks at process startup if it has been
started by a 64 bit parent process and if the stack address is in the
dangerous region.  If so, it re-spawns itself.  Since this second
process is started from another 32 bit process, its stack address is
useful again.  The intermediate process keeps in memory as long as the
re-spawned process runs.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
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] 2+ messages in thread

end of thread, other threads:[~2011-05-03 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03  8:45 Two processes are always created while running cygwin program(bash, ls, etc) under windows 2003 x64 R2 Oh, Choong-Hyun (HPSS-BSM)
2011-05-03 10:43 ` Corinna Vinschen

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