This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 151
NullReferenceException in Clousot/cccheck #138
Comments
I have a similar issue myself, here's my stack-trace below. My project isn't anything super-secret or confidential, it's a simple database application using Entity Framework 6, so I'll be happy to provide the project if anyone needs it. The output doesn't tell me which method it was analyzing when it died, but based on the last-good and next-good output I believe it was trying to process a function that contained a rather complicated Linq expression. CodeContracts: Rss: Internal error in Clousot/cccheck --- catching it, and continuing CodeContracts: Rss: \nException Type:System.NullReferenceException CodeContracts: Rss: \nMessage:Object reference not set to an instance of an object.\, Stack TraceSystem.NullReferenceException: Object reference not set to an instance of an object. CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.BoxedExpressionReader`11.ExpressionInPostStateHelper(BoxedExpression exp\, Boolean replaceReturnValue\, Boolean overrideAccessModifiers\, Boolean allowReturnValue\, Details& details) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`11.GenericValueAnalysis`2.ToListOfBoxedExpressions(AbstractDomain astate\, BoxedExpressionReader`11 expInPostState) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`11.GenericNumericalAnalysis`1.SuggestPostconditionsFromReturnState(IFixpointInfo`2 fixpointInfo\, List`1 expressions) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`11.GenericNumericalAnalysis`1.SuggestAnalysisSpecificPostconditions(ContractInferenceManager inferenceManager\, IFixpointInfo`2 fixpointInfo\, List`1 postconditions) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`11.ArrayAnalysis`2.SuggestAnalysisSpecificPostconditions(ContractInferenceManager inferenceManager\, IFixpointInfo`2 fixpointInfo\, List`1 postconditions) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.AnalysisWrapper.TypeBindings`11.GenericValueAnalysis`2.SuggestPostcondition(ContractInferenceManager inferenceManager\, IFixpointInfo`2 fixpointInfo) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`9.RunContractInference(Int32 phasecount\, String methodFullName\, IMethodDriver`12 mdriver\, AnalysisStatistics& methodStats\, List`1 results\, ContractInferenceManager inferenceManager\, ComposedFactQuery`1 factQuery) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`9.MethodAnalysisNonCached(Method method\, MethodAnalysisFlags& analysisFlags\, Int32& phasecount\, String methodFullName\, IClassDriver`13 cdriver\, IMethodDriver`12 mdriver\, AnalysisStatistics& methodStats\, ContractDensity& methodContractDensity) CodeContracts: Rss: \n at Microsoft.Research.CodeAnalysis.Clousot.TypeBinder`9.AnalyzeMethodInternal2(Method method\, MethodAnalysisFlags analysisFlags\, IClassDriver`13& cdriver\, AnalysisStatistics& methodStats\, APC& entryPC) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I enabled Code Contracts (all default settings, except unticked Check In Background hoping it might work around #137 - it didn't) on a project in a big solution I have, and this was spat into the output window as it ran.
Unfortunately the chances of my getting a repro I can provide are slim (it's a massive project I can't share, and I doubt I could repro it in small, shareable codebase), but I'm hoping since it's an NRE with a stack, it might be possible to figure out from the error alone.
There are no contract annotations in any of our code (though the default settings include inferring and suggesting some).
The text was updated successfully, but these errors were encountered: