www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/27/03:10:39

Date: Fri, 26 Apr 1996 23:59:33 -0700 (PDT)
From: Samuel Vincent <svincent AT cs DOT sonoma DOT edu>
To: Jag <gaghon AT nevada DOT edu>
cc: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: problem with DJGPP and arrays.
In-Reply-To: <Pine.OSF.3.91.960426123526.29873B@pioneer.nevada.edu>
Message-ID: <Pine.SUN.3.90.960426235710.9006C-100000@zippy>
MIME-Version: 1.0

On Fri, 26 Apr 1996, Jag wrote:

> On Fri, 26 Apr 1996, Eli Zaretskii wrote:
> 
> > On Thu, 25 Apr 1996, Jag wrote:
> > 
> > > They are static variables, declared outside function.  I tried enlarging 
> > > the stack to 2megs and it still did the same thing.
> > 
> > Then the stack is not related to your problem.  Please post the minimum 
> > code fragment that is required to see what you are doing, and the exact 
> > error message that is printed when the program crashes.  Did you check 
> > that you don't read more data than the length of the arrays?
> > 
> 
> Here is the funny part.  If I create an extra array BEFORE the array I 
> get the error from, then it works.  I checked the size several times, but 
> it does not explain why the same size array works with the extra array, 
> but not without it.  I don't use the extra array.  I just put it there as 
> padding.
> 
> 
> Here is the error message:
> 
[error message and code examples removed]

Hrm..  it sounds as if you are accessing memory with a garbage pointer..
in other words, going outside your array...  And somehow declaring more 
array storage gives more memory so you happen to hit memory which was 
allocated somewhere (probably not for that particular piece of code that 
is accessing it however...)

Could you post the contents of function read_t2?

Thanks,

Sam

- Raw text -


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