delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/18/19:17:11

From: Christopher Bier <chbier AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: New to djgpp, desperate for help...
Date: Mon, 18 May 1998 17:45:08 -0500
Organization: LCC Internet
Lines: 38
Message-ID: <3560B9F4.1B460FFE@yahoo.com>
References: <355F48B9 DOT 8DB27C57 AT cyberrealm DOT net>
NNTP-Posting-Host: conr-ddas3-a9.lcc.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


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