infersharp: When I scan the C# project with the docker container, there seems to be an error, integer overflow, and no vulnerabilities scanned

[root@MiWiFi-R3600-srv Miniblog.Core]# docker run -v /home/Jonas/Project/Miniblog.Core:/infersharp/binary_path --rm mcr.microsoft.com/infersharp:v1.3 /bin/bash -c "./run_infersharp.sh binary_path; cp infer-out/report.txt /infersharp/binary_path/report.txt"
Processing {binary_path}
Copying binaries to a staging folder...

Code translation started...
Translation stage 1/3: Loading binaries.
Translation stage 2/3: Computing type environment.
Translation stage 3/3: Computing control-flow graph.

Coverage Statistics:

Method successfully translated: 0 (-2147483648%)
Method partially translated: 0 (-2147483648%)
Instructions translated: 0 (-2147483648%)
Instructions skipped: 0 (-2147483648%)
======================================

Code translation completed. Analyzing...


  No issues found
[root@MiWiFi-R3600-srv Miniblog.Core]# docker run -v /home/Jonas/Project/Miniblog.Core:/infersharp/Examples -it mcr.microsoft.com/infersharp:v1.3
root@9facf129f394:/infersharp# ./run_infersharp.sh Examples
Processing {Examples}
Copying binaries to a staging folder...

Code translation started...
Translation stage 1/3: Loading binaries.
Translation stage 2/3: Computing type environment.
Translation stage 3/3: Computing control-flow graph.

Coverage Statistics:

Method successfully translated: 0 (-2147483648%)
Method partially translated: 0 (-2147483648%)
Instructions translated: 0 (-2147483648%)
Instructions skipped: 0 (-2147483648%)
======================================

Code translation completed. Analyzing...


  No issues found

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

@xi-liu-ds, Hmm. Very strange, but I can’t reproduce the error. Now everything is working properly. Maybe I made a mistake yesterday when launching on macos. I’m sorry for the inconvenience.

My docker desktop version is 4.12.0 My parameters: image

@m-sedl, thank you so much for providing the detailed repro steps!

We recently updated the script to speed up the binary copying process (https://github.com/microsoft/infersharp/commit/bc6fb62d01115a6edc81ad46e15d75934be1fa68). Instead of copying everything from a user-specified folder, the script only copies the .dll and pdb files and flattens the structure.

.NET produces Examples.dll under the Examples/ref folder after dotnet publish. However, it is not the matching .dll file with Examples/Examples.pdb. On Linux, the script probably copied Examples/ref/Examples.dll and Examples/Examples.pdb first, then ignored Examples/Examples.dll. It is probably why you are seeing a SymbolNotMatchingException.

I don’t have a Mac, but I am guessing the reason you are not seeing it on MacOS is that the copying behavior is different. It probably copied the matching Examples/Examples.dll and Examples/Example.pdb first, then ignored Examples/ref/Examples.dll.

I made a PR https://github.com/microsoft/infersharp/pull/179 so that the copying behavior becomes consistent across different OSs. Would you mind updating run_infersharp.sh in your local docker container and try again?

I also find this problem

[root@MiWiFi-R3600-srv Project]# docker run -v /home/Jonas/Project/OrchardCore/:/infersharp/Examples -it mcr.microsoft.com/infersharp:v1.3 
root@ffd2c246885c:/infersharp# ./run_infersharp.sh Examples/
Processing {Examples/}
Copying binaries to a staging folder...

Code translation started...
Translation stage 1/3: Loading binaries.
Translation stage 2/3: Computing type environment.
Translation stage 3/3: Computing control-flow graph.

Coverage Statistics:

Method successfully translated: 0 (-2147483648%)
Method partially translated: 0 (-2147483648%)
Instructions translated: 0 (-2147483648%)
Instructions skipped: 0 (-2147483648%)
======================================

Code translation completed. Analyzing...


  No issues found