From d603de4a87f1c3632fdf57e3fe5e49c557ad94ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Wed, 3 Apr 2024 12:51:15 +0300 Subject: [PATCH] =?UTF-8?q?mdbx:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D1=80=D0=B8=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B9=20=D0=BE=D1=88=D0=B8=D0=B1?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B2=20`TXN=5FFOREACH=5FDBI=5FFROM`.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Какие-либо выпуски и стабильные ветки не были затронуты проблемой. Ошибка была внесена 2023-11-05 коммитом e6af7d7c53428ca2892bcbf7eec1c2acee06fd44 в ветку `devel`. Большое спасибо команде Erigon и особенно Алексею Шарову за помощь в поиске причины проблемы. --- src/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.c b/src/core.c index 6d000e9a..9038b8ef 100644 --- a/src/core.c +++ b/src/core.c @@ -3924,8 +3924,10 @@ static __inline size_t dbi_bitmap_ctz(const MDBX_txn *txn, intptr_t bmi) { bitmap_item = TXN->mt_dbi_sparse[0] >> FROM, I = FROM; \ I < TXN->mt_numdbs; ++I) \ if (bitmap_item == 0) { \ - I |= bitmap_chunk - 1; \ + I = (I - 1) | (bitmap_chunk - 1); \ bitmap_item = TXN->mt_dbi_sparse[(1 + I) / bitmap_chunk]; \ + if (!bitmap_item) \ + I += bitmap_chunk; \ continue; \ } else if ((bitmap_item & 1) == 0) { \ size_t bitmap_skip = dbi_bitmap_ctz(txn, bitmap_item); \