Giter Club home page Giter Club logo

infersharp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

infersharp's Issues

Resource leak does not display leaked resource type.

I'm trying to run InferSharp, but the error does not display the leaked ressources, only it's location, which make it hard to find the actual leak:

C:\dev\CK-MQTT\CK.MQTT.Common\BasicImplementations\MemoryStoreFactory.cs:12: error: Dotnet Resource Leak
  Leaked { n$8 -> 1 } resource(s) in method "ValueTask`1<!0> MemoryStoreFactory.CreateAsync(IActivityMonitor,ProtocolConfiguration,MqttConfigurationBase,String,Boolean)" at type(s) CK.MQTT.MemoryPacketStore.

C:\dev\CK-MQTT\CK.MQTT.Common\BasicImplementations\TcpChannelFactory.cs:18: error: Dotnet Resource Leak
  Leaked { n$10 -> 1 } resource(s) in method "ValueTask`1<!0> TcpChannelFactory.CreateAsync(IActivityMonitor,String)" at type(s) CK.MQTT.TcpChannel.

C:\dev\CK-MQTT\CK.MQTT.Common\BasicImplementations\MemoryStoreFactory.cs:27: error: Dotnet Resource Leak
  Leaked { n$8 -> 1 } resource(s) in method "ValueTask`1<!0> MemoryStoreFactory.CreateAsync(IInputLogger,ProtocolConfiguration,MqttConfigurationBase,String,Boolean)" at type(s) CK.MQTT.MemoryPacketStore, CK.MQTT.MemoryPacketStore.

The n$8 make me think of a placeholder not replaced ?

Installing from NuGet

First of all, a very interesting project!

C# static code analyzers using Roslyn are commonly distributed (also) in NuGet form, so you just have to add a package to your project: Without installing or configuring anything else, you can see analyzer violations in your IDE and during build too. Is it technologically possible and feasible for InferSharp to be able to work in a similar fashion, just from NuGet, and if yes, do you happen to have any plans for that?

I realize InferSharp doesn't use Roslyn nor analyses C# directly but nevertheless, I wanted to inquire about the possibilities.

Doesn't recognise "throw helpers", such as `ArgumentNullException.ThrowIfNull`

.NET 6 introduced a bunch of new throw helpers - syntactic sugar for argument null checks.

Infer# doesn't seem to recognise how these work, and will show Null Dereference errors even though the argument cannot be null because ArgumentNullException.ThrowIfNull has been used. I've verified that switching back to the old way works:

if (myArg == null) throw new ArgumentNullException(nameof(myArg ));

Error running action: ConfigurationPathNotFoundException

Hello,

I get the following error when trying to run this action...

Error: ConfigurationPathNotFoundException: A configuration file could not be found for: /home/runner/work/_actions/dotnet/code-analysis/main/roslynanalyzers-linux.gdnconfig

The full task output is as follows...

with:
solution: Consensus\ Project\ Downloader.sln
build-breaking: true
all-categories: all
env:
DOTNET_ROOT: /home/runner/.dotnet
{"fileVersion":"1.12.0","tools":[{"fileVersion":"1.12.0","tool":{"name":"RoslynAnalyzers","version":"1.12.0"},"arguments":{"CopyLogsOnly":false,"SourcesDirectory":"$(Folders.SourceRepo)","MSBuildVersion":"16.0","CodeAnalysisAssemblyVersion":"3.8.0","SetupCommandlines":"\"$(VisualStudioInstallDirectory)\Common7\Tools\VsMSBuildCmd.bat\"","BuildArchitecture":"amd64","BuildCommandlines":"msbuild.exe /p:AnalysisLevel=latest /p:AnalysisMode=all Consensus\ Project\ Downloader.sln","NetAnalyzersRootDirectory":"$(Packages.Microsoft.CodeAnalysis.NetAnalyzers)","CSharpCodeStyleAnalyzersRootDirectory":"$(Packages.Microsoft.CodeAnalysis.CSharp.CodeStyle)","FxCopAnalyzersRootDirectory":"","RulesetPath":"","SdlRulesetVersion":"","TreatWarningsAsErrors":true,"LoggerLevel":"Warning","ForceSuccess":true},"outputExtension":"sarif","successfulExitCodes":[0]}]}

Installing and running analyzers...
Warnings and errors will be displayed once the analysis completes.

Installing Microsoft Security Code Analysis Cli...
/home/runner/.dotnet/dotnet restore /home/runner/work/_actions/dotnet/code-analysis/main/lib/msca-toolkit/msca-toolkit.proj /p:MscaPackageVersion=0.* --packages /home/runner/work/_msca/versions --source https://api.nuget.org/v3/index.json
Determining projects to restore...
Restored /home/runner/work/_actions/dotnet/code-analysis/main/lib/msca-toolkit/msca-toolkit.proj (in 739 ms).

/home/runner/work/_msca/versions/microsoft.security.codeanalysis.cli/0.100.0/tools/guardian init --force
Init:
Creating guardian repo at: /home/runner/work/The99PercentProject/The99PercentProject
Created a settings file at: /home/runner/work/The99PercentProject/The99PercentProject/.gdn/.gdnsettings
Added /home/runner/work/The99PercentProject/The99PercentProject/.gdn/.gitignore file to ignore internal files. Please commit this file.
Guardian repository created at: /home/runner/work/The99PercentProject/The99PercentProject/.gdn
Please commit everything in the .gdn folder to source control. You can now use "guardian run" to run tools.
/home/runner/work/_msca/versions/microsoft.security.codeanalysis.cli/0.100.0/tools/guardian run -c /home/runner/work/_actions/dotnet/code-analysis/main/roslynanalyzers.gdnconfig --no-policy --logger-level Warning --export-breaking-results-to-file /home/runner/work/The99PercentProject/The99PercentProject/.gdn/analysis_results.sarif
Error: ConfigurationPathNotFoundException: A configuration file could not be found for: /home/runner/work/_actions/dotnet/code-analysis/main/roslynanalyzers-linux.gdnconfig

run_infersharp.sh parameter must be an absolute path, relative paths do not work

If I run the run_infersharp.sh script from the infersharp1.2 directory I need to pass a parameter defining the root of the tree where the DLLs are found. The problem is that this tree can only be designated by an absolute path, not a relative one. In other words:

$ pwd
/root
$ infersharp1.2/run_infersharp.sh applicationplatform/bin

will print this:
Processing {applicationplatform/bin}
Copying binaries to a staging folder...\n
cp: cannot stat 'applicationplatform/bin': No such file or directory
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%)

Where as

$ infersharp1.2/run_infersharp.sh /root/applicationplatform/bin

will actually do the analysis as expected.

Also, if there is a real problem where the path really does not exist, you should probably stop with a decent error message and not print out junk information with -2147483648%

Expected binaries not detected; please wait while they are downloaded and extracted.

I have installed the plugin into Visual studio 2022. Version 17.1.3 - Windows 10 - 21H1

It shows up in the visual studio tools menu and when I click on it I get a message

Expected binaries not detected; please wait while they are downloaded and extracted.

I have seen it display the following as well (but then nothing after that)

Expected binaries not detected; please wait while they are downloaded and extracted.
T

Expected binaries not detected; please wait while they are downloaded and extracted.
TI

Expected binaries not detected; please wait while they are downloaded and extracted.
N

Nothing seems to happen, no activity and no further messages.

I did run this on another machine, same OS and Visual studio version. And initially it looked the same. But it did come up with Ubunto and worked on the 2nd machine.

I am going to try the manual install of WSL

Array dimensions exceeded supported range

When running Infer# from WSL on a large code base, I get System.OutOfMemoryException: Array dimensions exceeded supported range:

sad face - Copy

Except for running Infer# on a subset of the code base, do you have any suggestions on how to proceed?

Running via Visual Studio 2022 doesn't appear to work due to attempt to write to internal Microsoft file share.

Running this in VS, I pointed the analyzer at my build directory. It goes for a while and then fails with this error:

Translation complete. Beginning analysis.
In instruction n$5=fun_Boolean Nullable`1<!0>.get_HasValue()(&CS$0$0000:) [line 68, column 13]
While analysing function ./Program.cs:Void NumberedRecurrenceRange.WriteElementsToXml(EwsServiceXmlWriter) at \REDMOND\EXCHANGE\BUILD\E15\15.00.0913.015\SOURCES\sources\dev\EwsManagedApi\src\EwsManagedApi\ComplexProperties\Recurrence\Ranges\NumberedRecurrenceRange.cs:66:13, raised "Assert_failure src/absint/HilExp.ml:455:85"
Uncaught Internal Error: "Assert_failure src/absint/HilExp.ml:455:85"

Error backtrace:
Raised at Absint__HilExp.access_exprs_of_exp.of_exp
in file "src/absint/HilExp.ml", line 455, characters 85-97
Called from Absint__HilExp.access_expr_of_lhs_exp in file "src/absint/HilExp.ml", line 521, characters 16-95
Called from Absint__HilExp.of_sil.of_sil_ in file "src/absint/HilExp.ml", line 602, characters 12-90
Called from Absint__HilInstr.of_sil.exp_of_sil in file "src/absint/HilInstr.ml" (inlined), line 50, characters 4-65
Called from Absint__HilInstr.of_sil.(fun) in file "src/absint/HilInstr.ml" (inlined), line 94, characters 51-69
Called from Base__List.count_map in file "src/list.ml", line 387, characters 13-17
Called from Base__List.count_map in file "src/list.ml" (inlined), line 383, characters 18-680
Called from Base__List.map in file "src/list.ml" (inlined), line 418, characters 15-31
Called from Absint__HilInstr.of_sil in file "src/absint/HilInstr.ml", line 94, characters 20-78
Called from Absint__LowerHil.Make.hil_instr_of_sil in file "src/absint/LowerHil.ml", line 68, characters 6-96
Called from Absint__LowerHil.Make.exec_instr in file "src/absint/LowerHil.ml", line 89, characters 12-43
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs.exec_instr in file "src/absint/AbstractInterpreter.ml", line 384, characters 21-78
Re-raised at Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs.exec_instr in file "src/absint/AbstractInterpreter.ml", line 408, characters 10-58
Called from Base__Array.foldi.foldi_loop in file "src/array.ml" (inlined), line 347, characters 54-68
Called from Base__Array.foldi in file "src/array.ml" (inlined), line 349, characters 2-24
Called from IR__Instrs.foldi in file "src/IR/Instrs.ml" (inlined), line 196, characters 6-33
Called from Absint__AbstractInterpreter.SimpleNodeTransferFunctions.exec_node_instrs in file "src/absint/AbstractInterpreter.ml" (inlined), line 123, characters 4-47
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node_instrs in file "src/absint/AbstractInterpreter.ml", line 412, characters 4-75
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node.update_inv_map in file "src/absint/AbstractInterpreter.ml" (inlined), line 420, characters 21-88
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.exec_node in file "src/absint/AbstractInterpreter.ml", line 458, characters 9-47
Called from Absint__AbstractInterpreter.MakeWithScheduler.exec_worklist in file "src/absint/AbstractInterpreter.ml", line 540, characters 16-125
Called from Absint__AbstractInterpreter.AbstractInterpreterCommon.make_compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 520, characters 18-86
Called from Absint__AbstractInterpreter.MakeWithScheduler.compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 570, characters 37-93
Called from Absint__AbstractInterpreter.MakeWithScheduler.compute_post in file "src/absint/AbstractInterpreter.ml" (inlined), line 570, characters 37-93
Called from Absint__LowerHil.MakeAbstractInterpreterWithConfig.compute_post in file "src/absint/LowerHil.ml", line 129, characters 4-80
Called from Dotnet__ResourceLeaksCS.checker in file "src/dotnet/ResourceLeaksCS.ml", line 197, characters 4-87
Called from Backend__CallbackOfChecker.interprocedural_with_field in file "src/backend/CallbackOfChecker.ml", line 55, characters 15-36
Called from Backend__Callbacks.iterate_procedure_callbacks.(fun) in file "src/backend/callbacks.ml", line 58, characters 22-49
Called from Base__List.fold_right.(fun) in file "src/list.ml" (inlined), line 482, characters 29-34
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Backend__Ondemand.analyze in file "src/backend/ondemand.ml", line 155, characters 16-76
Re-raised at IStdlib__IExn.reraise_if in file "src/istd/IExn.ml" (inlined), line 18, characters 15-63
Called from Backend__Ondemand.run_proc_analysis in file "src/backend/ondemand.ml", line 223, characters 4-752
Called from Backend__Ondemand.analyze_proc_name_no_caller in file "src/backend/ondemand.ml" (inlined), line 340, characters 2-58
Called from Backend__Ondemand.analyze_procedures.analyze_proc_name_call in file "src/backend/ondemand.ml" (inlined), line 346, characters 12-53
Called from Stdlib__list.iter in file "list.ml", line 110, characters 12-15
Called from Stdlib__list.iter in file "list.ml" (inlined), line 108, characters 13-64
Called from Stdlib__list.iter in file "list.ml" (inlined), line 110, characters 17-25
Called from Stdlib__list.iter in file "list.ml" (inlined), line 108, characters 13-64
Called from Base__List0.iter in file "src/list0.ml" (inlined), line 25, characters 16-35
Called from Backend__Ondemand.analyze_procedures in file "src/backend/ondemand.ml", line 348, characters 2-54
Called from Backend__Ondemand.analyze_file in file "src/backend/ondemand.ml" (inlined), line 359, characters 2-64
Called from Backend__InferAnalyzeJson.analyze_json in file "src/backend/InferAnalyzeJson.ml", line 723, characters 2-43
Called from Integration__Driver.execute_analyze_json in file "src/integration/Driver.ml", line 189, characters 6-54
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Integration__Driver.analyze_and_report in file "src/integration/Driver.ml" (inlined), line 288, characters 2-144
Called from Dune__exe__Infer.run in file "src/infer.ml" (inlined), line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml" (inlined), line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

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

Error on Cicil write type environment

Running infer on a small project I'm having this error, anyone has a clue about?

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Text.EncoderFallbackException: Unable to translate Unicode character \uD800 at index 699 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(ReadOnlySpan1 chars, Int32& charsConsumed) at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount, Boolean flush)
at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at System.IO.File.WriteAllText(String path, String contents)
at Cilsil.Program.Translate(String[] paths, String printprocs, String outcfg, String cfgtxt, String outtenv, String dot, Boolean debug) in /Cilsil/Program.cs:line 108
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<b__0>d.MoveNext()
Code translation completed. Analyzing...
Logs in /infersharp/infer-out/logs
Uncaught Internal Error: (Sys_error "/infersharp/infer-staging/tenv.json: No such file or directory")
Error backtrace:
Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 399, characters 28-54
Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 404, characters 2-45
Called from Yojson.Safe.from_file in file "lib/read.mll" (inlined), line 1135, characters 13-25
Called from Backend__InferAnalyzeJson.analyze_json in file "src/backend/InferAnalyzeJson.ml", line 691, characters 24-57
Called from Integration__Driver.execute_analyze_json in file "src/integration/Driver.ml", line 182, characters 6-54
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 79, characters 29-44
Called from Integration__Driver.analyze_and_report in file "src/integration/Driver.ml" (inlined), line 286, characters 2-144
Called from Dune__exe__Infer.run in file "src/infer.ml" (inlined), line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml" (inlined), line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 79, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

Azure Pipelines integration

Good Morning,
are there any plans to integrate your tool with Azure Pipelines as well?

I would love to use it in my pull requests for analysis! And it would be great, if a plugin could decorate a pull request with comments on the issued files / lines (as SonarCloud does).

This relates to https://devblogs.microsoft.com/dotnet/infer-interprocedural-memory-safety-analysis-for-c/#comment-8145, but for tracking reasons I assume it's better to flag up a feature request here.

Fatal error: out of memory

Hi,

Tried to run infersharp from my docker on one our .Net framework project - quite big and ran into an out of memory.

I have attached all the logs I could to this post.

Is this a docker issue or infersharp problem?

Either way, what would recommend as a work around?

I understand running it as a github action is also an option but I ran into another issue here.

Thank you
infersharp-out-of--memory.zip

Infer# Throwing Errors in Azure DevOps Pipeline

We have been using Infer# in our pipelines for a week or 2 now. Today, our steps started failing.

2021-03-03T19:55:22.4440623Z ##[section]Starting: InferSharp analysis result
2021-03-03T19:55:22.4448841Z ==============================================================================
2021-03-03T19:55:22.4449189Z Task         : Command line
2021-03-03T19:55:22.4449571Z Description  : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
2021-03-03T19:55:22.4449899Z Version      : 2.182.0
2021-03-03T19:55:22.4450172Z Author       : Microsoft Corporation
2021-03-03T19:55:22.4450539Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line
2021-03-03T19:55:22.4450961Z ==============================================================================
2021-03-03T19:55:22.7968307Z Generating script.
2021-03-03T19:55:22.7976721Z Script contents:
2021-03-03T19:55:22.7977470Z cat /__w/1/s/infer-out/filtered_bugs.txt
2021-03-03T19:55:22.7977883Z ========================== Starting Command Output ===========================
2021-03-03T19:55:22.8004269Z [command]/usr/bin/bash --noprofile --norc /__w/_temp/a97ff80f-6495-48c6-9879-f5a0f9cf01ed.sh
2021-03-03T19:55:22.8066107Z cat: /__w/1/s/infer-out/filtered_bugs.txt: No such file or directory
2021-03-03T19:55:22.8129942Z ##[error]Bash exited with code '1'.
2021-03-03T19:55:22.8238518Z ##[section]Finishing: InferSharp analysis result

CLI Quick Start Documentation

Infer's quick start documentation can be summarized as infer run -- make. Does infersharp have any documentation beyond the github actions that can be used to inform other integrations?

Infersharp Visual Studio 2022 plugin doesn't handle spaces in directory path correct.

When using the Visual Studio 2022 plugin of Infersharp the spaces in a directory path are not handled correct.

Output:

InferSharp is analyzing: //mnt/c/DEV/KBVB/License App/src/license-app
Processing {//mnt/c/DEV/KBVB/License}
cp: cannot stat '//mnt/c/DEV/KBVB/License': No such file or directory
Copying binaries to a staging folder...

cp: target 'App/src/license-app' is not a directory

Expected: Spaces in directory paths are handled correctly.

Extension Point for own analyzers?

Hello,

I've read the announcement on the dev-blog and was wandering, how would one go and use Infer# for writing their one analyzers. In particular there's things like checking that every branch in a method calls a specific method or that a value is only used in a const-fashion, etc.

Some cases might be interesting to contribute but others could be very business-case-specific and not lend themselves to contribution. So, would it be best to fork Infer# or is there a way for plugging in your own analyzers to be run with the rest of the native analyzers provided by Infer#

Many thanks, Michael

Hide DOTNET_RESOURCE_LEAK on empty IDisposable implementations

I just tried the Visual Studio extension of Infer# on a 500k LOC code base and it works surprisingly well, I've found lots of things to fix.

I noticed quite a few DOTNET_RESOURCE_LEAK reports on classes that implement a no-op IDisposable (empty body in Dispose). These are usually mock classes needed for testing so I can't remove the IDisposable there. Is it possible to hide diagnostics that originate from an empty Dispose body?

Windows Docker image available?

Following the instructions from the README causes a Linux docker image to be obtained. Any chance of a Docker image for Windows?

False positives when using "default" or ?? operator

Tested on a large code base and there were a number or reports for CONDITION_ALWAYS_FALSE with the message "Boolean condition 'null' is always false"

The code in question here is when using the ?? operator along with automatic null checks (?).

This does trigger the warning: xelement.Element("Amount")?.Value ?? "0"
This does not: nullableVar ?? "0"

Also getting ANALYSIS_STOPS with exception: Missing_fld when using the default keyword for assigning to objects.

This does trigger the warning: myString = default
This does not: myString = null

Would be awesome if the analyzer could detect these perfectly valid/reasonable scenarios.

Sarif in Azure DevOps

Hi,

I read the commit that introduced sarif support but didn't got any wiser on how to surface it in Azure DevOps with the extension that MS provides

Building further upon the existing txt output I thought this might work

  - script: |
      curl -o run_infersharp.sh https://raw.githubusercontent.com/microsoft/infersharp/v1.2/run_infersharp_ci.sh
      chmod +x run_infersharp.sh
      ./run_infersharp.sh inferDir/$(project) --sarif
    displayName: 'Infer# Analysis of $(project)'

  - task: PublishBuildArtifacts@1
    displayName: "Publish analysis logs"
    inputs:
      PathtoPublish: "$(Build.SourcesDirectory)/infer-out"
      ArtifactName: "CodeAnalysisLogs"
      publishLocation: "Container"

But I get the following error
##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: /__w/1/s/infer-out
BTW I don't mind to do some plumbing but it would be heplful for the developers over at Azure DevOps if there was an extension like there is now for GitHub Actions

analysis process is killed without any error message

The analysis process is being killed without an explicit message. I have 8GB memory on the container that I am running the analysis on.

Do you have any ideas?

...
Unknown instructions:
Ldelema: 1
Ldelem_U2: 1
Mul_Ovf: 1
Conv_Ovf_U2: 1
Conv_Ovf_U4: 1
Conv_Ovf_U8: 1
Ldelem_U4: 2
Conv_Ovf_U1: 2
Initobj: 4
Stobj: 4
Localloc: 4
Ldelem_U1: 4
Constrained: 15
Ldind_U1: 23
Leave: 25
Ldobj: 32
Ldvirtftn: 37
Unbox_Any: 75
Switch: 114
Ldlen: 115
Leave_S: 437
Throw: 577
Ldftn: 1226
Castclass: 4958

Coverage Statistics:

Method successfully translated: 24774 (76%)
Method partially translated: 7674 (24%)
Instructions translated: 1081979 (68%)
Instructions skipped: 511962 (32%)
======================================

-e You may see 'Unable to parse instruction xxx' above. This is expected as we have not yet translated all the CIL instructions, which follow a long tail distribution. We are continuing to expand our .NET translation coverage.

-e Translation completed. Analyzing...

Logs in /app/infer-out/logs
Killed

Infersharp crashes when on abstract record

When running as a part of github action, with my private repository that contains :
namespace WebChat.StateStore { public abstract record FailureAction(string ErrorMessage); }

The infersharp crashes with

More than two space-separated tokens in: System.Void modreq(System.Runtime.CompilerServices.IsExternalInit) WebChat.StateStore.FailureAction::set_ErrorMessage(System.String)
More than two space-separated tokens in: System.Void modreq(System.Runtime.CompilerServices.IsExternalInit) WebChat.StateStore.FailureAction::set_ErrorMessage(System.String)
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Cilsil.Services.ServiceExecutionException: Popping on empty stack at method: System.Void modreq(System.Runtime.CompilerServices.IsExternalInit) modreq(System.Runtime.CompilerServices.IsExternalInit) WebChat.StateStore.FailureAction::set_ErrorMessage(System.String) instruction: IL_0007: ret location: Line 3
at Cilsil.Utils.ProgramState.Pop() in /app/Cilsil/Utils/ProgramState.cs:line 241
at Cilsil.Cil.Parsers.RetParser.ParseCilInstructionInternal(Instruction instruction, ProgramState state) in /app/Cilsil/Cil/Parsers/RetParser.cs:line 18
at Cilsil.Cil.Parsers.InstructionParser.ParseCilInstruction(Instruction instruction, ProgramState state) in /app/Cilsil/Cil/Parsers/InstructionParser.cs:line 84
at Cilsil.Services.CfgParserService.ComputeMethodCfg(MethodDefinition method) in /app/Cilsil/Services/CfgParserService.cs:line 113
at Cilsil.Services.CfgParserService.Execute() in /app/Cilsil/Services/CfgParserService.cs:line 49
at Cilsil.Program.ExecuteTranslation(String[] paths, String printprocs) in /app/Cilsil/Program.cs:line 123
at Cilsil.Program.Translate(String[] paths, String printprocs, String outcfg, String cfgtxt, String outtenv, String dot) in /app/Cilsil/Program.cs:line 95
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<b__0>d.MoveNext()

Full log:
infer_crash.log

Github Actions Workflow Error

Repository: https://github.com/mike-ward/Loon

Run microsoft/[email protected]
/usr/bin/docker run --name e4a64ec07f510942839d8c19711ac276e2_fa50e8 --label 5588e4 --workdir /github/workspace --rm -e DOTNET_ROOT -e INPUT_BINARY-PATH -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/Loon/Loon":"/github/workspace" 5588e4:a64ec07f510942839d8c19711ac276e2  "./src/Loon/bin/Release/net5.0"
Running Infer#...
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Method with duplicate full name found: System.Void Avalonia.Themes.Default.DefaultTheme::!XamlIlPopulateTrampoline(Avalonia.Themes.Default.DefaultTheme)
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Unable to parse instruction Ldftn
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Unable to parse instruction Ldftn
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Unable to parse instruction Ldftn
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Unable to parse instruction Ldftn
Unable to parse instruction Castclass
Unable to parse instruction Castclass
Unable to parse instruction Ldftn
Unable to parse instruction Castclass
Unable to parse instruction Throw
Unable to parse instruction Throw
Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.InvalidCastException: Unable to cast object of type 'Mono.Cecil.ParameterDefinition' to type 'System.Int32'.
   at Cilsil.Cil.Parsers.LdargParser.ParseCilInstructionInternal(Instruction instruction, ProgramState state) in /app/Cilsil/Cil/Parsers/LdargParser.cs:line 21
   at Cilsil.Cil.Parsers.InstructionParser.ParseCilInstruction(Instruction instruction, ProgramState state) in /app/Cilsil/Cil/Parsers/InstructionParser.cs:line 83
   at Cilsil.Services.CfgParserService.ComputeMethodCfg(MethodDefinition method) in /app/Cilsil/Services/CfgParserService.cs:line 113
   at Cilsil.Services.CfgParserService.Execute() in /app/Cilsil/Services/CfgParserService.cs:line 51
   at Cilsil.Services.CfgParserService.ExecuteFromResult(ServiceExecutionResult result) in /app/Cilsil/Services/CfgParserService.cs:line 73
   at Cilsil.Services.ServiceExecutionResult.ThenExecute(IService service) in /app/Cilsil/Services/Results/ServiceExecutionResult.cs:line 11
   at Cilsil.Program.ExecuteTranslation(String[] paths, String printprocs) in /app/Cilsil/Program.cs:line 124
   at Cilsil.Program.Translate(String[] paths, String printprocs, String outcfg, String cfgtxt, String outtenv, String dot) in /app/Cilsil/Program.cs:line 95
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Delegate.DynamicInvoke(Object[] args)
   at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
   at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<<InvokeAsync>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseParseErrorReporting>b__16_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseSuggestDirective>b__7_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseParseDirective>b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c.<<UseHelp>b__14_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c.<<RegisterWithDotnetSuggest>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
   at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<<UseExceptionHandler>b__0>d.MoveNext()
You may see 'Unable to parse instruction xxx' above. This is expected as we have not yet translated all the CIL instructions, which follow a long tail distribution. We are continuing to expand our .NET translation coverage. 

Translation completed. Analyzing...

Logs in /github/workspace/infer-out/logs
Uncaught Internal Error: (Sys_error "/github/workspace/tenv.json: No such file or directory")
Error backtrace:
Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 398, characters 28-54
Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 403, characters 2-45
Called from Yojson.Safe.from_file in file "lib/read.mll", line 1135, characters 13-25
Called from Backend__InferAnalyzeJson.analyze_json in file "src/backend/InferAnalyzeJson.ml", line 677, characters 24-57
Called from Integration__Driver.execute_analyze_json in file "src/integration/Driver.ml", line 177, characters 6-54
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 429, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml", line 79, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 429, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml", line 79, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

Run the command again with `--keep-going` to try and ignore this error.
cat: infer-out/report.txt: No such file or directory

MacOS support

# ./run_infersharp.sh MyProject/LearningSomething.Web/bin/Debug/net5.0/LearningSomething.Web.dll
Processing {MyProject/LearningSomething.Web/bin/Debug/net5.0/LearningSomething.Web.dll}
Copying binaries to a staging folder...\n
cp: Cilsil/System.Private.CoreLib.dll: No such file or directory
Code translation started...
./run_infersharp.sh: line 60: ./Cilsil/Cilsil: No such file or directory
Code translation completed. Analyzing...

./run_infersharp.sh: line 62: /Users/me/workspace/learning/b1/infer/lib/infer/infer/bin/infer: No such file or directory
mkdir: infer-out: No such file or directory
./run_infersharp.sh: line 64: /Users/me/workspace/learning/b1/infer/lib/infer/infer/bin/infer: No such file or directory

Running from a bash shell in MacOS, looks like some paths are incorrect.

Are infersharp and run_infersharp.sh compatible with MacOS?

Binary Releases?

Building infer is hard - it requires lots of disk space and time. InferSharp presumably isn't drastically different. Do you have/plan on making binary releases?

False positive Null Dereference

/_/src/Meziantou.Framework.Csv/CsvReader.cs:34: error: Null Dereference
  [B5] pointer `returned by get_BaseReader()` could be null and is dereferenced at line 34, column 17.

In this case BaseReader is set in the constructor and there is a new check, so it cannot be null. However, Infer# reports it later in the code. I think Infer# is confused by the is statement before.

        public TextReader BaseReader { get; }

        public CsvReader(TextReader textReader)
        {
            BaseReader = textReader ?? throw new ArgumentNullException(nameof(textReader));
        }

       public bool EndOfStream
        {
            get
            {
                if (BaseReader is StreamReader streamReader)
                    return streamReader.EndOfStream;

                return BaseReader.Peek() < 0; // ๐Ÿ‘ˆ infer# reports this line
            }
        }

F# Support

.NET isn't only C#, what is the great team behind Infer# planning for F# support ?
Is there any timeline ?

Visual Studio Support?

How can I use this from Visual Studio? It would be a bit counterintuitive to have to commit and push my code many times everyday day as I'm developing. I'd rather run it alongside all of my other static analysis tools.

Unable to start

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?

Unable to translate Unicode character \\uDC00

Using infersharp 1.3, I got the following:

`InferSharp is analyzing: //mnt/e/projects/WorkProject
Processing {//mnt/e/projects/WorkProject}
Copying binaries to a staging folder...

Code translation started...
Translation stage 1/3: Loading binaries.
Translation stage 2/3: Computing type environment.
Methods analyzed: ATranslation stage 3/3: Computing control-flow graph.
Methods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: T
Methods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: TMethods analyzed: T
Coverage Statistics:

Method successfully translated: 309817 (90%)
Method partially translated: 34265 (10%)
Instructions translated: 5548111 (72%)
Instructions skipped: 2140588 (28%)

ERROR: Unhandled exception: ERROR: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.Text.EncoderFallbackException: Unable to translate Unicode character \uDC00 at index 767 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(ReadOnlySpan1 chars, Int32& charsConsumed) at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan1 chars, Int32 originalCharsLength, Span`1 bytes, Int32 originalBytesLength, EncoderNLS encoder)
at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar, EncoderNLS encoder)
at System.Text.Encoding.GetBytes(Char* pChars, Int32 charCount, Byte* pBytes, Int32 byteCount, EncoderNLS encoder)
at System.Text.EncoderNLS.GetBytes(Char[] chars, Int32 charIndex, Int32 charCount, Byte[] bytes, Int32 byteIndex, Boolean flush)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Dispose(Boolean disposing)
at System.IO.TextWriter.Dispose()
at System.IO.File.WriteAllText(String path, String contents)
at Cilsil.Program.Translate(String[] paths, String outcfg, String cfgtxt, String outtenv, String dot, Boolean debug, Boolean extprogress) in /Cilsil/Program.cs:line 101
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__16_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass8_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__7_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__6_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__14_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass3_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c.<b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Invocation.InvocationExtensions.<>c__DisplayClass5_0.<b__0>d.MoveNext()
Code translation completed. Analyzing...

ERROR: Uncaught Internal Error: (Sys_error
"/root/infersharp/infer-staging/tenv.json: No such file or directory")
Error backtrace:
Raised by primitive operation at Stdlib.open_in_gen in file "stdlib.ml", line 405, characters 28-54
Called from Stdlib.open_in in file "stdlib.ml" (inlined), line 410, characters 2-45
Called from Yojson.Safe.from_file in file "lib/read.mll" (inlined), line 1135, characters 13-25
Called from Backend__InferAnalyzeJson.analyze_json in file "src/backend/InferAnalyzeJson.ml", line 709, characters 24-57
Called from Integration__Driver.execute_analyze_json in file "src/integration/Driver.ml", line 200, characters 6-54
Called from IBase__Utils.timeit in file "src/base/Utils.ml", line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Integration__Driver.analyze_and_report in file "src/integration/Driver.ml" (inlined), line 299, characters 2-144
Called from Dune__exe__Infer.run in file "src/infer.ml" (inlined), line 21, characters 2-47
Called from IBase__Utils.timeit in file "src/base/Utils.ml" (inlined), line 424, characters 16-20
Called from IBase__ScubaLogging.execute_with_time_logging in file "src/base/ScubaLogging.ml" (inlined), line 83, characters 29-44
Called from Dune__exe__Infer.run in file "src/infer.ml", line 25, characters 22-94

Run the command again with --keep-going to try and ignore this error.`

Wrong Line Number On Reported Issues

We sometimes observe the wrong line number being recorded on reported issues, particularly when there are some compiler-generated class methods. This occurs as a result of the wrong line number being read from the PDB file by Mono.Cecil (for example, async methods cause the compiler to auto-generate a lot of code, which is not associated with any line number jbevain/cecil#805) and therefore is an issue upstream of InferSharp.

To mitigate the issue we will include method names in resource leak warnings. Additionally, in the case of resource leak the warning is localized to one of the instances of the reported type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.