The phtree_multimap_d_test fails when setting NUM_DUPL = 10.
Specifically, the PhTreeMMDTest.TestUpdateWithEmplaceHint test fails with core dump.
Tested with: Ubuntu 22.04, gcc 12.3, ASAN enabled
This problem occurs only in the following scenario:
auto iter = find(p1, ..);
erase(p1, ...);
emplace_hint(iter, p2);
Reusing iter after erase() looks very dangerous, but should be alright in this scenario, emplace_hint has actually been designed to work with iterators after a single erase() occurred. However, in this case it does not appear to work, either because the returned iterator is wrong (unlikely) or because emplace_hint() does not handle the iterator correctly.
The result is that emplace_hint() inserts the entry at the wrong location.
The
phtree_multimap_d_test
fails when settingNUM_DUPL = 10
. Specifically, thePhTreeMMDTest.TestUpdateWithEmplaceHint
test fails with core dump.Tested with: Ubuntu 22.04, gcc 12.3, ASAN enabled
This problem occurs only in the following scenario:
Reusing
iter
aftererase()
looks very dangerous, but should be alright in this scenario,emplace_hint
has actually been designed to work with iterators after a singleerase()
occurred. However, in this case it does not appear to work, either because the returned iterator is wrong (unlikely) or becauseemplace_hint()
does not handle the iterator correctly.The result is that
emplace_hint()
inserts the entry at the wrong location.