Repository navigation
Conversation
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.
NewTablet(..., 1 << 29)could corrupt native memory becausemem_allocaccepted auint32_tbyte count while Tablet initialization used the fullsize_tbuffer size. String preallocation also multiplied the row count in 32-bit arithmetic, and allocation failures could leave partially initialized buffers unsafe to release.Use
size_tthroughout the allocator and string-buffer capacity, and preserve the fullmaxRows * 32string preallocation. Valid row capacities attempt normal allocation; failures propagate as OOM without an artificial row or preallocation cap. Keep byte counts intact in allocation metadata and memory accounting, and check size arithmetic before it can wrap. Propagate string and bitmap allocation failures and safely clean up partial initialization.Use unsigned row indices and device-segment boundaries consistently, fix bitmap and offset-array size arithmetic, and let the Go bridge accept the C ABI's positive
uint32_trow-count range. Actual string data still has to fit the existing signed Arrow offsets.Regression tests use injected allocation failures to verify complete requests at and above 4 GiB without allocating those buffers. They cover all supported Tablet types, every native constructor, C API OOM propagation, 32-byte-per-row string preallocation, 15 partial-initialization failure positions with balanced memory accounting, and filling and checking
2^20rows of DOUBLE, TEXT, BLOB, and STRING data.Validation on macOS arm64:
GOCACHE=/tmp/tsfile-go-build-cache go test -count=1 ./...passed.git diff --checkpassed.ASan/UBSan validation remains unavailable on this host: the system sanitizer runtime hangs during initialization before
main, and an alternative local runtime also fails during initialization. Sanitizer checks are not reported as passing.