Peter Chan
asked on
C++ Problem to run - Heap Corruption Detected
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to all.
How to test and run the whole process for detecting the real reason?
How to test and run the whole process for detecting the real reason?
Heap corruption is often difficult to isolate.
One approach is to whittle away the most recent added code to revert back to where the problem did not occur. Once there, then add code back in a bit at a time and repeat (i.e., do it like a binary search).
Usually, looking for pointer operations is also a good place to start.
A free trial of Parasoft's Insure++ should identify the problem quickly.
https://www.parasoft.com/product/insure/
One approach is to whittle away the most recent added code to revert back to where the problem did not occur. Once there, then add code back in a bit at a time and repeat (i.e., do it like a binary search).
Usually, looking for pointer operations is also a good place to start.
A free trial of Parasoft's Insure++ should identify the problem quickly.
https://www.parasoft.com/product/insure/
ASKER
Thanks Phoffric.
Sara,
Any other advice to check, if I cannot identify the reason, within the codes?
those errors often happen if the index of an array was calculated wrongly and so an array accidently was accessed outside of the allocated memory. the developer has a good chance to find out where it goes wrong though it might not be so simple to correct the error if the program has some kind of complexity.
Sara,
Any other advice to check, if I cannot identify the reason, within the codes?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks Subrat.
How to start the exe in windbg and get the core dump?
How to start the exe in windbg and get the core dump?
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I have recommended this question be closed as follows:
Split:
-- sarabande (https:#a41600773)
-- phoffric (https:#a41601768)
-- Subrat (C++ windows/Linux) (https:#a41618470)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
frankhelk
Experts-Exchange Cleanup Volunteer
I have recommended this question be closed as follows:
Split:
-- sarabande (https:#a41600773)
-- phoffric (https:#a41601768)
-- Subrat (C++ windows/Linux) (https:#a41618470)
If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.
frankhelk
Experts-Exchange Cleanup Volunteer
2> Or if you have logs of your system/application (DBServer), it might help you look at your logs to see and find out some workflow or isolate some part of your code from logs which could point to the code where corruption might have happened.
3> Or run DBServer.exe in debug mode and enable break on exceptions setting in visual studio, and let it run so that the code stops when an exception happens.