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

Crash on deep call stack under Windows #89069

Open
aleReimondo mannequin opened this issue Aug 13, 2021 · 3 comments
Open

Crash on deep call stack under Windows #89069

aleReimondo mannequin opened this issue Aug 13, 2021 · 3 comments
Labels
3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@aleReimondo
Copy link
Mannequin

aleReimondo mannequin commented Aug 13, 2021

BPO 44906
Nosy @pfmoore, @tjguk, @zware, @zooba, @aleReimondo
Files
  • crashWin3.9-2021-08-12.zip: snapshot and test file
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-08-13.00:17:16.986>
    labels = ['interpreter-core', 'OS-windows', 'type-crash', '3.9']
    title = 'Crash on deep call stack under Windows'
    updated_at = <Date 2021-08-13.21:38:51.504>
    user = 'https://github.com/aleReimondo'

    bugs.python.org fields:

    activity = <Date 2021-08-13.21:38:51.504>
    actor = 'steve.dower'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Interpreter Core', 'Windows']
    creation = <Date 2021-08-13.00:17:16.986>
    creator = 'aleReimondo'
    dependencies = []
    files = ['50214']
    hgrepos = []
    issue_num = 44906
    keywords = []
    message_count = 3.0
    messages = ['399487', '399563', '399565']
    nosy_count = 5.0
    nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'aleReimondo']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue44906'
    versions = ['Python 3.9']

    @aleReimondo
    Copy link
    Mannequin Author

    aleReimondo mannequin commented Aug 13, 2021

    The py8.py file starts a S8 system, a Smalltalk system running on Python runtime, I am actually developing (in Beta).
    The system is running w/o problems on OSX systems, but crash (fast exit w/o any information) when running on Windows.
    The crash occurs while compiling a simple expression (simple but produce a deep recursion on parsing stage). The expression is shown in "fileMeIn.st".
    The issue happens on Windows and python version Python 3.9.2
    The stack depth is aprox 1800 frames.
    Steps to reproduce the crash:
    1.- decompress the zip file in a folder
    2.- on command prompt "python -i py8.py"
    3.- "Image loaded" must be shown in console
    4.- evaluate "t()" to run tests that fileIn the code in "fileMeIn.st"
    5.- after aprox. one minute working, the fast exit occurs and the Python VM exits without reporting anything on output

    @aleReimondo aleReimondo mannequin added 3.9 only security fixes OS-windows type-crash A hard crash of the interpreter, possibly with a core dump labels Aug 13, 2021
    @zooba
    Copy link
    Member

    zooba commented Aug 13, 2021

    I guess we've got a new path through the interpreter loop that takes more stack space than before and isn't part of our existing recursion tests.

    It's probably somewhere in the vector call changes. Capturing the stack at overflow point should show us - I'll see if I can get it easily from the repro.

    @zooba zooba added interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Aug 13, 2021
    @zooba
    Copy link
    Member

    zooba commented Aug 13, 2021

    I get stack overflows all the way back to 3.7, so it's probably not anything new. But our stack overflow detection is clearly not going to catch this case. It's really only set up for a direct call within Python code, but this is going through many more steps.

    Best thing you can do as a user is run it with "python -X faulthandler ..." to see the error. Perhaps we can handle the stack overflow ourselves and print a message suggesting that option, but unfortunately this problem doesn't have a generic solution :( The assumption is that you have a known recursion limit for your application, and as a scripting engine, we don't. Decoupling from the C stack is the best hope.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-windows type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant