www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/21/09:58:15

Xref: news2.mv.net comp.os.msdos.djgpp:7714
From: ac387 AT yfn DOT ysu DOT edu (randall williams)
Newsgroups: comp.os.msdos.djgpp
Subject: memory overwriting itself??
Date: 21 Aug 1996 07:18:12 GMT
Organization: St. Elizabeth Hospital, Youngstown, OH
Lines: 24
Message-ID: <4ved7k$gps@news.ysu.edu>
Reply-To: ac387 AT yfn DOT ysu DOT edu (randall williams)
NNTP-Posting-Host: yfn.ysu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

I finally finished, sort of, a project I've been working on.

I found a problem maybe a bug. I have a function that uses the
system() to make a dir list file and then it reads the file
in for a directory menu. I know it can be done another way, but
I do the same thing with a program's output and it saves some
space. the function also moves around the directory tree, so it
has to be able to read the directory several times. The open file
is closed after it is read, and removed with unlink().

After several steps through directories, the program crashes and I
get usually SIGFPE, SIGBUS, or out of file handles. GDB showed me
the divide by zero problem and I found an index counter was 0.
The index counter is initialized to 1 and should never be zero
since it only ever counts up. is there any easy way to find this
bug? is this a bug in gcc? suggestions on narrowing this down?

The bad thing is that another compiler doesn't have this bug with
the same source code.

-- 
PGP key available
keyID=148DF819 fingerprint=1A 6F 0C 7F 79 1E 87 8F 86 C2 DF D4 3A CA 8A 3F

- Raw text -


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