Re: [Fink-devel] unlimit stack

2003-11-01 Thread Koen van der Drift
On Friday, Oct 31, 2003, at 23:35 US/Eastern, David Brown wrote: { int labels[20]; int names[1]; float num[1]; These variables in main are probably the cause of the overflow, not the static ones. You might just try declaring 'names' and 'num' to be static, but I

Re: [Fink-devel] unlimit stack

2003-11-01 Thread Koen van der Drift
On Friday, Oct 31, 2003, at 23:38 US/Eastern, Charles Lepple wrote: Depending on how much you want to mess with the source, you could rename the main function to something else, and create a new main function which does the setrlimit call and then calls the old main function. Yes! That solved

Re: [Fink-devel] unlimit stack

2003-10-31 Thread Koen van der Drift
On Tuesday, Oct 28, 2003, at 22:47 US/Eastern, Koen van der Drift wrote: On Tuesday, Oct 28, 2003, at 22:12 US/Eastern, Charles Lepple wrote: #include std.disclaimer /* haven't tried this myself */ #include sys/types.h #include sys/time.h #include sys/resource.h struct rlimit rlim;

Re: [Fink-devel] unlimit stack

2003-10-31 Thread David Brown
On Fri, Oct 31, 2003 at 08:40:10PM -0500, Koen van der Drift wrote: Well, I figured out why the program is crashing. The code is assigning some very large arrays as a static variables, which are created before main() is called. They use all available stack, which causes the crash. If I

Re: [Fink-devel] unlimit stack

2003-10-31 Thread David Brown
Static variables should be on the stack. What do you mean by assigning I meant: Static variables should _not_ be on the stack. Dave --- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more

Re: [Fink-devel] unlimit stack

2003-10-31 Thread Koen van der Drift
On Friday, Oct 31, 2003, at 21:11 US/Eastern, David Brown wrote: What do you mean by assigning large arrays? Are they declared at the top level in the C file? Yes, here is a snippet: static int myarray[20][1] static int anotherarray[20][1] int main (int argc char** argv) { int

Re: [Fink-devel] unlimit stack

2003-10-31 Thread David Brown
On Fri, Oct 31, 2003 at 09:53:38PM -0500, Koen van der Drift wrote: Yes, here is a snippet: static int myarray[20][1] static int anotherarray[20][1] int main (int argc char** argv) { int labels[20]; int names[1]; float num[1]; These variables in main

Re: [Fink-devel] unlimit stack

2003-10-29 Thread Koen van der Drift
On Tuesday, Oct 28, 2003, at 22:12 US/Eastern, Charles Lepple wrote: #include std.disclaimer /* haven't tried this myself */ #include sys/types.h #include sys/time.h #include sys/resource.h struct rlimit rlim; getrlimit(RLIMIT_STACK, rlim); rlim.rlim_cur = RLIM_INFINITY; setrlimit(RLIMIT_STACK,

Re: [Fink-devel] unlimit stack

2003-10-28 Thread Charles Lepple
On Tuesday, October 28, 2003, at 08:01 PM, Koen van der Drift wrote: Is there a way to patch the source so that the user doesn't have to enter 'unlimit stack' each time? #include std.disclaimer /* haven't tried this myself */ #include sys/types.h #include sys/time.h #include sys/resource.h

Re: [Fink-devel] unlimit stack

2003-10-28 Thread Peter O'Gorman
Koen van der Drift wrote: Hi, Two of the programs of the emboss package do not work on Mac OS X apparently because of the limited stacksize on Mac OS X. For instance, if I type just 'cirdna' at the prompt, I get an segmentation fault. However if I type 'unlimit stack' first, the program works

Re: [Fink-devel] unlimit stack

2003-10-28 Thread Koen van der Drift
On Tuesday, Oct 28, 2003, at 22:12 US/Eastern, Charles Lepple wrote: #include std.disclaimer /* haven't tried this myself */ #include sys/types.h #include sys/time.h #include sys/resource.h struct rlimit rlim; getrlimit(RLIMIT_STACK, rlim); rlim.rlim_cur = RLIM_INFINITY; setrlimit(RLIMIT_STACK,