public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
@ 2012-03-02 14:39 Ulf-Dietrich Braumann
  2012-03-03  6:44 ` Larry Hall (Cygwin)
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-02 14:39 UTC (permalink / raw)
  To: cygwin

Hi,

I run in a similar problem after I have updated cygwin1.dll from 1.7.9 to 
1.7.11 on Win2k3 64bit. When I now try to start sshd as a service

C:\>net start sshd
The CYGWIN sshd service is starting.
The CYGWIN sshd service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.


In the windows event viewer I found

"... starting service `sshd' failed: fork: 11, Resource temporarily 
unavailable."

Inspired by Carl Soderstrom's solution for a similar problem I have tried 
a program-individual heap size setting using

$ peflags --cygwin-heap=1024 /usr/sbin/sshd.exe

but without success. Unfortunately, since we have now cygwin1.dll in 
version 1.7.11 I can no longer simply roll back to 1.7.9 (where the heap 
setting was done in the previous global way).

Any hints welcome - Ulf-Dietrich


On Feb 16, Carl Soderstrom wrote:

> I want to make sure my solution ends up in the archives for the benefit 
> of other people.
> 
> ...
> 
> > http://cygwin.com/cygwin-ug-net/setup-maxmem.html
> 
> Thank you, that was helpful. In the end what seems to have fixed it was 
> to run an ash.exe shell (launched directly from the Start -> Run 
> dialog), run 'cd /bin;PATH=. rebaseall' in that, then re-launch the 
> Cygwin terminal, run the following commands:
> 
> $ peflags --cygwin-heap=1024 /usr/bin/run.exe
> $ peflags --cygwin-heap=1024 /usr/bin/cygrunsrv.exe
> 
> I do not know if all those steps were necessary, but the programs seem 
> to work correctly now.

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-02 14:39 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable" Ulf-Dietrich Braumann
@ 2012-03-03  6:44 ` Larry Hall (Cygwin)
  2012-03-03 19:16   ` Ulf-Dietrich Braumann
  0 siblings, 1 reply; 20+ messages in thread
From: Larry Hall (Cygwin) @ 2012-03-03  6:44 UTC (permalink / raw)
  To: cygwin

On 3/2/2012 9:39 AM, Ulf-Dietrich Braumann wrote:
> Hi,
>
> I run in a similar problem after I have updated cygwin1.dll from 1.7.9 to
> 1.7.11 on Win2k3 64bit. When I now try to start sshd as a service
>
> C:\>net start sshd
> The CYGWIN sshd service is starting.
> The CYGWIN sshd service could not be started.
>
> A system error has occurred.
>
> System error 1067 has occurred.
>
> The process terminated unexpectedly.
>
>
> In the windows event viewer I found
>
> "... starting service `sshd' failed: fork: 11, Resource temporarily
> unavailable."

Try this:
<http://cygwin.com/faq-nochunks.html#faq.using.fixing-fork-failures>


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

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-03  6:44 ` Larry Hall (Cygwin)
@ 2012-03-03 19:16   ` Ulf-Dietrich Braumann
  2012-03-04 11:50     ` Corinna Vinschen
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-03 19:16 UTC (permalink / raw)
  To: cygwin

On Sat, 3 Mar 2012, Larry Hall (Cygwin) wrote:

> Try this:
> http://cygwin.com/faq-nochunks.html#faq.using.fixing-fork-failures

Thanks. Unfortunately, rebaseall did not help. I also tried peflagsall and 
a reboot, but no change. Also, I do not run programs mentioned in the 
BLODA (Big List Of Dodgy Apps). And, when I temporally replace the present 
cygwin1.dll version 1.7.11 with an old version 1.7.9 copied from another 
non-updated installation, the sshd again can be started as service, i.e. 
the fork problem does not occur.

Any more ideas?

Regards - Ulf-Dietrich


> On 3/2/2012 9:39 AM, Ulf-Dietrich Braumann wrote:
>> Hi,
>> 
>> I run in a similar problem after I have updated cygwin1.dll from 1.7.9 
>> to 1.7.11 on Win2k3 64bit. When I now try to start sshd as a service
>> 
>> C:\>net start sshd
>> The CYGWIN sshd service is starting.
>> The CYGWIN sshd service could not be started.
>> 
>> A system error has occurred.
>> 
>> System error 1067 has occurred.
>> 
>> The process terminated unexpectedly.
>> 
>> 
>> In the windows event viewer I found
>> 
>> "... starting service `sshd' failed: fork: 11, Resource temporarily 
>> unavailable."

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-03 19:16   ` Ulf-Dietrich Braumann
@ 2012-03-04 11:50     ` Corinna Vinschen
  2012-03-04 14:54       ` Ulf-Dietrich Braumann
  0 siblings, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-04 11:50 UTC (permalink / raw)
  To: cygwin

On Mar  3 20:16, Ulf-Dietrich Braumann wrote:
> On Sat, 3 Mar 2012, Larry Hall (Cygwin) wrote:
> 
> >Try this:
> >http://cygwin.com/faq-nochunks.html#faq.using.fixing-fork-failures
> 
> Thanks. Unfortunately, rebaseall did not help. I also tried
> peflagsall and a reboot, but no change. Also, I do not run programs
> mentioned in the BLODA (Big List Of Dodgy Apps). And, when I
> temporally replace the present cygwin1.dll version 1.7.11 with an
> old version 1.7.9 copied from another non-updated installation, the
> sshd again can be started as service, i.e. the fork problem does not
> occur.
> 
> Any more ideas?

You wrote:
> $ peflags --cygwin-heap=1024 /usr/sbin/sshd.exe

Did you revert this setting?  It's a hell of a lot of heap, which just
by itself can break fork.  sshd doesn't need that much heap anyway.


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-04 11:50     ` Corinna Vinschen
@ 2012-03-04 14:54       ` Ulf-Dietrich Braumann
  2012-03-05 10:38         ` Wilfried
  2012-03-05 16:32         ` Corinna Vinschen
  0 siblings, 2 replies; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-04 14:54 UTC (permalink / raw)
  To: cygwin

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.

This however is misleading, since I clearly see the sshd running now (I 
made sure it was not running before), and indeed I can now connect using 
slogin and sftp:


top - 14:41:26 up 21:27,  0 users,  load average: 0.00, 0.00, 0.00
Tasks:   3 total,   1 running,   2 sleeping,   0 stopped,   0 zombie
top - 14:42:48 up 21:29,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:   7 total,   1 running,   6 sleeping,   0 stopped,   0 zombie
Cpu(s):   0.0% user,   0.4% system,   0.0% nice,  99.6% idle
Mem:  13630564k total,  2475144k used, 11155420k free,        0k buffers
Swap:  2095104k total,    56792k used,  2038312k free,        0k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
14960 mylogin   RT   0  5128 5272 1144 R    2  0.0   0:00.09 top
14616 mylogin   RT   0  4668 4596  952 S    0  0.0   0:00.06 sftp-server
14132 cyg_serv  RT   0  6380 6840  960 S    0  0.1   0:00.06 sshd
14460 mylogin   RT   0  6596 7440 2064 S    0  0.1   0:00.14 tcsh
14104 mylogin   RT   0  4336 3844  888 S    0  0.0   0:00.07 ash
14444 mylogin   RT   0  6096 6796 2068 S    0  0.0   0:00.04 tcsh
14340 cyg_serv  RT   0  9784  10m 1876 S    0  0.1   0:00.12 sshd


When I try to start sshd from Services menu accessible from the 
Administrative Tools menu, I also get a message that the sshd has been 
started and then stopped again (even though it actually runs). And in the 
Status column no "Started" entry occurs.

Hope this report may help to fix these problems seemingly related to 
cygwin1.dll 1.7.11 and cygrunsrv 1.36-1. Now I have downgraded to 
cygrunsrv 1.34-1 and sshd can be used, whereas earlier I found that 
cygrunsrv 1.36-1 and cygwin1.dll 1.7.9 (I had manually downgraded) also 
made sshd launchable as service (but have not documented the messages, I 
think similar misleading start-stop messages were given).

Thanks - Ulf-Dietrich


On Sun, 4 Mar 2012, it was written:

> You wrote:
> > $ peflags --cygwin-heap=1024 /usr/sbin/sshd.exe
> 
> Did you revert this setting?  It's a hell of a lot of heap, which just
> by itself can break fork.  sshd doesn't need that much heap anyway.
> 
> Corinna
>
> 
> On Mar  3 20:16, Ulf-Dietrich Braumann wrote:
> > On Sat, 3 Mar 2012, Larry Hall (Cygwin) wrote:
> > 
> > >Try this:
> > >http://cygwin.com/faq-nochunks.html#faq.using.fixing-fork-failures
> > 
> > Thanks. Unfortunately, rebaseall did not help. I also tried
> > peflagsall and a reboot, but no change. Also, I do not run programs
> > mentioned in the BLODA (Big List Of Dodgy Apps). And, when I
> > temporally replace the present cygwin1.dll version 1.7.11 with an
> > old version 1.7.9 copied from another non-updated installation, the
> > sshd again can be started as service, i.e. the fork problem does not
> > occur.
> > 
> > Any more ideas?

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-04 14:54       ` Ulf-Dietrich Braumann
@ 2012-03-05 10:38         ` Wilfried
  2012-03-05 16:32         ` Corinna Vinschen
  1 sibling, 0 replies; 20+ messages in thread
From: Wilfried @ 2012-03-05 10:38 UTC (permalink / raw)
  To: cygwin

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.
> 
> This however is misleading, since I clearly see the sshd running now (I 
> made sure it was not running before), and indeed I can now connect using 
> slogin and sftp:
> [...]

Hello,
I see the same "misleading message" (`sshd' service stopped) since I am
running sshd on my Windows XP Pro 32bit machine. (currently running
cygrunsrv V1.34, Mar 18 2008
OpenSSH_5.1p1, OpenSSL 0.9.8l 5 Nov 2009)
However I don't bother because several other (Microsoft) services behave
similar, i.e. they are started when Windows is booted and stopped
immediately afterwards. This doesn't prevent them from being started
again when needed.
--
Wilfried Hennings


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-04 14:54       ` Ulf-Dietrich Braumann
  2012-03-05 10:38         ` Wilfried
@ 2012-03-05 16:32         ` Corinna Vinschen
  2012-03-05 17:33           ` Charles Wilson
  1 sibling, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-05 16:32 UTC (permalink / raw)
  To: cygwin

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

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-05 16:32         ` Corinna Vinschen
@ 2012-03-05 17:33           ` Charles Wilson
  2012-03-05 17:40             ` Corinna Vinschen
  0 siblings, 1 reply; 20+ messages in thread
From: Charles Wilson @ 2012-03-05 17:33 UTC (permalink / raw)
  To: cygwin

On 3/5/2012 11:31 AM, Corinna Vinschen wrote:
> Why this only fails when cygrunsrv has been built with gcc-4 but not with
> gcc-3 is most puzzeling.

$ cygcheck /usr/bin/cygrunsrv.exe
C:\cygwin\bin\cygrunsrv.exe
  C:\cygwin\bin\cygwin1.dll
    C:\WINDOWS\system32\KERNEL32.dll
      C:\WINDOWS\system32\ntdll.dll
  C:\WINDOWS\system32\ADVAPI32.DLL
    C:\WINDOWS\system32\RPCRT4.dll
      C:\WINDOWS\system32\Secur32.dll
  C:\WINDOWS\system32\USER32.dll
    C:\WINDOWS\system32\GDI32.dll
  C:\cygwin\bin\cyggcc_s-1.dll        <<<<<
  C:\cygwin\bin\cygstdc++-6.dll       <<<<<

When built with gcc3, we didn't have runtime dlls so everything was
static.  Maybe just building cygrunsrv with -static-libgcc
-static-libstdc++ ?

--
Chuck

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-05 17:33           ` Charles Wilson
@ 2012-03-05 17:40             ` Corinna Vinschen
  2012-03-07 11:43               ` Corinna Vinschen
  0 siblings, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-05 17:40 UTC (permalink / raw)
  To: cygwin

On Mar  5 12:33, Charles Wilson wrote:
> On 3/5/2012 11:31 AM, Corinna Vinschen wrote:
> > Why this only fails when cygrunsrv has been built with gcc-4 but not with
> > gcc-3 is most puzzeling.
> 
> $ cygcheck /usr/bin/cygrunsrv.exe
> C:\cygwin\bin\cygrunsrv.exe
>   C:\cygwin\bin\cygwin1.dll
>     C:\WINDOWS\system32\KERNEL32.dll
>       C:\WINDOWS\system32\ntdll.dll
>   C:\WINDOWS\system32\ADVAPI32.DLL
>     C:\WINDOWS\system32\RPCRT4.dll
>       C:\WINDOWS\system32\Secur32.dll
>   C:\WINDOWS\system32\USER32.dll
>     C:\WINDOWS\system32\GDI32.dll
>   C:\cygwin\bin\cyggcc_s-1.dll        <<<<<
>   C:\cygwin\bin\cygstdc++-6.dll       <<<<<
> 
> When built with gcc3, we didn't have runtime dlls so everything was
> static.  Maybe just building cygrunsrv with -static-libgcc
> -static-libstdc++ ?

BTDT.  That doesn't help at all, unfortunately.  But thanks for your
input.  More ideas welcome :-}


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-05 17:40             ` Corinna Vinschen
@ 2012-03-07 11:43               ` Corinna Vinschen
  2012-03-08 10:05                 ` Ulf-Dietrich Braumann
  0 siblings, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-07 11:43 UTC (permalink / raw)
  To: cygwin

On Mar  5 18:39, Corinna Vinschen wrote:
> On Mar  5 12:33, Charles Wilson wrote:
> > On 3/5/2012 11:31 AM, Corinna Vinschen wrote:
> > > Why this only fails when cygrunsrv has been built with gcc-4 but not with
> > > gcc-3 is most puzzeling.
> > 
> > $ cygcheck /usr/bin/cygrunsrv.exe
> > C:\cygwin\bin\cygrunsrv.exe
> >   C:\cygwin\bin\cygwin1.dll
> >     C:\WINDOWS\system32\KERNEL32.dll
> >       C:\WINDOWS\system32\ntdll.dll
> >   C:\WINDOWS\system32\ADVAPI32.DLL
> >     C:\WINDOWS\system32\RPCRT4.dll
> >       C:\WINDOWS\system32\Secur32.dll
> >   C:\WINDOWS\system32\USER32.dll
> >     C:\WINDOWS\system32\GDI32.dll
> >   C:\cygwin\bin\cyggcc_s-1.dll        <<<<<
> >   C:\cygwin\bin\cygstdc++-6.dll       <<<<<
> > 
> > When built with gcc3, we didn't have runtime dlls so everything was
> > static.  Maybe just building cygrunsrv with -static-libgcc
> > -static-libstdc++ ?
> 
> BTDT.  That doesn't help at all, unfortunately.  But thanks for your
> input.  More ideas welcome :-}

I just released a new cygrunsrv which fixes the problem for me.  What
it does is to fork in a separate pthread, for which the stack has been
set up in the application heap.  This reduceds the chance for collision
a lot.  Please give it a try.


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-07 11:43               ` Corinna Vinschen
@ 2012-03-08 10:05                 ` Ulf-Dietrich Braumann
  2012-03-08 10:21                   ` Ulf-Dietrich Braumann
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-08 10:05 UTC (permalink / raw)
  To: cygwin

Great, Corinna, now cygrunsrv in its new version 1.40-1 works on my Win2k3 
64bit machine. Thanks for the repair - Ulf-Dietrich

On Wed, 7 Mar 2012, Corinna Vinschen wrote:

> I just released a new cygrunsrv which fixes the problem for me.  What it 
> does is to fork in a separate pthread, for which the stack has been set 
> up in the application heap.  This reduceds the chance for collision a 
> lot.  Please give it a try.
>
> Corinna

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-08 10:05                 ` Ulf-Dietrich Braumann
@ 2012-03-08 10:21                   ` Ulf-Dietrich Braumann
  2012-03-08 10:37                     ` Corinna Vinschen
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-08 10:21 UTC (permalink / raw)
  To: cygwin

Well, while sshd now can be launched again by cygrunsrv, still the 
mechanism behaves weird, in the event viewer sshd tells me to be stopped 
short after it was started, however in fact it runs. And in the services 
list the "Started" entry is missing, so it cannot be stopped there. - What 
counts at the moment, sshd basically works as service, thanks - 
Ulf-Dietrich


On Thu, 8 Mar 2012, Ulf-Dietrich Braumann wrote:

> Great, Corinna, now cygrunsrv in its new version 1.40-1 works on my Win2k3 
> 64bit machine. Thanks for the repair - Ulf-Dietrich
>
> On Wed, 7 Mar 2012, Corinna Vinschen wrote:
>
>> I just released a new cygrunsrv which fixes the problem for me.  What it 
>> does is to fork in a separate pthread, for which the stack has been set up 
>> in the application heap.  This reduceds the chance for collision a lot. 
>> Please give it a try.
>> 
>> Corinna

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-08 10:21                   ` Ulf-Dietrich Braumann
@ 2012-03-08 10:37                     ` Corinna Vinschen
  2012-03-08 15:12                       ` Ulf-Dietrich Braumann
  0 siblings, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-08 10:37 UTC (permalink / raw)
  To: cygwin

On Mar  8 11:21, Ulf-Dietrich Braumann wrote:
> Well, while sshd now can be launched again by cygrunsrv, still the
> mechanism behaves weird, in the event viewer sshd tells me to be
> stopped short after it was started,

That doesn't happen for me.  Does your service entry for sshd omit
the -D option?  What does `cygrunsrv -Q sshd' print?  That should
look like:

  $ cygrunsrv -Q sshd
  Service             : sshd
  Display name        : CYGWIN sshd
  Current State       : [...]
  Command             : /usr/sbin/sshd -D


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-08 10:37                     ` Corinna Vinschen
@ 2012-03-08 15:12                       ` Ulf-Dietrich Braumann
  2012-03-08 15:51                         ` Corinna Vinschen
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf-Dietrich Braumann @ 2012-03-08 15:12 UTC (permalink / raw)
  To: cygwin

Thanks, Corinna, for asking if sshd was called with the -D option. This 
was the point, although I do not really know why -D was missing (I used 
ssh-host-config).

This is was came out before (sshd in fact was running):

$ cygrunsrv -Q sshd
Service             : sshd
Display name        : CYGWIN sshd
Current State       : Stopped
Command             : /usr/sbin/sshd

Then I removed the service:

$ sc delete sshd
[SC] DeleteService SUCCESS

Then I rerun the installation script (only selected the service 
re-install, of course using the cyg_server account for Win2k3):

$ ssh-host-config
...
*** Info: Host configuration finished. Have fun!
$ cygrunsrv -S sshd
$ cygrunsrv -Q sshd
Service             : sshd
Display name        : CYGWIN sshd
Current State       : Running
Controls Accepted   : Stop
Command             : /usr/sbin/sshd -D

I guess, when I was installing the service before, I may have changed 
something in the Properties menu of the CYGWIN sshd service, perhaps I 
tested something under the SYSTEM account and then have reverted to the 
cyg_server account, so by this action finally the -D may got lost for the 
call of sshd. BTW, I do not actually understand the meaning of -D (When 
this option is specified, sshd will not detach and does not become a 
daemon. This allows easy monitoring of sshd.)

Thank you again - Ulf-Dietrich


On Thu, 8 Mar 2012, Corinna Vinschen wrote:

> That doesn't happen for me.  Does your service entry for sshd omit the 
> -D option?  What does `cygrunsrv -Q sshd' print?  That should look like:
>
>  $ cygrunsrv -Q sshd
>  Service             : sshd
>  Display name        : CYGWIN sshd
>  Current State       : [...]
>  Command             : /usr/sbin/sshd -D
>
> Corinna


> On Mar  8 11:21, Ulf-Dietrich Braumann wrote:
> 
>> Well, while sshd now can be launched again by cygrunsrv, still the 
>> mechanism behaves weird, in the event viewer sshd tells me to be 
>> stopped short after it was started,

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-03-08 15:12                       ` Ulf-Dietrich Braumann
@ 2012-03-08 15:51                         ` Corinna Vinschen
  0 siblings, 0 replies; 20+ messages in thread
From: Corinna Vinschen @ 2012-03-08 15:51 UTC (permalink / raw)
  To: cygwin

On Mar  8 16:11, Ulf-Dietrich Braumann wrote:
> I guess, when I was installing the service before, I may have
> changed something in the Properties menu of the CYGWIN sshd service,
> perhaps I tested something under the SYSTEM account and then have
> reverted to the cyg_server account, so by this action finally the -D
> may got lost for the call of sshd. BTW, I do not actually understand
> the meaning of -D (When this option is specified, sshd will not
> detach and does not become a daemon. This allows easy monitoring of
> sshd.)

On UNIX-based systems, service processes usually fork and the child
process runs as the service in the background, while the parent process
exits.  That's what is called starting a daemon process.

The Windows Service Control Manager (SCM) doesn't support this mode of
operation, and cygrunsrv is the actual service process from SCM's point
of view.  cygrunsrv itself starts the *real* service like sshd, but in
the default mode it just forks and execs it off, then waits for the 
process to stop.  That's what the -D option of sshd is for.  It does
not create a daemon process and exits, rather the parent just runs as
the service directly.

Cygrunsrv can also handle daemon services, but that is only useful
if the service doesn't support running non-daemonized.  This also
requires the service to write a pidfile and using the cygrunsrv
--pidfile option.


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-02-10  9:10   ` Corinna Vinschen
@ 2012-02-16 14:27     ` Carl Soderstrom
  0 siblings, 0 replies; 20+ messages in thread
From: Carl Soderstrom @ 2012-02-16 14:27 UTC (permalink / raw)
  To: cygwin


I want to make sure my solution ends up in the archives for the benefit of other people.

> From: "Corinna Vinschen" 
<snip>
> On Feb  9 15:39, Carl Soderstrom wrote:
> > Changing the stack size using regtool (regtool.exe -i set
> > /HKLM/Software/Cygwin/heap_chunk_in_mb 2048) has not fixed the
> > problem.
> 
> I don't know what the problem is here, but please note the change in
> terms of the heap size in 1.7.10:
> 
> http://cygwin.com/cygwin-ug-net/setup-maxmem.html


Thank you, that was helpful. In the end what seems to have fixed it was to run an ash.exe shell (launched directly from the Start -> Run 
dialog), run 'cd /bin;PATH=. rebaseall' in that, then re-launch the Cygwin terminal, run the following commands:

$ peflags --cygwin-heap=1024 /usr/bin/run.exe
$ peflags --cygwin-heap=1024 /usr/bin/cygrunsrv.exe

I do not know if all those steps were necessary, but the programs seem to work correctly now.

-- 
Carl Soderstrom
Systems Administrator
Real-Time Enterprises
www.real-time.com

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-02-09 21:39 ` Carl Soderstrom
  2012-02-09 21:46   ` Carl Soderstrom
  2012-02-09 22:27   ` marco atzeri
@ 2012-02-10  9:10   ` Corinna Vinschen
  2012-02-16 14:27     ` Carl Soderstrom
  2 siblings, 1 reply; 20+ messages in thread
From: Corinna Vinschen @ 2012-02-10  9:10 UTC (permalink / raw)
  To: cygwin

On Feb  9 15:39, Carl Soderstrom wrote:
> Changing the stack size using regtool (regtool.exe -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 2048) has not fixed the problem.

I don't know what the problem is here, but please note the change in
terms of the heap size in 1.7.10:

http://cygwin.com/cygwin-ug-net/setup-maxmem.html


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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-02-09 21:39 ` Carl Soderstrom
  2012-02-09 21:46   ` Carl Soderstrom
@ 2012-02-09 22:27   ` marco atzeri
  2012-02-10  9:10   ` Corinna Vinschen
  2 siblings, 0 replies; 20+ messages in thread
From: marco atzeri @ 2012-02-09 22:27 UTC (permalink / raw)
  To: cygwin

On 2/9/2012 10:39 PM, Carl Soderstrom wrote:
> Pardon me if this is old news, but searching the mailing lists has not yielded a solution that solves the problems I'm having on this computer.
>
> system is Windows XP Professional (patched up to date), Cygwin version is:
> $ uname -a
> CYGWIN_NT-5.1 CADMAN 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin
>

>
> ALSO: run.exe fails silently. No output (called application does not run), no error, nothing in the logs.
>

run depends from just 2 dlls,
   cygwin1.dll =>  cygwin-1.7.10-1
   cyggcc_s-1.dll =>  libgcc1-4.5.3-3

and if you miss the 2nd one, a lot of things are broken.
What is the output of
$ cygcheck run


Reporting problem please follow the guidelines
  http://cygwin.com/problems.html

Marco

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

* Re: 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
  2012-02-09 21:39 ` Carl Soderstrom
@ 2012-02-09 21:46   ` Carl Soderstrom
  2012-02-09 22:27   ` marco atzeri
  2012-02-10  9:10   ` Corinna Vinschen
  2 siblings, 0 replies; 20+ messages in thread
From: Carl Soderstrom @ 2012-02-09 21:46 UTC (permalink / raw)
  To: cygwin

> From: "Carl Soderstrom" <chrome@mn.real-time.com>

> Reinstallation (of 1.7.9 and 1.7.10) has not fixed the problem; even
> after completely deleting all of C:\cygwin.
> 
> Changing the stack size using regtool (regtool.exe -i set
> /HKLM/Software/Cygwin/heap_chunk_in_mb 2048) has not fixed the
> problem.
> 
> I looked at the BLODA
> (http://cygwin.com/faq/faq.using.html#faq.using.bloda) and tried
> completely uninstalling Spybot S&D, and this did not fix the
> problem.

I also ran 'rebaseall' in a ash.exe process, which also did not fix the problem.

-- 
Carl Soderstrom
Systems Administrator
Real-Time Enterprises
www.real-time.com

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

* 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable"
       [not found] <fcee3c8c-1f00-4482-9507-9bd6deaec648@zimbra>
@ 2012-02-09 21:39 ` Carl Soderstrom
  2012-02-09 21:46   ` Carl Soderstrom
                     ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Carl Soderstrom @ 2012-02-09 21:39 UTC (permalink / raw)
  To: cygwin

Pardon me if this is old news, but searching the mailing lists has not yielded a solution that solves the problems I'm having on this computer.

system is Windows XP Professional (patched up to date), Cygwin version is:
$ uname -a
CYGWIN_NT-5.1 CADMAN 1.7.10(0.259/5/3) 2012-02-05 12:36 i686 Cygwin

I can register a service such as rsyncd using cygrunsrv (cygrunsrv -R <options>), but when I try to start it, the 'error 1062' appears on the command line and the following error appears in the Application log:

rsyncd: PID 3216: starting service `rsyncd' failed: fork: 11, Resource temporarily unavailable.

ALSO: run.exe fails silently. No output (called application does not run), no error, nothing in the logs.

I'm not sure when this started, and I don't know how to find a pre-compiled older version of cygwin. (I only see what I'm guessing are source code tarballs of setup.exe in the archives).

I'm running Cygwin on many dozens of other computers, and this is the only one that has this problem. 

Reinstallation (of 1.7.9 and 1.7.10) has not fixed the problem; even after completely deleting all of C:\cygwin.

Changing the stack size using regtool (regtool.exe -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 2048) has not fixed the problem.

I looked at the BLODA (http://cygwin.com/faq/faq.using.html#faq.using.bloda) and tried completely uninstalling Spybot S&D, and this did not fix the problem.

What is the next thing I should try to troubleshoot this?

-- 
Carl Soderstrom
Systems Administrator
Real-Time Enterprises
www.real-time.com

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

end of thread, other threads:[~2012-03-08 15:51 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-02 14:39 1.7.10 cygrunsrv.exe fails with "fork: 11, Resource temporarily unavailable" Ulf-Dietrich Braumann
2012-03-03  6:44 ` Larry Hall (Cygwin)
2012-03-03 19:16   ` Ulf-Dietrich Braumann
2012-03-04 11:50     ` Corinna Vinschen
2012-03-04 14:54       ` Ulf-Dietrich Braumann
2012-03-05 10:38         ` Wilfried
2012-03-05 16:32         ` Corinna Vinschen
2012-03-05 17:33           ` Charles Wilson
2012-03-05 17:40             ` Corinna Vinschen
2012-03-07 11:43               ` Corinna Vinschen
2012-03-08 10:05                 ` Ulf-Dietrich Braumann
2012-03-08 10:21                   ` Ulf-Dietrich Braumann
2012-03-08 10:37                     ` Corinna Vinschen
2012-03-08 15:12                       ` Ulf-Dietrich Braumann
2012-03-08 15:51                         ` Corinna Vinschen
     [not found] <fcee3c8c-1f00-4482-9507-9bd6deaec648@zimbra>
2012-02-09 21:39 ` Carl Soderstrom
2012-02-09 21:46   ` Carl Soderstrom
2012-02-09 22:27   ` marco atzeri
2012-02-10  9:10   ` Corinna Vinschen
2012-02-16 14:27     ` Carl Soderstrom

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