rs@mirror.TMC.COM (Rich Salz) (12/29/86)
I'm trying to track down a malloc() failure, no doubt because someone is writing n+1 bytes into an n-byte block. I'm pretty much at the point where I want to perform checking on all mallocated areas by putting guard words at either end, and running down the list and checking each time I call malloc. I know how to do this, but before I dig down and write it, I thought I'd ask around if anyone else has already done so. We have source licenses for 4.3BSD and SystemV Release 2 Version 2. I'll be happy to mail a copy of the license(s) to anyone who is willing to send me source code or diffs. Thanks in advance. /rs -- -- Rich $alz "Drug tests p**s me off" Mirror Systems, Cambridge Massachusetts rs@mirror.TMC.COM {mit-eddie, ihnp4, wjh12, cca, cbosgd, seismo}!mirror!rs
dennis@rlgvax.UUCP (Dennis Bednar) (01/07/87)
In article <1030@mirror.TMC.COM>, rs@mirror.TMC.COM (Rich Salz) writes: > > I'm trying to track down a malloc() failure, no doubt because > someone is writing n+1 bytes into an n-byte block. I'm pretty > much at the point where I want to perform checking on all > mallocated areas by putting guard words at either end, and > running down the list and checking each time I call malloc. > A package for a different type of malloc checker was once written here at rlgvax, but the source code is no longer on the disk. This malloc checker was developed to track down long running programs (daemons) that call malloc() but forget to call free(). There was a write-up of the ideas in an issue of the ACM (SigPlan Notices I think). I probably cannot even send you the source, because the system malloc.c routine was borrowed and massaged. Also, the code had a neat machine/compiler dependent (VAX and Power 6/32 only) feature, that saved the stack trace, and the post-mortem examiner tool used those addresses to tell you the calling subroutine that called malloc()! Maybe someone would like to submit a PD version of this, too? -- -Dennis Bednar {decvax,ihnp4,harpo,allegra}!seismo!rlgvax!dennis UUCP