You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a Segmentation Fault in the Tree Sitter Python bindings, which can happen with complex Queries. A python example to reproduce the error is attached here.
Dependencies
tree-sitter==0.23.1
tree-sitter-cpp==0.23.1
Precondition
Install dependencies - requirements.txt is contained in zip
Reproduce
Run python3 main.py from the zip
Error
Running a complex Query with Alternations and Predicates results in a segmentation fault in the Python Bindings.
I am aware now, that the problematic predicate is redundant and I have since removed it from my final program. But it should not produce a segmentation fault. You can test, by removing and adding the predicate at line 18 in my test program (@name (#eq? @name @class_names)) to see the difference.
The core dump suggests a self Null Pointer at node_get_text line 515 in "node.c", called from satisfies_eq_captures line 74 in "query_predicates.c". The first parameter passed in this call is null:
I found a Segmentation Fault in the Tree Sitter Python bindings, which can happen with complex Queries. A python example to reproduce the error is attached here.
Dependencies
tree-sitter==0.23.1
tree-sitter-cpp==0.23.1
Precondition
Install dependencies - requirements.txt is contained in zip
Reproduce
Run
python3 main.py
from the zipError
Running a complex Query with Alternations and Predicates results in a segmentation fault in the Python Bindings.
I am aware now, that the problematic predicate is redundant and I have since removed it from my final program. But it should not produce a segmentation fault. You can test, by removing and adding the predicate at line 18 in my test program (
@name (#eq? @name @class_names)
) to see the difference.The core dump suggests a self Null Pointer at
node_get_text
line 515 in "node.c", called fromsatisfies_eq_captures
line 74 in "query_predicates.c". The first parameter passed in this call is null:I didn't yet dive deeper and check why
PyList_GetItem
could return a null pointer here and if there should be a check somewhere.Here's a excerpt of the Core Dump:
The text was updated successfully, but these errors were encountered: