开发者

pstack in a shared library (c/c++). Corrupted shared library

开发者 https://www.devze.com 2023-02-15 11:16 出处:网络
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, i

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消