简体   繁体   中英

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

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 scope 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/是我的建议。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM