delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/01/30/19:52:47

Date: Mon, 30 Jan 1995 15:05:51 -0500 (EST)
From: Cuthalion / Sliced Bread <enrico AT max DOT tiac DOT net>
Subject: malloc bug?
To: DJGPP Listserver <djgpp AT sun DOT soe DOT clarkson DOT edu>

	Ok.  I am writing a program that scales a graphic with 
antialiasing.  It works, most of the time.  However, every so often, it 
crashed.  So I said to myself "You probably did something stupid." so I 
turned on debug info, and recompiled, coff2exe'd it, and ran it.  It, 
after a lot of annoying working totally normally, eventually crashed.  I 
ran symify, and found that the crash happened in "_malloc + 200".  I 
checked my source, and sure enough, I did call malloc where it told me I 
did.  I was passing it a non-negative, non-zero number.  I kept messing 
around with it and eventually found that there are a couple of places 
where I call malloc that it sometimes crashes on.  Since I use a lot of 
temporary buffers, some of which are two dimensional arrays, I get to 
call malloc (and free, too, ever since those out of memory problems.. :) 
fairly often.

	I don't see how this could be a "that's my fault" crash, but I've 
enough faith in DJGPP to think that there is some way I am missing.  Can 
anyone tell me what I may be doing wrong to get this sort of crash?  If 
not, is something wrong with DJGPP's malloc()?

	Thanks.


- Raw text -


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