From shenkin@still3.chem.columbia.edu  Sun Mar 19 23:35:27 1995
Received: from mailhub.cc.columbia.edu  for shenkin@still3.chem.columbia.edu
	by www.ccl.net (8.6.10/930601.1506) id WAA13290; Sun, 19 Mar 1995 22:49:07 -0500
Received: from still3.chem.columbia.edu by mailhub.cc.columbia.edu with SMTP id AA12796
  (5.65c+CU/IDA-1.4.4/HLK for <@mailhub.cc.columbia.edu:chemistry@ccl.net>); Sun, 19 Mar 1995 22:49:05 -0500
Received: by still3.chem.columbia.edu (931110.SGI/930416.SGI.AUTO)
	for @mailhub.cc.columbia.edu:chemistry@ccl.net id AA27855; Sun, 19 Mar 95 22:49:04 -0500
From: "Peter Shenkin" <shenkin@still3.chem.columbia.edu>
Message-Id: <9503192249.ZM27853@still3.chem.columbia.edu>
Date: Sun, 19 Mar 1995 22:49:02 -0500
In-Reply-To: "Simon Kilvington" <S.R.Kilvington@soton.ac.uk>
        "CCL:malloc etc. on DEC Alpha" (Mar 16,  6:13pm)
References: <199503161813.SAA27313@vision.soton.ac.uk>
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: "Simon Kilvington" <S.R.Kilvington@soton.ac.uk>, chemistry@ccl.net
Subject: Re: CCL:malloc etc. on DEC Alpha
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0


On Mar 16,  6:13pm, Simon Kilvington wrote:
> Subject: CCL:malloc etc. on DEC Alpha

> Konrad Hinsen wrote:
> > 
> > However, in all cases of malloc()-related crashes I have experienced
> > so far (and that is a large number), the code calling malloc() was at
> > fault. .....

This is my experience as well.  Whether the user error trashes the
malloc() arena or not depends essentially on luck.

> 	a (fairly) easy way to check for writing passed the end of malloc
> blocks is to replace calls to malloc with calls to a routine which claims
> slightly more space than is needed, puts some id characters at the start
> and end of the block eg "MALLOC_BLOCK" or something, and returns a ptr to
> the first byte after the id....

You can also use the public-domain dbmalloc package, by Conor Cahill.
As I understand it, this package does things similar to what Konrad
suggests.  Conor also has a commercial package called Sentinel which
does fancier things as well.

I've had great success with dbmalloc over the years -- most recently,
about two weeks ago!

	-P.

-- 
************************ The secret of life: *************************
*Peter S. Shenkin, Box 768 Havemeyer Hall, Chemistry, Columbia Univ.,*
* New York, NY  10027;     shenkin@columbia.edu;     (212) 854-5143  *
************* If you find a loose thread, don't pull it. *************


