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.
NullReferenceException in OverloadResultComparer.Equals #286
There seems to be a recent regression in the commit c067e83 (does not appear to be directly caused by it though), that throws a NullReferenceException in
at Microsoft.PythonTools.Analysis.BuiltinFunctionOverloadResult.get_Documentation()
at Microsoft.PythonTools.Analysis.OverloadResultComparer.Equals(OverloadResult x, OverloadResult y)
at Microsoft.PythonTools.Analysis.OverloadResult.Equals(Object obj)
at System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
at System.Collections.Generic.HashSet`1.Contains(T item)
at System.Collections.Generic.HashSet`1.ContainsAllElements(IEnumerable`1 other)
at Microsoft.PythonTools.Analysis.Infrastructure.EnumerableExtensions.SetEquals[T](IEnumerable`1 source, IEnumerable`1 other, IEqualityComparer`1 comparer)
at Microsoft.PythonTools.Analysis.Values.BuiltinFunctionInfo.Equals(Object obj)
at Microsoft.PythonTools.Analysis.ObjectComparer.Equals(AnalysisValue x, AnalysisValue y)
at Microsoft.PythonTools.Analysis.AnalysisValue.Microsoft.PythonTools.Analysis.IAnalysisSet.Add(AnalysisValue item, Boolean& wasChanged, Boolean canMutate)
at Microsoft.PythonTools.Analysis.Analyzer.TypedDependencyInfo.AddType(AnalysisValue ns)
at Microsoft.PythonTools.Analysis.TypedDef`1.AddTypes(IVersioned projectEntry, IAnalysisSet newTypes, Boolean enqueue, IProjectEntry declaringScope)
at Microsoft.PythonTools.Analysis.TypedDef`1.AddTypes(AnalysisUnit unit, IAnalysisSet newTypes, Boolean enqueue, IProjectEntry declaringScope)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.AssignImportedModuleOrMember(String name, IAnalysisSet value, Boolean addRef, Node node, NameExpression nameReference)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.FinishImportModuleOrMember(ModuleReference module, IReadOnlyList`1 attribute, String name, Boolean addRef, Node node, NameExpression nameReference)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(FromImportStatement node)
at Microsoft.PythonTools.Parsing.Ast.FromImportStatement.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Walk(SuiteStatement node)
at Microsoft.PythonTools.Parsing.Ast.SuiteStatement.Walk(PythonWalker walker)
at Microsoft.PythonTools.Parsing.Ast.PythonAst.Walk(PythonWalker walker)
at Microsoft.PythonTools.Analysis.AnalysisUnit.AnalyzeWorker(DDG ddg, CancellationToken cancel)
at Microsoft.PythonTools.Analysis.AnalysisUnit.Analyze(DDG ddg, CancellationToken cancel)
at Microsoft.PythonTools.Analysis.Analyzer.DDG.Analyze(Deque`1 queue, CancellationToken cancel, Action`1 reportQueueSize, Int32 reportQueueInterval)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.AnalyzeQueuedEntries(CancellationToken cancel)
I can not stably reproduce this issue, because I parse and queue modules in random order.
Mikhail Arkhipov (@MikhailArkhipov) it looks like I still get the same exception after rebasing on top of today's master. BTW, all this time I was able to work around it using this simple change: 15b64b2
Mikhail Arkhipov (@MikhailArkhipov) though the fact, that my commit causes the exception to disappear, means, that the problem is waaay deeper. It looks like _docTask is being accessed for read and write from different threads, which should not have happened in the first place.
Activity
lostmsu commentedon Oct 24, 2018
Mikhail Arkhipov (@MikhailArkhipov) it looks like I still get the same exception after rebasing on top of today's master. BTW, all this time I was able to work around it using this simple change: 15b64b2
lostmsu commentedon Oct 24, 2018
Mikhail Arkhipov (@MikhailArkhipov) though the fact, that my commit causes the exception to disappear, means, that the problem is waaay deeper. It looks like
_docTaskis being accessed for read and write from different threads, which should not have happened in the first place.jakebailey commentedon Oct 29, 2018
Yeah, this doesn't seem to be fully fixed yet. #318
MikhailArkhipov commentedon Oct 29, 2018
Thread race condition. BuiltinFunctionOverloadResult does
while task body is setting docTask to null. So between if and Wait docTask can become null.