B
bluekite2000
My program has a bunch of matrix objects, all of which were allocated
w/ new and deallocated w/ delete. When valgrind runs, it gives me all
these errors such as
invalid read of size...
Address 0x25BC5694 is 4 bytes after a block of size 160 alloc'd
==25239== at 0x25985639: operator new[](unsigned)
(vg_replace_malloc.c:138)
invalid write of size...
Address 0x25BC91B4 is 4 bytes after a block of size 40 alloc'd
==25239== at 0x25985639: operator new[](unsigned)
(vg_replace_malloc.c:138)
And when my program exits, similar errors occur
invalid read of size...
at 0x804AEA4: Matrix<std::complex<float> >::~Matrix() (matlib2.h:424)
==25239== by 0x804A08B: main (test2.cc:153)
==25239== Address 0x25BE5B40 is 0 bytes inside a block of size 8
free'd
==25239== at 0x25985AB5: operator delete[](void*)
(vg_replace_malloc.c:161)
....
No malloc'd blocks -- no leaks are possible.
The output of my program is correct however.
PS: I tried a bt on gdb and the cursor points to my matrix destructor's
function. But I dont understand what that means really.
Thanx for ur help.
w/ new and deallocated w/ delete. When valgrind runs, it gives me all
these errors such as
invalid read of size...
Address 0x25BC5694 is 4 bytes after a block of size 160 alloc'd
==25239== at 0x25985639: operator new[](unsigned)
(vg_replace_malloc.c:138)
invalid write of size...
Address 0x25BC91B4 is 4 bytes after a block of size 40 alloc'd
==25239== at 0x25985639: operator new[](unsigned)
(vg_replace_malloc.c:138)
And when my program exits, similar errors occur
invalid read of size...
at 0x804AEA4: Matrix<std::complex<float> >::~Matrix() (matlib2.h:424)
==25239== by 0x804A08B: main (test2.cc:153)
==25239== Address 0x25BE5B40 is 0 bytes inside a block of size 8
free'd
==25239== at 0x25985AB5: operator delete[](void*)
(vg_replace_malloc.c:161)
....
No malloc'd blocks -- no leaks are possible.
The output of my program is correct however.
PS: I tried a bt on gdb and the cursor points to my matrix destructor's
function. But I dont understand what that means really.
Thanx for ur help.