Run the maxVersion "borrowed range version" check
CI / test (arm64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 22, https://minio.weaselab.dev/public/aarch64/msan-toolchain-22.1.8.tar.zst, debug-arm64, ubuntu-latest-arm64) (pull_request) Successful in 4m17s
CI / release (arm64, , ubuntu-latest-arm64) (pull_request) Successful in 3m31s
CI / pre-commit (pull_request) Successful in 2m44s
CI / test (amd64, -DCMAKE_BUILD_TYPE=Debug -DMSAN_TOOLCHAIN_PATH=/opt/msan, 21, https://minio.weaselab.dev/public/x86_64/msan-toolchain-21.1.8.tar.zst, debug, ubuntu-latest-amd64) (pull_request) Successful in 4m21s
CI / test (amd64, -DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 21, , 64-bit-versions, ubuntu-latest-amd64) (pull_request) Successful in 3m34s
CI / test (amd64, -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, 21, , gcc, ubuntu-latest-amd64) (pull_request) Successful in 3m30s
CI / test (amd64, -DUSE_SIMD_FALLBACK=ON, 21, , simd-fallback, ubuntu-latest-amd64) (pull_request) Successful in 3m34s
CI / release (amd64, -DMSAN_TOOLCHAIN_PATH=/opt/msan, ubuntu-latest-amd64) (pull_request) Successful in 5m58s
CI / coverage (pull_request) Successful in 3m59s

checkMaxVersion derived the key to look up from getSearchPath(root), but
`root` is the tree root, which is always the empty string. strinc("")
fails, so the block accounting for the range version of the first key
after the node's subtree never ran, for any node of any input, since it
was introduced in 9363d78. Use the node's own search path so the block
runs (and so `root` is left doing only what it was meant to do: being the
base of the search).

firstGeqLogical(), whose only caller is that block, dereferenced a null
sibling when the search key sorts after every key in the tree. It now
returns nullptr there, matching firstGeqPhysical().

Closes #95
This commit is contained in:
weaselbot committed 2026-11-10 16:05:49 -05:00
1 parent e23018c952
commit 3d997d5c57
1 file changed
+6 -1
+6 -1
View File
@@ -5631,6 +5631,9 @@ Node *firstGeqLogical(Node *n, const TrivialSpan key) {
goto downLeftSpine;
} else {
n = nextSibling(n);
if (n == nullptr) {
return nullptr;
}
goto downLeftSpine;
}
}
@@ -5928,7 +5931,9 @@ checkMaxVersion(Node *root, Node *node, InternalVersionT oldestVersion,
expected = std::max(expected, child->entry.rangeVersion);
}
}
auto key = getSearchPath(root);
// Account for the range version of the first key after `node`'s subtree: a
// range write spanning the subtree is recorded there.
auto key = getSearchPath(node);
bool ok;
auto inc = strinc(key, ok);
if (ok) {