This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Potential locking issue in newlocale
- From: Paolo Carlini <pcarlini at suse dot de>
- To: libc-alpha at sources dot redhat dot com
- Cc: Ulrich dot Weigand at de dot ibm dot com, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 16 Jul 2004 11:23:55 +0200
- Subject: Re: Potential locking issue in newlocale
Hi Ulrich, hi everyone
> And in fact, in one crash I have analysed, it looks as if glibc-internal
> data structures are corrupted.
As a very empirical data point, supporting your conjecture, a few days ago
I tried wrapping in a mutex the call of
locale::facet::_S_create_c_locale(__cloc, __s)
present in locale::_Impl::_Impl(const char*, size_t).
The former, I recall, is just:
void
locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
__c_locale __old)
{
__cloc = __newlocale(1 << LC_ALL, __s, __old);
if (!__cloc)
{
// This named locale is not supported by the underlying OS.
__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
"name not valid"));
}
}
and, to my *very* big surprise, the testcase did *not* fail anymore on 4-way
x86_64...
Thanks,
Paolo.