www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/28/17:34:07

Message-ID: <3BB4E801.32F49852@cyberoptics.com>
From: Eric Rudd <rudd AT cyberoptics DOT com>
Organization: CyberOptics
X-Mailer: Mozilla 4.72 [en] (Win95; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Heap structure
References: <3BA1292B DOT C593DFD8 AT cyberoptics DOT com> <9p25as$rra$1 AT milzis DOT latnet DOT lv>
Lines: 27
Date: Fri, 28 Sep 2001 16:13:37 -0500
NNTP-Posting-Host: 38.196.93.9
X-Trace: client 1001711620 38.196.93.9 (Fri, 28 Sep 2001 17:13:40 EDT)
NNTP-Posting-Date: Fri, 28 Sep 2001 17:13:40 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Antonijs Kipans wrote:

> As I stumbled over this myself, there is one unexpected possibility - you
> trie to fprintf() into UNOPEN file!

My program had opened and closed the same file for appending several times
before the bomb occurred, and the file contents were plausible, so I doubt
that was the problem here.

The debugging tools were not of much help because the side effects of the bug
disappeared as soon as I enabled the debugging code.  (Specifically,
whenever I increased malloc_debug to 1 or higher to detect the bug, the
program executed normally and malloc_verify() returned 1 -- how
frustrating!)   By inspection, I eventually did find some errors in my code,
and after I fixed them the program didn't bomb anymore.  Thanks to all who
offered their help.

-Eric

> "Eric Rudd" <rudd AT cyberoptics DOT com> wrote in message
> news:3BA1292B DOT C593DFD8 AT cyberoptics DOT com...
> > I have a DJGPP program that is bombing with a SIGSEGV error.  I have
> > reason to believe that the program has an array overflow that is
> > corrupting the structure of the heap.  (The program actually bombs in a
> > malloc call inside fprintf, but at this point I have no convincing
> > reason to believe that a system function bug is to blame.)

- Raw text -


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