This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 25, 2026. It is now read-only.
[feature/damAnalyzer] Integrate DAM analyzer feature branch into main #2580
Copy link
Copy link
Closed
Labels
Description
#2523 is adding a test run to check that there are no extra warnings produced by the analyzer. The list of test failures so far is below, along with an initial triage. I created a few new dedicated issues for tracking purposes.
Issues blocking integration to main
- [DAM analyzer] don't produce warnings for unsupported intrinsics #2578
- Support filter regions (tracked by [DAM analyzer] support exceptional control flow #2415)
- [DAM analyzer] Add support for attribute warning suppressions #2579
- [feature/damAnalyzer] Warning code differ between the linker and analyzer #2583
- Test infra issues (fixing in [DAM analyzer] Check for unexpected analyzer warnings in linker tests #2523)
- [DAM analyzer] Don't produce dataflow warnings for annotations on invalid types #2598
Note: this does not include tests which are currently skipped, such as the LinkAtributes tests - I will update the list to include those once I run the skipped tests in the "no extra warnings" mode.
Tests failing in #2523
- ReflectionTests.MembersUsedViaReflection [FAIL]
unsupported intrinsic: GetMember with binding flags - ReflectionTests.TypeUsedViaReflection [FAIL]
RUC on GetType - ReflectionTests.FieldsUsedViaReflection [FAIL]
unsupported intrinsic binding flags - ReflectionTests.ExpressionNewType [FAIL]
RUC on GetType - ReflectionTests.ConstructorsUsedViaReflection [FAIL]
unsupported intrinsic: GetConstructors with binding flags - ReflectionTests.EventsUsedViaReflection [FAIL]
unsupported intrinsic: GetEvents with binding flags - ReflectionTests.ActivatorCreateInstance [FAIL]
RUC on CreateInstance - ReflectionTests.ExpressionCallString [FAIL]
RUC on Expression.Call - ReflectionTests.TypeUsedViaReflectionTypeDoesntExist [FAIL]
RUC on Type.GetType - ReflectionTests.ExpressionPropertyMethodInfo [FAIL]
RUC on Expression.Property - ReflectionTests.AssemblyImportedViaReflectionWithSweptReferences [FAIL]
RUC on Type.GetType - ReflectionTests.MethodsUsedViaReflection [FAIL]
unsupported intrinsic: Type.GetMethods with binding flags - ReflectionTests.TypeHierarchySuppressions [FAIL]
unsupported intrinsic: GetType call on instance, where type has DAM,
and we don't look for DAM on type - ReflectionTests.ConstructorUsedViaReflection [FAIL]
unsupported intrinsic: GetConstructors with binding flags - ReflectionTests.PropertiesUsedViaReflection [FAIL]
unsupported intrinsic: GetProperties with binding flags - ReflectionTests.NestedTypesUsedViaReflection [FAIL]
unsupported intrinsic: GetNestedTypes with binding flags - ReflectionTests.MemberUsedViaReflection [FAIL]
unsupported intrinsic: Type.GetMember with binding flags - ReflectionTests.ObjectGetType [FAIL]
unsupported intrinsic: object.GetType - ReflectionTests.TypeHierarchyReflectionWarnings [FAIL]
unsupported intrinsic: object.GetType - UnreachableBlockTests.TryFilterBlocks [FAIL]
no support for filter regions - LoggingTests.SourceLines [FAIL]
is OK, test infra doesn't support ExpectedWarning with SourceLine - AdvancedTests.TypeCheckRemoval [FAIL]
no support for filter regions - TestFrameworkTests.VerifyResourceInAssemblyAttributesBehavior [FAIL]
test infra problem (needs investigation) - TestFrameworkTests.CanSandboxDependenciesUsingType [FAIL]
test infra problem (needs investigation) - Warnings.WarningSuppressionTests.SuppressWarningsInMembersAndTypesUsingTarget
warning suppressions in code usingTarget = "..."syntax - Warnings.WarningSuppressionTests.SuppressWarningsInCompilerGeneratedCode
extra warnings in analyzer, needs investigation - Warnings.WarningSuppressionTests.SuppressWarningsViaXml
analyzer needs to support XML attributes
@agocke hopefully this helps track things - let me know if you want me to adjust anything.
Activity
sbomer commentedon Feb 11, 2022
@tlakollo and I looked at warnings produced by the analyzer on dotnet/runtime. Before disabling intrinsics:
Most of these are explained by lack of intrinsic support, as expected. One interesting case is the warning in
Introspections.cs. This one was being produced for the method body of an intrinsic calling another intrinsic. It went away when we disabled the unimplemented intrinsics, but note that unlike the linker, the analyzer is currently analyzing the bodies of intrinsics. There were a few other warnings left after disabling warnings for unsupported intrinsics:ComponentActivator.cs,ManifestBasedResourceGroveler.cs, andStartupHookProvider.csare warnings which are silenced by XML suppressions.ModuleBuilder.cslooks like it's in unused code. The linker doesn't warn and there seem to be no references to the method so we can just delete it.RuntimeHelpers.csone is a bug in the feature branch. The bug exists in shared code, and the linker is producing the warning too: [DAM analyzer] Don't produce dataflow warnings for annotations on invalid types #2598tlakollo commentedon Feb 17, 2022
I run again the analyzer in runtime, possibly in a different way than Sven and got very similar results
We can see the following:
vitek-karas commentedon Feb 17, 2022
The
RuntimeType.GetInterfaceis a bug in the linker's data flow: #2624The analyzer is correct - there should be a warning reported here.
I'm unsure about the fix - it's deep down in the
MethodBodyScannerand could impact lot of cases.sbomer commentedon Feb 22, 2022
Closing since #2614 merged the feature branch.