Patch ping

Ian Lance Taylor ian@airs.com
Fri Oct 7 18:06:00 GMT 2005


Paolo Carlini <pcarlini@suse.de> writes:

> Ian Lance Taylor wrote:

> >Patch for 4.1 regression PR libstdc++/13583 (limited memory leak in
> >threaded program):
> >    http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01550.html
> >  
> >
> Ian, I think your approach has a serious problem: we end up with
> different mutexes in different translation units (locale_facets.tcc is
> included byt <locale>) and this doesn't seem safe, in general.
> 
> I would be happy to be wrong, because the same approach would solve
> another issue in our shared_ptr code, as you may have noticed. Is there
> something I'm missing?

You're quite right.  My patch is completely bogus.  Thanks for
noticing that.

It would be easy to add a single instance of the mutex in
src/locale_init.cc.  But then code compiled with a newer version of
libstdc++ would not work with older versions of libstdc++.so, as there
would be an undefined symbol at link time.  Does that count as a bad
ABI change?  It would continue to be possible to use code compiled
with older versions of libstdc++ with the new libstdc++.so; the older
code just wouldn't use the mutex when initializing the cache.

Ian



More information about the Libstdc++ mailing list