cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/30/14:30:20

From: Charles Terry <cterry AT plinet DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Need help with a program.
Date: Sun, 29 Mar 1998 10:37:09 -0800
Organization: All USENET -- http://www.Supernews.com
Lines: 38
Message-ID: <351E94D5.7550@plinet.com>
References: <351df020 DOT 4727187 AT nntp DOT ix DOT netcom DOT com>
NNTP-Posting-Host: 24214 AT 207 DOT 174 DOT 3 DOT 190
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Kevin S. wrote:
> 
> I was wondering if someone could help me with the following problem:
> 
> I'm writing a program that reads a text file and builds a series of
> linked lists from the data within.  So far I've used 4 different text
> files as test examples and 3 out of the 4 work fine.
> However, the 4th file, for reasons yet unknown, crashes the program.
> The main function calls three phase functions, each of which read the
> whole text file and do various things.  Using RHIDE's internal
> debugger, I've discovered that the program stops dead at the end of
> the first phase, right at the return call to the main function.  The
> error being reported is a SIGSEGV one, which I really don't understand
> anything about.  The program isn't doing anything with the data, or
> the memory, or anything....all it's doing is returning to the main
> function, and it gives me a SIGSEGV error.
> 
> Strangley, the program only works under QEMM 8.0's DPMI Server, and
> Windows 95's Dos prompt.  When I try to use CWSDPMI, it doesn't work
> at all.  (Which I find strange since I'm not using any DPMI related
> functions as far as I can tell.)
> 
> "The AGT/AGATE Guy"
> Kevin Soucy  (Serpent2 AT ix DOT netcom DOT com)
Chances are that you have a pointer overwriting the stack.
cwsdpmi pays more attention than win95 does, so probably in
win the problem would just show up later.
Also if you are using large amounts of dataspace in you functions
ie 
myfunc()
char myarray[10000]
instead of
char* myarray=new char[10000] //(or malloc)

you might be running out of stack space.

Charles

- Raw text -


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