How to detect segmentation fault details using Valgrind?
- by Davit Siradeghyan
Hi all
I have a std::map< std::string, std::string which initialized with some API call. When I'm trying to use this map I'm getting segmentation fault. How can I detect invalid code or what is invalid or any detail which can help me to fix problem? Code looks like this:
std::map< std::string, std::string> cont;
some_func( cont ); // getting parameter by reference and initialize it
std::cout << cont[ "some_key" ] << '\n'; // getting segmentation fault here