7eb138a9e5
Each locale embeds a lazily initialized lconv which is populated by localeconv(3) and localeconv_l(3). When setlocale(3) updates the global locale, the lconv needs to be (lazily) reinitialized. To signal this, we set flag variables in the locale structure. There are two problems: - The flags are set before the locale is fully updated, so a concurrent localeconv() call can observe partially initialized locale data. - No barriers ensure that localeconv() observes a fully initialized locale if a flag is set. So, move the flag update appropriately, and use acq/rel barriers to provide some synchronization. Note that this is inadequate in the face of multiple concurrent calls to setlocale(3), but this is not expected to work regardless. Thanks to Henry Hu <henry.hu.sh@gmail.com> for providing a test case demonstrating the race. PR: 258360 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31899 |
||
---|---|---|
.. | ||
ascii.c | ||
big5.5 | ||
big5.c | ||
btowc.3 | ||
btowc.c | ||
c16rtomb_iconv.c | ||
c16rtomb.c | ||
c32rtomb_iconv.c | ||
c32rtomb.c | ||
collate.c | ||
collate.h | ||
collcmp.c | ||
ctype_l.3 | ||
ctype.3 | ||
ctype.c | ||
cXXrtomb_iconv.h | ||
DESIGN.xlocale | ||
digittoint.3 | ||
duplocale.3 | ||
euc.5 | ||
euc.c | ||
fix_grouping.c | ||
freelocale.3 | ||
gb2312.5 | ||
gb2312.c | ||
gb18030.5 | ||
gb18030.c | ||
gbk.5 | ||
gbk.c | ||
isalnum.3 | ||
isalpha.3 | ||
isascii.3 | ||
isblank.3 | ||
iscntrl.3 | ||
isctype.c | ||
isdigit.3 | ||
isgraph.3 | ||
isideogram.3 | ||
islower.3 | ||
isphonogram.3 | ||
isprint.3 | ||
ispunct.3 | ||
isrune.3 | ||
isspace.3 | ||
isspecial.3 | ||
isupper.3 | ||
iswalnum_l.3 | ||
iswalnum.3 | ||
iswctype.c | ||
isxdigit.3 | ||
ldpart.c | ||
ldpart.h | ||
lmessages.c | ||
lmessages.h | ||
lmonetary.c | ||
lmonetary.h | ||
lnumeric.c | ||
lnumeric.h | ||
localeconv.3 | ||
localeconv.c | ||
Makefile.inc | ||
mblen.3 | ||
mblen.c | ||
mblocal.h | ||
mbrlen.3 | ||
mbrlen.c | ||
mbrtoc16_iconv.c | ||
mbrtoc16.c | ||
mbrtoc32_iconv.c | ||
mbrtoc32.c | ||
mbrtocXX_iconv.h | ||
mbrtowc.3 | ||
mbrtowc.c | ||
mbsinit.3 | ||
mbsinit.c | ||
mbsnrtowcs.c | ||
mbsrtowcs.3 | ||
mbsrtowcs.c | ||
mbstowcs.3 | ||
mbstowcs.c | ||
mbtowc.3 | ||
mbtowc.c | ||
mskanji.5 | ||
mskanji.c | ||
multibyte.3 | ||
newlocale.3 | ||
nextwctype.3 | ||
nextwctype.c | ||
nl_langinfo.3 | ||
nl_langinfo.c | ||
nomacros.c | ||
none.c | ||
querylocale.3 | ||
rpmatch.3 | ||
rpmatch.c | ||
rune.c | ||
runefile.h | ||
runetype.c | ||
setlocale.3 | ||
setlocale.c | ||
setlocale.h | ||
setrunelocale.c | ||
Symbol.map | ||
table.c | ||
toascii.3 | ||
tolower.3 | ||
tolower.c | ||
toupper.3 | ||
toupper.c | ||
towlower.3 | ||
towupper.3 | ||
uselocale.3 | ||
utf8.5 | ||
utf8.c | ||
wcrtomb.3 | ||
wcrtomb.c | ||
wcsftime.3 | ||
wcsftime.c | ||
wcsnrtombs.c | ||
wcsrtombs.3 | ||
wcsrtombs.c | ||
wcstod.3 | ||
wcstod.c | ||
wcstof.c | ||
wcstoimax.c | ||
wcstol.3 | ||
wcstol.c | ||
wcstold.c | ||
wcstoll.c | ||
wcstombs.3 | ||
wcstombs.c | ||
wcstoul.c | ||
wcstoull.c | ||
wcstoumax.c | ||
wctob.c | ||
wctomb.3 | ||
wctomb.c | ||
wctrans.3 | ||
wctrans.c | ||
wctype.3 | ||
wctype.c | ||
wcwidth.3 | ||
wcwidth.c | ||
xlocale_private.h | ||
xlocale.3 | ||
xlocale.c |