Add Python regression test for #866 (SIGSEGV re-executing parameterized write via implicit cache) - #869
Merged
Conversation
Relates to #866. Submodule PR: LadybugDB/ladybug-python#53
adsharma
force-pushed
the
regression/issue-866-regression-test
branch
from
August 31, 2026 03:56
53d42d1 to
2f369be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tools/python_api(submodule PR: Add regression test for issue ladybug#866 (SIGSEGV re-executing parameterized write) ladybug-python#53).CREATE (:Contribution {id: $id, embedding: $embedding})) executed repeatedly viaConnection.execute()through the implicit prepared-statement cache, followed by a vector similarity read.Root cause analysis
The reported
QUERY_VECTOR_INDEX/ARRAY_COSINE_SIMILARITYSIGSEGV is not a vector-extension bug. On 0.20.0, re-executing a parameterized write query string takes the cached-physical-plan fast path (ClientContext::executeNoLock->PhysicalPlan::prepareForReuse()->ResultCollector::prepareForReuse()->FactorizedTable::clear()). A write statement's rootResultCollectorhas an empty result schema, and theFactorizedTableconstructor skips allocatingflatTupleBlockCollection/inMemOverflowBufferentirely for empty schemas, soclear()unconditionally dereferenced null (crash at0x8).Evidence gathered while reproducing:
EXC_BAD_ACCESSat0x8inlbug::processor::FactorizedTable::clear()underClientContext::executeWithParams.CREATEs segfaults; the identical vector flow (CREATE_VECTOR_INDEX+QUERY_VECTOR_INDEX+ARRAY_COSINE_SIMILARITY) with no parameterized queries runs cleanly.FactorizedTable::clear()added in d09008e, Bug: SIGSEGV re-executing a parameterized write query string (0.20.0 regression) #862), the issue's exact script and the new test pass.Verification
pytest exit=139), passes on main.prepareWithParamspath; this test covers the implicit-cache path used by the Python API (Connection.execute(query, params)), which is what the issue exercised.Relates to #866. No engine code changes needed (already fixed by d09008e for #862).