Commit Graph
1 Commits
Author SHA1 Message Date
weaselbotandandrew 3e28538a15 Keep Python key buffers alive in WriteRange/ReadRange
CI / release (arm64, ubuntu-latest-arm64) (pull_request) Successful in 3m29s
CI / pre-commit (pull_request) Successful in 2m16s
CI / test (-DCMAKE_BUILD_TYPE=Debug, debug) (pull_request) Successful in 3m39s
CI / test (-DCMAKE_CXX_FLAGS=-DUSE_64_BIT=1, 64-bit-versions) (pull_request) Successful in 3m39s
CI / test (-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++, gcc) (pull_request) Successful in 3m48s
CI / test (-DUSE_SIMD_FALLBACK=ON, simd-fallback) (pull_request) Successful in 3m36s
CI / release (amd64, ubuntu-latest-amd64) (pull_request) Failing after 4m30s
CI / coverage (pull_request) Failing after 3m31s
`write()` and `read()` created _Key objects from ephemeral ctypes arrays
backed by local bytearray objects. Once the helpers returned, those local
variables were freed, leaving the C library with dangling pointers when
addWrites()/check() later read the keys.

Store the backing bytearray on the returned WriteRange/ReadRange objects
as private `_begin_buf` / `_end_buf` attributes. Python keeps them alive
for the lifetime of the range object, so the C pointer is always valid.

Closes #42
2026-06-21 19:29:50 -04:00