py-tree-sitter: Segment Fault on linux arm after upgrading to 0.25.0

Initially discovered on Github Action testing job for my project that runs ubuntu-arm with various python versions: https://github.com/Davidyz/VectorCode/actions/runs/16411987376

Managed to reproduce on a rocky linux 9.5 VPS with the following snippet:

import tree_sitter_python as tspython
from tree_sitter import Language, Parser

PY_LANGUAGE = Language(tspython.language())
parser = Parser(PY_LANGUAGE)
tree = parser.parse(
    bytes(
        """
def foo():
    if bar:
        baz()
""",
        "utf8",
    )
)

# print(tree.root_node())

Library versions:

$ uv pip freeze | grep tree-sitter
tree-sitter==0.25.0
tree-sitter-python==0.23.6

UPDATE: the root cause seems to be related to the pypa container that build the aarch64 package for pypi. Building from source locally gives no errors.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Looks like this is the same issue as #330 and has the same workaround.

Install python3.11-debug.aarch64 in the container and run the following commands:

git clone https://github.com/tree-sitter/py-tree-sitter --depth=1
cd py-tree-sitter
git submodule update --init --depth=1
python3.11d -m venv .venv
source .venv/bin/activate
pip install --compile -v -e '.[tests]'
python -m unittest discover -s tests -v

Could be an issue with the manylinux aarch64 image that built the wheel.

The job runs on all versions from 3.10 to 3.13 and didn’t fail in any of them.