To: chrisa AT meaddata DOT com (Chris Anderson) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Malloc Tracing Date: Mon, 15 Aug 1994 10:49:56 PDT From: "Marty Leisner" In message <9408151443 DOT AA21869 AT moscow DOT meaddata DOT com>you write: >Three questions: > >1) I just put 1.12 on a Dell 486-33. When I compile it complains >with the message: > > Unsupported INT 0x06 > Invalid Opcode at eip=d867 > int 6 is the invalid opcode...What are you running? I have compaq-dos 6.2 with windows 3.1, and I think int 6 just hangs the machine... > >2) I had recieved a note about a program that traces calls to malloc and >free and reports if they match or not. Can someone give me the name >of this program or a pointer to where I can find it. I have this ported to djgpp... Its very nice: ------------------------------------------------------------------------------- $Id: README,v 1.38 1994/03/20 17:13:33 gray Exp $ ------------------------------------------------------------------------------- MALLOC_DEBUG: The malloc_dbg library has been designed as a drop in replacement for the system's malloc, realloc, calloc, free and other memory management routines while providing powerful heap-memory debugging facilities. It is also reasonably portable having been successfully run on the following operating systems: BSDI, SunOS, Solaris, AIX, Ultrix, OSF, Irix, HPUX, and probably a couple others. ------------------------------------------------------------------------------- See the INSTALL file for installation notes. ------------------------------------------------------------------------------- ANTAIRE REPOSITORY: Currently, you can get the newest versions of the malloc_dbg library from anonymous ftp via ftp.antaire.com in the /antaire/src/malloc_dbg directory. The versions in this repository also include such files as a postscript version of the manual and other large files which may not have been included in the distribution you received. OTHER REPOSITORIES: You can also get a recent version from anonymous ftp via gatekeeper.dec.com in the /pub/misc/malloc_dbg directory. This repository has been made available through the generosity of the Digital Equipment Corporation with special help from Dave Hill and the gatekeepers. Thanks much to them all. ------------------------------------------------------------------------------- DOCUMENTATION: Examine the malloc.info file. Is is a gnu-info file having the user-documentation for the malloc subsystem. It can be installed in the emacs info directory and read with emacs/info or the info program available from the texinfo package at GNU archive sites. It is also suitable for reading as text. It can be reproduced from the malloc.texi texinfo file which also can generate TeX hardcopy output with the help of the texinfo.tex file. A malloc.ps postscript file may also have been included for you TeX-less folks. Important sections from malloc.info: * Overview:: General debugging concepts. * Debug Tokens:: Description of the debugging token flags. * Extensions:: Additional non-standard routines. * Malloc_dbg Program:: Env variable setting utility. * Debugging with the Library:: How to debug problems with the library ------------------------------------------------------------------------------- GENERAL: - the system is pretty dependent on a good ansi-c compiler like gcc. Non-ansi folks might have to: - add some sort of ansi option to your compiler. if there is one let me know and I will add it to the configure script. - first try 'make noansi' which will try and run the Deansify.pl perl script. It takes care of: - changing stdarg.h and ... to varargs.h and va_alist - changing all (void *) references to (char *). - fixing all functions to remove foo(char * var) decls. - if it doesn't work you may have to do Deansify.pl's job by hand. - the file Manifest contains a list of each of the files and what it does. - configure can be regenerated by the autoconf script (versions 1.6 and above) - this malloc has never been (and maybe never will be) optimized for space nor speed. it is *very* wasteful and while handling large allocations or tons of concurrent small allocations, the heap can quickly become huge. ------------------------------------------------------------------------------- ARGV LIBRARY: My argv library which should have been included with this package (argv.[ch], argv_loc.h). I use it with all my binaries. It is like getopt in that it provides a standardized way of processing arguments but I find it significantly better. You have to write no C code to do the actual processing, it handles short -l and long --logfile style options, gives standard short and long usage messages, and many other features while trying to comply with POSIX specs. For copies of the library, try ftp.antaire.com in the /antaire/src/argv directory. ------------------------------------------------------------------------------- THANKS: Many net folk contributed to the library and my thanks goes out to them all. Special thanks, however, to my core contributors/testers: Scott Michel, Greg Sylvain, Bali Jatinder, Marc Evans, Dave Hill, Manfred Hauswirth, Richard Birnbaum, and Francois Pinard. ------------------------------------------------------------------------------- AUTHOR: If you have any questions, comments, or problems feel free to send me mail. gray DOT watson AT antaire DOT com -------------------------------------------------------------------------------