| [Top] | [Contents] | [Index] | [ ? ] |
On many systems this actually a C++ compiler by default, and should be a C++ compiler if you wish to use the C++ operators.
Also available on DG/UX 4.20MU05 with patch dgux_R4.20MU05.p59 and DG/UX 4.20MU06 with patch dgux_R4.20MU06.p08.
Or more accurately, at link time.
Or per thread on some systems.
There is currently at least one garbage collection package available for C and C++ (see section K. Related software).
Some compilers now support variable length arrays which provide roughly the same functionality.
Well, perhaps that's too harsh a word, but it will certainly seem that way to a process running on a 32-bit UNIX system with only 4 megabytes of physical memory, and yet it will be able to read from and write to over 4 gigabytes of virtual memory!
The size of a page varies between operating systems and processor architectures, but they are generally around 4 or 8 kilobytes in size, and are always a power of two.
DLLs on Windows platforms.
The operating system is still considered software.
Due to the overhead of having to translate every address and swap in and out pages -- although memory mapped files will usually be more efficient than using normal file operations on a system without virtual memory.
Usually part of the Application Binary Interface, or ABI.
A process also known as stack unwinding.
Also known as the return address.
Reduced Instruction Set Computer.
Complex Instruction Set Computer.
Generally known as a line number table.
Which is the part of the operating system that performs the run-time linking of shared libraries.
Where the kernel is effectively a single process running all user programs as threads.
In mpatrol release 1.0 it was enabled by default.
Commonly known as overflow buffers or fence posts.
This is a feature that was first used by Electric Fence (see section K. Related software) to track down memory corruption.
Unless you've linked the debugger with the mpatrol library.
The other reason that this program is simple is because a proper example would generally involve crashing the program, but on AmigaOS and Netware that would also involve crashing the system -- not something you'd want to do whilst trying this out.
A sample GDB command file for use with mpatrol can be found in `extra/.gdbinit'.
Actually, it's not really the mpatrol library that
uses the memory but the object file access libraries since they call
malloc() to allocate any memory that they require.
A set of tests that run without user intervention.
If that information is not available then the function name or return address will be used instead.
Dbmalloc is copyright (C) 1990-1992 Conor P. Cahill.
Dmalloc is copyright (C) 1992-2001 Gray Watson.
A freely available version of the ELF access library, libelf, can be downloaded from ftp://sunsite.unc.edu/pub/Linux/libs/.
The GNU BFD access library can be downloaded from ftp://ftp.gnu.org/.
The `--call-graph' option is only needed to display the allocation call graph table, which is not normally displayed by default.
If no symbols could be read from the program's executable file, or if the corresponding symbol could not be determined, then the function names will be replaced with the code addresses at which the calls took place.
Cycles in the graph are marked by dashed lines along the relevant edges instead of solid lines.
The mpatrol version of
xmalloc() was not used in this case since another version of
xmalloc() was originally statically linked into the program being run,
and so could not be overridden.
You might also have noticed the dotted lines connecting
do_spec_1() and handle_braces() in the previous graph.
Graphical User Interface.
The actual allocation events from this do not appear since they were internal memory allocations.
Note that the `LOGMEMORY' option isn't listed which is why `LOGALL' wasn't listed either.
Such as for use in a linked list.
A freely distributably library called GC (see section K. Related software).
If you can, why are you reading this -- you've already read it!
The mpatrol library comes with the xmalloc() and
MP_MALLOC() families of functions.
Whether they are documented or not.
This information may also be filled in if the
`USEDEBUG' option or the mpsym command is used and supported,
and if debugging information about the call to malloc() is available.
The error can be turned into a warning with the `ALLOWOFLOW' option which will also force the operation to be performed.
On UNIX
systems with dynamic linking it might also be possible to run the program under
the mpatrol command with its `--dynamic' option without having
to recompile or relink, but compiling and linking with the mpatrol library is a
more generic solution across different platforms.
This is not strictly necessary on UNIX and Windows
platforms (and AmigaOS when using gcc), but it does give us more
debugging information.
Note that the start address of the allocation has changed slightly since we added padding around it with the `OFLOWSIZE' option.
This is really only necessary when the mpatrol library has been built as a shared library.
This is not necessarily the fault of the debugger or the debugging information generated by the compiler since on most platforms such watch points can only be caught after they occur, hence most debuggers show the next statement to be executed rather than the current one.
The file `extra/magic' contains
a UNIX magic file excerpt for automatically identifying an mpatrol log
file, an mpatrol profiling output file and an mpatrol tracing output file with
the file command.
You will
also have to make any changes to pagesize() in `src/mpalloc.c' and
possibly also have to define MP_MEMALIGN_SUPPORT in `src/config.h'
if the new system supports the memalign() function.
Although some do, and you can follow the instructions for CISC processors above in order to provide stack traversal support for them.
You might also be interested to note that you can safely call
malloc() in this code to allocate memory -- just remember to clean up
after yourself!
There is currently a library called StackTrace written by Bjorn Reese which invokes a debugger to generate a stack traceback on certain UNIX platforms. This method would be too slow for mpatrol to use though.
Looking back at these statements about six months after they were written, it would appear that I have just written such a library judging by the number of architectures for which stack traversal is now supported.
This code can be applied as an mpatrol library patch which can be downloaded from http://www.cbmamiga.demon.co.uk/mpatrol/patches/mpatrol_patch1.tar.gz.
And perhaps also make the mptools library threadsafe as well
If you really really want this functionality then code to do this is available as an mpatrol library patch which can be downloaded from http://www.cbmamiga.demon.co.uk/mpatrol/patches/mpatrol_patch4.tar.gz.
There
is an mpatrol library patch that supports reading symbols from shared libraries
opened by dlopen() which can be downloaded from
http://www.cbmamiga.demon.co.uk/mpatrol/patches/mpatrol_patch2.tar.gz.
This list can be considered to be a slightly more up to date version of Debugging Tools for Dynamic Storage Allocation and Memory Management (http://www.cs.colorado.edu/~zorn/MallocDebug.html) by Ben Zorn (zorn@microsoft.com).
| [Top] | [Contents] | [Index] | [ ? ] |