title: Std::map throws bad_alloc when making new entry in another thread
body: <p>I'm using GCC 4.4.7. I have a map of type <code>map&lt;int, string&gt;</code>. I find whenever I'm trying to access it from another thread, <code>terminate called without an active exception</code> is thrown. It works when I initialize a entry in the main thread and then access in it another thread. I reproduced the error using this code</p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;   
  #include &lt;thread&gt;
  
  using namespace std;
  
  
  
  class A {
  public:
      void start() {
          while(1) {
              mp["random"] = 2;
          }
      }
  private:
      map&lt; int , string &gt; mp_1;
      map&lt;string, int&gt; mp;
  
  };
  
  int main() {
      A * a = new A();
      std::thread t;
      cout &lt;&lt; "opening new thread" &lt;&lt; std::endl;
      t = std::thread(std::bind(&amp;A::start, a));
  }
  </code></pre>
  
  <p>Can anyone help? Thanks.</p>