Mail Archives: djgpp/1998/05/18/19:17:11
Mike wrote:
[snip]
> I wrote these programs on Unix workstations (SGI, Sparc, DEC)
> ... [and] I need to port them over to my Win95/DOS PC.
[snip]
> I brought my old programs over from the University and they compiled
> just fine... BUT. The problem is that they don't run. They all give
> segmentation faults.
[snip]
> Okay, after all that, my simple question is: Why didn't this simple
> program work?
> (I am running it in a Win95 DOS prompt window. I set DPMI to 65535 as
> it suggested in the FAQ.... I have 32 MB RAM, a lot of disk space, on
> a 200MHZ AMD-K6 machine). )
>
> main() {
> int test[90000];
> printf("This is a test.\n");
> return(0);
> }
>
[snip]
> Well, thanks for getting through this long explanation. If you want
> to respond, I would appreciate a cc to my e-mail address in case I
> miss your reply on usenet. I don't read news very often anymore.
>
> Mike Hodsdon
> meh AT cyberrealm DOT net
Hi Mike,
The answer to your problem is in section 15.9 of the FAQ. It says that
the default stack size is 256k, "but some programs which use large
automatic arrays ... might need more." One of the suggestions it gives
is to use STUBEDIT to increase the stack size. So I tried giving your
test program a 1Mbyte stack and it worked fine. Good Luck.
Chris
- Raw text -