delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/03/09/02:41:53

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <47D3949E.1050805@tlinx.org>
Date: Sat, 08 Mar 2008 23:41:18 -0800
From: Linda Walsh <cygwin AT tlinx DOT org>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Win32 error 487? can't reserve memory for stack
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

I have a simple C program I place in my win32 system dir to "catch"
any references to "gvim" in the system dir and have it really started
from the actual program dir.  This is only for the win32-version of gvim --
the cygwin version I call in the shell, I call using "vi".  The "vim" version
looks in the cygwin dirs for it's supporting files.

It had been working "fine" and recently has broken in some difficult to debug
cases (like when launched from explorer on a text file).  At the same time
some of my 'bash.exe' invocations from the windows SHELL (explorer) have
started failing -- the message flickers by too fast for me to see them.

I manage to duplicate the gvim error in a 'cmd.exe' shell though and thought
I'd throw it out and see if it looked familiar to anyone.  I tried running
rebaseall, to see if that changed anything.  Not.  Nada on recompile/new
binary. It appears, if I execute the same "gvim.exe" file in a different
directory, it works. If I execute a cygwin shell first, then I can
execute the binary in the system32 directory and I get no error (it just
works).

Am sending this out now to see if the error messages look familiar to
anyone. The error messages (except the last one) aren't coming out of
my program. The program is included, below the error.  It seems
"trivial" enough... Not sure why it would die when called from
windows progs, but not cygwin progs...

If I can't trace it down to something odd in my config, I'll submit
a cygcheck...but off hand, not sure of all the differences between the
working and non-working cases and the error is just strange...
(I have plenty of memory, disk, resources, whatever...not at issue
since I can run 'ash', then the 'gvim' file (same one) and it works).
Here's the messages:

C:\bin>gvim
    3690 [main] gvim 3196 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
       7 [main] gvim 1012 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
       7 [main] gvim 856 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
       7 [main] gvim 3424 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
       7 [main] gvim 1804 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
       7 [main] gvim 804 C:\WINDOWS\system32\gvim.exe: *** fatal error - fork: 
can't reserve memory for stack 0x23CB28 - 0x240000, Win32 error 487
      11 [main] gvim 2660 fork: child -1 - died waiting for longjmp before 
initialization, retry 0, exit code 0x100, errno 11
Error forking, errno=11
---------
#include <stdio.h>
#include <errno.h>

extern int errno;

char * const path="/Prog/Vim/gvim.exe";

int main (int argc,char * const argv[]) {
         int p;
         p=fork();
         if (p<0) {
                 fprintf(stderr, "Error forking, errno=%d\n",errno);
                 exit(1);
         }
         if (!p) {       /* in child */
                 execv(path,argv);
                 fprintf(stderr, "Error exec'ing %s, errno=%d\n",path,errno);
                 exit(2);
         }
         // parent, hopefully, quietly exits....
         exit(0);
}


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

- Raw text -


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