Hi!
I'm using mpatrol 1.4.8. I have '???' in log file:
> mpatrol --dynamic ./leak
@(#) mpatrol 1.4.8 (02/01/08)
Copyright (C) 1997-2002 Graeme S. Roy
This is free software, and you are welcome to redistribute it under
certain
conditions; see the GNU Library General Public License for details.
For the latest mpatrol release and documentation,
visit http://www.cbmamiga.demon.co.uk/mpatrol.
operating system: UNIX
system variant: Linux
processor architecture: PowerPC
processor word size: 32-bit
object file format: BFD
dynamic linker type: SVR4
Log file generated on Wed Mar 17 13:54:40 2004
read 387 symbols from /home/Abrhan.tmp/mp/lib/libmpatrolmt.so
read 92 symbols from /home/Abrhan.tmp/mp/lib/libmpalloc.so
read 379 symbols from /home/Abrhan.tmp/mp/lib/libmpatrol.so
read 334 symbols from /home/Abrhan.tmp/lib2/libpthread.so.0
read 705 symbols from /home/Abrhan.tmp/lib/libbfd-2.10.0.33.so
read 246 symbols from /home/Abrhan.tmp/lib/libiberty.so
read 2180 symbols from /home/Abrhan.tmp/lib2/librwtool.so
read 1215 symbols from /home/Abrhan.tmp/lib2/libstdc++-libc6.1-2.so.3
read 742 symbols from /home/Abrhan.tmp/lib2/libm.so.6
read 3179 symbols from /home/Abrhan.tmp/lib2/libc.so.6
read 40 symbols from /home/Abrhan.tmp/lib2/libdl.so.2
read 29 symbols from /lib/ld.so.1
read 12 symbols from leak
FREE: operator delete (0x100111D8) [1024|-|-|-]
0x7FFFF950 ???
0x0FC3DC00 ???
0x100111D8 ???
0x10011188 ???
0x7FFFFCAC ???
0x100005A0 _start
ERROR: [INCOMP]: operator delete: 0x100111D8 was allocated with
operator new[]
0x100111D8 (9 bytes) {operator new[]:152:0} [1024|-|-|-]
0x7FFFF960 ???
0x00000001 ???
0x10011188 ???
0x7FFFFCAC ???
0x100005A0 _start
...
system page size: 4096 bytes
default alignment: 8 bytes
overflow size: 0 bytes
overflow byte: 0xAA
allocation byte: 0xFF
free byte: 0x55
allocation stop: 0
reallocation stop: 0
free stop: 0
unfreed abort: 0
small boundary: 32 bytes
medium boundary: 256 bytes
large boundary: 2048 bytes
lower check range: 0
upper check range: 0
check frequency: 1
failure frequency: 0
failure seed: 1079531680
prologue function: <unset>
epilogue function: <unset>
handler function: <unset>
log file: mpatrol.log
profiling file: mpatrol.out
tracing file: mpatrol.trace
program filename: leak
symbols read: 9540
autosave count: 0
freed queue size: 0
allocation count: 275
allocation peak: 131 (689475 bytes)
allocation limit: 0 bytes
allocated blocks: 131 (1553 bytes)
marked blocks: 0 (0 bytes)
freed blocks: 0 (0 bytes)
free blocks: 130 (793071 bytes)
internal blocks: 53 (868352 bytes)
total heap usage: 1662976 bytes
total compared: 0 bytes
total located: 2 bytes
total copied: 105053 bytes
total set: 1293356 bytes
total warnings: 0
total errors: 124
---------------------------------------------------
This is a small example what I'm testing (leak.cc):
#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include "rw/mempool.h"
int main(void)
{
RWMemoryPool *p[128];
size_t i;
for (i = 0; i < 128; i++)
{
if ((p[i] = new RWMemoryPool[9]) == NULL)
{
fputs("out of memory\n", stderr);
exit(0);
}
// sprintf(p[i], "test%lu", i * 100);
// puts(p[i]);
delete p[i];
}
return 0;
}
I use rwtool library for this example, but it seems the problem is
same for all libs in my real project. I rebuilt it with debug options,
no optimization. Library is not stripped.
> file librwtool.so.2
librwtool.so.2: ELF 32-bit MSB shared object, PowerPC or cisco 4500,
version 1 (SYSV), not stripped
If I replae new, delete in code with MP_NEW, MP_DELETE, some ??? were
replaced with correct symbols, but only in files where I used this macros.
Does anybody have any idea where is the problem?
Thank you.