Skip to content

Python analysis engine terminated due to stack overflow #2108

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

Closed
daenney opened this issue Jul 7, 2018 · 8 comments
Closed

Python analysis engine terminated due to stack overflow #2108

daenney opened this issue Jul 7, 2018 · 8 comments
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@daenney
Copy link

daenney commented Jul 7, 2018

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 (ViewOutput, 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.
@MikhailArkhipov
Copy link

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

@daenney
Copy link
Author

daenney commented Jul 9, 2018

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?

@MikhailArkhipov MikhailArkhipov self-assigned this Jul 9, 2018
@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs verification labels Jul 10, 2018
@brettcannon
Copy link
Member

@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?

@brettcannon brettcannon added info-needed Issue requires more information from poster and removed needs verification labels Aug 2, 2018
@pankajp
Copy link

pankajp commented Aug 17, 2018

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.

@MikhailArkhipov
Copy link

@pankajp - can you try insider's build?

@MikhailArkhipov
Copy link

This was fixed a while ago. Closing.

@pankajp
Copy link

pankajp commented Sep 25, 2018

I still have staackoverflow. Is this a different issue?

image

followed by:
image

@brettcannon
Copy link
Member

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

@lock lock bot locked as resolved and limited conversation to collaborators Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

4 participants