Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal runtime error: stack overflow when running a test that makes use of astroid #1

Open
leynos opened this issue Nov 24, 2024 · 1 comment

Comments

@leynos
Copy link

leynos commented Nov 24, 2024

Output:

% ξ‚° poetry run xc
xc πŸƒ (Python 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 15.0.0 (clang-1500.3.9.4)] darwin)
   Found 1 tests from 1 files in 0.00s
           [       0s] β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘      0/1
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: abort      poetry run xc

Pyproject.toml:

[tool.poetry]
name = "empty"
version = "0.1.0"
description = ""
authors = ["Payton McIntosh <payton.mcintosh@___.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.13"
astroid = "^3.3.5"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

test_empty.py:

import astroid

def test_empty():
    source_code = """
    def foo(bar: str) -> int:
        return len(bar)
    """
    tree = astroid.parse(source_code)
    assert tree

Another example giving the same results:

xc πŸƒ (Python 3.13.0 (main, Oct  7 2024, 05:02:14) [Clang 15.0.0 (clang-1500.3.9.4)] darwin)
   Found 1 tests from 1 files in 0.00s
           [       0s] β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘      0/1
thread 'main' has overflowed its stack
fatal runtime error: stack overflow
zsh: abort      poetry run xc test_yarl.py

pyproject.toml:

[tool.poetry]
name = "xc-yarl"
version = "0.1.0"
description = ""
authors = ["Payton McIntosh <payton.mcintosh@___.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.13"
yarl = "^1.18.0"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

test_yarl.py:

from yarl import URL

def test_yarl():
    foo = URL('http://foo.com/')
    assert foo / 'bar'

This is on Apple Silicon / Mac OS v14.7.1 (23H222):

% ξ‚° uname -a
Darwin EDI-MAC-PaytonM 23.6.0 Darwin Kernel Version 23.6.0: Thu Sep 12 23:36:23 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6031 arm64
% ξ‚° cargo --version
cargo 1.81.0 (2dbb1af80 2024-08-20)

Any other information I can provide to be of assistance?

@brownben
Copy link
Owner

Hey! I'm sorry you're having issues. Unfortunately, I can't reproduce the problem you're having.

I have added your examples as tests, and they are passing in CI (bdd55e3).
I have also added MacOS to run in CI, and the new tests are passing on MacOS as well.

I also cannot reproduce when I run locally on Windows 11, with Rust 1.81 or Nightly, and with Python 3.12 or 3.13.

Does it happen every time you run it? Or does it sometimes succeed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants