unlink rolled-back keys from hash buckets on insert rollback - #1188
unlink rolled-back keys from hash buckets on insert rollback#1188Ramya-9353 wants to merge 1 commit into
Conversation
|
An automated preview of the documentation is available at https://1188.json.prtest2.cppalliance.org/libs/json/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-08-18 13:36:10 UTC |
|
GCOVR code coverage report https://1188.json.prtest2.cppalliance.org/gcovr/index.html Build time: 2026-08-18 13:58:14 UTC |
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1188 +/- ##
===========================================
+ Coverage 93.71% 93.76% +0.05%
===========================================
Files 85 85
Lines 8971 8986 +15
===========================================
+ Hits 8407 8426 +19
+ Misses 564 560 -4
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|

Repro: bulk-insert a range or initializer_list into a hash-mode object that already has spare capacity, where a later element throws (e.g. an allocation failure) after an earlier one has been inserted; a subsequent lookup reads a freed key (ASAN heap-use-after-free in
find_in_object).Cause: on the no-reallocation path
revert_insert::destroyrolls back the partially inserted elements and the size, butinsert_implhas already linked each of them into a bucket chain, and those bucket heads are left pointing at the slots that are then destroyed.Fix: unlink the rolled-back elements from their buckets in
revert_insert::destroy, on the no-reallocation path only, before they are destroyed. Both bulk-insert overloads share this path. Regression test intest/object.cppfails under ASAN before the change and passes after.