How can I corrupt a shared library?
I have a process that attaches to several shared libraries. One action, eg createObject1 works 99% but 1% creates a pstack. The problem is not easy to reproduce, it happens sometimes in real time.
The shared library has an array of various Object1. Before writing the new Object1, we are doing a get operation in order to see if the object already exists. The array is defined static at global scop开发者_如何学运维e and every object in the array is a pointer to an Object1.
As I have already wrote 99% the code works fine. How can I debug the issue? Is it possible a memory leak to overwrite the static data of the shared library?
Code in Linux
http://www.valgrind.org/ would be my suggestion.
精彩评论