delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/03/05/11:32:52

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Mon, 5 Mar 2012 17:31:58 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
Message-ID: <20120305163158.GT18852@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <alpine DOT WNT DOT 2 DOT 01 DOT 1203021514490 DOT 5120 AT zbpxnh DOT vmov DOT hav-yrvcmvt DOT qr> <4F51BDA2 DOT 1040108 AT cygwin DOT com> <Pine DOT WNT DOT 4 DOT 64 DOT 1203032002030 DOT 5532 AT zbpxnh DOT vmov DOT hav-yrvcmvt DOT qr> <20120304114922 DOT GA18852 AT calimero DOT vinschen DOT de> <Pine DOT CYG DOT 4 DOT 58 DOT 1203041425290 DOT 2588 AT zbpxnh DOT vmov DOT hav-yrvcmvt DOT qr>
MIME-Version: 1.0
In-Reply-To: <Pine.CYG.4.58.1203041425290.2588@zbpxnh.vmov.hav-yrvcmvt.qr>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar  4 15:53, Ulf-Dietrich Braumann wrote:
> Yes, Corinna, I reverted this setting again to the default 384MB
> heap size calling:
> 
> $ peflags --cygwin-heap=0 /usr/sbin/sshd.exe
> and
> $ peflags --cygwin-heap=0 /usr/bin/cygrunsrv.exe
> 
> Later on, someone has recommended me to downgrade cygrunsrv from
> 1.36-1 to 1.34-1. This helped, so now under cygwin1.dll 1.7.11 the
> sshd can be started. However, the mechanism behaves strange
> reporting problems:
> 
> C:\>net start sshd
> The CYGWIN sshd service is starting.
> The CYGWIN sshd service could not be started.
> 
> The service did not report an error.
> 
> More help is available by typing NET HELPMSG 3534.
> 
> 
> Having a look into the Event Viewer of my Win2k3 64bit machine, I
> correspondingly find:
> 
> ... `sshd' service stopped, exit status: 0.

I can't reproduce this one, but I can reproduce the original problem

  System error 1067 has occurred.
  The process terminated unexpectedly.

on Windows 2003 64 bit.  It works fine on W7, Windows 2008 R2, and
even on Windows 2003 32 bit.

I'm still looking into it, but I made an astonishing discovery:

If I build cygrunsrv with gcc-3.x, it works.  Only when building
cygrunsrv with gcc-4.x, it fails as above.

However, the reason why starting the service fails is the following:
When cygrunsrv runs under SCM, it gets started, then it registers, then
scm starts another thread in cygrunsrv.  This thread then starts the
actual service application like sshd by calling fork/exec.

What happens is that forking cygrunsrv fails, because the child process
can't duplicate the parent processes stack, because the memory addresses
are already taken by something else in the child.

Why this only fails when cygrunsrv has been built with gcc-4 but not with
gcc-3 is most puzzeling.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019