From: Ondřej Surý Date: Wed, 14 Aug 2024 15:19:11 +0000 (+0000) Subject: fix: dev: Fix the assertion failure in the isc_hashmap iterator X-Git-Tag: v9.21.1~51 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=c31cd6778826b7adcfa3db8159686181c5b5bb9f;p=thirdparty%2Fbind9.git fix: dev: Fix the assertion failure in the isc_hashmap iterator When the round robin hashing reorders the map entries on deletion, we were adjusting the iterator table size only when the reordering was happening at the internal table boundary. The iterator table size had to be reduced by one to prevent seeing the entry that resized on position [0] twice because it migrated to [iter->size - 1] position. However, the same thing could happen when the same entry migrates a second time from [iter->size - 1] to [iter->size - 2] position (and so on) because the check that we are manipulating the entry just in the [0] position was insufficient. Instead of checking the position [pos == 0], we now check that the [pos % iter->size == 0], thus ignoring all the entries that might have moved back to the end of the internal table. Closes #4838 Merge branch '4838-fix-assertion-failure-in-hashmap-deletion-iterator' into 'main' Closes #4838 See merge request isc-projects/bind9!9292 --- c31cd6778826b7adcfa3db8159686181c5b5bb9f