www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/11/00:00:23

From: David Mikesell <dmikesell AT ee DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Seg fault
Date: Tue, 10 Feb 1998 23:42:55 -0500
Organization: eNET Inc. (Report Abuse to abuse AT ee DOT net)
Lines: 26
Message-ID: <34E12C4F.A2@ee.net>
Reply-To: dmikesell AT ee DOT net
NNTP-Posting-Host: 209.190.33.50
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Mikesell wrote:
> 
> I'm using djgpp 2.01 on dos 6.22 and am trying to work through
> a particularly nasty seg fault bug.  I will purposely keep
> the problem statement general here, but will be happy to
> drill down to the source if nobody can point me in the right
> direction to begin looking.
> 
> I get the seg fault immediately after returning from a function
> that allocates memory...I can't seem to narrow the bug down to
> an offending pointer reference or a free() of a NULL pointer, etc.
> None of the malloc()'s returns a NULL pointer.  Any ideas
> on where to start looking?

	Problem solved.  I was passing an unallocated RGB pointer
to load_pcx().  Got away with it for a while, and then things went
bad. 
	The good thing that came of this was that I developed a set
of safe malloc()/free()/etc. routines, along with debugging routines
to check allocated memory.  Pointed me right to the offending load_pcx()
call.  Live and learn.  
	Thanks for the responses...they pointed me in the right 
direction.

-- 
Dave Mikesell (dmikesell AT ee DOT net)

- Raw text -


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