www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/10/18:33:38

Date: Sat, 11 Nov 2000 01:31:57 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <2427-Sat11Nov2000013157+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.6
In-reply-to: <8uho2n$kr9$1@nnrp1.deja.com> (dcasale@my-deja.com)
Subject: Re: My program hangs under RHIDE's debugger
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1001109084112 DOT 16891F-100000 AT is> <8ueodf$5ep$1 AT nnrp1 DOT deja DOT com> <9743-Thu09Nov2000224218+0200-eliz AT is DOT elta DOT co DOT il> <8ufgue$reg$1 AT nnrp1 DOT deja DOT com> <9003-Fri10Nov2000120410+0200-eliz AT is DOT elta DOT co DOT il> <8uho2n$kr9$1 AT nnrp1 DOT deja DOT com>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: dcasale AT my-deja DOT com
> Newsgroups: comp.os.msdos.djgpp
> Date: Fri, 10 Nov 2000 21:07:40 GMT
> 
> Here's an update on the situation, though.  I was able to get my
> compression program working with Nate Eldredge's YAMD (Yet Another
> Malloc Debugger).  My program has a loop which allocates some bytes,
> allocates some more bytes, then deallocates both.  The loop executes
> without any trouble several times, then fails on an allocation.

What do you mean by ``fails''?  Did it crash with a Page Fault?  If
so, the place where it crashed is the code which overwrites an
allocated buffer, and you should look closely at the code which
crashed.

The way YAMD works, it causes a Page Fault whenever a program tries to
access any address outside of any buffer allocated via malloc.

> Any ideas why that would happen?  Is there a DJGPP equivalent to the
> Microsoft _fheapmin call that I don't know about, that might solve this
> problem?

What do you need the equivalent of _fheapmin for?  How would it help
to solve this problem?

> I'll post a snippet from YAMD's symify'ed log file if you'd like, but
> it's kind of large.

If the program's run ends with a Page Fault and a crash, look at the
spot where it crashed.  If there's no Page Fault, it's useless to post
the log file here, because no one will be able to interpret it without
knowing a lot about your program.

> One of the things that I noticed was that it
> wasn't malloc'ing in the same spot.  One time it would malloc at
> 0x272eff4 and 0x2732fd8 (and deallocate them both properly).  The next
> time it would malloc at 0x2736ff4 and 0x273afd8 (again, deallocating
> them both properly).  There's nothing else in between these two
> allocations and deallocations in the log file, either, and they both
> happen to be 12 bytes and 40 bytes.  So why didn't the malloc's happen
> in the same spot?

Perhaps malloc couldn't merge the small allocations back into a larger
block, before the other allocation comes.  Or maybe the smaller
allocation belongs to another bucket.

In any case, I wouldn't worry about this, I don't think your problem
is due to some bug in malloc.

- Raw text -


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