title: EXC_BAD_ACCESS(code=1, address=0x0) occurs when passing a std::map as parameter to a virtual function call
body: <p>I have a class that has the following virtual function</p>
  
  <pre><code>namespace Book
  {
  class Secure
  {
  virtual Result setPassword(const std::map&lt;std::string, std::vector&lt;std::string&gt; &gt;&amp; params)=0;
  
  }
  }
  </code></pre>
  
  <p>I have another test class in which a method gets the password and user name from the excel and sets it to the map secureParams and sets the password for the current file.</p>
  
  <pre><code>bool initialize(std::string bookPath, std::string loginPath, std::string userName, std::string password)
  
  {
  Book::SharedPtr&lt;Book::Secure&gt; secure;
  bool result;
  std::map&lt;std::string, std::vector&lt;std::string&gt; &gt; secureParams;
  
  std::vector&lt;std::string&gt; userNames;
  std::vector&lt;std::string&gt; passwords;
  
  userNames.push_back(userName);
  passwords.push_back(password);
  
  secureParams.insert(std::pair&lt;std::string, std::vector&lt;std::string&gt;&gt;("USERNAME",userNames);
  secureParams.insert(std::pair&lt;std::string, std::vector&lt;std::string&gt;&gt;("PASSWORD",passwords);
  
  secure-&gt;setPassword(secureParams);
  
  secure-&gt;getLoginFile(loginPath.c_str());
  
  result=Book::SecureBook::canLogin(bookPath.c_str(),secure);
  
  return result;
  
  }
  </code></pre>
  
  <p>The code when run terminates saying Unknown File: Failure
  Unknown C++ exception thrown in test body.</p>
  
  <p>When debugged in XCode it shows a EXC_BAD_ACCESS(code=1,address=0xc0000000) error in the line secure->setPassword(secureParams);</p>
  
  <p>I have been trying to debug the issue all day. Any help is appreciated :)</p>
  
  <p>Thanks in advance :)</p>