When I scan the C# project with the docker container, there seems to be an error, integer overflow, and no vulnerabilities scanned
See original GitHub issue[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
Issue Analytics
- State:
- Created a year ago
- Comments:17 (7 by maintainers)
Top Results From Across the Web
Unable to docker scan: "failed to get DockerScanID"
I execute <$ sudo docker scan second-time>. and I get the error <failed to get DockerScanID: bad status code “400 Bad Request”>. trying...
Read more >Too many vulnerabilities in Docker image · Issue #2425
I checked all the binaries binaries being installed in Dockerfile and none of them dynamically link against libc. To Reproduce. Follow https:// ...
Read more >18 security vulnerabilities when scanned with Clair #1878
Steps to reproduce the issue Download latest LTS dotnet core 3.1 docker image Scan with Clair Expected behavior no CVEs detected (0) Actual ......
Read more >Why does integer overflow cause errors with C++ iostreams?
iostreams is designed to detect errors and enter an error state. ... Just tried this code and it does seem to be setting...
Read more >Klar analysis always returns "contains NO unapproved ...
Summary Klar analysis always returns "contains NO unapproved vulnerabilities", even though the image has vulnerabilities.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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:
@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 theExamples/ref
folder afterdotnet publish
. However, it is not the matching .dll file withExamples/Examples.pdb
. On Linux, the script probably copiedExamples/ref/Examples.dll
andExamples/Examples.pdb
first, then ignoredExamples/Examples.dll
. It is probably why you are seeing aSymbolNotMatchingException
.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
andExamples/Example.pdb
first, then ignoredExamples/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?