For tests that call uselocale(), the locale is stored in the g_userlocale_key thread-specific key. If freelocale() is called later, then g_uselocal_key points to a deleted pointer. CTS eventually calls vfprintf to print the result, which calls MB_CUR_MAX and MB_CUR_MAX accesses the deleted locale stored in g_uselocale_key, causing unpredictable errors. Fixed the tests by calling uselocale() with the old locale before calling freelocale. (cherry-pick of 8a46cf0fcf82b8c76e05be7e066ec854f974603a.) Bug: 17299565 Change-Id: I87efa2a9b16999a11d587f68d3aeedcbe6ac8a2c
20 KiB
20 KiB