J
John Black
Hi,
In debugging a core dump, I run purify against my code, it says
several "Free Memory Read" errors. All the errors are on one delete
statement. Usually this means some pointer is deleted by non-owner. But
it is really hard to locate the error code.
The code structure is like this:
class BigClass{ // this is from somebody else code
......
}
// following is my code
BigClass* big = new BigClass();
... operation on big ...
delete big;
The core dump is on "delete big;", and purify says that it trying to
free 4 bytes at 0x123456 which passes 85 bytes of a freed block, and
that block is generated by func1().
The problem is func1() is a very basic function which is called all
over the code, so I have no clue to know the high level constructor.
Wondering if you have any suggestion in catch such kind of error.
Thanks.
In debugging a core dump, I run purify against my code, it says
several "Free Memory Read" errors. All the errors are on one delete
statement. Usually this means some pointer is deleted by non-owner. But
it is really hard to locate the error code.
The code structure is like this:
class BigClass{ // this is from somebody else code
......
}
// following is my code
BigClass* big = new BigClass();
... operation on big ...
delete big;
The core dump is on "delete big;", and purify says that it trying to
free 4 bytes at 0x123456 which passes 85 bytes of a freed block, and
that block is generated by func1().
The problem is func1() is a very basic function which is called all
over the code, so I have no clue to know the high level constructor.
Wondering if you have any suggestion in catch such kind of error.
Thanks.