🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #21

Re: Specific meaning of error msgs returned by malloc_error()?

#21
From: Greg Cockroft
Date: Wed, 28 Oct 1992 00:29
44 lines
1785 bytes
In article <6224@ucsbcsl.ucsb.edu> doug@foxtrot.ccmrc.ucsb.edu (Douglas  
Scott) writes:
> Can someone who has used the malloc debugging features of the compiler  
(via
> malloc_debug() and malloc_error()) please tell me the specific meaning  
of the
> following error messages:
> 
> node overflow
> node underflow
> free node trashed
> 

I'm assuming you are linking with MallocDebug since that is where these  
error strings exist.

  agog> strings /usr/lib/libMallocDebug.a | grep node
  node underflow: %p
  node overflow: %p
  free node trashed: %p

The malloc debug library places guard data at the beginning and end of  
malloced data, so I'm guessing that the overflow and underflows are  
corruptions of this guard data. Free node trashed means that you wrote  
over freed data.
In theory if you run /NextDeveloper/Apps/MallocDebug, the trashed data  
should be marked at the top when you look at malloced memory.

My personal favorite is to not use libMallocDebug.a but to pepper my code  
with a define that when enabled calls NXMallocCheck().

It will slow down your code, but nicely isolate where the memory trash is  
occurring. 


	-greg.	


-- 
Greg Cockroft                       greg@agog.com    
Agog, Inc.                          (517) 627-2186   fax 2673
13780 North River Highway
Grand Ledge, MI  48837
Technical Details
Message-ID: <1992Oct28.002917.2169@agog.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!yale.edu!nigel.msen.com!heifetz!agog!greg
References: <6224@ucsbcsl.ucsb.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!yale.edu!nigel.msen.com!heifetz!agog!greg
From: greg@agog (Greg Cockroft)
Subject: Re: Specific meaning of error msgs returned by malloc_error()?
Message-ID: <1992Oct28.002917.2169@agog.com>
Sender: greg@agog.com (Greg Cockroft)
Organization: Agog, Inc.
References: <6224@ucsbcsl.ucsb.edu>
Date: Wed, 28 Oct 1992 00:29:17 GMT
Lines: 44