Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

UnauthorizedAccessException crash #136

Closed

Description

From a diagnostics log.

We catch IOException but not UnauthorizedAccessException.

Application: Microsoft.PythonTools.Analyzer.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
   at System.IO.__Error.WinIOError(Int32, System.String)
   at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
   at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
   at System.IO.StreamReader..ctor(System.String, System.Text.Encoding, Boolean, Int32, Boolean)
   at System.IO.StreamReader..ctor(System.String)
   at System.IO.File.OpenText(System.String)
   at Microsoft.PythonTools.Analysis.PythonLibraryPath.GetCachedDatabaseSearchPaths(System.String)
   at Microsoft.PythonTools.Analysis.PythonLibraryPath+<GetDatabaseSearchPathsAsync>d__14.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory+<GetCurrentSearchPathsAsync>d__48.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory+<GetSearchPathsAsync>d__49.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory+<GetImportableModulesAsync>d__43.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter.GetModuleNames()
   at Microsoft.PythonTools.Analysis.ModuleTable.ReInit()
   at Microsoft.PythonTools.Analysis.LanguageServer.Server.Interpreter_ModuleNamesChanged(System.Object, System.EventArgs)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreter.Factory_ImportableModulesChanged(System.Object, System.EventArgs)
   at Microsoft.PythonTools.Interpreter.Ast.AstPythonInterpreterFactory.NotifyImportNamesChanged()
   at Microsoft.PythonTools.Analysis.PythonAnalyzer+<ReloadModulesAsync>d__66.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Analysis.LanguageServer.Server+ReloadModulesQueueItem.Analyze(System.Threading.CancellationToken)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.PythonTools.Analysis.LanguageServer.Server+<DidChangeConfiguration>d__68.MoveNext()
   at Microsoft.PythonTools.Infrastructure.TaskExtensions+<>c.<DoNotWaitThreadContinuation>b__2_0(System.Object)
   at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Activity

  1. MikhailArkhipov commented on Sep 25, 2018

    @MikhailArkhipov

    Is it PTVS code base? The bug was fixed here. The code above is trying to open directory as a file. See https://github.com/Microsoft/python-language-server/pull/86/files. This is why AstTypeStubPaths tests fail.

  2. MikhailArkhipov commented on Oct 1, 2018

    @MikhailArkhipov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions