STL related seg fault in C++ std::string?
Does anyone point when can the below seg fault occur, as below: - heap Corruption - Memory leak - Flaw in the STL implementation of Strings
0xf0f1d672 in std::__default_alloc_template<true, 0>::allocate(unsigned int) () from /usr/lib/libstdc++.so.5
To give some context, the stack trace is as below:
#0 0xf0f1d672 in std::__default_alloc_template<true, 0>::allocate(unsigned int) () from /usr/lib/libstdc++.so.5
#1 0xf10bdae1 in std::__simple_alloc<std::_Rb_tree_node<std::pair<std::string const, Calculator*> >, std::__default_alloc_template<true, 0> >::alloc开发者_高级运维ate(unsigned int) () from /export/work/install/lib/Plugin.so
From your stack trace it appears that you're creating a dynamically loaded .so
plugin. If the plugin interface uses heap allocation, you must generally make sure that the same instance of the runtime library is used on both sides of the plugin API boundary.
精彩评论