This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]