Skip to content
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

Crash when a file cannot be read #146

Closed
scovetta opened this issue Feb 28, 2020 · 0 comments
Closed

Crash when a file cannot be read #146

scovetta opened this issue Feb 28, 2020 · 0 comments

Comments

@scovetta
Copy link
Member

Describe the bug
Here is a stack trace:

2020-02-28T06:27:16 1 ERROR - Runtime error: The file cannot be accessed by the system. : 'C:\users\scovetta\source\repos\x\venv\bin\python'    at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
   at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
   at System.IO.File.ReadAllBytes(String path)
   at MultiExtractor.MiniMagic.DetectFileType(String filename)
   at Microsoft.AppInspector.AnalyzeCommand.Run()
   at Microsoft.AppInspector.Program.RunAnalyzeCommand(AnalyzeCommandOptions opts)
   at Microsoft.AppInspector.Program.<>c.<Main>b__6_0(AnalyzeCommandOptions opts)
   at CommandLine.ParserResultExtensions.MapResult[T1,T2,T3,T4,T5,TResult](ParserResult`1 result, Func`2 parsedFunc1, Func`2 parsedFunc2, Func`2 parsedFunc3, Func`2 parsedFunc4, Func`2 parsedFunc5, Func`2 notParsedFunc)
   at Microsoft.AppInspector.Program.Main(String[] args)

That file may be open, in which case for that or any other similar error, I'd expect the app to fail gracefully.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
I should get a warning about the file not being analyzable.

Desktop (please complete the following information):

  • OS: [e.g. iOS] - Windows 10
  • Browser [e.g. chrome, safari] n/a
  • Version [e.g. 22] 1.0.27

Additional context
I happened to try

guyacosta added a commit that referenced this issue Mar 2, 2020
Fixes #146, #147 includes status result value change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant