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.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Microsoft.Python.Analysis.Analyzer.Symbols.SymbolCollector.AddProperty(FunctionDefinition, IPythonType, Boolean) in Analysis\Ast\Impl\Analyzer\Symbols\SymbolCollector.cs:line 170
Microsoft.Python.Analysis.Analyzer.Symbols.SymbolCollector.TryAddProperty(FunctionDefinition, IPythonType) in Analysis\Ast\Impl\Analyzer\Symbols\SymbolCollector.cs:line 158
Microsoft.Python.Analysis.Analyzer.Symbols.SymbolCollector.AddFunctionOrProperty(FunctionDefinition) in Analysis\Ast\Impl\Analyzer\Symbols\SymbolCollector.cs:line 101
Microsoft.Python.Analysis.Analyzer.Symbols.SymbolCollector.Walk(FunctionDefinition) in Analysis\Ast\Impl\Analyzer\Symbols\SymbolCollector.cs:line 77
Microsoft.Python.Parsing.Ast.FunctionDefinition.Walk(PythonWalker) in Parsing\Impl\Ast\FunctionDefinition.cs:line 197
Not sure what could be null at line 170, though. Maybe it's getting optimized and fd is null and is breaking at fd.Name.
so what IS null is the NameExpression in fd which may happen in
def (a, b, c)
OR if function is from a library module and somehow fd lost its name node. This is unlikely since we actually are running analysis and there is live AST right there. Now FunctionDefinition has
which then would crash on NameExpression being null which contradicts with the fact that line 77 can only get called when `if (!string.IsNullOrEmpty(fd.Name)).
So what is looks like is that AST was dropped by another task analyzing same module and it completed the analysis and removed the AST while this analysis was still running here. Alexander Sher (@AlexanderSher) - opinions?
Activity
MikhailArkhipov commentedon Jun 11, 2019
nullfunction names do happen, but walker checks it inWalk:So I guess, _eval or something in
_eval.GetLocationOfName(fd)jakebailey commentedon Jun 18, 2019
Was the same as #1219, I believe.
jakebailey commentedon Jun 19, 2019
Didn't go away.
MikhailArkhipov commentedon Jun 20, 2019
FunctionDefinitionis valid. That's line 197.if (!string.IsNullOrEmpty(fd.Name))so bothfdandNameare valid._eval.GetLocationOfName(fd).So either a)
_evalis null - which is unlikely, we'd crash way earlier and besides, it is readonly andthis means
GetLocationOfNameis inlined and the issue is there.fdis not null and if it was, thenGetLocationOfNamewould throw inso what IS null is the
NameExpressioninfdwhich may happen inOR if function is from a library module and somehow
fdlost its name node. This is unlikely since we actually are running analysis and there is live AST right there. NowFunctionDefinitionhaswhich then would crash on
NameExpressionbeing null which contradicts with the fact that line 77 can only get called when `if (!string.IsNullOrEmpty(fd.Name)).So what is looks like is that AST was dropped by another task analyzing same module and it completed the analysis and removed the AST while this analysis was still running here. Alexander Sher (@AlexanderSher) - opinions?
Multiple analysis fixes.
Multiple analysis fixes (#1297)
Multiple analysis fixes.
Merge master into database branch (#1312)
Multiple analysis fixes.
Merge persistence work into master (#1482)
Adding support for egg and zip files (#1552)
Multiple analysis fixes (microsoft#1297)
Merge persistence work into master (microsoft#1482)
Adding support for egg and zip files (microsoft#1552)