This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to spawn from big-stack program


Hi,

Can anyone tell me how to invoke a program from a big-stack program
(i.e. a program which has a big stack). Here is a small big-stack program which reproduces the problem:


---

$ more example.c
#include <stdio.h>
#include <process.h>
int main(){
  printf("Hello\n");
  spawnlp(_P_WAIT,"ls","ls",NULL);
  printf("Goodbye\n");}

$ gcc -o example example.c

$ ./example.exe
Hello
example.c  example.exe
Goodbye

$ editbin /STACK:500111000:500111000 example.exe
Microsoft (R) COFF/PE Editor Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

$ ./example.exe
Hello
2 [main] example 3360 C:\cygwin\home\grue\example\example.exe: *** fatal error - CreateThread failed for proc_waiter - 0x0<0x0>, Win32 error 8
Hangup


---

So the big-stack program gives a Win32 error 8: ERROR_NOT_ENOUGH_MEMORY.

I tried on a recently updated Cygwin under Windows XP on a machine with 4GB ram.

Using FAQ-6.21 and http://cygwin.com/cygwin-ug-net/setup-maxmem.html
I learned that I can allocate 1.5GB.

I also tried with stack sizes of 0.4GB and 0.6GB to be sure 0.5GB was not close to some magic boundary.

Then I did a fresh cygwin install on a Windows Vista 64 machine with 8GB. The results were identical.

On the Vista machine I did
cygcheck -s -v -r > cygcheck.out
I stopped it after it had generated 10MB of output. I have merely attached the first 39329 bytes of cygcheck.out. It looks like cygcheck loops indefinitely.


So my question is: does anyone know how to invoke an innocent program like "ls" from a program which has a big stack.

Cheers,
Klaus

Attachment: cygcheck.out
Description: cygcheck.out

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]