fix: pin tree-sitter below 0.26.0 to fix segfault - #315
Open
namelessnotion wants to merge 2 commits into
Open
Conversation
tree-sitter 0.26.0 reimplemented Point as a native tuple subclass (replacing the namedtuple), and that reimplementation has a memory safety bug that corrupts the heap when Point objects are repeatedly constructed/discarded, as chunking.py and query/__init__.py do. The corruption doesn't crash immediately, so `make test` segfaulted at different, seemingly unrelated tests across runs. Pinning to >=0.25.1,<0.26.0 (still excluding the aarch64-linux-broken 0.25.0) eliminates the crash. Also widen the exception handling in chunking.py's parser lookup to catch tree_sitter_language_pack's own Error hierarchy, not just LookupError: the currently locked tree_sitter_language_pack (1.14.3) raises DownloadError for an unrecognized language instead of the LookupError it used to raise, and normalize the re-raised exception back to LookupError so callers keep the same contract.
…gs in stderr in GitHub Linux runners microsoft/onnxruntime#27268
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## main #315 +/- ##
=======================================
Coverage 99.72% 99.72% =======================================
Files 25 25 Lines 1845 1845 =======================================
Hits 1840 1840 Misses 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 freeto 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.
tree-sitter 0.26.0 reimplemented Point as a native tuple subclass (replacing the namedtuple), and that reimplementation has a memory safety bug that corrupts the heap when Point objects are repeatedly constructed/discarded, as chunking.py and query/init.py do. The corruption doesn't crash immediately, so
make testsegfaulted at different, seemingly unrelated tests across runs. I observed similar behavior when runningvectorcode vectorise, segfaulting at different times. Pinning tree-sitter >=0.25.1,<0.26.0 eliminates the crash.Also widen the exception handling in chunking.py's parser lookup to catch tree_sitter_language_pack's own Error hierarchy, not just LookupError: the currently locked tree_sitter_language_pack (1.14.3) raises DownloadError for an unrecognized language instead of the LookupError it used to raise, and normalize the re-raised exception back to LookupError so callers keep the same contract.