This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/13583] New: __use_cache not threadsafe
- From: "peturr02 at ru dot is" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2004 12:17:18 -0000
- Subject: [Bug libstdc++/13583] New: __use_cache not threadsafe
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This fragment in __use_cache (taken from the 3.3 branch) is not threadsafe:
if (__builtin_expect(!__cache, false))
{
__cache = new __locale_cache<_Facet>(__loc);
__loc._M_impl->_M_install_cache(__cache, __i);
}
If this code is executed by two threads at the same time, two instances of
the cache are created, of which one will be leaked.
The version on mainline has the same problem.
Since __use_cache first appeard in 3.3.1, this is a regression.
--
Summary: __use_cache not threadsafe
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: peturr02 at ru dot is
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13583