http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52604
--- Comment #7 from Laurent Aflonsi <laurent.alfonsi at st dot com> 2012-04-10 15:28:07 UTC --- Ping ? Here is the patch proposed. ============================ --- libstdc++-v3/src/mt_allocator.cc 2011/08/04 07:56:49 2064 +++ libstdc++-v3/src/mt_allocator.cc 2012/04/03 08:45:48 2551 @@ -47,7 +47,9 @@ if (_M_thread_freelist_array) { __gthread_key_delete(_M_key); + _M_key = NULL; ::operator delete(static_cast<void*>(_M_thread_freelist_array)); + _M_thread_freelist = NULL; } } }; @@ -639,7 +641,10 @@ } } - __gthread_setspecific(freelist._M_key, (void*)_M_id); + if (freelist._M_key) + { + __gthread_setspecific(freelist._M_key, (void*)_M_id); + } } return _M_id >= _M_options._M_max_threads ? 0 : _M_id; } =====================================