microsoft / infersharp

Infer# is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null dereferences, resource leaks, and thread-safety violations. It also performs taint flow tracking to detect critical security vulnerabilities like SQL injections.
MIT License
734 stars 29 forks source link

GitHub action runs out of memory after 44 minutes of analyzing #51

Closed mike-ward closed 3 years ago

mike-ward commented 3 years ago

Couple of issues here:

https://github.com/mike-ward/Loon/actions/runs/629723358

xinshiMSFT commented 3 years ago

Hi Mike! You may run into memory issues if you have really large binary files or the available space allocated on the host machine is too small. With that being said, I just tried running Infer# on your repo locally. The entire analysis took about 30 seconds to complete with no detected issues. This is what I did.

  1. Cloned your repo and updated the Avalonia.XX NuGet packages to 0.10.0 because the beta version you are using is not available on my end.
  2. Built the Loon solution, which contains Loon and Twitter.
  3. I assumed that the binaries you are interested in are Loon.dll, Loon.pdb, Twitter.dll, Twitter.pdb, so I only ran the analysis on these.

You have a lot of binaries and duplicate language variants that are not built from your own code (i.e. Avalonia, Microsoft, System, etc.), which I assume you have no interest in analyzing. If my assumption is correct, you may put an extra step before the analysis to copy those 4 binary files to a separate folder and point Infer# to that instead.

xinshiMSFT commented 3 years ago

On a side note, I also ran Infer# on the entire release folder on my local machine. It took about 30 mins. All the warnings are from Avalonia.XX. Loon does not have any.

mike-ward commented 3 years ago

Thanks. I thought it might be the case that the issues were in Avalonia. Was looking for a command line way to limit scope. Did not occur to me to just copy them into a different folder.