Skip to content

Python analysis engine terminated due to stack overflow #2108

Description

@daenney

Environment data

  • VS Code version: 1.25.0
  • Extension version (available under the Extensions sidebar): 2018.6.0
  • OS and version: Arch Linux
  • Python version (& distribution if applicable, e.g. Anaconda): 2.7.14
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv
  • Relevant/affected Python packages and their versions: *

Actual behavior

Extremely high CPU usage and no completions. Eventually an error is shown by VS Code informing me the server has crashed too many times and won't be restarted.

Expected behavior

Provide working completions while not launching my laptop into orbit.

Steps to reproduce:

  1. Enable the Python Analysis Engine
  2. Wait
  3. Boom

Logs

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

Starting the analysis engine.
[Info  - 12:52:20 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
Loading files from /home/daenney/Development/personal/gimme
##########Linting Output - flake8##########
Process is terminating due to StackOverflowException.
[Info  - 12:52:24 PM] Connection to server got closed. Server will restart.
[Info  - 12:52:25 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
Loading files from /home/daenney/Development/personal/gimme
Process is terminating due to StackOverflowException.
[Info  - 12:52:27 PM] Connection to server got closed. Server will restart.
[Info  - 12:52:28 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
Loading files from /home/daenney/Development/personal/gimme
Process is terminating due to StackOverflowException.
[Info  - 12:52:30 PM] Connection to server got closed. Server will restart.
[Info  - 12:52:31 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
Loading files from /home/daenney/Development/personal/gimme
Process is terminating due to StackOverflowException.
[Info  - 12:52:33 PM] Connection to server got closed. Server will restart.
[Info  - 12:52:34 PM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
Loading files from /home/daenney/Development/personal/gimme
Process is terminating due to StackOverflowException.
[Error - 12:52:36 PM] Connection to server got closed. Server will not be restarted.

Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)


TMSyntax.ts:47 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///opt/visual-studio-code/resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///home/daenney/.vscode/extensions/redhat.vscode-yaml-0.0.13/syntaxes/yaml.tmLanguage.json
e.register @ TMSyntax.ts:47

console.ts:136 [Extension Host] vscode-icons is active!

notificationsAlerts.ts:42 The Python Tools server crashed 5 times in the last 3 minutes. The server will not be restarted.

Activity

  1. MikhailArkhipov commented on Jul 8, 2018

    @MikhailArkhipov

    This should be fixed with microsoft/PTVS#4477. If you delete analysis folder, new build will be downloaded.

  2. daenney commented on Jul 9, 2018

    @daenney
    Author

    Doesn't look like it. I removed the analysis folder in the extension and after reloading VS Code it went about and downloaded the Python Language Server again (this is painfully slow by the way).

    Starting the analysis engine.
    Downloading https://pvsc.blob.core.windows.net/python-analysis/Python-Analysis-VSCode-linux-x64.0.1.0.nupkg... complete.
    Verifying download... valid.
    Unpacking archive... done.
    [Info  - 8:13:33 AM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
    ##########Linting Output - flake8##########
    Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
    Loading files from /home/daenney/Development/personal/gimme
    Process is terminating due to StackOverflowException.
    [Info  - 8:13:40 AM] Connection to server got closed. Server will restart.
    [Info  - 8:13:40 AM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
    Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
    Loading files from /home/daenney/Development/personal/gimme
    Process is terminating due to StackOverflowException.
    [Info  - 8:13:42 AM] Connection to server got closed. Server will restart.
    [Info  - 8:13:43 AM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
    Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
    Loading files from /home/daenney/Development/personal/gimme
    Process is terminating due to StackOverflowException.
    [Info  - 8:13:45 AM] Connection to server got closed. Server will restart.
    [Info  - 8:13:46 AM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
    Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
    Loading files from /home/daenney/Development/personal/gimme
    Process is terminating due to StackOverflowException.
    [Info  - 8:13:48 AM] Connection to server got closed. Server will restart.
    [Info  - 8:13:48 AM] Created Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter instance from Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory
    Initializing for /home/daenney/.local/share/virtualenvs/gimme-IW0Pxo7A/bin/python
    Loading files from /home/daenney/Development/,personal/gimme
    Process is terminating due to StackOverflowException.
    [Error - 8:13:50 AM] Connection to server got closed. Server will not be restarted.
    

    I'm guessing some artifact still needs to get updated?

  3. brettcannon commented on Jul 10, 2018

    @brettcannon
    Member

    Daenney (@daenney) if the status bar started downloading the language server again then there isn't any other artifact (at worst you need to restart VS Code).

    Any chance you have sample code in your project that triggers this problem which you can share with us?

  4. pankajp commented on Aug 17, 2018

    @pankajp

    I am experiencing the same on a large (25k) line python3 file which also has imports of other similarly massive files (and some unresolved imports as well). I could see the rapidly rising memory usage of the language server process until it crashed and is restarted.

  5. MikhailArkhipov commented on Aug 21, 2018

    @MikhailArkhipov

    Pankaj Pandey (@pankajp) - can you try insider's build?

  6. MikhailArkhipov commented on Sep 24, 2018

    @MikhailArkhipov

    This was fixed a while ago. Closing.

  7. pankajp commented on Sep 25, 2018

    @pankajp

    I still have staackoverflow. Is this a different issue?

    image

    followed by:
    image

  8. brettcannon commented on Sep 25, 2018

    @brettcannon
    Member

    Pankaj Pandey (@pankajp) it might be the same. Once our next release comes out if it comes up again then please open a new issue.

  9. locked as resolved and limited conversation to collaborators on Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions