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

Unable to start #25

Closed aleksandrsmyk closed 3 years ago

aleksandrsmyk commented 3 years ago

When executing : sh run_infersharp.sh Examples output

I got : sh: run_infersharp.sh: No such file or directory

Could you suggest any options to fix it?

xinshiMSFT commented 3 years ago

After you've pulled the image, start an interactive container: docker run -it mcr.microsoft.com/infersharp:latest

run_infersharp.sh should be under /app/: Untitled

vswathidev commented 3 years ago

sh: 0: Can't open run_infersharp.sh

with azure pipeline task given in .build/azure-pipelines-example.yml

ethanturk commented 3 years ago

I'm having the same problem with the Azure Pipeline task example. I can run the example in a local container, though.

ethanturk commented 3 years ago

I put a 'ls' into my script run. Here is the output at the base folder (on our ADO build agents) where the example tries to run the script. Locally, I get a completely different listing. I'm still debugging this issue.

CODEOWNERS azure-pipelines-ect-test.yml docs lib readme.md src tools sh: 0: Can't open run_infersharp.sh

[error]Bash exited with code '127'.

xinshiMSFT commented 3 years ago

Hi @vswathidev, @ethanturk, it seems that your Azure Pipelines were not running in container mode, but rather directly on the host. Can you double check if the container section of your pipelines looks like this?

pool:
  vmImage: 'ubuntu-20.04'
container:
  image: mcr.microsoft.com/infersharp:latest

This is one of the test run results on Azure Pipelines using .build/azure-pipelines-example.yml.

ethanturk commented 3 years ago

Here is the addition to my pipeline:

Run Infer

xinshiMSFT commented 3 years ago

Thanks for the additional info! I think I know where it could have gone wrong. Let me get the fix ready.

xinshiMSFT commented 3 years ago

So the problem is that _runinfersharp.sh needs to be present on the host first in order to run in a container. You can refer to the PR linked above for the updated instructions. I think it should resolve the issue. Please let me know otherwise. Thanks!

ethanturk commented 3 years ago

I saw the PR. It seems to have resolved the issue on my end, yes. Thanks for the quick response.