You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
I'm running this on MacOS in VSCode with a Python 3.6 virtual env. I'm using the latest version of the vscode python extension (2018.12.1) which contains version 0.1.72 of the PLS.
The crash occurs in the method PythonAnalyzer.GetTypeFromObject (which is called by PythonAnalyzer.GetAnalysisValueFromObjects). The problem is that the walk member is of type ILazyMember, so when GetTypeFromObject is called, it is not able to determine its type, and it calls Debug.Fail which crashes the server. The crash occurs repeatedly as long as the file is open, and VSCode kills the service after five crashes.
I think the correct fix is to add the following lines to PythonAnalyzer.GetAnalysisValueFromObjects:
if (attr is ILazyMember lm) {
var member = lm.Get();
return GetAnalysisValueFromObjects(member);
}
This resolves the lazy member and recursively calls GetAnalysisValueFromObjects to determine its type. I've confirmed that with this fix, the crash no longer occurs, but I'm not familiar enough with the analysis engine and its internal objects to say for sure that this is the correct fix.
The text was updated successfully, but these errors were encountered:
I'm seeing a consistent crash in the analyzer with the following simple python code:
I'm running this on MacOS in VSCode with a Python 3.6 virtual env. I'm using the latest version of the vscode python extension (2018.12.1) which contains version 0.1.72 of the PLS.
The crash occurs in the method
PythonAnalyzer.GetTypeFromObject
(which is called byPythonAnalyzer.GetAnalysisValueFromObjects
). The problem is that thewalk
member is of typeILazyMember
, so when GetTypeFromObject is called, it is not able to determine its type, and it callsDebug.Fail
which crashes the server. The crash occurs repeatedly as long as the file is open, and VSCode kills the service after five crashes.I think the correct fix is to add the following lines to
PythonAnalyzer.GetAnalysisValueFromObjects
:This resolves the lazy member and recursively calls
GetAnalysisValueFromObjects
to determine its type. I've confirmed that with this fix, the crash no longer occurs, but I'm not familiar enough with the analysis engine and its internal objects to say for sure that this is the correct fix.The text was updated successfully, but these errors were encountered: