Skip to content

Python language server crashes with large files open #3011

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
pankajp opened this issue Oct 25, 2018 · 4 comments
Closed

Python language server crashes with large files open #3011

pankajp opened this issue Oct 25, 2018 · 4 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@pankajp
Copy link

pankajp commented Oct 25, 2018

Environment data

  • VS Code version: 1.28.2 (User Setup)
  • Extension version (available under the Extensions sidebar): 2018.9.1
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda, python 3.7.0
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda root env
  • Relevant/affected Python packages and their versions: -

Actual behavior

Python language server continually crashes (I have some pretty large python files open) and a window frequently pops up with following message.
image

Carried forward from: #2108

Expected behavior

Thing should run normally, if a file cannot be handled it should inform me as such and at least not crash.

Steps to reproduce:

  1. Open VSCode with files

Logs

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

Starting Microsoft Python language server.
Downloading https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.0.1.48.nupkg... complete.
Unpacking archive... done.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe
Reloading modules... 
done.
Reloading modules... 

Process is terminating due to StackOverflowException.
[Info  - 10:15:09 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe

Process is terminating due to StackOverflowException.
[Info  - 10:17:00 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe

Process is terminating due to StackOverflowException.
[Info  - 10:18:18 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe
##########Linting Output - pylint##########
************* Module opt_recipes
5128,0,warning,W0301:Unnecessary semicolon
5177,0,warning,W0301:Unnecessary semicolon
17519,0,warning,W0301:Unnecessary semicolon

...


10618,8,warning,W0612:Unused variable 'index'
10626,16,warning,W0612:Unused variable 'lindex'
10922,8,warning,W0612:Unused variable 'm'

Process is terminating due to StackOverflowException.
[Info  - 10:19:18 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe

Process is terminating due to StackOverflowException.
[Info  - 10:20:23 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe

Process is terminating due to StackOverflowException.
[Info  - 10:21:27 PM] Connection to server got closed. Server will restart.
Microsoft Python Language Server version 0.1.48.0
Initializing for C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\python.exe

[...repeats indefinitely...]

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

/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4274 Overwriting grammar scope name to file mapping for scope text.html.django.
Old grammar file: file:///c%3A/Users/ppandey/.vscode/extensions/batisteo.vscode-django-0.17.0/syntaxes/django-html.tmLanguage.json.
New grammar file: file:///c%3A/Users/ppandey/.vscode/extensions/bibhasdn.django-html-1.2.0/syntaxes/django-html.json
e.register @ /C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4274
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4274 Overwriting grammar scope name to file mapping for scope source.python.
Old grammar file: file:///c%3A/Users/ppandey/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/extensions/python/syntaxes/MagicPython.tmLanguage.json.
New grammar file: file:///c%3A/Users/ppandey/.vscode/extensions/magicstack.magicpython-1.1.0/grammars/MagicPython.tmLanguage
e.register @ /C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:4274
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1409  INFO no standard startup: not just one window
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] activating extension
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] starting language server
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:1409   ERR File(s) not opened on this client.

/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] rejected promise not handled within 1 second
t.log @ /C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Traceback (most recent call last):
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-notebook-script.py", line 6, in <module>
    from notebook.notebookapp import main
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 46, in <module>
    from zmq.eventloop import ioloop
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\__init__.py", line 47, in <module>
    from zmq import backend
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
    reraise(*exc_info)
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
    raise value
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
    _ns = select_backend(first)
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\select.py", line 27, in select_backend
    mod = __import__(name, fromlist=public_api)
  File "C:\Users\ppandey\AppData\Local\Continuum\Anaconda3\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
    from . import (constants, error, message, context,
ImportError: DLL load failed: The specified module could not be found.

t.log @ /C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Listing Nuget Packages, Arg 1: "https://pvsc.blob.core.windows.net", Arg 2: "python-language-server-stable", Arg 3: "Python-Language-Server-win-x64"
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get latest language server nuget package version, , Return Value: {"package":"Python-Language-Server-win-x64.0.1.48.nupkg","uri":"https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.0.1.48.nupkg","version":{"loose":true,"raw":"0.1.48","major":0,"minor":1,"patch":48,"prerelease":[],"build":[],"version":"0.1.48"}}
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get latest version of Language Server, , Return Value: {"package":"Python-Language-Server-win-x64.0.1.48.nupkg","uri":"https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.0.1.48.nupkg","version":{"loose":true,"raw":"0.1.48","major":0,"minor":1,"patch":48,"prerelease":[],"build":[],"version":"0.1.48"}}
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.48"
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Listing Nuget Packages, Arg 1: "https://pvsc.blob.core.windows.net", Arg 2: "python-language-server-stable", Arg 3: "Python-Language-Server-win-x64"
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get latest language server nuget package version, , Return Value: {"package":"Python-Language-Server-win-x64.0.1.48.nupkg","uri":"https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.0.1.48.nupkg","version":{"loose":true,"raw":"0.1.48","major":0,"minor":1,"patch":48,"prerelease":[],"build":[],"version":"0.1.48"}}
/C:/Users/ppandey/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.main.js:282 [Extension Host] Python Extension: Get latest version of Language Server, , Return Value: {"package":"Python-Language-Server-win-x64.0.1.48.nupkg","uri":"https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.0.1.48.nupkg","version":{"loose":true,"raw":"0.1.48","major":0,"minor":1,"patch":48,"prerelease":[],"build":[],"version":"0.1.48"}}
@brettcannon brettcannon self-assigned this Oct 25, 2018
@brettcannon
Copy link
Member

Can you help give us a concept of what "large" and "some" is? Are we talking 10,000 lines of code? A million? And do you have 3 such files open? 20? Any chance you can share the files with us?

FYI I've opened a relevant issue with the language server if you want to answer the questions over there.

@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. upstream-language server and removed triage labels Oct 25, 2018
@brettcannon brettcannon removed their assignment Oct 25, 2018
@MikhailArkhipov
Copy link

@pankajp - did it happen before or it is new in the .48?

@pankajp
Copy link
Author

pankajp commented Oct 26, 2018

This is not a new issue. Moving further discussion to the upstream gh issue created by Brett ( microsoft/python-language-server#309 ). Thanks

@luabud
Copy link
Member

luabud commented Sep 11, 2019

Fixed upstream (microsoft/python-language-server#309)

@luabud luabud closed this as completed Sep 11, 2019
@ghost ghost removed the needs upstream fix label Sep 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 18, 2019
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
Projects
None yet
Development

No branches or pull requests

4 participants