-
Xing Zhang authored
MULTIPLE CONNECTION The crash caused by concurrent get_charset_number_internal() calls is because the std::unsorted_map::operator [] is not thread safe. When there are multiple threads, one might access the memory already freed by another one. There is also memory usage continuously increasing observed. This is because the collation name - collation id mapping allocs new buffer for new added collations, even when the collation doesn't exist at all. Fix: Check the existence of collation when getting its id by the mapping. The collation initialization should have been done in init_available_charsets() which is thread-safe with std::call_once. Change-Id: Ie604901a2dce5a1f1a794cdd2196bf5434f9202f
Xing Zhang authoredMULTIPLE CONNECTION The crash caused by concurrent get_charset_number_internal() calls is because the std::unsorted_map::operator [] is not thread safe. When there are multiple threads, one might access the memory already freed by another one. There is also memory usage continuously increasing observed. This is because the collation name - collation id mapping allocs new buffer for new added collations, even when the collation doesn't exist at all. Fix: Check the existence of collation when getting its id by the mapping. The collation initialization should have been done in init_available_charsets() which is thread-safe with std::call_once. Change-Id: Ie604901a2dce5a1f1a794cdd2196bf5434f9202f
Loading