diff --git a/.azure-pipelines/ultimate-pipeline.yml b/.azure-pipelines/ultimate-pipeline.yml index 201ae5f94048..fc60ccc73798 100644 --- a/.azure-pipelines/ultimate-pipeline.yml +++ b/.azure-pipelines/ultimate-pipeline.yml @@ -395,7 +395,7 @@ stages: parameters: target: builder baseImage: $(managedBaseImage) - command: "BuildManagedTracerHome ExtractDebugInfoLinux ValidateNativeTracerGlibcCompatibility" + command: "BuildManagedTracerHome ExtractDebugInfoLinux" retryCountForRunCommand: 1 - publish: $(monitoringHome) @@ -533,12 +533,10 @@ stages: matrix: x64: baseImage: centos7 - managedBaseImage: debian artifactSuffix: linux-x64 useNativeSdkVersion: true alpine: baseImage: alpine - managedBaseImage: alpine artifactSuffix: linux-musl-x64 useNativeSdkVersion: "" pool: @@ -557,19 +555,10 @@ stages: baseImage: $(baseImage) useNativeSdkVersion: $(useNativeSdkVersion) # We only need the native wrapper for the unit tests but we do not want to publish it (universal binary) - command: "Clean BuildProfilerHome CompileNativeWrapper CompileProfilerNativeTests RunProfilerNativeTests CompileNativeWrapperNativeTests RunNativeWrapperNativeTests CompileNativeLoaderNativeTests RunNativeLoaderNativeTests" + command: "Clean BuildProfilerHome CompileNativeWrapper CompileProfilerNativeTests RunProfilerNativeTests CompileNativeWrapperNativeTests RunNativeWrapperNativeTests CompileNativeLoaderNativeTests RunNativeLoaderNativeTests ExtractDebugInfoLinux" retryCountForRunCommand: 1 apiKey: $(DD_LOGGER_DD_API_KEY) - # We have to run these in a separate stage because the version of nm included with centos7 is insufficient to validate the glibc version - - template: steps/run-in-docker.yml - parameters: - build: true - target: builder - baseImage: $(managedBaseImage) - command: "ExtractDebugInfoLinux ValidateNativeProfilerGlibcCompatibility" - retryCountForRunCommand: 1 - - publish: $(monitoringHome) displayName: Uploading linux profiler home artifact artifact: linux-profiler-home-$(artifactSuffix) @@ -716,7 +705,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "Clean CompileManagedLoader BuildNativeTracerHome BuildManagedTracerHome ExtractDebugInfoLinux ValidateNativeTracerGlibcCompatibility" + command: "Clean CompileManagedLoader BuildNativeTracerHome BuildManagedTracerHome ExtractDebugInfoLinux" retryCountForRunCommand: 1 - publish: $(monitoringHome) @@ -809,7 +798,7 @@ stages: build: true target: builder baseImage: $(baseImage) - command: "Clean BuildProfilerHome ExtractDebugInfoLinux ValidateNativeProfilerGlibcCompatibility" + command: "Clean BuildProfilerHome ExtractDebugInfoLinux" retryCountForRunCommand: 1 - publish: $(System.DefaultWorkingDirectory)/profiler/_build @@ -6352,7 +6341,7 @@ stages: SNAPSHOT_DIR: $(System.DefaultWorkingDirectory)/tracer/build/smoke_test_snapshots SNAPSHOT_CI: 1 # ignoring 'http.client_ip' and 'network.client.ip' because it's set to '::1' here instead of expected '127.0.0.1' - SNAPSHOT_IGNORED_ATTRS: span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta._dd.p.dm,meta._dd.p.tid,meta._dd.git.commit.sha,meta._dd.git.repository_url,meta.http.client_ip,meta.network.client.ip,meta._dd.appsec.s.req.params,meta._dd.appsec.s.res.body,meta._dd.appsec.s.req.headers,meta._dd.appsec.s.res.headers #api-security attrs are unfortunately ignored because gzip compression generates different bytes per platform windows/linux + SNAPSHOT_IGNORED_ATTRS: span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta._dd.p.dm,meta._dd.p.tid,meta._dd.git.commit.sha,meta._dd.git.repository_url,meta.http.client_ip,meta.network.client.ip - script: | # Based on variables set in smoke.dotnet-tool.nuget.dockerfile diff --git a/.gitignore b/.gitignore index 23203d69fcc9..105d145ac02e 100644 --- a/.gitignore +++ b/.gitignore @@ -383,7 +383,4 @@ cmake-build-debug/ #datadog coverage datadog-coverage-* -.localstack/* - -# nuke -.nuke/build.schema.json +.localstack/* \ No newline at end of file diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json new file mode 100644 index 000000000000..85905d23b996 --- /dev/null +++ b/.nuke/build.schema.json @@ -0,0 +1,762 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Build Schema", + "$ref": "#/definitions/build", + "definitions": { + "build": { + "type": "object", + "properties": { + "Artifacts": { + "type": "string", + "description": "The location to place NuGet packages and other packages. Default is ./bin/artifacts " + }, + "AsUniversal": { + "type": "boolean", + "description": "Should we build native binaries as Universal. Default to false, so we can still build native libs outside of docker" + }, + "AZURE_DEVOPS_PIPELINE_ID": { + "type": "integer", + "description": "Azure Devops pipeline id" + }, + "AZURE_DEVOPS_PROJECT_ID": { + "type": "string", + "description": "Azure Devops project id" + }, + "AZURE_DEVOPS_TOKEN": { + "type": "string", + "description": "An Azure Devops PAT (for use in GitHub Actions)" + }, + "AzureDevopsBuildId": { + "type": "integer", + "description": "The specific Azure DevOps Build ID to use" + }, + "BenchmarkCategory": { + "type": "string", + "description": "Override the default category filter for running benchmarks. (Optional)" + }, + "BuildConfiguration": { + "type": "string", + "description": "Configuration to build - Default is 'Release'", + "enum": [ + "Debug", + "Release" + ] + }, + "BuildId": { + "type": "string", + "description": "The id of a build in AzureDevops" + }, + "CodeCoverageEnabled": { + "type": "boolean", + "description": "Enables code coverage" + }, + "CommitSha": { + "type": "string", + "description": "The specific commit sha to use" + }, + "Continue": { + "type": "boolean", + "description": "Indicates to continue a previously failed build attempt" + }, + "DebugType": { + "type": "string", + "description": "Specifies the type of debugging information that should be included in the compiled assembly. Used for debugger integrations tests" + }, + "DisableDynamicInstrumentationProduct": { + "type": "boolean", + "description": "Indicates if the Dynamic Instrumentation product should be disabled" + }, + "EnableFaultTolerantInstrumentation": { + "type": "boolean", + "description": "Indicates if the Fault-Tolerant Instrumentation should be turned on" + }, + "ExcludePackages": { + "type": "array", + "description": "Don't update package versions for packages with the following names", + "items": { + "type": "string" + } + }, + "ExpectChangelogUpdate": { + "type": "boolean", + "description": "Is the ChangeLog expected to change?" + }, + "ExplorationTestCloneLatest": { + "type": "boolean", + "description": "Indicates whether exploration tests should run on latest repository commit. Useful if you want to update tested repositories to the latest tags. Default false" + }, + "ExplorationTestName": { + "type": "string", + "description": "Indicates name of exploration test to run. If not specified, will run all tests sequentially", + "enum": [ + "automapper", + "cake", + "eShopOnWeb", + "paket", + "polly", + "protobuf", + "RestSharp", + "serilog", + "swashbuckle" + ] + }, + "ExplorationTestUseCase": { + "type": "string", + "description": "Indicates use case of exploration test to run", + "enum": [ + "ContinuousProfiler", + "Debugger", + "Tracer" + ] + }, + "ExtraEnvVars": { + "type": "array", + "description": "Additional environment variables, in the format KEY1=Value1 Key2=Value2 to use when running the IIS Sample", + "items": { + "type": "string" + } + }, + "FastDevLoop": { + "type": "boolean", + "description": "Enable or Disable fast developer loop" + }, + "Filter": { + "type": "string", + "description": "Override the default test filters for integration tests. (Optional)" + }, + "ForceARM64BuildInWindows": { + "type": "boolean", + "description": "Force ARM64 build in Windows" + }, + "Framework": { + "type": "string", + "description": "The TargetFramework to execute when running or building a sample app, or linux integration tests", + "enum": [ + "NET461", + "NET462", + "NET5_0", + "NET6_0", + "NET7_0", + "NET8_0", + "NETCOREAPP2_1", + "NETCOREAPP3_0", + "NETCOREAPP3_1", + "NETSTANDARD2_0" + ] + }, + "GITHUB_REPOSITORY_NAME": { + "type": "string", + "description": "Git repository name" + }, + "GITHUB_TOKEN": { + "type": "string", + "description": "A GitHub token (for use in GitHub Actions)" + }, + "Help": { + "type": "boolean", + "description": "Shows the help text for this build assembly" + }, + "Host": { + "type": "string", + "description": "Host for execution. Default is 'automatic'", + "enum": [ + "AppVeyor", + "AzurePipelines", + "Bamboo", + "Bitbucket", + "Bitrise", + "GitHubActions", + "GitLab", + "Jenkins", + "Rider", + "SpaceAutomation", + "TeamCity", + "Terminal", + "TravisCI", + "VisualStudio", + "VSCode" + ] + }, + "IncludeAllTestFrameworks": { + "type": "boolean", + "description": "Should we build and run tests against _all_ target frameworks, or just the reduced set. Defaults to true locally, false in PRs, and true in CI on main branch only" + }, + "IncludeMinorPackageVersions": { + "type": "boolean", + "description": "Should minor versions of integration NuGet packages be included" + }, + "IncludePackages": { + "type": "array", + "description": "Only update package versions for packages with the following names", + "items": { + "type": "string" + } + }, + "IncludeTestsRequiringDocker": { + "type": "boolean", + "description": "Should we build and run tests that require docker. true = only docker integration tests, false = no docker integration tests, null = all" + }, + "IsAlpine": { + "type": "boolean", + "description": "Is the build running on Alpine linux? Default is 'false'" + }, + "IsPrerelease": { + "type": "boolean", + "description": "Whether the current build version is a prerelease(for packaging purposes)" + }, + "LatestMajorVersion": { + "type": "integer", + "description": "The current latest tracer version" + }, + "MonitoringHome": { + "type": "string", + "description": "The location to create the monitoring home directory. Default is ./shared/bin/monitoring-home " + }, + "NewIsPrerelease": { + "type": "boolean", + "description": "Whether the new build version is a prerelease(for packaging purposes)" + }, + "NewVersion": { + "type": "string", + "description": "The new build version to set" + }, + "NoLogo": { + "type": "boolean", + "description": "Disables displaying the NUKE logo" + }, + "NugetPackageDirectory": { + "type": "string", + "description": "The location to restore Nuget packages (optional) " + }, + "Optimize": { + "type": "boolean", + "description": "Optimize generated code. Used for debugger integrations tests" + }, + "Partition": { + "type": "string", + "description": "Partition to use on CI" + }, + "Plan": { + "type": "boolean", + "description": "Shows the execution plan (HTML)" + }, + "PrintDriveSpace": { + "type": "boolean", + "description": "Prints the available drive space before executing each target. Defaults to false" + }, + "Profile": { + "type": "array", + "description": "Defines the profiles to load", + "items": { + "type": "string" + } + }, + "ProfilerSamplesSolution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded. Default is profiler/src/Demos/Datadog.Demos.sln" + }, + "ProfilerSolution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded. Default is Datadog.Profiler.sln" + }, + "PullRequestNumber": { + "type": "integer", + "description": "The Pull Request number for GitHub Actions" + }, + "Root": { + "type": "string", + "description": "Root directory during build execution" + }, + "RuntimeIdentifier": { + "type": "string", + "description": "RuntimeIdentifier sets the target platform for ReadyToRun assemblies in 'PublishManagedTracerR2R'.See https://learn.microsoft.com/en-us/dotnet/core/rid-catalog" + }, + "SampleName": { + "type": "string", + "description": "The sample name to execute when running or building sample apps" + }, + "Skip": { + "type": "array", + "description": "List of targets to be skipped. Empty list skips all dependencies", + "items": { + "type": "string", + "enum": [ + "AnalyzePipelineCriticalPath", + "AssignLabelsToPullRequest", + "AssignPullRequestToMilestone", + "BuildAndRunDdDotnetArtifactTests", + "BuildAndRunDebuggerIntegrationTests", + "BuildAndRunLinuxIntegrationTests", + "BuildAndRunManagedUnitTests", + "BuildAndRunOsxIntegrationTests", + "BuildAndRunProfilerCpuLimitTests", + "BuildAndRunProfilerIntegrationTests", + "BuildAndRunToolArtifactTests", + "BuildAndRunWindowsAzureFunctionsTests", + "BuildAndRunWindowsIntegrationTests", + "BuildAndRunWindowsRegressionTests", + "BuildAspNetIntegrationTests", + "BuildBenchmarkNuget", + "BuildBundleNuget", + "BuildDdDotnet", + "BuildDdDotnetArtifactTests", + "BuildDebuggerIntegrationTests", + "BuildIisSampleApp", + "BuildLinuxIntegrationTests", + "BuildManagedTracerHome", + "BuildManagedTracerHomeR2R", + "BuildMsi", + "BuildNativeLoader", + "BuildNativeTracerHome", + "BuildNativeWrapper", + "BuildOsxIntegrationTests", + "BuildProfilerAsanTest", + "BuildProfilerHome", + "BuildProfilerSampleForSanitiserTests", + "BuildProfilerSamples", + "BuildProfilerUbsanTest", + "BuildRunnerTool", + "BuildStandaloneTool", + "BuildToolArtifactTests", + "BuildTracerHome", + "BuildWindowsIntegrationTests", + "BuildWindowsRegressionTests", + "CalculateNextVersion", + "CheckBuildLogsForErrors", + "CheckClangTidyResults", + "CheckCppCheckResults", + "CheckProfilerStaticAnalysisResults", + "CheckSmokeTestsForErrors", + "CheckTestResultForProfilerWithSanitizer", + "Clean", + "CleanObjFiles", + "CloseMilestone", + "CompareBenchmarksResults", + "CompareCodeCoverageReports", + "CompareExecutionTimeBenchmarkResults", + "CompareThroughputResults", + "CompileAzureFunctionsSamplesWindows", + "CompileDebuggerIntegrationTests", + "CompileDebuggerIntegrationTestsDependencies", + "CompileDebuggerIntegrationTestsSamples", + "CompileDependencyLibs", + "CompileFrameworkReproductions", + "CompileInstrumentationVerificationLibrary", + "CompileIntegrationTests", + "CompileLinuxDdDotnetIntegrationTests", + "CompileLinuxOrOsxIntegrationTests", + "CompileManagedLoader", + "CompileManagedSrc", + "CompileManagedTestHelpers", + "CompileManagedUnitTests", + "CompileMultiApiPackageVersionSamples", + "CompileNativeLoader", + "CompileNativeLoaderLinux", + "CompileNativeLoaderNativeTests", + "CompileNativeLoaderOsx", + "CompileNativeLoaderTestsLinux", + "CompileNativeLoaderTestsWindows", + "CompileNativeLoaderWindows", + "CompileNativeSrcMacOs", + "CompileNativeWrapper", + "CompileNativeWrapperNativeTests", + "CompileProfilerNativeSrc", + "CompileProfilerNativeSrcLinux", + "CompileProfilerNativeSrcWindows", + "CompileProfilerNativeTests", + "CompileProfilerNativeTestsLinux", + "CompileProfilerNativeTestsWindows", + "CompileProfilerWithAsanLinux", + "CompileProfilerWithAsanWindows", + "CompileProfilerWithUbsanLinux", + "CompileRegressionDependencyLibs", + "CompileRegressionSamples", + "CompileSamplesLinuxOrOsx", + "CompileSamplesWindows", + "CompileTracerNativeSrc", + "CompileTracerNativeSrcLinux", + "CompileTracerNativeSrcWindows", + "CompileTracerNativeTests", + "CompileTracerNativeTestsLinux", + "CompileTracerNativeTestsWindows", + "CopyDdDotnet", + "CopyLibDdwaf", + "CopyNativeFilesForAppSecUnitTests", + "CopyServerlessArtifacts", + "CppCheckNativeLoader", + "CppCheckNativeLoaderUnix", + "CppCheckNativeSrc", + "CppCheckNativeSrcUnix", + "CreateBenchmarkIntegrationHome", + "CreateBundleHome", + "CreateMissingNullabilityFile", + "CreateRequiredDirectories", + "CreateRootDescriptorsFile", + "DownloadAzurePipelineFromBuild", + "DownloadLibDdwaf", + "DownloadReleaseArtifacts", + "ExtractDebugInfoLinux", + "GacAdd", + "GacRemove", + "GenerateNoopStages", + "GeneratePackageVersions", + "GenerateReleaseNotes", + "GenerateSpanDocumentation", + "GenerateVariables", + "HackForMissingMsBuildLocation", + "Info", + "InstallDdTraceTool", + "OutputCurrentVersionToGitHub", + "PackageTracerHome", + "PackNuGet", + "PackRunnerToolNuget", + "PrintSnapshotsDiff", + "PublishDdDotnetSymbolsWindows", + "PublishIisSamples", + "PublishManagedTracer", + "PublishManagedTracerR2R", + "PublishNativeLoader", + "PublishNativeLoaderOsx", + "PublishNativeLoaderUnix", + "PublishNativeLoaderWindows", + "PublishNativeSymbolsWindows", + "PublishNativeTracer", + "PublishNativeTracerOsx", + "PublishNativeTracerUnix", + "PublishNativeTracerWindows", + "PublishNativeWrapper", + "PublishProfiler", + "PublishProfilerLinux", + "PublishProfilerWindows", + "RenameVNextMilestone", + "Restore", + "RunBenchmarks", + "RunClangTidyProfiler", + "RunClangTidyProfilerLinux", + "RunClangTidyProfilerWindows", + "RunCppCheckProfiler", + "RunCppCheckProfilerLinux", + "RunCppCheckProfilerWindows", + "RunDdDotnetArtifactTests", + "RunDebuggerIntegrationTests", + "RunDotNetSample", + "RunExplorationTests", + "RunIisSample", + "RunInstrumentationGenerator", + "RunLinuxDdDotnetIntegrationTests", + "RunLinuxIntegrationTests", + "RunManagedUnitTests", + "RunNativeLoaderNativeTests", + "RunNativeLoaderTestsLinux", + "RunNativeLoaderTestsWindows", + "RunNativeTests", + "RunNativeUnitTests", + "RunNativeWrapperNativeTests", + "RunOsxIntegrationTests", + "RunProfilerAsanTest", + "RunProfilerNativeTests", + "RunProfilerNativeUnitTestsLinux", + "RunProfilerNativeUnitTestsWindows", + "RunProfilerUbsanTest", + "RunSampleWithProfilerAsan", + "RunSampleWithProfilerUbsan", + "RunToolArtifactTests", + "RunTracerNativeTests", + "RunTracerNativeTestsLinux", + "RunTracerNativeTestsWindows", + "RunUnitTestsWithAsanLinux", + "RunUnitTestsWithAsanWindows", + "RunUnitTestsWithUbsanLinux", + "RunWindowsAzureFunctionsTests", + "RunWindowsIntegrationTests", + "RunWindowsMsiIntegrationTests", + "RunWindowsRegressionTests", + "RunWindowsSecurityIisIntegrationTests", + "RunWindowsTracerIisIntegrationTests", + "SetUpExplorationTests", + "SignDlls", + "SignMsi", + "SummaryOfSnapshotChanges", + "TestNativeWrapper", + "UpdateChangeLog", + "UpdateSnapshots", + "UpdateSnapshotsFromBuild", + "UpdateVendoredCode", + "UpdateVersion", + "VerifyChangedFilesFromVersionBump", + "VerifyReleaseReadiness", + "ZipMonitoringHome", + "ZipMonitoringHomeLinux", + "ZipMonitoringHomeOsx", + "ZipMonitoringHomeWindows", + "ZipSymbols" + ] + } + }, + "Solution": { + "type": "string", + "description": "Path to a solution file that is automatically loaded. Default is Datadog.Trace.sln" + }, + "Target": { + "type": "array", + "description": "List of targets to be invoked. Default is '{default_target}'", + "items": { + "type": "string", + "enum": [ + "AnalyzePipelineCriticalPath", + "AssignLabelsToPullRequest", + "AssignPullRequestToMilestone", + "BuildAndRunDdDotnetArtifactTests", + "BuildAndRunDebuggerIntegrationTests", + "BuildAndRunLinuxIntegrationTests", + "BuildAndRunManagedUnitTests", + "BuildAndRunOsxIntegrationTests", + "BuildAndRunProfilerCpuLimitTests", + "BuildAndRunProfilerIntegrationTests", + "BuildAndRunToolArtifactTests", + "BuildAndRunWindowsAzureFunctionsTests", + "BuildAndRunWindowsIntegrationTests", + "BuildAndRunWindowsRegressionTests", + "BuildAspNetIntegrationTests", + "BuildBenchmarkNuget", + "BuildBundleNuget", + "BuildDdDotnet", + "BuildDdDotnetArtifactTests", + "BuildDebuggerIntegrationTests", + "BuildIisSampleApp", + "BuildLinuxIntegrationTests", + "BuildManagedTracerHome", + "BuildManagedTracerHomeR2R", + "BuildMsi", + "BuildNativeLoader", + "BuildNativeTracerHome", + "BuildNativeWrapper", + "BuildOsxIntegrationTests", + "BuildProfilerAsanTest", + "BuildProfilerHome", + "BuildProfilerSampleForSanitiserTests", + "BuildProfilerSamples", + "BuildProfilerUbsanTest", + "BuildRunnerTool", + "BuildStandaloneTool", + "BuildToolArtifactTests", + "BuildTracerHome", + "BuildWindowsIntegrationTests", + "BuildWindowsRegressionTests", + "CalculateNextVersion", + "CheckBuildLogsForErrors", + "CheckClangTidyResults", + "CheckCppCheckResults", + "CheckProfilerStaticAnalysisResults", + "CheckSmokeTestsForErrors", + "CheckTestResultForProfilerWithSanitizer", + "Clean", + "CleanObjFiles", + "CloseMilestone", + "CompareBenchmarksResults", + "CompareCodeCoverageReports", + "CompareExecutionTimeBenchmarkResults", + "CompareThroughputResults", + "CompileAzureFunctionsSamplesWindows", + "CompileDebuggerIntegrationTests", + "CompileDebuggerIntegrationTestsDependencies", + "CompileDebuggerIntegrationTestsSamples", + "CompileDependencyLibs", + "CompileFrameworkReproductions", + "CompileInstrumentationVerificationLibrary", + "CompileIntegrationTests", + "CompileLinuxDdDotnetIntegrationTests", + "CompileLinuxOrOsxIntegrationTests", + "CompileManagedLoader", + "CompileManagedSrc", + "CompileManagedTestHelpers", + "CompileManagedUnitTests", + "CompileMultiApiPackageVersionSamples", + "CompileNativeLoader", + "CompileNativeLoaderLinux", + "CompileNativeLoaderNativeTests", + "CompileNativeLoaderOsx", + "CompileNativeLoaderTestsLinux", + "CompileNativeLoaderTestsWindows", + "CompileNativeLoaderWindows", + "CompileNativeSrcMacOs", + "CompileNativeWrapper", + "CompileNativeWrapperNativeTests", + "CompileProfilerNativeSrc", + "CompileProfilerNativeSrcLinux", + "CompileProfilerNativeSrcWindows", + "CompileProfilerNativeTests", + "CompileProfilerNativeTestsLinux", + "CompileProfilerNativeTestsWindows", + "CompileProfilerWithAsanLinux", + "CompileProfilerWithAsanWindows", + "CompileProfilerWithUbsanLinux", + "CompileRegressionDependencyLibs", + "CompileRegressionSamples", + "CompileSamplesLinuxOrOsx", + "CompileSamplesWindows", + "CompileTracerNativeSrc", + "CompileTracerNativeSrcLinux", + "CompileTracerNativeSrcWindows", + "CompileTracerNativeTests", + "CompileTracerNativeTestsLinux", + "CompileTracerNativeTestsWindows", + "CopyDdDotnet", + "CopyLibDdwaf", + "CopyNativeFilesForAppSecUnitTests", + "CopyServerlessArtifacts", + "CppCheckNativeLoader", + "CppCheckNativeLoaderUnix", + "CppCheckNativeSrc", + "CppCheckNativeSrcUnix", + "CreateBenchmarkIntegrationHome", + "CreateBundleHome", + "CreateMissingNullabilityFile", + "CreateRequiredDirectories", + "CreateRootDescriptorsFile", + "DownloadAzurePipelineFromBuild", + "DownloadLibDdwaf", + "DownloadReleaseArtifacts", + "ExtractDebugInfoLinux", + "GacAdd", + "GacRemove", + "GenerateNoopStages", + "GeneratePackageVersions", + "GenerateReleaseNotes", + "GenerateSpanDocumentation", + "GenerateVariables", + "HackForMissingMsBuildLocation", + "Info", + "InstallDdTraceTool", + "OutputCurrentVersionToGitHub", + "PackageTracerHome", + "PackNuGet", + "PackRunnerToolNuget", + "PrintSnapshotsDiff", + "PublishDdDotnetSymbolsWindows", + "PublishIisSamples", + "PublishManagedTracer", + "PublishManagedTracerR2R", + "PublishNativeLoader", + "PublishNativeLoaderOsx", + "PublishNativeLoaderUnix", + "PublishNativeLoaderWindows", + "PublishNativeSymbolsWindows", + "PublishNativeTracer", + "PublishNativeTracerOsx", + "PublishNativeTracerUnix", + "PublishNativeTracerWindows", + "PublishNativeWrapper", + "PublishProfiler", + "PublishProfilerLinux", + "PublishProfilerWindows", + "RenameVNextMilestone", + "Restore", + "RunBenchmarks", + "RunClangTidyProfiler", + "RunClangTidyProfilerLinux", + "RunClangTidyProfilerWindows", + "RunCppCheckProfiler", + "RunCppCheckProfilerLinux", + "RunCppCheckProfilerWindows", + "RunDdDotnetArtifactTests", + "RunDebuggerIntegrationTests", + "RunDotNetSample", + "RunExplorationTests", + "RunIisSample", + "RunInstrumentationGenerator", + "RunLinuxDdDotnetIntegrationTests", + "RunLinuxIntegrationTests", + "RunManagedUnitTests", + "RunNativeLoaderNativeTests", + "RunNativeLoaderTestsLinux", + "RunNativeLoaderTestsWindows", + "RunNativeTests", + "RunNativeUnitTests", + "RunNativeWrapperNativeTests", + "RunOsxIntegrationTests", + "RunProfilerAsanTest", + "RunProfilerNativeTests", + "RunProfilerNativeUnitTestsLinux", + "RunProfilerNativeUnitTestsWindows", + "RunProfilerUbsanTest", + "RunSampleWithProfilerAsan", + "RunSampleWithProfilerUbsan", + "RunToolArtifactTests", + "RunTracerNativeTests", + "RunTracerNativeTestsLinux", + "RunTracerNativeTestsWindows", + "RunUnitTestsWithAsanLinux", + "RunUnitTestsWithAsanWindows", + "RunUnitTestsWithUbsanLinux", + "RunWindowsAzureFunctionsTests", + "RunWindowsIntegrationTests", + "RunWindowsMsiIntegrationTests", + "RunWindowsRegressionTests", + "RunWindowsSecurityIisIntegrationTests", + "RunWindowsTracerIisIntegrationTests", + "SetUpExplorationTests", + "SignDlls", + "SignMsi", + "SummaryOfSnapshotChanges", + "TestNativeWrapper", + "UpdateChangeLog", + "UpdateSnapshots", + "UpdateSnapshotsFromBuild", + "UpdateVendoredCode", + "UpdateVersion", + "VerifyChangedFilesFromVersionBump", + "VerifyReleaseReadiness", + "ZipMonitoringHome", + "ZipMonitoringHomeLinux", + "ZipMonitoringHomeOsx", + "ZipMonitoringHomeWindows", + "ZipSymbols" + ] + } + }, + "TargetBranch": { + "type": "string", + "description": "The git branch to use" + }, + "TargetPlatform": { + "type": "string", + "description": "Platform to build - x86, x64, ARM64. Defaults to the current platform", + "enum": [ + "arm", + "MSIL", + "Win32", + "x64", + "x86" + ] + }, + "TestAllPackageVersions": { + "type": "boolean", + "description": "Should all versions of integration NuGet packages be tested" + }, + "ToolDestination": { + "type": "string", + "description": "The directory to install the tool to" + }, + "ToolSource": { + "type": "string", + "description": "The directory containing the tool .nupkg file" + }, + "Verbosity": { + "type": "string", + "description": "Logging verbosity during build execution. Default is 'Normal'", + "enum": [ + "Minimal", + "Normal", + "Quiet", + "Verbose" + ] + }, + "Version": { + "type": "string", + "description": "The current version of the source and build" + } + } + } + } +} \ No newline at end of file diff --git a/Datadog.Trace.Native.sln b/Datadog.Trace.Native.sln index e24bcc723637..bc719e0335b9 100644 --- a/Datadog.Trace.Native.sln +++ b/Datadog.Trace.Native.sln @@ -29,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.ClrProfiler.M EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Datadog.Trace.ClrProfiler.Native", "shared\src\Datadog.Trace.ClrProfiler.Native\Datadog.Trace.ClrProfiler.Native.vcxproj", "{48D12C26-6E63-419C-BFE2-E668E8550613}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Datadog.Trace.ClrProfiler.Native.Tests", "shared\test\Datadog.Trace.ClrProfiler.Native.Tests\Datadog.Trace.ClrProfiler.Native.Tests.vcxproj", "{3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -178,26 +176,6 @@ Global {48D12C26-6E63-419C-BFE2-E668E8550613}.Release|x64.Build.0 = Release|x64 {48D12C26-6E63-419C-BFE2-E668E8550613}.Release|x86.ActiveCfg = Release|Win32 {48D12C26-6E63-419C-BFE2-E668E8550613}.Release|x86.Build.0 = Release|Win32 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|Any CPU.ActiveCfg = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|Any CPU.Build.0 = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|ARM64.Build.0 = Debug|ARM64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|ARM64EC.ActiveCfg = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|ARM64EC.Build.0 = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|x64.ActiveCfg = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|x64.Build.0 = Debug|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|x86.ActiveCfg = Debug|Win32 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Debug|x86.Build.0 = Debug|Win32 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|Any CPU.ActiveCfg = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|Any CPU.Build.0 = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|ARM64.ActiveCfg = Release|ARM64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|ARM64.Build.0 = Release|ARM64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|ARM64EC.ActiveCfg = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|ARM64EC.Build.0 = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|x64.ActiveCfg = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|x64.Build.0 = Release|x64 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|x86.ActiveCfg = Release|Win32 - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -210,7 +188,6 @@ Global {6CE95C50-9533-4650-8F11-BCE30908DCDF} = {B9AA20A4-0F9A-47FB-B3BE-A5BDEA42EFF0} {0686E907-996A-4D6D-A685-D9C0F932C405} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} {48D12C26-6E63-419C-BFE2-E668E8550613} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB} - {3FCBD2EB-ACBE-4DA1-850F-12BEE08B937B} = {8CEC2042-F11C-49F5-A674-2355793B600A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F} diff --git a/build/cmake/FindLibdatadog.cmake b/build/cmake/FindLibdatadog.cmake index 46a839460547..2a96950b3231 100644 --- a/build/cmake/FindLibdatadog.cmake +++ b/build/cmake/FindLibdatadog.cmake @@ -4,22 +4,22 @@ endif() include(FetchContent) -set(LIBDATADOG_VERSION "v13.1.0" CACHE STRING "libdatadog version") +set(LIBDATADOG_VERSION "v13.0.0" CACHE STRING "libdatadog version") if (CMAKE_SYSTEM_PROCESSOR STREQUAL aarch64 OR CMAKE_SYSTEM_PROCESSOR STREQUAL arm64) if (DEFINED ENV{IsAlpine} AND "$ENV{IsAlpine}" MATCHES "true") - set(SHA256_LIBDATADOG "9cddbc9ece4c2fe9a1f0ab5a7cfed218d617c5154f318e0bce9a6102b265c989" CACHE STRING "libdatadog sha256") + set(SHA256_LIBDATADOG "13a0e9966f2174ea17b1203f4174c9dae36c482d522c31e67bca3283efd0b550" CACHE STRING "libdatadog sha256") set(FILE_TO_DOWNLOAD libdatadog-aarch64-alpine-linux-musl.tar.gz) else() - set(SHA256_LIBDATADOG "db17a5873d82ef772f969582949b272dcd04044a0cd08b196d3820172a19814d" CACHE STRING "libdatadog sha256") + set(SHA256_LIBDATADOG "84f2006f2b00b018979f1e74f628cb8043413c1e20d19d610f95fceb7e14a8c1" CACHE STRING "libdatadog sha256") set(FILE_TO_DOWNLOAD libdatadog-aarch64-unknown-linux-gnu.tar.gz) endif() else() if (DEFINED ENV{IsAlpine} AND "$ENV{IsAlpine}" MATCHES "true") - set(SHA256_LIBDATADOG "46d0e6445fa1b0fbe8d079e6fa997fa10a4fef4084fe10f4b5886c92effc7be8" CACHE STRING "libdatadog sha256") + set(SHA256_LIBDATADOG "2d7a1926772a9079facfdbfe096881910f2053fe08e59189a6fed89e2b3f4c4d" CACHE STRING "libdatadog sha256") set(FILE_TO_DOWNLOAD libdatadog-${CMAKE_SYSTEM_PROCESSOR}-alpine-linux-musl.tar.gz) else() - set(SHA256_LIBDATADOG "adaf79470fd0b06ce6d63ae8f231e555fa12b70d5bf82565a96a25f59ea8071d" CACHE STRING "libdatadog sha256") + set(SHA256_LIBDATADOG "c0e94fcff4f8129a8e9a3c3805791e189c08ee7a64e803086f33dfec2a767b0d" CACHE STRING "libdatadog sha256") set(FILE_TO_DOWNLOAD libdatadog-${CMAKE_SYSTEM_PROCESSOR}-unknown-linux-gnu.tar.gz) endif() endif() diff --git a/docker-compose.windows.yml b/docker-compose.windows.yml index 02c92ea5f21a..f7a835f8860b 100644 --- a/docker-compose.windows.yml +++ b/docker-compose.windows.yml @@ -23,7 +23,7 @@ services: - "8126:8126" environment: - SNAPSHOT_CI=1 - - SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta.http.client_ip,meta.network.client.ip,meta._dd.p.dm,meta._dd.p.tid,meta._dd.parent_id,meta._dd.appsec.s.req.params,meta._dd.appsec.s.res.body,meta._dd.appsec.s.req.headers,meta._dd.appsec.s.res.headers #api-security attrs are unfortunately ignored because gzip compression generates different bytes per platform windows/linux + - SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta.http.client_ip,meta.network.client.ip,meta._dd.p.dm,meta._dd.p.tid,meta._dd.parent_id smoke-tests.windows: build: diff --git a/docker-compose.yml b/docker-compose.yml index 2b73089d2613..c169b3b1e65b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -871,7 +871,7 @@ services: environment: - ENABLED_CHECKS=trace_count_header,meta_tracer_version_header,trace_content_length - SNAPSHOT_CI=1 - - SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta._dd.p.dm,meta._dd.p.tid,meta._dd.parent_id,meta._dd.appsec.s.req.params,meta._dd.appsec.s.res.body,meta._dd.appsec.s.req.headers,meta._dd.appsec.s.res.headers #api-security attrs are unfortunately ignored because gzip compression generates different bytes per platform windows/linux + - SNAPSHOT_IGNORED_ATTRS=span_id,trace_id,parent_id,duration,start,metrics.system.pid,meta.runtime-id,metrics.process_id,meta._dd.p.dm,meta._dd.p.tid,meta._dd.parent_id smoke-tests: build: diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.cpp index a4f26a44d742..970b007dd3ad 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -27,8 +28,6 @@ extern "C" #include "datadog/crashtracker.h" } -#include - CrashReporting* CrashReporting::Create(int32_t pid) { auto crashReporting = new CrashReportingLinux(pid); @@ -67,9 +66,9 @@ int32_t CrashReportingLinux::Initialize() return result; } -std::pair CrashReportingLinux::FindModule(uintptr_t ip) +std::pair CrashReportingLinux::FindModule(uintptr_t ip) { - for (auto const& module : _modules) + for (auto& module : _modules) { if (ip >= module.startAddress && ip < module.endAddress) { @@ -114,10 +113,10 @@ std::vector CrashReportingLinux::GetModules() continue; } - auto startStr = std::string_view(addressRange).substr(0, dashPos); - auto endStr = std::string_view(addressRange).substr(dashPos + 1); - uintptr_t start = std::stoull(startStr.data(), nullptr, 16); - uintptr_t end = std::stoull(endStr.data(), nullptr, 16); + std::string startStr = addressRange.substr(0, dashPos); + std::string endStr = addressRange.substr(dashPos + 1); + uintptr_t start = std::stoull(startStr, nullptr, 16); + uintptr_t end = std::stoull(endStr, nullptr, 16); // Get the base address of the module if we have it, otherwise add it auto it = moduleBaseAddresses.find(path); @@ -133,7 +132,7 @@ std::vector CrashReportingLinux::GetModules() moduleBaseAddresses[path] = baseAddress; } - modules.push_back(ModuleInfo{ start, end, baseAddress, std::move(path) }); + modules.push_back(ModuleInfo{ start, end, baseAddress, path }); } return modules; @@ -198,8 +197,8 @@ std::vector CrashReportingLinux::GetThreadFrames(int32_t tid, Resolv ResolveMethodData methodData; - auto [moduleName, moduleAddress] = FindModule(ip); - stackFrame.moduleAddress = moduleAddress; + auto module = FindModule(ip); + stackFrame.moduleAddress = module.second; bool hasName = false; @@ -236,13 +235,13 @@ std::vector CrashReportingLinux::GetThreadFrames(int32_t tid, Resolv if (!hasName) { std::ostringstream unknownModule; - unknownModule << moduleName << "!+" << std::hex << (ip - moduleAddress); + unknownModule << module.first << "!+" << std::hex << (ip - module.second); stackFrame.method = unknownModule.str(); } stackFrame.isSuspicious = false; - fs::path modulePath(moduleName); + std::filesystem::path modulePath(module.first); if (modulePath.has_filename()) { @@ -267,6 +266,49 @@ std::vector CrashReportingLinux::GetThreadFrames(int32_t tid, Resolv return MergeFrames(frames, managedFrames); } +std::vector CrashReportingLinux::MergeFrames(const std::vector& nativeFrames, const std::vector& managedFrames) +{ + std::vector result; + result.reserve(std::max(nativeFrames.size(), managedFrames.size())); + + size_t i = 0, j = 0; + while (i < nativeFrames.size() && j < managedFrames.size()) + { + if (nativeFrames.at(i).sp < managedFrames.at(j).sp) + { + result.push_back(nativeFrames.at(i)); + ++i; + } + else if (managedFrames.at(j).sp < nativeFrames.at(i).sp) + { + result.push_back(managedFrames.at(j)); + ++j; + } + else + { // frames[i].sp == managedFrames[j].sp + // Prefer managedFrame when sp values are the same + result.push_back(managedFrames.at(j)); + ++i; + ++j; + } + } + + // Add any remaining frames that are left in either vector + while (i < nativeFrames.size()) + { + result.push_back(nativeFrames.at(i)); + ++i; + } + + while (j < managedFrames.size()) + { + result.push_back(managedFrames.at(j)); + ++j; + } + + return result; +} + std::string CrashReportingLinux::GetSignalInfo(int32_t signal) { auto signalInfo = strsignal(signal); @@ -303,7 +345,7 @@ std::vector> CrashReportingLinux::GetThreads() continue; auto threadId = atoi(entry->d_name); auto threadName = GetThreadName(threadId); - threads.push_back(std::make_pair(threadId, std::move(threadName))); + threads.push_back(std::make_pair(threadId, threadName)); } closedir(proc_dir); diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.h b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.h index c8266de6a426..eace98610a74 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.h +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/CrashReportingLinux.h @@ -28,9 +28,10 @@ class CrashReportingLinux : public CrashReporting private: std::vector> GetThreads() override; std::vector GetThreadFrames(int32_t tid, ResolveManagedCallstack resolveManagedCallstack, void* context) override; - std::pair FindModule(uintptr_t ip); + std::pair FindModule(uintptr_t ip); std::vector GetModules(); std::string GetSignalInfo(int32_t signal) override; + std::vector MergeFrames(const std::vector& nativeFrames, const std::vector& managedFrames); std::string GetThreadName(int32_t tid); unw_addr_space_t _addressSpace; diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp index 76d6bad63e31..a3f87197d11c 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/LinuxStackFramesCollector.cpp @@ -102,13 +102,13 @@ StackSnapshotResultBuffer* LinuxStackFramesCollector::CollectStackSampleImplemen // In case we are self-unwinding, we do not want to be interrupted by the signal-based profilers (walltime and cpu) // This will crashing in libunwind (accessing a memory area which was unmapped) // This lock is acquired by the signal-based profiler (see StackSamplerLoop->StackSamplerLoopManager) - pThreadInfo->AcquireLock(); + pThreadInfo->GetStackWalkLock().Acquire(); _plibrariesInfo->UpdateCache(); on_leave { - pThreadInfo->ReleaseLock(); + pThreadInfo->GetStackWalkLock().Release(); }; errorCode = CollectCallStackCurrentThread(nullptr); diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.cpp deleted file mode 100644 index e4f6a71aae62..000000000000 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.cpp +++ /dev/null @@ -1,247 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc. - -#include "windows.h" - -#include "CrashReportingWindows.h" -#include "TlHelp32.h" -#include "DbgHelp.h" -#include "Psapi.h" - -#include -#include - -#pragma comment(lib, "dbghelp.lib") - -CrashReporting* CrashReporting::Create(int32_t pid) -{ - auto crashReporting = new CrashReportingWindows(pid); - return (CrashReporting*)crashReporting; -} - -CrashReportingWindows::CrashReportingWindows(int32_t pid) - : CrashReporting(pid) - , _process(NULL) -{ -} - -CrashReportingWindows::~CrashReportingWindows() = default; - -int32_t CrashReportingWindows::Initialize() -{ - auto result = CrashReporting::Initialize(); - - if (result == 0) - { - _process = ScopedHandle(OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, _pid)); - - if (!_process.IsValid()) - { - return 1; - } - - SymInitialize(_process, nullptr, TRUE); - - _modules = GetModules(); - } - - return result; -} - -std::vector> CrashReportingWindows::GetThreads() -{ - std::vector> threads; - - auto threadSnapshot = ScopedHandle(CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, _pid)); - - if (!threadSnapshot.IsValid()) - { - return threads; - } - - THREADENTRY32 threadEntry = {}; - threadEntry.dwSize = sizeof(THREADENTRY32); - - if (Thread32First(threadSnapshot, &threadEntry)) - { - do - { - if (threadEntry.th32OwnerProcessID == _pid) - { - auto thread = ScopedHandle(OpenThread(THREAD_QUERY_INFORMATION, FALSE, threadEntry.th32ThreadID)); - - if (thread.IsValid()) - { - std::string threadName; - PWSTR description; - - if (SUCCEEDED(GetThreadDescription(thread, &description))) - { - threadName = shared::ToString(description); - } - - threads.push_back({ threadEntry.th32ThreadID, std::move(threadName) }); - } - } - } while (Thread32Next(threadSnapshot, &threadEntry)); - } - - return threads; -} - -std::vector CrashReportingWindows::GetThreadFrames(int32_t tid, ResolveManagedCallstack resolveManagedCallstack, void* callbackContext) -{ - std::vector frames; - - // Get the managed callstack - ResolveMethodData* managedCallstack; - int32_t numberOfManagedFrames; - - auto resolved = resolveManagedCallstack(tid, callbackContext, &managedCallstack, &numberOfManagedFrames); - - std::vector managedFrames; - - if (resolved == 0 && numberOfManagedFrames > 0) - { - managedFrames.reserve(numberOfManagedFrames); - - for (int i = 0; i < numberOfManagedFrames; i++) - { - auto const& managedFrame = managedCallstack[i]; - - StackFrame stackFrame; - stackFrame.ip = managedFrame.ip; - stackFrame.sp = managedFrame.sp; - stackFrame.method = std::string(managedFrame.symbolName); - stackFrame.moduleAddress = managedFrame.moduleAddress; - stackFrame.symbolAddress = managedFrame.symbolAddress; - stackFrame.isSuspicious = managedFrame.isSuspicious; - - managedFrames.push_back(std::move(stackFrame)); - } - } - - CONTEXT context = {}; - context.ContextFlags = CONTEXT_FULL; - - auto thread = ScopedHandle(OpenThread(THREAD_GET_CONTEXT, FALSE, tid)); - - if (!thread.IsValid()) - { - return managedFrames; - } - - if (GetThreadContext(thread, &context)) - { - STACKFRAME_EX nativeStackFrame = {}; -#ifdef _M_X64 - int machineType = IMAGE_FILE_MACHINE_AMD64; - nativeStackFrame.AddrPC.Offset = context.Rip; - nativeStackFrame.AddrPC.Mode = AddrModeFlat; - nativeStackFrame.AddrFrame.Offset = context.Rsp; - nativeStackFrame.AddrFrame.Mode = AddrModeFlat; - nativeStackFrame.AddrStack.Offset = context.Rsp; - nativeStackFrame.AddrStack.Mode = AddrModeFlat; -#elif _M_IX86 - int machineType = IMAGE_FILE_MACHINE_I386; - nativeStackFrame.AddrPC.Offset = context.Eip; - nativeStackFrame.AddrPC.Mode = AddrModeFlat; - nativeStackFrame.AddrFrame.Offset = context.Ebp; - nativeStackFrame.AddrFrame.Mode = AddrModeFlat; - nativeStackFrame.AddrStack.Offset = context.Esp; - nativeStackFrame.AddrStack.Mode = AddrModeFlat; -#endif - - while (StackWalkEx(machineType, - _process, - thread, - &nativeStackFrame, - &context, - nullptr, - nullptr, - nullptr, - nullptr, - SYM_STKWALK_DEFAULT)) - { - auto [moduleName, moduleAddress] = FindModule(nativeStackFrame.AddrPC.Offset); - - StackFrame stackFrame; - stackFrame.ip = nativeStackFrame.AddrPC.Offset; - stackFrame.sp = nativeStackFrame.AddrStack.Offset; - stackFrame.isSuspicious = false; - stackFrame.moduleAddress = moduleAddress; - stackFrame.symbolAddress = nativeStackFrame.AddrPC.Offset; - - std::ostringstream methodName; - methodName << moduleName << "!+" << std::hex << (nativeStackFrame.AddrPC.Offset - moduleAddress); - stackFrame.method = methodName.str(); - - fs::path modulePath(moduleName); - - if (modulePath.has_filename()) - { - const auto moduleFilename = modulePath.stem().string(); - - if (moduleFilename.rfind("Datadog", 0) == 0 - || moduleFilename == "libdatadog" - || moduleFilename == "datadog" - || moduleFilename == "libddwaf" - || moduleFilename == "ddwaf") - { - stackFrame.isSuspicious = true; - } - } - - frames.push_back(std::move(stackFrame)); - } - } - - return MergeFrames(frames, managedFrames); -} - -std::string CrashReportingWindows::GetSignalInfo(int32_t signal) -{ - return std::string(); -} - -std::vector CrashReportingWindows::GetModules() -{ - std::vector modules; - - HMODULE hModules[1024]; - DWORD cbNeeded; - if (EnumProcessModules(_process, hModules, sizeof(hModules), &cbNeeded)) - { - for (unsigned int i = 0; i < (cbNeeded / sizeof(HMODULE)); ++i) - { - MODULEINFO moduleInfo = {}; - if (GetModuleInformation(_process, hModules[i], &moduleInfo, sizeof(moduleInfo))) - { - std::string resolvedModuleName = ""; - - char moduleName[MAX_PATH]; - if (GetModuleFileNameExA(_process, hModules[i], moduleName, sizeof(moduleName))) - { - resolvedModuleName = moduleName; - } - - modules.push_back({ (uintptr_t)moduleInfo.lpBaseOfDll, (uintptr_t)moduleInfo.lpBaseOfDll + moduleInfo.SizeOfImage, std::move(resolvedModuleName) }); - } - } - } - - return modules; -} - -std::pair CrashReportingWindows::FindModule(uintptr_t ip) -{ - for (auto const& module : _modules) - { - if (ip >= module.startAddress && ip < module.endAddress) - { - return std::make_pair(module.path, module.startAddress); - } - } - - return std::make_pair("", 0); -} diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.h b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.h deleted file mode 100644 index d1fcbc7c2769..000000000000 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/CrashReportingWindows.h +++ /dev/null @@ -1,33 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc. - -#pragma once -#include "CrashReporting.h" -#include "ScopedHandle.h" - -struct ModuleInfo -{ - uintptr_t startAddress; - uintptr_t endAddress; - std::string path; -}; - -class CrashReportingWindows : public CrashReporting -{ -public: - CrashReportingWindows(int32_t pid); - - ~CrashReportingWindows() override; - - int32_t STDMETHODCALLTYPE Initialize() override; - -private: - std::vector> GetThreads() override; - std::vector GetThreadFrames(int32_t tid, ResolveManagedCallstack resolveManagedCallstack, void* context) override; - std::string GetSignalInfo(int32_t signal) override; - std::vector GetModules(); - std::pair FindModule(uintptr_t ip); - - ScopedHandle _process; - std::vector _modules; -}; diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj index 6318b439fbd9..829fc0c3a059 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj @@ -1,6 +1,6 @@ - + Debug @@ -219,7 +219,6 @@ - @@ -237,7 +236,6 @@ - @@ -269,6 +267,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + - \ No newline at end of file + diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj.filters b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj.filters index f44652c84aec..bdfe1208172a 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj.filters +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.Windows.vcxproj.filters @@ -65,9 +65,6 @@ ETW - - Header Files - @@ -109,9 +106,6 @@ ETW - - Source Files - diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.def b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.def index bbe0d7c6a653..68a2870edc62 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.def +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/Datadog.Profiler.Native.def @@ -9,5 +9,4 @@ SetApplicationInfoForAppDomain PRIVATE SetEndpointForTrace PRIVATE SetGitMetadataForApplication PRIVATE - FlushProfile PRIVATE - CreateCrashReport PRIVATE \ No newline at end of file + FlushProfile PRIVATE \ No newline at end of file diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/packages.config b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/packages.config index 8e9f505e1dc5..5a1c0ff95227 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/packages.config +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.cpp index 353ea150a847..4f220c6f0cd4 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.cpp @@ -18,9 +18,13 @@ extern "C" extern "C" IUnknown * STDMETHODCALLTYPE CreateCrashReport(int32_t pid) { +#ifdef _WIN32 + return nullptr; +#else auto instance = CrashReporting::Create(pid); instance->AddRef(); return (IUnknown*)instance; +#endif } CrashReporting::CrashReporting(int32_t pid) @@ -153,11 +157,11 @@ int32_t CrashReporting::ResolveStacks(int32_t crashingThreadId, ResolveManagedCa *isSuspicious = false; - for (auto const& [threadId, threadName] : threads) + for (auto thread : threads) { - auto frames = GetThreadFrames(threadId, resolveCallback, context); + auto frames = GetThreadFrames(thread.first, resolveCallback, context); - ddog_crasht_Slice_StackFrame stackTrace{}; + ddog_crasht_Slice_StackFrame stackTrace; auto count = frames.size(); @@ -169,16 +173,15 @@ int32_t CrashReporting::ResolveStacks(int32_t crashingThreadId, ResolveManagedCa stackTrace.ptr = stackFrames.get(); - auto currentIsCrashingThread = threadId == crashingThreadId; for (int i = 0; i < count; i++) { - auto const& frame = frames[i]; + auto frame = frames.at(i); - if (currentIsCrashingThread) + if (thread.first == crashingThreadId) { // Mark the callstack as suspicious if one of the frames is suspicious // or the thread name begins with DD_ - if (frame.isSuspicious || threadName.rfind("DD_", 0) == 0) + if (frame.isSuspicious || thread.second.rfind("DD_", 0) == 0) { *isSuspicious = true; } @@ -210,7 +213,7 @@ int32_t CrashReporting::ResolveStacks(int32_t crashingThreadId, ResolveManagedCa }; } - auto threadIdStr = std::to_string(threadId); + auto threadIdStr = std::to_string(thread.first); auto result = ddog_crasht_CrashInfo_set_stacktrace(&_crashInfo, { threadIdStr.c_str(), threadIdStr.length() }, stackTrace); @@ -222,7 +225,7 @@ int32_t CrashReporting::ResolveStacks(int32_t crashingThreadId, ResolveManagedCa successfulThreads++; - if (currentIsCrashingThread) + if (thread.first == crashingThreadId) { // Setting the default stacktrace result = ddog_crasht_CrashInfo_set_stacktrace(&_crashInfo, { nullptr, 0 }, stackTrace); @@ -299,49 +302,6 @@ int32_t CrashReporting::ExportImpl(ddog_Endpoint* endpoint) return 0; } -std::vector CrashReporting::MergeFrames(const std::vector& nativeFrames, const std::vector& managedFrames) -{ - std::vector result; - result.reserve(std::max(nativeFrames.size(), managedFrames.size())); - - size_t i = 0, j = 0; - while (i < nativeFrames.size() && j < managedFrames.size()) - { - if (nativeFrames[i].sp < managedFrames[j].sp) - { - result.push_back(nativeFrames[i]); - ++i; - } - else if (managedFrames[j].sp < nativeFrames[i].sp) - { - result.push_back(managedFrames[j]); - ++j; - } - else - { // frames[i].sp == managedFrames[j].sp - // Prefer managedFrame when sp values are the same - result.push_back(managedFrames[j]); - ++i; - ++j; - } - } - - // Add any remaining frames that are left in either vector - while (i < nativeFrames.size()) - { - result.push_back(nativeFrames[i]); - ++i; - } - - while (j < managedFrames.size()) - { - result.push_back(managedFrames[j]); - ++j; - } - - return result; -} - int32_t CrashReporting::CrashProcess() { std::thread crashThread([]() diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.h b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.h index fcf00423f49c..3f3ff1cc47b6 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.h +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/CrashReporting.h @@ -102,7 +102,6 @@ class CrashReporting : public ICrashReporting virtual std::vector GetThreadFrames(int32_t tid, ResolveManagedCallstack resolveManagedCallstack, void* context) = 0; virtual std::string GetSignalInfo(int32_t signal) = 0; - static std::vector MergeFrames(const std::vector& nativeFrames, const std::vector& managedFrames); private: int32_t ExportImpl(ddog_Endpoint* endpoint); int32_t _refCount; diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Datadog.Profiler.Native.vcxproj b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Datadog.Profiler.Native.vcxproj index 5f22a4fea438..d1ac45d00950 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Datadog.Profiler.Native.vcxproj +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Datadog.Profiler.Native.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -355,6 +355,7 @@ + @@ -468,6 +469,6 @@ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + \ No newline at end of file diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.cpp index be0f67435bc3..1c8b76472a0d 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.cpp @@ -41,11 +41,10 @@ ManagedThreadInfo::ManagedThreadInfo(ThreadID clrThreadId, ICorProfilerInfo4* pC _deadlockTotalCount{0}, _deadlockInPeriodCount{0}, _deadlockDetectionPeriod{0}, + _stackWalkLock(1), _isThreadDestroyed{false}, - _traceContext{}, -#ifdef LINUX + _traceContextTrackingInfo{}, _sharedMemoryArea{nullptr}, -#endif _info{pCorProfilerInfo}, _blockingThreadId{0} { diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.h b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.h index 5034d8cd0b03..6cdae8edf55f 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.h +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedThreadInfo.h @@ -10,6 +10,7 @@ #include "IThreadInfo.h" #include "ScopedHandle.h" +#include "Semaphore.h" #include "shared/src/native-src/string.h" #include @@ -75,26 +76,28 @@ struct ManagedThreadInfo : public IThreadInfo std::uint64_t* deadlockDetectionsInAggregationPeriodCount, std::uint64_t* usedDeadlockDetectionsAggregationPeriodIndex) const; + inline Semaphore& GetStackWalkLock(); + inline bool IsThreadDestroyed(); inline bool IsDestroyed(); inline void SetThreadDestroyed(); inline std::pair SetBlockingThread(uint64_t osThreadId, shared::WSTRING name); inline TraceContextTrackingInfo* GetTraceContextPointer(); + inline std::uint64_t GetLocalRootSpanId() const; + inline std::uint64_t GetSpanId() const; inline bool HasTraceContext() const; inline std::string GetProfileThreadId() override; inline std::string GetProfileThreadName() override; - inline void AcquireLock(); - inline void ReleaseLock(); #ifdef LINUX inline void SetSharedMemory(volatile int* memoryArea); inline void MarkAsInterrupted(); inline int32_t SetTimerId(int32_t timerId); inline int32_t GetTimerId() const; - inline bool CanBeInterrupted() const; #endif + inline bool CanBeInterrupted() const; inline AppDomainID GetAppDomainId(); @@ -128,29 +131,29 @@ struct ManagedThreadInfo : public IThreadInfo std::uint64_t _deadlockInPeriodCount; std::uint64_t _deadlockDetectionPeriod; + Semaphore _stackWalkLock; bool _isThreadDestroyed; - TraceContextTrackingInfo _traceContext; + TraceContextTrackingInfo _traceContextTrackingInfo; // strings to be used by samples: avoid allocations when rebuilding them over and over again std::string _profileThreadId; std::string _profileThreadName; - ICorProfilerInfo4* _info; - std::shared_mutex _threadIdMutex; - std::shared_mutex _threadNameMutex; -#ifdef LINUX // Linux only // This is pointer to a shared memory area coming from the Datadog.Linux.ApiWrapper library. // This establishes a simple communication channel between the profiler and this library // to know (for now, maybe more later) if the profiler interrupted a thread which was // doing a syscalls. volatile int* _sharedMemoryArea; + ICorProfilerInfo4* _info; + std::shared_mutex _threadIdMutex; + std::shared_mutex _threadNameMutex; +#ifdef LINUX std::int32_t _timerId; #endif uint64_t _blockingThreadId; shared::WSTRING _blockingThreadName; - std::mutex _objLock; }; std::string ManagedThreadInfo::GetProfileThreadId() @@ -192,16 +195,6 @@ std::string ManagedThreadInfo::GetProfileThreadName() return _profileThreadName; } -inline void ManagedThreadInfo::AcquireLock() -{ - _objLock.lock(); -} - -inline void ManagedThreadInfo::ReleaseLock() -{ - _objLock.unlock(); -} - inline std::string ManagedThreadInfo::BuildProfileThreadId() { std::stringstream builder; @@ -390,10 +383,15 @@ inline void ManagedThreadInfo::GetDeadlocksCount(std::uint64_t* deadlockTotalCou } } +inline Semaphore& ManagedThreadInfo::GetStackWalkLock() +{ + return _stackWalkLock; +} + // TODO: this does not seem to be needed inline bool ManagedThreadInfo::IsThreadDestroyed() { - std::unique_lock l(_objLock); + SemaphoreScope guardedLock(_stackWalkLock); return _isThreadDestroyed; } @@ -405,7 +403,7 @@ inline bool ManagedThreadInfo::IsDestroyed() inline void ManagedThreadInfo::SetThreadDestroyed() { - std::unique_lock l(_objLock); + SemaphoreScope guardedLock(_stackWalkLock); _isThreadDestroyed = true; } @@ -418,12 +416,22 @@ inline std::pair ManagedThreadInfo::SetBlockingThread inline TraceContextTrackingInfo* ManagedThreadInfo::GetTraceContextPointer() { - return &_traceContext; + return &_traceContextTrackingInfo; +} + +inline std::uint64_t ManagedThreadInfo::GetLocalRootSpanId() const +{ + return _traceContextTrackingInfo._currentLocalRootSpanId; +} + +inline std::uint64_t ManagedThreadInfo::GetSpanId() const +{ + return _traceContextTrackingInfo._currentSpanId; } inline bool ManagedThreadInfo::CanReadTraceContext() const { - bool canReadTraceContext = _traceContext._writeGuard; + bool canReadTraceContext = _traceContextTrackingInfo._writeGuard; // As said in the doc, on x86 (x86_64 including) this is a compiler fence. // In our case, it suffices. We have to make sure that reading this field is done @@ -437,20 +445,20 @@ inline bool ManagedThreadInfo::HasTraceContext() const { if (CanReadTraceContext()) { - auto [localRootSpanId, spanId] = GetTracingContext(); + std::uint64_t localRootSpanId = GetLocalRootSpanId(); + std::uint64_t spanId = GetSpanId(); return localRootSpanId != 0 && spanId != 0; } return false; } -#ifdef LINUX - inline bool ManagedThreadInfo::CanBeInterrupted() const { return _sharedMemoryArea == nullptr; } +#ifdef LINUX // This method is called by the signal handler, when the thread has already been interrupted. // There is no race and it's safe to call it there. inline void ManagedThreadInfo::MarkAsInterrupted() @@ -495,8 +503,8 @@ inline std::pair ManagedThreadInfo::GetTracingCont if (CanReadTraceContext()) { - localRootSpanId = _traceContext._currentLocalRootSpanId; - spanId = _traceContext._currentSpanId; + localRootSpanId = GetLocalRootSpanId(); + spanId = GetSpanId(); } return {localRootSpanId, spanId}; diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Semaphore.h b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Semaphore.h new file mode 100644 index 000000000000..83d3d44159fc --- /dev/null +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/Semaphore.h @@ -0,0 +1,126 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2022 Datadog, Inc. + +#pragma once + +#include +#include + +class Semaphore +{ +public: + inline Semaphore(); + explicit inline Semaphore(std::uint32_t initialCount); + inline Semaphore(std::uint32_t initialCount, std::uint32_t maxCount); + + Semaphore(const Semaphore&) = delete; + Semaphore& operator=(const Semaphore&) = delete; + + inline bool TryAcquire(); + inline std::uint32_t Acquire(); + inline std::uint32_t Release(); + inline std::uint32_t GetCurrentCount() const; + inline std::uint32_t GetMaxCount() const; + +private: + std::mutex _syncLock; + std::condition_variable _signal; + std::uint32_t _currentCount; + const std::uint32_t _maxCount; +}; + +class SemaphoreScope +{ +public: + explicit inline SemaphoreScope(Semaphore& semaphore); + inline ~SemaphoreScope() noexcept; + + SemaphoreScope() = delete; + SemaphoreScope(const SemaphoreScope&) = delete; + SemaphoreScope& operator=(const SemaphoreScope&) = delete; + +private: + Semaphore& _semaphore; +}; + +inline Semaphore::Semaphore() : + Semaphore(1, 1) +{ +} + +inline Semaphore::Semaphore(std::uint32_t initialCount) : + Semaphore(initialCount, initialCount) +{ +} + +inline Semaphore::Semaphore(std::uint32_t initialCount, std::uint32_t maxCount) : + _currentCount{initialCount}, + _maxCount{maxCount} +{ +} + +inline bool Semaphore::TryAcquire() +{ + if (_currentCount > 0) + { + std::lock_guard lock(_syncLock); + + if (_currentCount > 0) + { + _currentCount--; + return true; + } + } + + return false; +} + +inline std::uint32_t Semaphore::Acquire() +{ + std::unique_lock lock(_syncLock); + + while (_currentCount == 0) + { + _signal.wait(lock); + } + + return --_currentCount; +} + +inline std::uint32_t Semaphore::Release() +{ + std::uint32_t newCount; + { + std::lock_guard lock(_syncLock); + newCount = ++_currentCount; + + if (_currentCount > _maxCount) + { + _currentCount = _maxCount; + } + } + + _signal.notify_one(); + return newCount; +} + +inline std::uint32_t Semaphore::GetCurrentCount() const +{ + return _currentCount; +} + +inline std::uint32_t Semaphore::GetMaxCount() const +{ + return _maxCount; +} + +inline SemaphoreScope::SemaphoreScope(Semaphore& semaphore) : + _semaphore(semaphore) +{ + _semaphore.Acquire(); +} + +inline SemaphoreScope::~SemaphoreScope() noexcept +{ + _semaphore.Release(); +} \ No newline at end of file diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoop.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoop.cpp index 7f8697430de8..e02744941e5a 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoop.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoop.cpp @@ -252,14 +252,8 @@ void StackSamplerLoop::WalltimeProfilingIteration() firstThread = _targetThread.get(); } - auto mustSkip = -#ifdef LINUX - !_targetThread->CanBeInterrupted() || -#endif - // skip thread if it has a trace context - _targetThread->HasTraceContext(); - - if (mustSkip) + // skip thread if it has a trace context + if (_targetThread->HasTraceContext() || !_targetThread->CanBeInterrupted()) { _targetThread.reset(); continue; @@ -379,14 +373,8 @@ void StackSamplerLoop::CodeHotspotIteration() firstThread = _targetThread.get(); } - auto mustSkip = -#ifdef LINUX - !_targetThread->CanBeInterrupted() || -#endif - // skip if it has no trace context - !_targetThread->HasTraceContext(); - - if (mustSkip) + // skip if it has no trace context + if (!_targetThread->HasTraceContext() || !_targetThread->CanBeInterrupted()) { _targetThread.reset(); continue; @@ -522,7 +510,7 @@ void StackSamplerLoop::CollectOneThreadStackSample( // ----------- ----------- ----------- ----------- ----------- ----------- } // _pManager->AllowStackWalk(..) - } + } // SemaphoreScope guardedLock(pThreadInfo->GetStackWalkLock()) // Store stack-walk results into the results buffer: PersistStackSnapshotResults(pStackSnapshotResult, pThreadInfo, profilingType); diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoopManager.cpp b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoopManager.cpp index 2c0173c1a39d..beb299697c10 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoopManager.cpp +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoopManager.cpp @@ -440,12 +440,12 @@ bool StackSamplerLoopManager::AllowStackWalk(std::shared_ptr // https://sourcegraph.com/github.com/dotnet/runtime/-/blob/src/coreclr/vm/proftoeeinterfaceimpl.cpp?L8479 // we _must_ block in ICorProfilerCallback::ThreadDestroyed to prevent the thread from being destroyed // while walking its callstack. - pThreadInfo->AcquireLock(); + pThreadInfo->GetStackWalkLock().Acquire(); // We _must_ check if the thread was not destroyed while acquiring the lock if (pThreadInfo->IsDestroyed()) { - pThreadInfo->ReleaseLock(); + pThreadInfo->GetStackWalkLock().Release(); return false; } @@ -498,7 +498,7 @@ void StackSamplerLoopManager::NotifyIterationFinished() { std::lock_guard guardedLock(_watcherActivityLock); - _pTargetThread->ReleaseLock(); + _pTargetThread->GetStackWalkLock().Release(); _pTargetThread.reset(); _collectionStartNs = 0; _isTargetThreadSuspended = false; diff --git a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/packages.config b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/packages.config index 8e9f505e1dc5..5a1c0ff95227 100644 --- a/profiler/src/ProfilerEngine/Datadog.Profiler.Native/packages.config +++ b/profiler/src/ProfilerEngine/Datadog.Profiler.Native/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/profiler/test/Datadog.Profiler.IntegrationTests/LinuxOnly/WrapperLibraryTest.cs b/profiler/test/Datadog.Profiler.IntegrationTests/LinuxOnly/WrapperLibraryTest.cs index ebb0228d62c8..4f5b368d1240 100644 --- a/profiler/test/Datadog.Profiler.IntegrationTests/LinuxOnly/WrapperLibraryTest.cs +++ b/profiler/test/Datadog.Profiler.IntegrationTests/LinuxOnly/WrapperLibraryTest.cs @@ -4,7 +4,6 @@ // using System; -using System.Diagnostics; using System.IO; using System.Linq; using Datadog.Profiler.IntegrationTests.Helpers; @@ -93,60 +92,7 @@ public void GenerateDumpIfDbgRequested(string appName, string framework, string using var processHelper = runner.LaunchProcess(); - var success = runner.WaitForExitOrCaptureDump(processHelper.Process, milliseconds: 30_000); - - if (!success) - { - // Note: we don't drain because the process hasn't exited, but it means the output may be incomplete - _output.WriteLine("Standard output:"); - _output.WriteLine(processHelper.StandardOutput); - - var pid = processHelper.Process.Id; - - var status = File.ReadAllText($"/proc/{pid}/status"); - - _output.WriteLine("Process status:"); - _output.WriteLine(status); - - _output.WriteLine("************************"); - - // Enumerating status for each thread - var threads = Directory.GetFiles($"/proc/{pid}/task"); - - foreach (var thread in threads) - { - _output.WriteLine($"**** {thread}:"); - try - { - var threadStatus = File.ReadAllText($"{thread}/status"); - _output.WriteLine(threadStatus); - } - catch (Exception ex) - { - _output.WriteLine(ex.Message); - } - } - - _output.WriteLine("************************"); - - var processes = Process.GetProcesses(); - - _output.WriteLine("Processes:"); - - foreach (var process in processes) - { - _output.WriteLine($"Process: {process.ProcessName} ({process.Id})"); - - if (process.ProcessName == "createdump") - { - var testBaseOutputDir = runner.Environment.GetTestOutputPath(); - process.GetAllThreadsStack(testBaseOutputDir, _output); - process.TakeMemoryDump(testBaseOutputDir, _output); - } - } - } - - success.Should().BeTrue(); + runner.WaitForExitOrCaptureDump(processHelper.Process, milliseconds: 30_000).Should().BeTrue(); processHelper.Drain(); processHelper.ErrorOutput.Should().Contain("Unhandled exception. System.InvalidOperationException: Task failed successfully"); processHelper.StandardOutput.Should().NotMatchRegex(@"createdump [\w\.\/]+createdump \d+") diff --git a/profiler/test/Datadog.Profiler.Native.Tests/Datadog.Profiler.Native.Tests.vcxproj b/profiler/test/Datadog.Profiler.Native.Tests/Datadog.Profiler.Native.Tests.vcxproj index c560696e3e8c..7d57d28fa33b 100644 --- a/profiler/test/Datadog.Profiler.Native.Tests/Datadog.Profiler.Native.Tests.vcxproj +++ b/profiler/test/Datadog.Profiler.Native.Tests/Datadog.Profiler.Native.Tests.vcxproj @@ -1,6 +1,6 @@  - + Debug @@ -210,6 +210,6 @@ - + \ No newline at end of file diff --git a/profiler/test/Datadog.Profiler.Native.Tests/packages.config b/profiler/test/Datadog.Profiler.Native.Tests/packages.config index 7e01b95979ee..deb4c676ab56 100644 --- a/profiler/test/Datadog.Profiler.Native.Tests/packages.config +++ b/profiler/test/Datadog.Profiler.Native.Tests/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj b/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj index f6595e0d586d..79cc9eb6b28c 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj @@ -318,7 +318,6 @@ - @@ -346,7 +345,6 @@ - diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj.filters b/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj.filters index e522bfbe26d9..7a5a769cbb06 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj.filters +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/Datadog.Trace.ClrProfiler.Native.vcxproj.filters @@ -84,18 +84,6 @@ Header Files - - Header Files - - - Header Files - - - Header Files - - - Header Files - @@ -149,15 +137,6 @@ shared - - Source Files - - - Source Files - - - Source Files - diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp index 97ec4df8def1..d54baeb2d5e8 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp @@ -256,25 +256,13 @@ namespace datadog::shared::nativeloader } // - // Initialize the dispatcher + // Get and set profiler pointers // if (m_dispatcher == nullptr) { - Log::Error("Dispatcher is not set."); - single_step_guard_rails.RecordBootstrapError(runtimeInformation, "initialization_error"); - return E_FAIL; - } - - if (FAILED(m_dispatcher->Initialize())) - { - Log::Error("Error initializing the dispatcher."); single_step_guard_rails.RecordBootstrapError(runtimeInformation, "initialization_error"); return E_FAIL; } - - // - // Get and set profiler pointers - // IDynamicInstance* cpInstance = m_dispatcher->GetContinuousProfilerInstance(); if (cpInstance != nullptr) { diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler_class_factory.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler_class_factory.cpp index e7deaa2f0963..1c22ff362fd4 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler_class_factory.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler_class_factory.cpp @@ -27,7 +27,13 @@ HRESULT STDMETHODCALLTYPE CorProfilerClassFactory::QueryInterface(REFIID riid, v { *ppvObject = this; this->AddRef(); - + + // We try to load the class factory of all target cor profilers. + if (FAILED(m_dispatcher->LoadClassFactory(riid))) + { + Log::Warn("Error loading all cor profiler class factories."); + } + return S_OK; } @@ -65,7 +71,11 @@ HRESULT STDMETHODCALLTYPE CorProfilerClassFactory::CreateInstance(IUnknown* pUnk auto profiler = new datadog::shared::nativeloader::CorProfiler(m_dispatcher); HRESULT res = profiler->QueryInterface(riid, ppvObject); - if (FAILED(res)) + if (SUCCEEDED(res)) + { + m_dispatcher->LoadInstance(pUnkOuter, riid); + } + else { delete profiler; } diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.cpp deleted file mode 100644 index abce9a477f1a..000000000000 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.cpp +++ /dev/null @@ -1,424 +0,0 @@ -#include "crashhandler.h" -#include -#include "util.h" -#include "WerApi.h" -#include - -namespace datadog::shared::nativeloader -{ - // Get the path of the current module - std::wstring GetCurrentDllPath() - { - wchar_t path[MAX_PATH]; - HMODULE hm = NULL; - - if (GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | - GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, - (LPCWSTR)&GetCurrentDllPath, &hm) == 0) - { - Log::Warn("Crashtracking - Failed to get the current module handle: ", GetLastError()); - return std::wstring(); - } - - if (GetModuleFileNameW(hm, path, MAX_PATH) == 0) - { - Log::Warn("Crashtracking - Failed to get the current module filename: ", GetLastError()); - return std::wstring(); - } - - return std::wstring(path); - } - - bool RegistryValueExists(HKEY rootKey, LPCWSTR subKey, LPCWSTR valueName) - { - HKEY hKey; - auto result = RegOpenKeyEx(rootKey, subKey, 0, KEY_QUERY_VALUE, &hKey); - - if (result == ERROR_SUCCESS) - { - DWORD dataSize = 0; - DWORD valueType = 0; - result = RegQueryValueEx(hKey, valueName, NULL, &valueType, NULL, &dataSize); - RegCloseKey(hKey); - - return result == ERROR_SUCCESS; - } - - return false; - } - - // Capture all the environment variables starting with "DD_" - void GetDatadogEnvironmentBlock(WCHAR*& environmentVariables, int32_t& length) - { - auto envStrings = GetEnvironmentStrings(); - - std::wstring envBlock; - - if (envStrings == nullptr) - { - length = 2; - environmentVariables = new WCHAR[length]; - environmentVariables[0] = L'\0'; - environmentVariables[1] = L'\0'; - return; - } - - for (LPWCH env = envStrings; *env != L'\0'; env += wcslen(env) + 1) - { - if (wcsncmp(env, L"DD_", 3) == 0) - { - envBlock.append(env); - envBlock.push_back('\0'); - } - } - - // Environment block ends with a double null terminator - envBlock.push_back('\0'); - - if (envBlock.length() == 1) - { - // If the environment block was empty, we're still missing one null terminator - envBlock.push_back('\0'); - } - - length = static_cast(envBlock.length()); - environmentVariables = new WCHAR[length]; - memcpy(environmentVariables, envBlock.c_str(), length * sizeof(WCHAR)); - FreeEnvironmentStrings(envStrings); - } - - // Merge two environment blocks. The first one takes precedence. - std::vector MergeEnvironmentBlocks(LPCWSTR envBlock1, LPCWSTR envBlock2) - { - // Define a case-insensitive comparator for keys - struct CaseInsensitiveCompare - { - bool operator()(const std::wstring& lhs, const std::wstring& rhs) const - { - return _wcsicmp(lhs.c_str(), rhs.c_str()) < 0; - } - }; - - // Map to hold environment variables with case-insensitive keys - std::map envMap; - - // Helper lambda to parse an environment block into the map - auto parseEnvBlock = [&envMap](LPCWSTR envBlock) - { - if (envBlock) - { - LPCWSTR curr = envBlock; - while (*curr) - { - std::wstring entry = curr; - size_t pos = entry.find(L'='); - if (pos != std::wstring::npos) - { - std::wstring key = entry.substr(0, pos); - std::wstring value = entry.substr(pos + 1); - envMap[key] = std::move(value); // Insert or overwrite the key - } - // Move to the next null-terminated string - curr += entry.length() + 1; - } - } - }; - - // Parse envBlock2 first so that envBlock1 values take precedence - parseEnvBlock(envBlock2); - parseEnvBlock(envBlock1); - - // Reconstruct the combined environment block - std::vector result; - result.reserve(envMap.size()); - - for (const auto& kv : envMap) - { - std::wstring entry = kv.first + L"=" + kv.second; - result.insert(result.end(), entry.begin(), entry.end()); - result.push_back(L'\0'); // Null terminator for the entry - } - result.push_back(L'\0'); // Double null terminator at the end - - return result; - } - - std::unique_ptr CrashHandler::Create() - { - std::unique_ptr crashHandler(new CrashHandler()); - - if (crashHandler->Register()) - { - return crashHandler; - } - - return nullptr; - } - - CrashHandler::~CrashHandler() - { - if (!_crashHandler.empty()) - { - auto hr = WerUnregisterRuntimeExceptionModule(_crashHandler.c_str(), &_context); - Log::Debug("Crashtracking - Unregistering crash handler: ", hr); - _crashHandler.clear(); - } - - if (_context.Environ != nullptr) - { - delete[] _context.Environ; - } - - _context.Environ = nullptr; - _context.EnvironLength = 0; - } - - CrashHandler::CrashHandler() - : _context(), - _crashHandler() - { - } - - bool CrashHandler::Register() - { - if (!_crashHandler.empty()) - { - Log::Warn("Crashtracking - Trying to initialize the crash handler twice"); - return false; - } - - auto dllPath = GetCurrentDllPath(); - - if (dllPath.empty()) - { - Log::Warn("Crashtracking - Could not register the crash handler: error when retrieving the path of the DLL"); - return false; - } - - GetDatadogEnvironmentBlock(_context.Environ, _context.EnvironLength); - - // Register the crash handler in the registry - // Windows expects a DWORD value with the full path of the DLL as the name, - // in SOFTWARE\Microsoft\Windows\Windows Error Reporting\RuntimeExceptionHelperModules. - // The key can be located either in HKLM or HKCU. The MSI will create the value in HKLM, - // but if it's missing we add it to HKCU. - HKEY hKey; - LPCWSTR subKey = L"SOFTWARE\\Microsoft\\Windows\\Windows Error Reporting\\RuntimeExceptionHelperModules"; - DWORD value = 1; - - if (!RegistryValueExists(HKEY_LOCAL_MACHINE, subKey, dllPath.c_str())) - { - // Open the key - DWORD disposition; - auto result = RegCreateKeyEx(HKEY_CURRENT_USER, subKey, 0, NULL, 0, KEY_SET_VALUE, NULL, &hKey, &disposition); - - if (result != ERROR_SUCCESS) - { - // Failing to set the registry is not a fatal error: in the worst case scenario the crash handler just won't be invoked by WER - Log::Warn("Crashtracking - Failed to create registry key: ", GetLastError()); - } - else - { - // Set the value - result = RegSetValueEx(hKey, dllPath.c_str(), 0, REG_DWORD, reinterpret_cast(&value), sizeof(value)); - - if (result != ERROR_SUCCESS) - { - Log::Warn("Crashtracking - Failed to set registry value: ", GetLastError()); - } - - RegCloseKey(hKey); - } - } - - // The profiler API is not initialized yet, so we look for clr.dll/coreclr.dll - // to know if we're running with .NET Framework or .NET Core - bool isDotnetCore = true; - HMODULE hModule = GetModuleHandle(L"coreclr.dll"); - - if (hModule == NULL) - { - hModule = GetModuleHandle(L"clr.dll"); - isDotnetCore = false; - - if (hModule == NULL) - { - Log::Warn("Crashtracking - Failed to get module handle for coreclr.dll or clr.dll"); - return false; - } - } - - wchar_t buffer[MAX_PATH]; - - if (GetModuleFileNameW(hModule, buffer, MAX_PATH) == 0) - { - Log::Warn("Crashtracking - Failed to get module filename: ", GetLastError()); - return false; - } - - auto clrFileName = std::wstring(buffer); - - fs::path clrFileNamePath(clrFileName); - auto clrDirectory = clrFileNamePath.parent_path(); - - // Build the path to the DAC (mscordacwks.dll on .NET, mscordaccore.dll on .NET Core) - std::wstring dacFileName = isDotnetCore ? L"mscordaccore.dll" : L"mscordacwks.dll"; - fs::path dacFilePath = clrDirectory / dacFileName; - - // Unregister the .NET handler - Log::Debug("Crashtracking - Unregistering the .NET handler ", dacFilePath.c_str()); - auto unregisterDacHr = WerUnregisterRuntimeExceptionModule(dacFilePath.c_str(), (PVOID)hModule); - - if (FAILED(unregisterDacHr)) - { - Log::Warn("Crashtracking - Failed to unregister the DAC handler: ", unregisterDacHr); - } - - // Register our handler - Log::Debug("Crashtracking - Registering the crash handler ", dllPath.c_str()); - auto registrationHr = WerRegisterRuntimeExceptionModule(dllPath.c_str(), &_context); - - // If we successfully unregistered the .NET handler, put it back in place - if (SUCCEEDED(unregisterDacHr)) - { - auto registrationHr2 = WerRegisterRuntimeExceptionModule(dacFilePath.c_str(), (PVOID)hModule); - - if (FAILED(registrationHr2)) - { - Log::Warn("Crashtracking - Failed to re-register the DAC handler: ", registrationHr2); - } - } - - if (FAILED(registrationHr)) - { - Log::Warn("Crashtracking - Could not register the crash handler: ", registrationHr); - return false; - } - - _crashHandler = dllPath; - return true; - } - - extern "C" - { - HRESULT __declspec(dllexport) OutOfProcessExceptionEventCallback( - PVOID pContext, - const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - BOOL* pbOwnershipClaimed, - PWSTR pwszEventName, - PDWORD pchSize, - PDWORD pdwSignatureCount - ) - { - Log::Debug("Crashtracking - OutOfProcessExceptionEventCallback"); - - if (pbOwnershipClaimed != nullptr) - { - // We don't claim the ownership of the crash. - // This way, the original crash handler registered by .NET will be invoked, - // and we don't affect the normal behavior. - *pbOwnershipClaimed = FALSE; - } - - // Get the pid and tid from the exception - auto pid = GetProcessId(pExceptionInformation->hProcess); - auto tid = GetThreadId(pExceptionInformation->hThread); - - // Read the environment variables saved in the crashing process - WerContext context{}; - - BOOL hasContext = ReadProcessMemory(pExceptionInformation->hProcess, pContext, &context, sizeof(context), nullptr); - BOOL hasEnviron = FALSE; - - std::vector envBlock; - - if (hasContext && context.EnvironLength > 0 && context.Environ != nullptr) - { - envBlock.resize(context.EnvironLength * sizeof(WCHAR)); - hasEnviron = ReadProcessMemory(pExceptionInformation->hProcess, context.Environ, envBlock.data(), context.EnvironLength * sizeof(WCHAR), nullptr); - - if (!hasEnviron) - { - Log::Warn("Crashtracking - Failed to read the environment block from crashing process"); - } - } - - // Merge them with the current environment variables - auto currentEnv = GetEnvironmentStrings(); - - if (hasEnviron) - { - envBlock = MergeEnvironmentBlocks((LPCWSTR)envBlock.data(), currentEnv); - } - else - { - envBlock.assign(currentEnv, currentEnv + envBlock.size()); - } - - FreeEnvironmentStrings(currentEnv); - - // Create the command-line for dd-dotnet - fs::path p(GetCurrentDllPath()); - auto directory = p.parent_path(); - auto ddDotnetPath = directory / "dd-dotnet.exe"; - - if (!fs::exists(ddDotnetPath)) - { - Log::Error("Crashtracking - dd-dotnet.exe not found at ", ddDotnetPath.c_str()); - return S_OK; - } - - std::wstringstream ss; - ss << ddDotnetPath << " createdump " << pid << " --crashthread " << tid; - auto commandLine = ss.str(); - - // Spawn dd-dotnet - STARTUPINFO si; - PROCESS_INFORMATION pi; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - if (!CreateProcessW(NULL, &commandLine[0], NULL, NULL, FALSE, CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, envBlock.data(), NULL, &si, &pi)) - { - Log::Error("Crashtracking - Failed to spawn dd-dotnet.exe: ", GetLastError()); - return S_OK; - } - - // Wait for the process to exit - WaitForSingleObject(pi.hProcess, INFINITE); - - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - - Log::Debug("Crashtracking - Crash report sent."); - - return S_OK; - } - - HRESULT __declspec(dllexport) OutOfProcessExceptionEventSignatureCallback( - PVOID pContext, - const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - DWORD dwIndex, - PWSTR pwszName, - PDWORD pchName, - PWSTR pwszValue, - PDWORD pchValue - ) - { - return E_NOTIMPL; - } - - HRESULT __declspec(dllexport) OutOfProcessExceptionEventDebuggerLaunchCallback( - PVOID pContext, - const PWER_RUNTIME_EXCEPTION_INFORMATION pExceptionInformation, - PBOOL pbIsCustomDebugger, - PWSTR pwszDebuggerLaunch, - PDWORD pchDebuggerLaunch, - PBOOL pbIsDebuggerAutolaunch - ) - { - return E_NOTIMPL; - } - } -} \ No newline at end of file diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.h b/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.h deleted file mode 100644 index 479e33f4b7a9..000000000000 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/crashhandler.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include "util.h" -#include "werapi.h" - -namespace datadog::shared::nativeloader -{ - // Be careful when updating the WerContext structure, it is read across processes using ReadProcessMemory - struct WerContext - { - WCHAR* Environ; - int32_t EnvironLength; - }; - - class CrashHandler - { - public: - static std::unique_ptr Create(); - - ~CrashHandler(); - - private: - CrashHandler(); - bool Register(); - - std::wstring _crashHandler; - WerContext _context; - }; -} \ No newline at end of file diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp index 70ee30f937c9..f4e640700179 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dllmain.cpp @@ -1,22 +1,10 @@ // dllmain.cpp : Defines the entry point for the DLL application. - -#if _WIN32 && AMD64 -#define CRASHTRACKING 1 -#endif - #include "cor_profiler_class_factory.h" #include "log.h" #include "dynamic_dispatcher.h" #include "util.h" -#if CRASHTRACKING -#include "crashhandler.h" -#endif - -#include "util.h" -#include - #ifndef _WIN32 #undef EXTERN_C #define EXTERN_C extern "C" __attribute__((visibility("default"))) @@ -26,89 +14,67 @@ using namespace datadog::shared::nativeloader; IDynamicDispatcher* dispatcher; -#if CRASHTRACKING -std::unique_ptr crashHandler; -#endif - EXTERN_C BOOL STDMETHODCALLTYPE DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { // Perform actions based on the reason for calling. switch (ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - { - // Initialize once for each new process. - // Return FALSE to fail DLL load. - - constexpr const bool IsLogDebugEnabledDefault = false; - bool isLogDebugEnabled; + case DLL_PROCESS_ATTACH: + { + // Initialize once for each new process. + // Return FALSE to fail DLL load. - shared::WSTRING isLogDebugEnabledStr = shared::GetEnvironmentValue(EnvironmentVariables::DebugLogEnabled); + constexpr const bool IsLogDebugEnabledDefault = false; + bool isLogDebugEnabled; - // no environment variable set - if (isLogDebugEnabledStr.empty()) - { - Log::Info("No \"", EnvironmentVariables::DebugLogEnabled, "\" environment variable has been found.", - " Enable debug log = ", IsLogDebugEnabledDefault, " (default)."); + shared::WSTRING isLogDebugEnabledStr = shared::GetEnvironmentValue(EnvironmentVariables::DebugLogEnabled); - isLogDebugEnabled = IsLogDebugEnabledDefault; - } - else - { - if (!shared::TryParseBooleanEnvironmentValue(isLogDebugEnabledStr, isLogDebugEnabled)) + // no environment variable set + if (isLogDebugEnabledStr.empty()) { - // invalid value for environment variable - Log::Info("Non boolean value \"", isLogDebugEnabledStr, "\" for \"", - EnvironmentVariables::DebugLogEnabled, "\" environment variable.", - " Enable debug log = ", IsLogDebugEnabledDefault, " (default)."); + Log::Info("No \"", EnvironmentVariables::DebugLogEnabled, "\" environment variable has been found.", + " Enable debug log = ", IsLogDebugEnabledDefault, " (default)."); isLogDebugEnabled = IsLogDebugEnabledDefault; } else { - // take environment variable into account - Log::Info("Enable debug log = ", isLogDebugEnabled, " from (", EnvironmentVariables::DebugLogEnabled, " environment variable)"); + if (!shared::TryParseBooleanEnvironmentValue(isLogDebugEnabledStr, isLogDebugEnabled)) + { + // invalid value for environment variable + Log::Info("Non boolean value \"", isLogDebugEnabledStr, "\" for \"", + EnvironmentVariables::DebugLogEnabled, "\" environment variable.", + " Enable debug log = ", IsLogDebugEnabledDefault, " (default)."); + + isLogDebugEnabled = IsLogDebugEnabledDefault; + } + else + { + // take environment variable into account + Log::Info("Enable debug log = ", isLogDebugEnabled, " from (", EnvironmentVariables::DebugLogEnabled, " environment variable)"); + } } - } - if (isLogDebugEnabled) - { - Log::EnableDebug(true); - } - -#if CRASHTRACKING - bool telemetry_enabled = true; - shared::TryParseBooleanEnvironmentValue(shared::GetEnvironmentValue(L"DD_INSTRUMENTATION_TELEMETRY_ENABLED"), telemetry_enabled); + if (isLogDebugEnabled) + { + Log::EnableDebug(true); + } - bool crashtracking_enabled = true; - shared::TryParseBooleanEnvironmentValue(shared::GetEnvironmentValue(L"DD_CRASHTRACKING_ENABLED"), crashtracking_enabled); - - if (telemetry_enabled && crashtracking_enabled) - { - Log::Info("Crashtracking - Registering unhandled exception filter."); - crashHandler = CrashHandler::Create(); - } - else - { - Log::Info("Crashtracking - Disabled by configuration."); - } -#endif + Log::Debug("DllMain: DLL_PROCESS_ATTACH"); + Log::Debug("DllMain: Pointer size: ", 8 * sizeof(void*), " bits."); dispatcher = new DynamicDispatcherImpl(); + dispatcher->LoadConfiguration(GetConfigurationFilePath()); - // ***************************************************************************************************************** - break; - } - - case DLL_PROCESS_DETACH: - // Perform any necessary cleanup. - Log::Debug("DllMain: DLL_PROCESS_DETACH"); + // ***************************************************************************************************************** + break; + } -#if CRASHTRACKING - crashHandler = nullptr; -#endif + case DLL_PROCESS_DETACH: + // Perform any necessary cleanup. + Log::Debug("DllMain: DLL_PROCESS_DETACH"); - break; + break; } return TRUE; // Successful DLL_PROCESS_ATTACH. } @@ -118,7 +84,7 @@ EXTERN_C HRESULT STDMETHODCALLTYPE DllGetClassObject(REFCLSID rclsid, REFIID rii Log::Debug("DllGetClassObject"); // {846F5F1C-F9AE-4B07-969E-05C26BC060D8} - const GUID CLSID_CorProfiler = { 0x846f5f1c, 0xf9ae, 0x4b07, {0x96, 0x9e, 0x5, 0xc2, 0x6b, 0xc0, 0x60, 0xd8} }; + const GUID CLSID_CorProfiler = {0x846f5f1c, 0xf9ae, 0x4b07, {0x96, 0x9e, 0x5, 0xc2, 0x6b, 0xc0, 0x60, 0xd8}}; if (ppv == nullptr || rclsid != CLSID_CorProfiler) { diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.cpp index a874a89d5496..99592ad55c2a 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.cpp @@ -22,43 +22,10 @@ namespace datadog::shared::nativeloader DynamicDispatcherImpl::DynamicDispatcherImpl() : m_continuousProfilerInstance(nullptr), m_tracerInstance(nullptr), - m_customInstance(nullptr), - m_initialized(false), - m_initializationResult(E_UNEXPECTED) + m_customInstance(nullptr) { } - HRESULT DynamicDispatcherImpl::Initialize() - { - if (m_initialized) - { - return m_initializationResult; - } - - m_initialized = true; - - LoadConfiguration(GetConfigurationFilePath()); - - m_initializationResult = LoadClassFactory(IID_IClassFactory); - - if (FAILED(m_initializationResult)) - { - Log::Error("Error loading all cor profiler class factories."); - return m_initializationResult; - } - - m_initializationResult = LoadInstance(); - - if (FAILED(m_initializationResult)) - { - Log::Error("Error loading all cor profiler instances."); - return m_initializationResult; - } - - m_initializationResult = S_OK; - return m_initializationResult; - } - void DynamicDispatcherImpl::LoadConfiguration(fs::path&& configFilePath) { ::shared::WSTRING nativeLoaderPath = ::shared::GetCurrentModuleFileName(); @@ -189,8 +156,7 @@ namespace datadog::shared::nativeloader HRESULT DynamicDispatcherImpl::LoadClassFactory(REFIID riid) { - // We consider the loading a success if at least one class factory is properly loaded. - HRESULT GHR = E_FAIL; + HRESULT GHR = S_OK; if (m_continuousProfilerInstance != nullptr) { @@ -198,19 +164,11 @@ namespace datadog::shared::nativeloader if (FAILED(result)) { Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load continuous profiler class factory in: ", - m_continuousProfilerInstance->GetFilePath(), ", error code: ", result); + m_continuousProfilerInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_continuousProfilerInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } @@ -219,20 +177,11 @@ namespace datadog::shared::nativeloader HRESULT result = m_tracerInstance->LoadClassFactory(riid); if (FAILED(result)) { - Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load tracer class factory in: ", - m_tracerInstance->GetFilePath(), ", error code: ", result); + Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load tracer class factory in: ", m_tracerInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_tracerInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } @@ -241,94 +190,58 @@ namespace datadog::shared::nativeloader HRESULT result = m_customInstance->LoadClassFactory(riid); if (FAILED(result)) { - Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load custom class factory in: ", - m_customInstance->GetFilePath(), ", error code: ", result); + Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load custom class factory in: ", m_customInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_customInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } return GHR; } - HRESULT DynamicDispatcherImpl::LoadInstance() + HRESULT DynamicDispatcherImpl::LoadInstance(IUnknown* pUnkOuter, REFIID riid) { - // We consider the loading a success if at least one class factory is properly loaded. - HRESULT GHR = E_FAIL; + HRESULT GHR = S_OK; if (m_continuousProfilerInstance != nullptr) { - HRESULT result = m_continuousProfilerInstance->LoadInstance(); + HRESULT result = m_continuousProfilerInstance->LoadInstance(pUnkOuter, riid); if (FAILED(result)) { Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the continuous profiler instance in: ", - m_continuousProfilerInstance->GetFilePath(), ", error code: ", result); + m_continuousProfilerInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_continuousProfilerInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } if (m_tracerInstance != nullptr) { - HRESULT result = m_tracerInstance->LoadInstance(); + HRESULT result = m_tracerInstance->LoadInstance(pUnkOuter, riid); if (FAILED(result)) { - Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the tracer instance in: ", - m_tracerInstance->GetFilePath(), ", error code: ", result); + Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the tracer instance in: ", m_tracerInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_tracerInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } if (m_customInstance != nullptr) { - HRESULT result = m_customInstance->LoadInstance(); + HRESULT result = m_customInstance->LoadInstance(pUnkOuter, riid); if (FAILED(result)) { - Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the custom instance in: ", - m_customInstance->GetFilePath(), ", error code: ", result); + Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the custom instance in: ", m_customInstance->GetFilePath()); // If we cannot load the class factory we release the instance. m_customInstance.release(); - - if (GHR != S_OK) - { - GHR = result; - } - } - else - { - GHR = S_OK; + GHR = result; } } @@ -403,4 +316,4 @@ namespace datadog::shared::nativeloader return m_customInstance.get(); } -} // namespace datadog::shared::nativeloader +} // namespace datadog::shared::nativeloader \ No newline at end of file diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.h b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.h index 2c8881e34805..f47438a88504 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.h +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_dispatcher.h @@ -18,12 +18,11 @@ namespace datadog::shared::nativeloader // class IDynamicDispatcher { - protected: - virtual void LoadConfiguration(fs::path&& configFilePath) = 0; - public: virtual ~IDynamicDispatcher() = default; - virtual HRESULT Initialize() = 0; + virtual void LoadConfiguration(fs::path&& configFilePath) = 0; + virtual HRESULT LoadClassFactory(REFIID riid) = 0; + virtual HRESULT LoadInstance(IUnknown* pUnkOuter, REFIID riid) = 0; virtual HRESULT STDMETHODCALLTYPE DllCanUnloadNow() = 0; virtual IDynamicInstance* GetContinuousProfilerInstance() = 0; virtual IDynamicInstance* GetTracerInstance() = 0; @@ -39,22 +38,16 @@ namespace datadog::shared::nativeloader std::unique_ptr m_continuousProfilerInstance; std::unique_ptr m_tracerInstance; std::unique_ptr m_customInstance; - void LoadConfiguration(fs::path&& configFilePath) override; public: DynamicDispatcherImpl(); - HRESULT Initialize() override; + void LoadConfiguration(fs::path&& configFilePath) override; + HRESULT LoadClassFactory(REFIID riid) override; + HRESULT LoadInstance(IUnknown* pUnkOuter, REFIID riid) override; HRESULT STDMETHODCALLTYPE DllCanUnloadNow() override; IDynamicInstance* GetContinuousProfilerInstance() override; IDynamicInstance* GetTracerInstance() override; IDynamicInstance* GetCustomInstance() override; - - private: - HRESULT LoadClassFactory(REFIID riid); - HRESULT LoadInstance(); - - bool m_initialized; - HRESULT m_initializationResult; }; } // namespace datadog::shared::nativeloader \ No newline at end of file diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.cpp b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.cpp index 9d62a475ce9f..e10e10f49ffc 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.cpp +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.cpp @@ -65,7 +65,7 @@ namespace datadog::shared::nativeloader return res; } - HRESULT DynamicInstanceImpl::LoadInstance() + HRESULT DynamicInstanceImpl::LoadInstance(IUnknown* pUnkOuter, REFIID riid) { Log::Debug("DynamicInstanceImpl::LoadInstance"); diff --git a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.h b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.h index c18ba98646f4..123b52817d5c 100644 --- a/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.h +++ b/shared/src/Datadog.Trace.ClrProfiler.Native/dynamic_instance.h @@ -20,7 +20,7 @@ namespace datadog::shared::nativeloader public: virtual ~IDynamicInstance() = default; virtual HRESULT LoadClassFactory(REFIID riid) = 0; - virtual HRESULT LoadInstance() = 0; + virtual HRESULT LoadInstance(IUnknown* pUnkOuter, REFIID riid) = 0; virtual HRESULT STDMETHODCALLTYPE DllCanUnloadNow() = 0; virtual ICorProfilerCallback10* GetProfilerCallback() = 0; virtual std::string GetFilePath() = 0; @@ -42,7 +42,7 @@ namespace datadog::shared::nativeloader DynamicInstanceImpl(const std::string& filePath, const std::string& clsid); ~DynamicInstanceImpl() override; HRESULT LoadClassFactory(REFIID riid) override; - HRESULT LoadInstance() override; + HRESULT LoadInstance(IUnknown* pUnkOuter, REFIID riid) override; HRESULT STDMETHODCALLTYPE DllCanUnloadNow() override; ICorProfilerCallback10* GetProfilerCallback() override; std::string GetFilePath() override; diff --git a/shared/src/msi-installer/Product.wxs b/shared/src/msi-installer/Product.wxs index 700ddfe93865..0bcf7fd89aad 100644 --- a/shared/src/msi-installer/Product.wxs +++ b/shared/src/msi-installer/Product.wxs @@ -129,9 +129,6 @@ - - - diff --git a/shared/test/Datadog.Trace.ClrProfiler.Native.Tests/test_dynamic_instance.h b/shared/test/Datadog.Trace.ClrProfiler.Native.Tests/test_dynamic_instance.h index 9290f6d9e07b..192448ecf3da 100644 --- a/shared/test/Datadog.Trace.ClrProfiler.Native.Tests/test_dynamic_instance.h +++ b/shared/test/Datadog.Trace.ClrProfiler.Native.Tests/test_dynamic_instance.h @@ -34,10 +34,10 @@ class TestDynamicInstanceImpl : public DynamicInstanceImpl return m_loadClassFactory; } - HRESULT LoadInstance() override + HRESULT LoadInstance(IUnknown* pUnkOuter, REFIID riid) override { if (GetFilePath() != "Test") - return DynamicInstanceImpl::LoadInstance(); + return DynamicInstanceImpl::LoadInstance(pUnkOuter, riid); return m_loadInstance; } diff --git a/tracer/build/PackageVersionsLatestMajors.g.props b/tracer/build/PackageVersionsLatestMajors.g.props index 99f5a6250756..46af2e03c382 100644 --- a/tracer/build/PackageVersionsLatestMajors.g.props +++ b/tracer/build/PackageVersionsLatestMajors.g.props @@ -13,97 +13,97 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.DynamoDBv2 - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.Kinesis @@ -127,97 +127,97 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.Amazon.Lambda.RuntimeSupport - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SimpleNotificationService @@ -535,13 +535,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate @@ -553,13 +553,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate @@ -571,13 +571,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate @@ -2467,7 +2467,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests @@ -2479,7 +2479,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests @@ -2491,7 +2491,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests @@ -2503,7 +2503,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests @@ -2515,7 +2515,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests @@ -2527,7 +2527,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests @@ -2539,7 +2539,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests @@ -2551,7 +2551,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests @@ -2563,7 +2563,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests2 @@ -2575,7 +2575,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests2 @@ -2587,7 +2587,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests2 @@ -2599,7 +2599,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests2 @@ -2611,7 +2611,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests2 @@ -2623,7 +2623,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests2 @@ -2635,7 +2635,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests2 @@ -2647,7 +2647,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests2 @@ -2659,7 +2659,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTestsRetries @@ -2671,7 +2671,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTestsRetries @@ -2683,7 +2683,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTestsRetries @@ -2695,7 +2695,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTestsRetries @@ -2707,7 +2707,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTestsRetries @@ -2719,7 +2719,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTestsRetries @@ -2731,7 +2731,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTestsRetries @@ -2743,7 +2743,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTestsRetries diff --git a/tracer/build/PackageVersionsLatestMinors.g.props b/tracer/build/PackageVersionsLatestMinors.g.props index f4a171b75477..7bbc0bf2f5fd 100644 --- a/tracer/build/PackageVersionsLatestMinors.g.props +++ b/tracer/build/PackageVersionsLatestMinors.g.props @@ -31,7 +31,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.DynamoDBv2 @@ -49,7 +49,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.DynamoDBv2 @@ -67,7 +67,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.DynamoDBv2 @@ -85,7 +85,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.DynamoDBv2 @@ -103,7 +103,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.DynamoDBv2 @@ -121,7 +121,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.DynamoDBv2 @@ -139,7 +139,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.DynamoDBv2 @@ -157,7 +157,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.DynamoDBv2 @@ -181,7 +181,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.Kinesis @@ -199,7 +199,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.Kinesis @@ -217,7 +217,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.Kinesis @@ -235,7 +235,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.Kinesis @@ -253,7 +253,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.Kinesis @@ -271,7 +271,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.Kinesis @@ -289,7 +289,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.Kinesis @@ -307,7 +307,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.Kinesis @@ -475,7 +475,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SQS @@ -493,7 +493,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SQS @@ -511,7 +511,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SQS @@ -529,7 +529,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SQS @@ -547,7 +547,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SQS @@ -565,7 +565,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SQS @@ -583,7 +583,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SQS @@ -601,7 +601,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SQS @@ -625,7 +625,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SimpleNotificationService @@ -643,7 +643,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SimpleNotificationService @@ -661,7 +661,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SimpleNotificationService @@ -679,7 +679,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SimpleNotificationService @@ -697,7 +697,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SimpleNotificationService @@ -715,7 +715,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SimpleNotificationService @@ -733,7 +733,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SimpleNotificationService @@ -751,7 +751,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SimpleNotificationService @@ -4693,7 +4693,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate @@ -4753,7 +4753,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate @@ -4915,7 +4915,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate @@ -4975,7 +4975,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate @@ -5137,7 +5137,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate @@ -5197,7 +5197,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate @@ -12613,7 +12613,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests @@ -12673,7 +12673,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests @@ -12733,7 +12733,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests @@ -12793,7 +12793,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests @@ -12853,7 +12853,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests @@ -12913,7 +12913,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests @@ -12973,7 +12973,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests @@ -13033,7 +13033,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests @@ -13093,7 +13093,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests2 @@ -13153,7 +13153,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests2 @@ -13213,7 +13213,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests2 @@ -13273,7 +13273,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests2 @@ -13333,7 +13333,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests2 @@ -13393,7 +13393,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests2 @@ -13453,7 +13453,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests2 @@ -13513,7 +13513,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests2 @@ -13573,7 +13573,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTestsRetries @@ -13633,7 +13633,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTestsRetries @@ -13693,7 +13693,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTestsRetries @@ -13753,7 +13753,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTestsRetries @@ -13813,7 +13813,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTestsRetries @@ -13873,7 +13873,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTestsRetries @@ -13933,7 +13933,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTestsRetries @@ -13993,7 +13993,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTestsRetries diff --git a/tracer/build/PackageVersionsLatestSpecific.g.props b/tracer/build/PackageVersionsLatestSpecific.g.props index 2d8dab1c06ca..8e5ddf55c5bf 100644 --- a/tracer/build/PackageVersionsLatestSpecific.g.props +++ b/tracer/build/PackageVersionsLatestSpecific.g.props @@ -25,7 +25,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.DynamoDBv2 @@ -37,7 +37,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.DynamoDBv2 @@ -49,7 +49,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.DynamoDBv2 @@ -61,7 +61,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.DynamoDBv2 @@ -73,7 +73,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.DynamoDBv2 @@ -85,7 +85,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.DynamoDBv2 @@ -97,7 +97,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.DynamoDBv2 @@ -109,7 +109,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.DynamoDBv2 - ApiVersion=3.7.401.8;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.401.4;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.DynamoDBv2 @@ -127,7 +127,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.Kinesis @@ -139,7 +139,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.Kinesis @@ -151,7 +151,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.Kinesis @@ -163,7 +163,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.Kinesis @@ -175,7 +175,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.Kinesis @@ -187,7 +187,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.Kinesis @@ -199,7 +199,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.Kinesis @@ -211,7 +211,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.Kinesis - ApiVersion=3.7.402.7;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.402.3;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.Kinesis @@ -247,7 +247,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SQS @@ -259,7 +259,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SQS @@ -271,7 +271,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SQS @@ -283,7 +283,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SQS @@ -295,7 +295,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SQS @@ -307,7 +307,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SQS @@ -319,7 +319,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SQS @@ -331,7 +331,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SQS - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SQS @@ -349,7 +349,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net462 All Samples.AWS.SimpleNotificationService @@ -361,7 +361,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 All Samples.AWS.SimpleNotificationService @@ -373,7 +373,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 All Samples.AWS.SimpleNotificationService @@ -385,7 +385,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 All Samples.AWS.SimpleNotificationService @@ -397,7 +397,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net5.0 All Samples.AWS.SimpleNotificationService @@ -409,7 +409,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net6.0 All Samples.AWS.SimpleNotificationService @@ -421,7 +421,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net7.0 All Samples.AWS.SimpleNotificationService @@ -433,7 +433,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.AWS.SimpleNotificationService - ApiVersion=3.7.400.30;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.7.400.26;RestoreRecursive=false;BuildProjectReferences=false net8.0 All Samples.AWS.SimpleNotificationService @@ -1153,13 +1153,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.HotChocolate @@ -1171,13 +1171,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.HotChocolate @@ -1189,13 +1189,13 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.HotChocolate - ApiVersion=12.22.6;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=12.22.5;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate - ApiVersion=13.9.14;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=13.9.13;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.HotChocolate @@ -3577,7 +3577,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests @@ -3595,7 +3595,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests @@ -3613,7 +3613,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests @@ -3631,7 +3631,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests @@ -3649,7 +3649,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests @@ -3667,7 +3667,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests @@ -3685,7 +3685,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests @@ -3703,7 +3703,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests @@ -3721,7 +3721,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTests2 @@ -3739,7 +3739,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTests2 @@ -3757,7 +3757,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTests2 @@ -3775,7 +3775,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTests2 @@ -3793,7 +3793,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTests2 @@ -3811,7 +3811,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTests2 @@ -3829,7 +3829,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTests2 @@ -3847,7 +3847,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTests2 - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTests2 @@ -3865,7 +3865,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net462 None Samples.MSTestTestsRetries @@ -3883,7 +3883,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp2.1 None Samples.MSTestTestsRetries @@ -3901,7 +3901,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.0 None Samples.MSTestTestsRetries @@ -3919,7 +3919,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false netcoreapp3.1 None Samples.MSTestTestsRetries @@ -3937,7 +3937,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net5.0 None Samples.MSTestTestsRetries @@ -3955,7 +3955,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net6.0 None Samples.MSTestTestsRetries @@ -3973,7 +3973,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net7.0 None Samples.MSTestTestsRetries @@ -3991,7 +3991,7 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely Samples.MSTestTestsRetries - ApiVersion=3.6.1;RestoreRecursive=false;BuildProjectReferences=false + ApiVersion=3.6.0;RestoreRecursive=false;BuildProjectReferences=false net8.0 None Samples.MSTestTestsRetries diff --git a/tracer/build/_build/Build.Profiler.Steps.cs b/tracer/build/_build/Build.Profiler.Steps.cs index 0b30d9c71311..9ed205585cc5 100644 --- a/tracer/build/_build/Build.Profiler.Steps.cs +++ b/tracer/build/_build/Build.Profiler.Steps.cs @@ -23,6 +23,7 @@ partial class Build { const string ClangTidyChecks = "-clang-analyzer-osx*,-clang-analyzer-optin.osx*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-type-vararg,-readability-braces-around-statements"; + const string LinuxApiWrapperLibrary = "Datadog.Linux.ApiWrapper.x64.so"; AbsolutePath ProfilerDeployDirectory => ProfilerOutputDirectory / "DDProf-Deploy"; @@ -145,7 +146,7 @@ partial class Build .Executes(() => { var (arch, _) = GetUnixArchitectureAndExtension(); - var libraryPath = ProfilerDeployDirectory / arch / FileNames.ProfilerLinuxApiWrapper; + var libraryPath = ProfilerDeployDirectory / arch / LinuxApiWrapperLibrary; var output = Nm.Value($"-D {libraryPath}").Select(x => x.Text).ToList(); @@ -249,7 +250,7 @@ partial class Build { // LD_PRELOAD must be set for this test library to validate that it works correctly. var (arch, _) = GetUnixArchitectureAndExtension(); - var envVars = new[] { $"LD_PRELOAD={ProfilerDeployDirectory / arch / FileNames.ProfilerLinuxApiWrapper}" }; + var envVars = new[] { $"LD_PRELOAD={ProfilerDeployDirectory / arch / LinuxApiWrapperLibrary}" }; RunProfilerUnitTests("Datadog.Linux.ApiWrapper.Tests", Configuration.Release, MSBuildTargetPlatform.x64, SanitizerKind.None, envVars); }); @@ -331,8 +332,8 @@ partial class Build var sourceDir = ProfilerDeployDirectory / arch; EnsureExistingDirectory(MonitoringHomeDirectory / arch); - var source = sourceDir / FileNames.ProfilerLinuxApiWrapper; - var dest = MonitoringHomeDirectory / arch / FileNames.ProfilerLinuxApiWrapper; + var source = sourceDir / LinuxApiWrapperLibrary; + var dest = MonitoringHomeDirectory / arch / LinuxApiWrapperLibrary; CopyFile(source, dest, FileExistsPolicy.Overwrite); if (AsUniversal) @@ -864,31 +865,6 @@ void RunCppCheck(string projectName, MSBuildTargetPlatform platform) RunSampleWithSanitizer(MSBuildTargetPlatform.x64, SanitizerKind.Ubsan); }); - Target ValidateNativeProfilerGlibcCompatibility => _ => _ - .Unlisted() - .OnlyWhenStatic(() => IsLinux) - .After(CompileProfilerNativeSrc) - .Before(PublishProfilerLinux) - .Before(ExtractDebugInfoLinux) - .Executes(() => - { - var (arch, extension) = GetUnixArchitectureAndExtension(); - var dest = ProfilerDeployDirectory / arch / $"{FileNames.NativeProfiler}.{extension}"; - - // The profiler has a different minimum glibc version to the tracer. - // The _overall_ minimum is the highest of the two, but as we don't - // currently enable the profiler on ARM64, we take the .NET runtime's minimum - // glibc as our actual minimum in practice. Before we can enable the profiler - // on arm64 we must first ensure we bring this glibc version down to 2.23. - // - // See also the ValidateNativeTracerGlibcCompatibility Nuke task and the checks - // in shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp#L1279 - var expectedGlibcVersion = IsArm64 - ? new Version(2, 28) - : new Version(2, 17); - - ValidateNativeLibraryGlibcCompatibility(dest, expectedGlibcVersion); - }); enum SanitizerKind { None, diff --git a/tracer/build/_build/Build.Shared.Steps.cs b/tracer/build/_build/Build.Shared.Steps.cs index 182dd9eec5ac..75648ff76bf7 100644 --- a/tracer/build/_build/Build.Shared.Steps.cs +++ b/tracer/build/_build/Build.Shared.Steps.cs @@ -1,15 +1,15 @@ using System; using System.Collections.Generic; using Nuke.Common; +using Nuke.Common.Tools.DotNet; using Nuke.Common.IO; using System.Linq; -using System.IO; using Nuke.Common.Tooling; using Nuke.Common.Tools.MSBuild; using static Nuke.Common.EnvironmentInfo; using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.Tools.MSBuild.MSBuildTasks; -using Logger = Serilog.Log; +using Nuke.Common.Tools.NuGet; partial class Build { @@ -284,81 +284,4 @@ partial class Build FileExistsPolicy.Overwrite, true); }); - - Target ValidateNativeTracerGlibcCompatibility => _ => _ - .Unlisted() - .OnlyWhenStatic(() => IsLinux) - .After(CompileTracerNativeSrc) - .After(PublishNativeTracer) - .Before(ExtractDebugInfoLinux) - .Executes(() => - { - var (arch, extension) = GetUnixArchitectureAndExtension(); - var dest = MonitoringHomeDirectory / arch / $"{NativeTracerProject.Name}.{extension}"; - - // The profiler has a different minimum glibc version to the tracer. - // The _overall_ minimum is the highest of the two, but as we don't - // currently enable the profiler on ARM64, we take the .NET runtime's minimum - // glibc as our actual minimum in practice. Before we can enable the profiler - // on arm64 we must first ensure we bring this glibc version down to 2.23. - // - // If we need to increase this version on arm64 later, that is ok as long - // as it doesn't go above 2.23. Just update the version below. We must - // NOT increase it beyond 2.23, or increase the version on x64. - // - // See also the ValidateNativeProfilerGlibcCompatibility Nuke task and the checks - // in shared/src/Datadog.Trace.ClrProfiler.Native/cor_profiler.cpp#L1279 - var expectedGlibcVersion = IsArm64 - ? new Version(2, 18) - : new Version(2, 17); - - ValidateNativeLibraryGlibcCompatibility(dest, expectedGlibcVersion); - }); - - void ValidateNativeLibraryGlibcCompatibility(AbsolutePath libraryPath, Version expectedGlibcVersion) - { - var filename = Path.GetFileNameWithoutExtension(libraryPath); - var glibcVersion = FindMinimumGlibcVersion(libraryPath); - - Logger.Information("Minimum required glibc version for {Filename} is {GlibcVersion}", filename, glibcVersion); - - if (IsAlpine && glibcVersion is not null) - { - throw new Exception($"Alpine build of {filename} should not have glibc symbols in the binary, but found {glibcVersion}"); - } - else if (!IsAlpine && glibcVersion != expectedGlibcVersion) - { - throw new Exception($"{filename} should have a minimum required glibc version of {expectedGlibcVersion} but has {glibcVersion}"); - } - } - - Version FindMinimumGlibcVersion(AbsolutePath libraryPath) - { - var output = Nm.Value($"--with-symbol-versions -D {libraryPath} ").Select(x => x.Text).ToList(); - - // Gives output similar to this: - // 0000000000170498 T SetGitMetadataForApplication - // 000000000016f944 T ThreadsCpuManager_Map - // w __cxa_finalize@GLIBC_2.17 - // U __cxa_thread_atexit_impl@GLIBC_2.18 - // U __duplocale@GLIBC_2.17 - // U __environ@GLIBC_2.17 - // U __errno_location@GLIBC_2.17 - // U __freelocale@GLIBC_2.17 - // U __fxstat@GLIBC_2.17 - // U __fxstat64@GLIBC_2.17 - // U __getdelim@GLIBC_2.17 - // w __gmon_start__ - // U __iswctype_l@GLIBC_2.17 - // U __lxstat@GLIBC_2.17 - // U __newlocale@GLIBC_2.17 - // - // We only care about the Undefined symbols that are in glibc - - return output - .Where(x=>x.Contains("@GLIBC_")) - .Select(x=> System.Version.Parse(x.Substring(x.IndexOf("@GLIBC_") + 7))) - .OrderDescending() - .FirstOrDefault(); - } } diff --git a/tracer/build/_build/Build.Steps.cs b/tracer/build/_build/Build.Steps.cs index 96a5dc4c6ac8..3128e948e21b 100644 --- a/tracer/build/_build/Build.Steps.cs +++ b/tracer/build/_build/Build.Steps.cs @@ -2322,7 +2322,6 @@ var name when multiPackageProjects.Contains(name) => false, DotNetTest(config => config .SetProjectFile(project) - .SetDotnetPath(TargetPlatform) .SetConfiguration(BuildConfiguration) .SetFramework(Framework) .SetTestTargetPlatform(TargetPlatform) diff --git a/tracer/build/smoke_test_snapshots/smoke_test_snapshots.json b/tracer/build/smoke_test_snapshots/smoke_test_snapshots.json index 429e6cd2450a..9563c41a1a03 100644 --- a/tracer/build/smoke_test_snapshots/smoke_test_snapshots.json +++ b/tracer/build/smoke_test_snapshots/smoke_test_snapshots.json @@ -40,10 +40,6 @@ "meta": { "_dd.appsec.waf.version": "1.19.1", "_dd.runtime_family": "dotnet", - "_dd.appsec.s.req.params": "H4sIAAAAAAAAA4uuVkrOzyspys/JSS1Ssoq2iNVRSkwuyczPA3NqYwH+CR9jIQAAAA==", - "_dd.appsec.s.res.body": "H4sIAAAAAAAAA4u2iAUA8YntnQMAAAA=", - "_dd.appsec.s.req.headers": "H4sIAAAAAAAAA4WOMQ6AIBAE/3I1FHaGrxCKixAkQSBwhYbwdzUWNhDqnd1ZWeHkGgl1tDxhNoG40yCklKtSrII3AcTSFAPKuJlCSKYb/zOEtkyQgkfyLjzK7GJ2dI2N36mZ8iVHx/dYev2mbkdocaj9AAAA", - "_dd.appsec.s.res.headers": "H4sIAAAAAAAAA4uuVkrOzytJzSvRLaksSFWyio6OtoiN1alWyknNU7IyrI2tjQUAcaAU2yQAAAA=", "aspnet_core.endpoint": "AspNetCoreSmokeTest.ValuesController.Get (AspNetCoreSmokeTest)", "aspnet_core.route": "api/values", "component": "aspnet_core", diff --git a/tracer/build/smoke_test_snapshots/smoke_test_snapshots_2_1.json b/tracer/build/smoke_test_snapshots/smoke_test_snapshots_2_1.json index ee830e108a3b..8263bcdbb341 100644 --- a/tracer/build/smoke_test_snapshots/smoke_test_snapshots_2_1.json +++ b/tracer/build/smoke_test_snapshots/smoke_test_snapshots_2_1.json @@ -40,9 +40,6 @@ "meta": { "_dd.appsec.waf.version": "1.19.1", "_dd.runtime_family": "dotnet", - "_dd.appsec.s.res.body": "H4sIAAAAAAAAA4u2iAUA8YntnQMAAAA=", - "_dd.appsec.s.req.headers": "H4sIAAAAAAAAA4WOMQrAIBDA/uKsQ7fiVw6Ho4oVrIp3Q4v491JcLc4JJNAEVzwcMbITGgB2Y2QT0SWht27kwAWrSzzlt7LIaLNXjJ4WCuFVYkhelRpyDfws/NFVwa7S3+SfdmaarXfzAg6PMlH9AAAA", - "_dd.appsec.s.res.headers": "H4sIAAAAAAAAA4uuVkrOzytJzSvRLaksSFWyio6OtoiN1alWyknNU7IyrI2tjQUAcaAU2yQAAAA=", "aspnet_core.route": "api/values", "component": "aspnet_core", "http.client_ip": "127.0.0.1", diff --git a/tracer/build/supported_versions.json b/tracer/build/supported_versions.json index 41a79a39e729..f88890ea7e74 100644 --- a/tracer/build/supported_versions.json +++ b/tracer/build/supported_versions.json @@ -242,9 +242,9 @@ "minVersionAvailableInclusive": "3.1.0", "minVersionSupportedInclusive": "3.1.0", "minVersionTestedInclusive": "3.1.5.3", - "maxVersionSupportedInclusive": "3.7.401.8", - "maxVersionAvailableInclusive": "3.7.401.8", - "maxVersionTestedInclusive": "3.7.401.8" + "maxVersionSupportedInclusive": "3.7.401.4", + "maxVersionAvailableInclusive": "3.7.401.4", + "maxVersionTestedInclusive": "3.7.401.4" } ] }, @@ -259,9 +259,9 @@ "minVersionAvailableInclusive": "3.1.0", "minVersionSupportedInclusive": "3.1.0", "minVersionTestedInclusive": "3.1.3.5", - "maxVersionSupportedInclusive": "3.7.402.7", - "maxVersionAvailableInclusive": "3.7.402.7", - "maxVersionTestedInclusive": "3.7.402.7" + "maxVersionSupportedInclusive": "3.7.402.3", + "maxVersionAvailableInclusive": "3.7.402.3", + "maxVersionTestedInclusive": "3.7.402.3" } ] }, @@ -293,8 +293,8 @@ "minVersionAvailableInclusive": "3.1.0", "minVersionSupportedInclusive": "3.1.0", "minVersionTestedInclusive": null, - "maxVersionSupportedInclusive": "3.7.400.30", - "maxVersionAvailableInclusive": "3.7.400.30", + "maxVersionSupportedInclusive": "3.7.400.26", + "maxVersionAvailableInclusive": "3.7.400.26", "maxVersionTestedInclusive": null } ] @@ -310,9 +310,9 @@ "minVersionAvailableInclusive": "3.1.0", "minVersionSupportedInclusive": "3.1.0", "minVersionTestedInclusive": "3.1.2.1", - "maxVersionSupportedInclusive": "3.7.400.30", - "maxVersionAvailableInclusive": "3.7.400.30", - "maxVersionTestedInclusive": "3.7.400.30" + "maxVersionSupportedInclusive": "3.7.400.26", + "maxVersionAvailableInclusive": "3.7.400.26", + "maxVersionTestedInclusive": "3.7.400.26" } ] }, @@ -327,9 +327,9 @@ "minVersionAvailableInclusive": "3.1.0", "minVersionSupportedInclusive": "3.1.0", "minVersionTestedInclusive": "3.1.0.13", - "maxVersionSupportedInclusive": "3.7.400.30", - "maxVersionAvailableInclusive": "3.7.400.30", - "maxVersionTestedInclusive": "3.7.400.30" + "maxVersionSupportedInclusive": "3.7.400.26", + "maxVersionAvailableInclusive": "3.7.400.26", + "maxVersionTestedInclusive": "3.7.400.26" } ] }, @@ -615,9 +615,9 @@ "minVersionAvailableInclusive": "0.1.0", "minVersionSupportedInclusive": "11.0.0", "minVersionTestedInclusive": "11.3.8", - "maxVersionSupportedInclusive": "13.9.14", - "maxVersionAvailableInclusive": "13.9.14", - "maxVersionTestedInclusive": "13.9.14" + "maxVersionSupportedInclusive": "13.9.13", + "maxVersionAvailableInclusive": "13.9.13", + "maxVersionTestedInclusive": "13.9.13" } ] }, @@ -818,8 +818,8 @@ "minVersionAvailableInclusive": "1.1.11", "minVersionSupportedInclusive": "1.1.11", "minVersionTestedInclusive": null, - "maxVersionSupportedInclusive": "3.6.1", - "maxVersionAvailableInclusive": "3.6.1", + "maxVersionSupportedInclusive": "3.6.0", + "maxVersionAvailableInclusive": "3.6.0", "maxVersionTestedInclusive": null } ] @@ -978,8 +978,8 @@ "minVersionAvailableInclusive": "12.1.21", "minVersionSupportedInclusive": "12.1.21", "minVersionTestedInclusive": null, - "maxVersionSupportedInclusive": "23.6.0", - "maxVersionAvailableInclusive": "23.6.0", + "maxVersionSupportedInclusive": "23.5.1", + "maxVersionAvailableInclusive": "23.5.1", "maxVersionTestedInclusive": null } ] @@ -1135,8 +1135,8 @@ "minVersionAvailableInclusive": "1.0.66.1", "minVersionSupportedInclusive": "1.0.66.1", "minVersionTestedInclusive": null, - "maxVersionSupportedInclusive": "1.0.119", - "maxVersionAvailableInclusive": "1.0.119", + "maxVersionSupportedInclusive": "1.0.118", + "maxVersionAvailableInclusive": "1.0.118", "maxVersionTestedInclusive": null } ] diff --git a/tracer/dependabot/Datadog.Dependabot.Integrations.csproj b/tracer/dependabot/Datadog.Dependabot.Integrations.csproj index 67723e10f89a..287b213db1c6 100644 --- a/tracer/dependabot/Datadog.Dependabot.Integrations.csproj +++ b/tracer/dependabot/Datadog.Dependabot.Integrations.csproj @@ -18,28 +18,28 @@ - - + + - - + + - - + + - - + + - - + + @@ -90,8 +90,8 @@ - - + + @@ -210,8 +210,8 @@ - - + + @@ -250,8 +250,8 @@ - - + + @@ -297,8 +297,8 @@ - - + + diff --git a/tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs b/tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs index d2af2025cb40..aa545e83b91d 100644 --- a/tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs +++ b/tracer/src/Datadog.Trace.Tools.dd_dotnet/CreatedumpCommand.cs @@ -4,14 +4,12 @@ // using System; -using System.Collections; using System.Collections.Generic; using System.CommandLine; using System.CommandLine.Invocation; using System.ComponentModel; using System.IO; using System.Linq; -using System.Net.Http; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; @@ -423,10 +421,7 @@ private void Execute(InvocationContext context) private unsafe void GenerateCrashReport(int pid, int? signal, int? crashThread) { - var extension = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dll" : "so"; - var profilerLibrary = $"Datadog.Profiler.Native.{extension}"; - - var lib = NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, profilerLibrary)); + var lib = NativeLibrary.Load(Path.Combine(AppContext.BaseDirectory, "Datadog.Profiler.Native.so")); var export = NativeLibrary.GetExport(lib, "CreateCrashReport"); @@ -522,6 +517,8 @@ private unsafe void GenerateCrashReport(int pid, int? signal, int? crashThread) var suspiciousExceptionTypes = new[] { "System.InvalidProgramException", + "System.Security.VerificationException", + "System.MissingMethodException", "System.MissingFieldException", "System.MissingMemberException", "System.BadImageFormatException", diff --git a/tracer/src/Datadog.Trace/AppSec/AttackerFingerprint/AttackerFingerprintHelper.cs b/tracer/src/Datadog.Trace/AppSec/AttackerFingerprint/AttackerFingerprintHelper.cs index ee644fc7bbc9..4046c2bd8a50 100644 --- a/tracer/src/Datadog.Trace/AppSec/AttackerFingerprint/AttackerFingerprintHelper.cs +++ b/tracer/src/Datadog.Trace/AppSec/AttackerFingerprint/AttackerFingerprintHelper.cs @@ -15,11 +15,12 @@ namespace Datadog.Trace.AppSec.AttackerFingerprint; internal static class AttackerFingerprintHelper { private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(typeof(AttackerFingerprintHelper)); + private static readonly Dictionary _fingerprintRequest = new() { { AddressesConstants.WafContextProcessor, new Dictionary { { "fingerprint", true } } } }; private static bool _warningLogged = false; - public static void AddSpanTags(Span span, IResult result) + public static void AddSpanTags(Span span) { - if (result?.FingerprintDerivatives is null || span.IsFinished || span.Type != SpanTypes.Web) + if (span.IsFinished || span.Type != SpanTypes.Web) { return; } @@ -32,7 +33,8 @@ public static void AddSpanTags(Span span, IResult result) return; } - AddSpanTags(result.FingerprintDerivatives, span); + var result = securityCoordinator.RunWaf(_fingerprintRequest); + AddSpanTags(result?.FingerprintDerivatives, span); } private static void AddSpanTags(Dictionary? fingerPrintDerivatives, ISpan span) diff --git a/tracer/src/Datadog.Trace/AppSec/Coordinator/SecurityCoordinator.Reporter.cs b/tracer/src/Datadog.Trace/AppSec/Coordinator/SecurityCoordinator.Reporter.cs index bbb9492f6606..788241d66eef 100644 --- a/tracer/src/Datadog.Trace/AppSec/Coordinator/SecurityCoordinator.Reporter.cs +++ b/tracer/src/Datadog.Trace/AppSec/Coordinator/SecurityCoordinator.Reporter.cs @@ -129,10 +129,10 @@ internal void TryReport(IResult result, bool blocked, int? status = null) var traceContext = _localRootSpan.Context.TraceContext; if (result.Data != null) { - traceContext.AppSecRequestContext.AddWafSecurityEvents(result.Data); + traceContext.AddWafSecurityEvents(result.Data); } - AttackerFingerprintHelper.AddSpanTags(_localRootSpan, result); + AttackerFingerprintHelper.AddSpanTags(_localRootSpan); var clientIp = _localRootSpan.GetTag(Tags.HttpClientIp); if (!string.IsNullOrEmpty(clientIp)) @@ -194,7 +194,7 @@ private void AddRaspSpanMetrics(IResult result, Span localRootSpan) // We report always, even if there is no match if (result.AggregatedTotalRuntimeRasp > 0) { - localRootSpan.Context.TraceContext.AppSecRequestContext.AddRaspSpanMetrics(result.AggregatedTotalRuntimeRasp, result.AggregatedTotalRuntimeWithBindingsRasp, result.Timeout); + localRootSpan.Context.TraceContext.AddRaspSpanMetrics(result.AggregatedTotalRuntimeRasp, result.AggregatedTotalRuntimeWithBindingsRasp, result.Timeout); } } diff --git a/tracer/src/Datadog.Trace/AppSec/Rasp/RaspModule.cs b/tracer/src/Datadog.Trace/AppSec/Rasp/RaspModule.cs index da15c0dcdeed..a975171aa6f5 100644 --- a/tracer/src/Datadog.Trace/AppSec/Rasp/RaspModule.cs +++ b/tracer/src/Datadog.Trace/AppSec/Rasp/RaspModule.cs @@ -177,7 +177,7 @@ private static void SendStack(Span rootSpan, string id) if (stack is not null) { - rootSpan.Context.TraceContext.AppSecRequestContext.AddRaspStackTrace(stack, Security.Instance.Settings.MaxStackTraces); + rootSpan.Context.TraceContext.AddRaspStackTraceElement(stack, Security.Instance.Settings.MaxStackTraces); } } diff --git a/tracer/src/Datadog.Trace/AppSec/SecuritySettings.cs b/tracer/src/Datadog.Trace/AppSec/SecuritySettings.cs index 6db6208ee3aa..3d03095a7448 100644 --- a/tracer/src/Datadog.Trace/AppSec/SecuritySettings.cs +++ b/tracer/src/Datadog.Trace/AppSec/SecuritySettings.cs @@ -124,7 +124,7 @@ public SecuritySettings(IConfigurationSource? source, IConfigurationTelemetry te } ApiSecurityEnabled = config.WithKeys(ConfigurationKeys.AppSec.ApiSecurityEnabled, "DD_EXPERIMENTAL_API_SECURITY_ENABLED") - .AsBool(true); + .AsBool(false); ApiSecuritySampleDelay = config.WithKeys(ConfigurationKeys.AppSec.ApiSecuritySampleDelay) .AsDouble(30.0, val => val >= 0.0) diff --git a/tracer/src/Datadog.Trace/Ci/TestSession.cs b/tracer/src/Datadog.Trace/Ci/TestSession.cs index 0d0c91926532..a2a86647d4af 100644 --- a/tracer/src/Datadog.Trace/Ci/TestSession.cs +++ b/tracer/src/Datadog.Trace/Ci/TestSession.cs @@ -533,6 +533,7 @@ private void OnIpcMessageReceived(object message) CIVisibility.Log.Information("TestSession.ReceiveMessage (code coverage): {Value}", codeCoverageMessage.Value); // Adds the global code coverage percentage to the session + SetTag(CodeCoverageTags.Enabled, "true"); SetTag(CodeCoverageTags.PercentageOfTotalLines, codeCoverageMessage.Value); } } diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/ManualInstrumentation/TracerSettingKeyConstants.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/ManualInstrumentation/TracerSettingKeyConstants.cs index 6e6bd9687747..a3c61dd1bff0 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/ManualInstrumentation/TracerSettingKeyConstants.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/ManualInstrumentation/TracerSettingKeyConstants.cs @@ -11,8 +11,8 @@ internal class TracerSettingKeyConstants { // These keys are used when sending from manual to automatic, but not in reverse public const string IsFromDefaultSourcesKey = "IsFromDefaultSources"; - public const string HttpClientErrorCodesKey = "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES"; - public const string HttpServerErrorCodesKey = "DD_TRACE_HTTP_SERVER_ERROR_STATUSES"; + public const string HttpClientErrorCodesKey = "DD_HTTP_CLIENT_ERROR_STATUSES"; + public const string HttpServerErrorCodesKey = "DD_HTTP_SERVER_ERROR_STATUSES"; public const string ServiceNameMappingsKey = "DD_TRACE_SERVICE_MAPPING"; // These keys are used when sending from automatic to manual, but not in reverse diff --git a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Testing/DotnetTest/DotnetCommon.cs b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Testing/DotnetTest/DotnetCommon.cs index d4d305f4f9c0..fd5cc529d420 100644 --- a/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Testing/DotnetTest/DotnetCommon.cs +++ b/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Testing/DotnetTest/DotnetCommon.cs @@ -155,6 +155,7 @@ internal static void FinalizeSession(TestSession? session, int exitCode, Excepti { if (TryGetCoveragePercentageFromXml(extCodeCoverageFilePath, out var coveragePercentage)) { + session.SetTag(CodeCoverageTags.Enabled, "true"); session.SetTag(CodeCoverageTags.PercentageOfTotalLines, coveragePercentage); } else diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AppSec.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AppSec.cs index 536969887552..e3ff01f312fd 100644 --- a/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AppSec.cs +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.AppSec.cs @@ -112,7 +112,7 @@ internal class AppSec internal const string UserEventsAutoInstrumentationMode = "DD_APPSEC_AUTO_USER_INSTRUMENTATION_MODE"; /// - /// When ASM is enabled, collects in spans endpoints apis schemas analyzed by the waf, default value is true. + /// Unless set to true or 1, tracers don’t collect schemas. After the experiment, the environment variable will be removed and schema collection will be enabled only when ASM is enabled /// internal const string ApiSecurityEnabled = "DD_API_SECURITY_ENABLED"; diff --git a/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs b/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs index b6d641bbfd98..42b9ddd8472a 100644 --- a/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs +++ b/tracer/src/Datadog.Trace/Configuration/ConfigurationKeys.cs @@ -300,27 +300,13 @@ internal static partial class ConfigurationKeys /// Configuration key for the application's server http statuses to set spans as errors by. /// /// - [Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_HTTP_SERVER_ERROR_STATUSES`")] - public const string DeprecatedHttpServerErrorStatusCodes = "DD_HTTP_SERVER_ERROR_STATUSES"; - - /// - /// Configuration key for the application's server http statuses to set spans as errors by. - /// - /// - public const string HttpServerErrorStatusCodes = "DD_TRACE_HTTP_SERVER_ERROR_STATUSES"; - - /// - /// Configuration key for the application's client http statuses to set spans as errors by. - /// - /// - [Obsolete("This parameter is obsolete and should be replaced by `DD_TRACE_HTTP_CLIENT_ERROR_STATUSES`")] - public const string DeprecatedHttpClientErrorStatusCodes = "DD_HTTP_CLIENT_ERROR_STATUSES"; + public const string HttpServerErrorStatusCodes = "DD_HTTP_SERVER_ERROR_STATUSES"; /// /// Configuration key for the application's client http statuses to set spans as errors by. /// /// - public const string HttpClientErrorStatusCodes = "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES"; + public const string HttpClientErrorStatusCodes = "DD_HTTP_CLIENT_ERROR_STATUSES"; /// /// Configuration key indicating the optional name of the custom header to take into account to report the ip address from. diff --git a/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs b/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs index a1f6c79ed598..1339a288b80d 100644 --- a/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs +++ b/tracer/src/Datadog.Trace/Configuration/TracerSettings.cs @@ -303,17 +303,13 @@ _ when x.ToBoolean() is { } boolean => boolean, StartupDiagnosticLogEnabledInternal = config.WithKeys(ConfigurationKeys.StartupDiagnosticLogEnabled).AsBool(defaultValue: true); var httpServerErrorStatusCodes = config -#pragma warning disable 618 // This config key has been replaced but may still be used - .WithKeys(ConfigurationKeys.HttpServerErrorStatusCodes, ConfigurationKeys.DeprecatedHttpServerErrorStatusCodes) -#pragma warning restore 618 + .WithKeys(ConfigurationKeys.HttpServerErrorStatusCodes) .AsString(defaultValue: "500-599"); HttpServerErrorStatusCodes = ParseHttpCodesToArray(httpServerErrorStatusCodes); var httpClientErrorStatusCodes = config -#pragma warning disable 618 // This config key has been replaced but may still be used - .WithKeys(ConfigurationKeys.HttpClientErrorStatusCodes, ConfigurationKeys.DeprecatedHttpClientErrorStatusCodes) -#pragma warning restore 618 + .WithKeys(ConfigurationKeys.HttpClientErrorStatusCodes) .AsString(defaultValue: "400-499"); HttpClientErrorStatusCodes = ParseHttpCodesToArray(httpClientErrorStatusCodes); @@ -1232,7 +1228,7 @@ void TrySetValue(int index) // Checks that the value about to be used follows the `401-404` structure or single 3 digit number i.e. `401` else log the warning if (!Regex.IsMatch(statusConfiguration, @"^\d{3}-\d{3}$|^\d{3}$")) { - Log.Warning("Wrong format '{0}' for DD_TRACE_HTTP_SERVER/CLIENT_ERROR_STATUSES configuration.", statusConfiguration); + Log.Warning("Wrong format '{0}' for DD_HTTP_SERVER/CLIENT_ERROR_STATUSES configuration.", statusConfiguration); } // If statusConfiguration equals a single value i.e. `401` parse the value and save to the array diff --git a/tracer/src/Datadog.Trace/Iast/IastModule.cs b/tracer/src/Datadog.Trace/Iast/IastModule.cs index 5ab1b2b78ccb..fca7373fbfa7 100644 --- a/tracer/src/Datadog.Trace/Iast/IastModule.cs +++ b/tracer/src/Datadog.Trace/Iast/IastModule.cs @@ -702,7 +702,7 @@ private static IastModuleResponse GetScope( } else { - stackId = currentSpan.Context.TraceContext.IastRequestContext?.GetNextVulnerabilityStackId(); + stackId = currentSpan.Context.TraceContext.GetNextVulnerabilityStackTraceId(); } } diff --git a/tracer/src/Datadog.Trace/Iast/Location.cs b/tracer/src/Datadog.Trace/Iast/Location.cs index e5a103b7b963..8d9005a295b1 100644 --- a/tracer/src/Datadog.Trace/Iast/Location.cs +++ b/tracer/src/Datadog.Trace/Iast/Location.cs @@ -83,7 +83,7 @@ internal void ReportStack(Span? span) #pragma warning restore CS8620 // Argument cannot be used for parameter due to differences in the nullability of reference types. if (stack is not null) { - span.Context.TraceContext?.AppSecRequestContext.AddVulnerabilityStackTrace(stack, Security.Instance.Settings.MaxStackTraces); + span.Context.TraceContext?.AddVulnerabilityStackTraceElement(stack, Security.Instance.Settings.MaxStackTraces); } } } diff --git a/tracer/src/Datadog.Trace/Propagators/DatadogContextPropagator.cs b/tracer/src/Datadog.Trace/Propagators/DatadogContextPropagator.cs index 8d988de2d648..97fb7db9fb3e 100644 --- a/tracer/src/Datadog.Trace/Propagators/DatadogContextPropagator.cs +++ b/tracer/src/Datadog.Trace/Propagators/DatadogContextPropagator.cs @@ -33,7 +33,7 @@ public void Inject(SpanContext context, TCarrier carri if (!string.IsNullOrEmpty(context.Origin)) { - carrierSetter.Set(carrier, HttpHeaderNames.Origin, context.Origin!); + carrierSetter.Set(carrier, HttpHeaderNames.Origin, context.Origin); } if (context.GetOrMakeSamplingDecision() is { } samplingPriority) diff --git a/tracer/src/Datadog.Trace/TraceContext.cs b/tracer/src/Datadog.Trace/TraceContext.cs index 3a6bccbee2ae..45d5b988a66f 100644 --- a/tracer/src/Datadog.Trace/TraceContext.cs +++ b/tracer/src/Datadog.Trace/TraceContext.cs @@ -29,12 +29,12 @@ internal class TraceContext { private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor(); - private ArrayBuilder _spans; - private int _openSpans; - private IastRequestContext? _iastRequestContext; private AppSecRequestContext? _appSecRequestContext; + private ArrayBuilder _spans; + private int _openSpans; + // _rootSpan was chosen in #4125 to be the lock that protects // * _spans // * _openSpans @@ -98,28 +98,51 @@ public Span? RootSpan /// internal string? AdditionalW3CTraceState { get; set; } - /// Gets the IAST context + /// + /// Gets the IAST context. + /// internal IastRequestContext? IastRequestContext => _iastRequestContext; - /// Gets the AppSec context - internal AppSecRequestContext AppSecRequestContext + internal static TraceContext? GetTraceContext(in ArraySegment spans) => + spans.Count > 0 ? + spans.Array![spans.Offset].Context.TraceContext : + null; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private AppSecRequestContext GetRequestContext() { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get + if (Volatile.Read(ref _appSecRequestContext) is null) { - if (Volatile.Read(ref _appSecRequestContext) is null) - { - Interlocked.CompareExchange(ref _appSecRequestContext, new(), null); - } - - return _appSecRequestContext!; + Interlocked.CompareExchange(ref _appSecRequestContext, new(), null); } + + return _appSecRequestContext!; } - internal static TraceContext? GetTraceContext(in ArraySegment spans) => - spans.Count > 0 ? - spans.Array![spans.Offset].Context.TraceContext : - null; + internal void AddWafSecurityEvents(IReadOnlyCollection events) + { + GetRequestContext().AddWafSecurityEvents(events); + } + + internal void AddRaspStackTraceElement(Dictionary stack, int maxStackTraces) + { + GetRequestContext().AddRaspStackTrace(stack, maxStackTraces); + } + + internal string? GetNextVulnerabilityStackTraceId() + { + return _iastRequestContext?.GetNextVulnerabilityStackId(); + } + + internal void AddVulnerabilityStackTraceElement(Dictionary stack, int maxStackTraces) + { + GetRequestContext().AddVulnerabilityStackTrace(stack, maxStackTraces); + } + + internal void AddRaspSpanMetrics(ulong duration, ulong durationWithBindings, bool timeout) + { + GetRequestContext().AddRaspSpanMetrics(duration, durationWithBindings, timeout); + } internal void EnableIastInRequest() { diff --git a/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp b/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp index 74b15e4837f6..9441009da13a 100644 --- a/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp +++ b/tracer/src/Datadog.Tracer.Native/cor_profiler.cpp @@ -942,10 +942,7 @@ HRESULT CorProfiler::TryRejitModule(ModuleID module_id, std::vector& m if (ShouldRewriteProfilerMaps()) { auto profiler_library_path = shared::GetEnvironmentValue(WStr("DD_INTERNAL_PROFILING_NATIVE_ENGINE_PATH")); - if (!profiler_library_path.empty() && fs::exists(profiler_library_path)) - { - RewritingPInvokeMaps(module_metadata, WStr("continuous profiler"), profiler_nativemethods_type, profiler_library_path); - } + RewritingPInvokeMaps(module_metadata, WStr("continuous profiler"), profiler_nativemethods_type, profiler_library_path); } if (IsVersionCompatibilityEnabled()) diff --git a/tracer/src/Datadog.Tracer.Native/iast/dataflow_il_analysis.cpp b/tracer/src/Datadog.Tracer.Native/iast/dataflow_il_analysis.cpp index dadd6fd93b97..69ff078345bd 100644 --- a/tracer/src/Datadog.Tracer.Native/iast/dataflow_il_analysis.cpp +++ b/tracer/src/Datadog.Tracer.Native/iast/dataflow_il_analysis.cpp @@ -666,7 +666,7 @@ namespace iast WSTRING GetMemberName(ILRewriter* body, mdToken token) { auto memberRef = body->GetMethodInfo()->GetModuleInfo()->GetMemberRefInfo(token); - WSTRING memberName = memberRef != nullptr ? memberRef->GetFullyQualifiedName() : WStr("Unknown"); + WSTRING memberName = memberRef != nullptr ? memberRef->GetFullNameWithReturnType() : WStr("Unknown"); return memberName; } std::string GetString(ILRewriter* body, mdString token) diff --git a/tracer/src/Datadog.Tracer.Native/iast/method_info.cpp b/tracer/src/Datadog.Tracer.Native/iast/method_info.cpp index beb6bcf95dc2..0927ae53e18d 100644 --- a/tracer/src/Datadog.Tracer.Native/iast/method_info.cpp +++ b/tracer/src/Datadog.Tracer.Native/iast/method_info.cpp @@ -91,19 +91,27 @@ namespace iast return _name; } - WSTRING MemberRefInfo::GetFullName() + WSTRING& MemberRefInfo::GetFullName() { - auto fullName = GetTypeName() + WStr("::") + _name; - auto signature = GetSignature(); - if (signature != nullptr) + if (_fullName.size() == 0) { - fullName = signature->CharacterizeMember(fullName); + CSGuard lock(&_module->_cs); + if (_fullName.size() == 0) + { + auto fullName = GetTypeName() + WStr("::") + _name; + auto signature = GetSignature(); + if (signature != nullptr) + { + fullName = signature->CharacterizeMember(fullName); + } + _fullName = fullName; + } } - return fullName; + return _fullName; } - WSTRING MemberRefInfo::GetFullyQualifiedName() + WSTRING MemberRefInfo::GetFullNameWithReturnType() { - WSTRING res = GetFullName(); + auto res = GetFullName(); auto signature = GetSignature(); if (signature != nullptr) { diff --git a/tracer/src/Datadog.Tracer.Native/iast/method_info.h b/tracer/src/Datadog.Tracer.Native/iast/method_info.h index c2c5d6dc4efc..959b3128549d 100644 --- a/tracer/src/Datadog.Tracer.Native/iast/method_info.h +++ b/tracer/src/Datadog.Tracer.Native/iast/method_info.h @@ -38,6 +38,7 @@ namespace iast protected: ModuleInfo* _module = nullptr; WSTRING _name = EmptyWStr; + WSTRING _fullName = EmptyWStr; mdTypeDef _typeDef = 0; TypeInfo* _typeInfo = nullptr; @@ -46,6 +47,7 @@ namespace iast SignatureInfo* _pSignature = nullptr; PCCOR_SIGNATURE _pSig = nullptr; ULONG _nSig = 0; + public: mdMemberRef GetMemberId(); @@ -54,8 +56,8 @@ namespace iast ModuleInfo* GetModuleInfo(); WSTRING& GetName(); - WSTRING GetFullName(); - WSTRING GetFullyQualifiedName(); + WSTRING& GetFullName(); + WSTRING GetFullNameWithReturnType(); WSTRING& GetTypeName(); virtual SignatureInfo* GetSignature(); ULONG GetParameterCount(); diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs index 019aecf37df2..bd820d273aac 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMajors.g.cs @@ -27,28 +27,28 @@ public class PackageVersionsLatestMajors new object[] { string.Empty }, #else #if NET462 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP2_1 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_0 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_1 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET5_0 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET6_0 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET7_0 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET8_0 - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #endif }; @@ -61,28 +61,28 @@ public class PackageVersionsLatestMajors new object[] { string.Empty }, #else #if NET462 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP2_1 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_0 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_1 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET5_0 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET6_0 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET7_0 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET8_0 - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #endif }; @@ -114,28 +114,28 @@ public class PackageVersionsLatestMajors new object[] { string.Empty }, #else #if NET462 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -148,28 +148,28 @@ public class PackageVersionsLatestMajors new object[] { string.Empty }, #else #if NET462 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -382,18 +382,18 @@ public class PackageVersionsLatestMajors #endif #if NET6_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #if NET7_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #if NET8_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #endif }; @@ -1082,35 +1082,35 @@ public class PackageVersionsLatestMajors #else #if NET462 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -1124,35 +1124,35 @@ public class PackageVersionsLatestMajors #else #if NET462 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -1166,35 +1166,35 @@ public class PackageVersionsLatestMajors #else #if NET462 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs index 91eddd0c08b7..b6da8fe16a8d 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestMinors.g.cs @@ -30,42 +30,42 @@ public class PackageVersionsLatestMinors new object[] { "3.1.5.3" }, new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET5_0 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET6_0 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET7_0 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET8_0 new object[] { "3.3.106.47" }, new object[] { "3.5.4.38" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #endif }; @@ -81,42 +81,42 @@ public class PackageVersionsLatestMinors new object[] { "3.1.3.5" }, new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET5_0 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET6_0 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET7_0 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET8_0 new object[] { "3.3.101.1" }, new object[] { "3.5.0.79" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #endif }; @@ -172,42 +172,42 @@ public class PackageVersionsLatestMinors new object[] { "3.1.0.13" }, new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 new object[] { "3.3.103.26" }, new object[] { "3.5.1.28" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -223,42 +223,42 @@ public class PackageVersionsLatestMinors new object[] { "3.1.2.1" }, new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 new object[] { "3.3.102.17" }, new object[] { "3.5.1.51" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -1075,7 +1075,7 @@ public class PackageVersionsLatestMinors new object[] { "12.19.2" }, new object[] { "12.20.0" }, new object[] { "12.21.0" }, - new object[] { "12.22.6" }, + new object[] { "12.22.5" }, new object[] { "13.0.5" }, new object[] { "13.1.0" }, new object[] { "13.2.1" }, @@ -1085,7 +1085,7 @@ public class PackageVersionsLatestMinors new object[] { "13.6.1" }, new object[] { "13.7.0" }, new object[] { "13.8.1" }, - new object[] { "13.9.14" }, + new object[] { "13.9.13" }, #endif #if NET7_0 new object[] { "11.0.9" }, @@ -1114,7 +1114,7 @@ public class PackageVersionsLatestMinors new object[] { "12.19.2" }, new object[] { "12.20.0" }, new object[] { "12.21.0" }, - new object[] { "12.22.6" }, + new object[] { "12.22.5" }, new object[] { "13.0.5" }, new object[] { "13.1.0" }, new object[] { "13.2.1" }, @@ -1124,7 +1124,7 @@ public class PackageVersionsLatestMinors new object[] { "13.6.1" }, new object[] { "13.7.0" }, new object[] { "13.8.1" }, - new object[] { "13.9.14" }, + new object[] { "13.9.13" }, #endif #if NET8_0 new object[] { "11.0.9" }, @@ -1153,7 +1153,7 @@ public class PackageVersionsLatestMinors new object[] { "12.19.2" }, new object[] { "12.20.0" }, new object[] { "12.21.0" }, - new object[] { "12.22.6" }, + new object[] { "12.22.5" }, new object[] { "13.0.5" }, new object[] { "13.1.0" }, new object[] { "13.2.1" }, @@ -1163,7 +1163,7 @@ public class PackageVersionsLatestMinors new object[] { "13.6.1" }, new object[] { "13.7.0" }, new object[] { "13.8.1" }, - new object[] { "13.9.14" }, + new object[] { "13.9.13" }, #endif #endif }; @@ -2773,7 +2773,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, @@ -2785,7 +2785,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, @@ -2797,7 +2797,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, @@ -2809,7 +2809,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, @@ -2821,7 +2821,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, @@ -2833,7 +2833,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, @@ -2845,7 +2845,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, @@ -2857,7 +2857,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -2879,7 +2879,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, @@ -2891,7 +2891,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, @@ -2903,7 +2903,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, @@ -2915,7 +2915,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, @@ -2927,7 +2927,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, @@ -2939,7 +2939,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, @@ -2951,7 +2951,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, @@ -2963,7 +2963,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -2985,7 +2985,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, @@ -2997,7 +2997,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, @@ -3009,7 +3009,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, @@ -3021,7 +3021,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, @@ -3033,7 +3033,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, @@ -3045,7 +3045,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, @@ -3057,7 +3057,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, @@ -3069,7 +3069,7 @@ public class PackageVersionsLatestMinors new object[] { "3.3.1" }, new object[] { "3.4.3" }, new object[] { "3.5.2" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs index d5b725817a3f..95deab602fee 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/PackageVersionsLatestSpecific.g.cs @@ -29,35 +29,35 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "3.1.5.3" }, new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET5_0 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET6_0 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET7_0 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #if NET8_0 new object[] { "3.3.106.47" }, - new object[] { "3.7.401.8" }, + new object[] { "3.7.401.4" }, #endif #endif }; @@ -72,35 +72,35 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "3.1.3.5" }, new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET5_0 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET6_0 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET7_0 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #if NET8_0 new object[] { "3.3.101.1" }, - new object[] { "3.7.402.7" }, + new object[] { "3.7.402.3" }, #endif #endif }; @@ -134,35 +134,35 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "3.1.0.13" }, new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 new object[] { "3.3.103.26" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -177,35 +177,35 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "3.1.2.1" }, new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP2_1 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_0 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NETCOREAPP3_1 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET5_0 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET6_0 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET7_0 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #if NET8_0 new object[] { "3.3.102.17" }, - new object[] { "3.7.400.30" }, + new object[] { "3.7.400.26" }, #endif #endif }; @@ -485,18 +485,18 @@ public class PackageVersionsLatestSpecific #endif #if NET6_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #if NET7_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #if NET8_0 new object[] { "11.3.8" }, - new object[] { "12.22.6" }, - new object[] { "13.9.14" }, + new object[] { "12.22.5" }, + new object[] { "13.9.13" }, #endif #endif }; @@ -1267,42 +1267,42 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -1317,42 +1317,42 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; @@ -1367,42 +1367,42 @@ public class PackageVersionsLatestSpecific #if NET462 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP2_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NETCOREAPP3_1 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET5_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET6_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET7_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #if NET8_0 new object[] { "2.0.0" }, new object[] { "2.2.10" }, - new object[] { "3.6.1" }, + new object[] { "3.6.0" }, #endif #endif }; diff --git a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/WebRequestTests.cs b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/WebRequestTests.cs index 2508e74d9de6..489a839ee6e1 100644 --- a/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/WebRequestTests.cs +++ b/tracer/test/Datadog.Trace.ClrProfiler.IntegrationTests/WebRequestTests.cs @@ -22,9 +22,9 @@ public class WebRequestTests : TracingIntegrationTest public WebRequestTests(ITestOutputHelper output) : base("WebRequest", output) { + SetEnvironmentVariable("DD_HTTP_CLIENT_ERROR_STATUSES", "410-499"); SetServiceVersion("1.0.0"); SetEnvironmentVariable("DD_TRACE_OTEL_ENABLED", "true"); - SetEnvironmentVariable("DD_TRACE_HTTP_CLIENT_ERROR_STATUSES", "410-499"); } public override Result ValidateIntegrationSpan(MockSpan span, string metadataSchemaVersion) => span.IsWebRequest(metadataSchemaVersion); diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetCoreApiSecurity.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetCoreApiSecurity.cs index ebe917558b22..ff5c41d8778a 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetCoreApiSecurity.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetCoreApiSecurity.cs @@ -35,7 +35,10 @@ protected AspNetCoreApiSecurity(AspNetCoreTestFixture fixture, ITestOutputHelper // necessary as the developer middleware prevents the right blocking response EnvironmentHelper.CustomEnvironmentVariables.Add("ASPNETCORE_ENVIRONMENT", "Production"); SetEnvironmentVariable(ConfigurationKeys.LogDirectory, LogDirectory); - SetEnvironmentVariable(ConfigurationKeys.AppSec.ApiSecurityEnabled, enableApiSecurity.ToString()); + if (enableApiSecurity) + { + EnvironmentHelper.CustomEnvironmentVariables.Add(ConfigurationKeys.AppSec.ApiSecurityEnabled, "true"); + } } public override void Dispose() diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetFxWebApiApiSecurity.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetFxWebApiApiSecurity.cs index 9ce0c10ca2cb..fff92263332a 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetFxWebApiApiSecurity.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetFxWebApiApiSecurity.cs @@ -34,7 +34,11 @@ internal AspNetFxWebApiApiSecurity(IisFixture iisFixture, ITestOutputHelper outp { SetSecurity(true); EnvironmentHelper.CustomEnvironmentVariables.Add(ConfigurationKeys.AppSec.Rules, "ApiSecurity\\ruleset-with-block.json"); - SetEnvironmentVariable(ConfigurationKeys.AppSec.ApiSecurityEnabled, enableApiSecurity.ToString()); + + if (enableApiSecurity) + { + EnvironmentHelper.CustomEnvironmentVariables.Add(ConfigurationKeys.AppSec.ApiSecurityEnabled, "true"); + } _iisFixture = iisFixture; AddCookies(new Dictionary { { "cookie-key", "cookie-value" } }); diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetMvc5ApiSecurity.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetMvc5ApiSecurity.cs index 999757271992..a782d2c36413 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetMvc5ApiSecurity.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/ApiSecurity/AspNetMvc5ApiSecurity.cs @@ -47,7 +47,11 @@ internal AspNetMvc5ApiSecurity(IisFixture iisIisFixture, ITestOutputHelper outpu { SetSecurity(true); EnvironmentHelper.CustomEnvironmentVariables.Add(ConfigurationKeys.AppSec.Rules, "ApiSecurity\\ruleset-with-block.json"); - SetEnvironmentVariable(ConfigurationKeys.AppSec.ApiSecurityEnabled, enableApiSecurity.ToString()); + if (enableApiSecurity) + { + EnvironmentHelper.CustomEnvironmentVariables.Add(ConfigurationKeys.AppSec.ApiSecurityEnabled, "true"); + } + AddCookies(new Dictionary { { "cookie-key", "cookie-value" } }); _iisFixture = iisIisFixture; _testName = "Security." + nameof(AspNetMvc5ApiSecurity) + ".enableApiSecurity=" + enableApiSecurity; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs index 224fd1b3042f..4419a6441762 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetBase.cs @@ -84,7 +84,6 @@ public AspNetBase(string sampleName, ITestOutputHelper outputHelper, string shut _jsonSerializerSettingsOrderProperty = new JsonSerializerSettings { ContractResolver = new OrderedContractResolver() }; _clearMetaStruct = clearMetaStruct; - SetEnvironmentVariable(ConfigurationKeys.AppSec.ApiSecurityEnabled, "false"); } protected bool IncludeAllHttpSpans { get; set; } = false; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCore5AutoUserEvents.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCore5AutoUserEvents.cs index 4e7283a331c3..1163446fadc7 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCore5AutoUserEvents.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCore5AutoUserEvents.cs @@ -8,7 +8,6 @@ #pragma warning disable SA1649 // File name must match first type name using System.Threading.Tasks; -using Datadog.Trace.Configuration; using Datadog.Trace.TestHelpers; using Xunit; using Xunit.Abstractions; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBare.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBare.cs index 04cf596eb6d5..e4fcb19f7099 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBare.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBare.cs @@ -8,7 +8,6 @@ using System; using System.Net; using System.Threading.Tasks; -using Datadog.Trace.Configuration; using Datadog.Trace.TestHelpers; using Xunit; using Xunit.Abstractions; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBase.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBase.cs index 80cc36a35c63..0b88c41ae770 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBase.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetCoreBase.cs @@ -8,8 +8,8 @@ using System.Net; using System.Threading.Tasks; using Datadog.Trace.AppSec; -using Datadog.Trace.Configuration; using Datadog.Trace.TestHelpers; +using Datadog.Trace.Vendors.Newtonsoft.Json; using Xunit; using Xunit.Abstractions; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetMvc5.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetMvc5.cs index c70329c02f84..301f226b7cb1 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetMvc5.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/AspNetMvc5.cs @@ -65,7 +65,6 @@ public AspNetMvc5(IisFixture iisFixture, ITestOutputHelper output, bool classicM SetSecurity(enableSecurity); SetEnvironmentVariable(Configuration.ConfigurationKeys.AppSec.Rules, DefaultRuleFile); SetEnvironmentVariable(Configuration.ConfigurationKeys.DebugEnabled, "1"); - SetEnvironmentVariable(Configuration.ConfigurationKeys.AppSec.ApiSecurityEnabled, "false"); _classicMode = classicMode; _iisFixture = iisFixture; diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/Rcm/RcmBase.cs b/tracer/test/Datadog.Trace.Security.IntegrationTests/Rcm/RcmBase.cs index ad9a88bade75..bee5eeca14d4 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/Rcm/RcmBase.cs +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/Rcm/RcmBase.cs @@ -25,7 +25,6 @@ protected RcmBase(AspNetCoreTestFixture fixture, ITestOutputHelper outputHelper, Fixture = fixture; EnableSecurity = enableSecurity; SetEnvironmentVariable(ConfigurationKeys.Rcm.PollInterval, "0.5"); - SetEnvironmentVariable(ConfigurationKeys.AppSec.ApiSecurityEnabled, "false"); } protected AspNetCoreTestFixture Fixture { get; } diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/rasp-rule-set.json b/tracer/test/Datadog.Trace.Security.IntegrationTests/rasp-rule-set.json index 3c3b22fed3f6..7701a52fd2be 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/rasp-rule-set.json +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/rasp-rule-set.json @@ -16,23 +16,22 @@ ], "processors": [ { - "id": "http-endpoint-fingerprint", + "id": "processor-001", "generator": "http_endpoint_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -63,27 +62,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-header-fingerprint", + "id": "processor-002", "generator": "http_header_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -99,27 +97,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-network-fingerprint", + "id": "processor-003", "generator": "http_network_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -135,27 +132,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "session-fingerprint", + "id": "processor-004", "generator": "session_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -181,7 +177,7 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true } ], @@ -460,35 +456,6 @@ "block" ] }, - { - "id": "ua0-600-12x", - "name": "Arachni", - "tags": { - "type": "attack_tool", - "category": "attack_attempt", - "cwe": "200", - "capec": "1000/118/169", - "tool_name": "Arachni", - "confidence": "1" - }, - "conditions": [ - { - "parameters": { - "inputs": [ - { - "address": "server.request.headers.no_cookies", - "key_path": [ - "user-agent" - ] - } - ], - "regex": "^Arachni\\/v" - }, - "operator": "match_regex" - } - ], - "transformers": [] - }, { "id": "rasp-932-400", "name": "New exploit", diff --git a/tracer/test/Datadog.Trace.Security.IntegrationTests/ruleset.3.0.json b/tracer/test/Datadog.Trace.Security.IntegrationTests/ruleset.3.0.json index 3c7740fb8083..1b34f9292fb4 100644 --- a/tracer/test/Datadog.Trace.Security.IntegrationTests/ruleset.3.0.json +++ b/tracer/test/Datadog.Trace.Security.IntegrationTests/ruleset.3.0.json @@ -16,23 +16,22 @@ ], "processors": [ { - "id": "http-endpoint-fingerprint", + "id": "processor-001", "generator": "http_endpoint_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -63,27 +62,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-header-fingerprint", + "id": "processor-002", "generator": "http_header_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -99,27 +97,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-network-fingerprint", + "id": "processor-003", "generator": "http_network_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -135,27 +132,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "session-fingerprint", + "id": "processor-004", "generator": "session_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -181,7 +177,7 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true } ], diff --git a/tracer/test/Datadog.Trace.Security.Unit.Tests/Fingerprint/FingerprintTests.cs b/tracer/test/Datadog.Trace.Security.Unit.Tests/Fingerprint/FingerprintTests.cs index 5c56708e885b..ff21fee7891b 100644 --- a/tracer/test/Datadog.Trace.Security.Unit.Tests/Fingerprint/FingerprintTests.cs +++ b/tracer/test/Datadog.Trace.Security.Unit.Tests/Fingerprint/FingerprintTests.cs @@ -16,120 +16,120 @@ namespace Datadog.Trace.Security.Unit.Tests; public class FingerprintTests : WafLibraryRequiredTest { - private static List>> sampleData = new() + private static List> sampleData = new() { - new List>() + new Dictionary() { - new Dictionary - { - { AddressesConstants.RequestUriRaw, "/path/to/resource/?key=" }, - { AddressesConstants.RequestMethod, "PUT" }, - { AddressesConstants.RequestQuery, new Dictionary { { "key", "value" } } }, - { AddressesConstants.RequestBody, new Dictionary { { "key", "value" } } }, - { AddressesConstants.RequestHeaderNoCookies, new Dictionary { { "user-agent", "Arachni/v1.5.1" }, { "x-forwarded-for", "::1" }, { "custom", "value" } } }, - { AddressesConstants.RequestCookies, new Dictionary { { "name", "albert" }, { "language", "en-GB" }, { "session_id", "ansd0182u2n" } } }, - { AddressesConstants.UserId, "admin" }, - { AddressesConstants.UserSessionId, "ansd0182u2n" } - } + { AddressesConstants.RequestUriRaw, "/path/to/resource/?key=" }, + { AddressesConstants.RequestMethod, "PUT" }, + { AddressesConstants.RequestQuery, new Dictionary { { "key", "value" } } }, + { AddressesConstants.RequestBody, new Dictionary { { "key", "value" } } }, + { AddressesConstants.RequestHeaderNoCookies, new Dictionary { { "user-agent", "Random" }, { "x-forwarded-for", "::1" }, { "custom", "value" } } }, + { AddressesConstants.RequestCookies, new Dictionary { { "name", "albert" }, { "language", "en-GB" }, { "session_id", "ansd0182u2n" } } }, + { AddressesConstants.UserId, "admin" }, + { AddressesConstants.UserSessionId, "ansd0182u2n" } }, - new List>() + new Dictionary() { - new Dictionary() + { "server.request.method", "GET" }, + { "server.response.status", "200" }, + { "server.request.uri.raw", "/Iast/GetFileContent?file=/nonexisting.txt" }, + { "http.client_ip", "::1" }, + { "server.request.body", new Dictionary() }, + { "server.request.query", new Dictionary { { "file", new[] { "/nonexisting.txt" } } } }, { - { "server.request.method", "GET" }, - { "server.response.status", "200" }, - { "server.request.uri.raw", "/Iast/GetFileContent?file=/nonexisting.txt" }, - { "http.client_ip", "::1" }, - { "server.request.body", new Dictionary() }, - { "server.request.query", new Dictionary { { "file", new[] { "/nonexisting.txt" } } } }, - { - "server.request.headers.no_cookies", new Dictionary - { - { "cache-control", new[] { "max-age=0" } }, - { "connection", new[] { "keep-alive" } }, - { "accept", new[] { "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" } }, - { "accept-encoding", new[] { "gzip , deflate, br, zstd" } }, - { "accept-language", new[] { "en,es-ES;q=0.9,es;q=0.8" } }, - { "host", new[] { "localhost:5003" } }, - { "referer", new[] { "http://localhost:5003/" } }, - { "user-agent", new[] { "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" } }, - { "sec-ch-ua", new[] { "\"Chromium\";v=\"128\", \"Not;A=Brand\";v=\"24\", \"Google Chrome\";v=\"128\"" } }, - { "sec-ch-ua-mobile", new[] { "?0" } }, - { "sec-ch-ua-platform", new[] { "\"Windows\"" } }, - { "upgrade-insecure-requests", new[] { "1" } }, - { "sec-fetch-site", new[] { "same-origin" } }, - { "sec-fetch-mode", new[] { "navigate" } }, - { "sec-fetch-user", new[] { "?1" } }, - { "sec-fetch-dest", new[] { "document" } } - } - }, + "server.request.headers.no_cookies", new Dictionary { - "server.request.cookies", new Dictionary - { - { ".AspNetCore.Antiforgery.dInqUVwbgyA", new[] { "CfDJ8DWtaLKARU1BicbVG7iD6w0lxol0VHahrPFrsql7ySzRtc-oxacIBn4biwlminJYcnuU_8hDW60aVfqux98gC6T-ZpAVQ7YK_fdPn6wbqLO4pNe9jQ3jwbhpMqgbl1Ng2nWoam8UexOt4Q0mP8lkADY" } }, - { "__AntiXsrfToken", new[] { "6587af0f57a2452185675cb0c830f8ec" } }, - { "accountType", new[] { "Personal" } }, - { "file", new[] { "value1" } }, - { "argumentLine", new[] { "value2" } }, - { "SecureKey", new[] { "SecureValue" } }, - { "SameSiteKey", new[] { "SameSiteValue" } }, - { "AllVulnerabilitiesCookieKey", new[] { "AllVulnerabilitiesCookieValue&SameSite=None" } }, - { "NoSameSiteKeyDefault", new[] { "NoSameSiteValueDefault" } }, - { "NoSameSiteKeyNone", new[] { "NoSameSiteValueNOne&SameSite=None" } }, - { "NoSameSiteKey", new[] { "NoSameSiteValue" } }, - { "NoSameSiteKeyLax", new[] { "NoSameSiteValueLax" } }, - { "NoSameSiteKeyDef", new[] { "NoSameSiteValueDef" } }, - { "insecureKey", new[] { "insecureValue" } }, - { ".AspNetCore.Correlation.oidc.xxxxxxxxxxxxxxxxxxx", new[] { "ExcludedCookieVulnValue" } }, - { "NoHttpOnlyKey", new[] { "NoHttpOnlyValue" } }, - { ".AspNetCore.Antiforgery.PEOLKb2zqCM", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv5Nx2auCU2Nz4wPtc65npv5lxXup6TheS5Af5OxeI4p-F8qu4m3bqB9ngwMMNLTksq3J4rDOfDleYwS0ZO6sus4UQwJj9PXsX_tmEjSjvyHBQSyj0erEIC206XNFDz7oi8" } }, - { ".AspNetCore.Antiforgery.dv9Y7hx5lOY", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv5vbQjBTneuzffR0UWgwEbiUtb6cQDjp8VEQ9JVGvqF_BW0M85B3spAuysW_rY5tFQ6R-pNAnwJnAvoO-zwxA7Fx6mepz2G7BFXjnEpeHkew7ARSyoryR12nYpD1tNU9S8" } }, - { ".AspNetCore.Antiforgery.jE_SavyZJRU", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv7NfxQhx1lE8BOs9z5BaqShFHv9a4xh3pg5gA40Yqo3uy4gFtk_oTW_aPSfpppytPKAdb-oYYt6FX5ajDN21C9yAIF3Ob8xBGGbBBoXKVXGE4g0AEan5HaSlUk2WxdY0PY" } }, - { ".AspNetCore.Session", new[] { "CfDJ8L/VJqbgbZ9AmItcsJeWhzGYBGDf0hQBOKYF9PXBQb+iCK/LWVuiTTVjmvN2NiKjtG08fe/7iqy/UwEmjtIf4RSZbvaAtdx5IjYu8J3t51dfons7ldcMWlvVu0hFrlB0aPuIiu25BAD1A4CXFuIfDIp+U3C/eCaHU9EJNLdKDh3c" } }, - { "umb_installId", new[] { "9a334af1-788e-473d-ae5c-ed64edc39f3a" } }, - { "SafeCookieKey", new[] { "SafeCookieValue&SameSite=Strict" } }, - { "UnsafeEmptyCookie", new[] { "SameSite=None" } } - } + { "cache-control", new[] { "max-age=0" } }, + { "connection", new[] { "keep-alive" } }, + { "accept", new[] { "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" } }, + { "accept-encoding", new[] { "gzip , deflate, br, zstd" } }, + { "accept-language", new[] { "en,es-ES;q=0.9,es;q=0.8" } }, + { "host", new[] { "localhost:5003" } }, + { "referer", new[] { "http://localhost:5003/" } }, + { "user-agent", new[] { "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36" } }, + { "sec-ch-ua", new[] { "\"Chromium\";v=\"128\", \"Not;A=Brand\";v=\"24\", \"Google Chrome\";v=\"128\"" } }, + { "sec-ch-ua-mobile", new[] { "?0" } }, + { "sec-ch-ua-platform", new[] { "\"Windows\"" } }, + { "upgrade-insecure-requests", new[] { "1" } }, + { "sec-fetch-site", new[] { "same-origin" } }, + { "sec-fetch-mode", new[] { "navigate" } }, + { "sec-fetch-user", new[] { "?1" } }, + { "sec-fetch-dest", new[] { "document" } } } }, - new Dictionary() { - { AddressesConstants.FileAccess, "/nonexisting.txt" } + "server.request.cookies", new Dictionary + { + { ".AspNetCore.Antiforgery.dInqUVwbgyA", new[] { "CfDJ8DWtaLKARU1BicbVG7iD6w0lxol0VHahrPFrsql7ySzRtc-oxacIBn4biwlminJYcnuU_8hDW60aVfqux98gC6T-ZpAVQ7YK_fdPn6wbqLO4pNe9jQ3jwbhpMqgbl1Ng2nWoam8UexOt4Q0mP8lkADY" } }, + { "__AntiXsrfToken", new[] { "6587af0f57a2452185675cb0c830f8ec" } }, + { "accountType", new[] { "Personal" } }, + { "file", new[] { "value1" } }, + { "argumentLine", new[] { "value2" } }, + { "SecureKey", new[] { "SecureValue" } }, + { "SameSiteKey", new[] { "SameSiteValue" } }, + { "AllVulnerabilitiesCookieKey", new[] { "AllVulnerabilitiesCookieValue&SameSite=None" } }, + { "NoSameSiteKeyDefault", new[] { "NoSameSiteValueDefault" } }, + { "NoSameSiteKeyNone", new[] { "NoSameSiteValueNOne&SameSite=None" } }, + { "NoSameSiteKey", new[] { "NoSameSiteValue" } }, + { "NoSameSiteKeyLax", new[] { "NoSameSiteValueLax" } }, + { "NoSameSiteKeyDef", new[] { "NoSameSiteValueDef" } }, + { "insecureKey", new[] { "insecureValue" } }, + { ".AspNetCore.Correlation.oidc.xxxxxxxxxxxxxxxxxxx", new[] { "ExcludedCookieVulnValue" } }, + { "NoHttpOnlyKey", new[] { "NoHttpOnlyValue" } }, + { ".AspNetCore.Antiforgery.PEOLKb2zqCM", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv5Nx2auCU2Nz4wPtc65npv5lxXup6TheS5Af5OxeI4p-F8qu4m3bqB9ngwMMNLTksq3J4rDOfDleYwS0ZO6sus4UQwJj9PXsX_tmEjSjvyHBQSyj0erEIC206XNFDz7oi8" } }, + { ".AspNetCore.Antiforgery.dv9Y7hx5lOY", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv5vbQjBTneuzffR0UWgwEbiUtb6cQDjp8VEQ9JVGvqF_BW0M85B3spAuysW_rY5tFQ6R-pNAnwJnAvoO-zwxA7Fx6mepz2G7BFXjnEpeHkew7ARSyoryR12nYpD1tNU9S8" } }, + { ".AspNetCore.Antiforgery.jE_SavyZJRU", new[] { "CfDJ8N8HgaU-AuxItWDrE6uHmv7NfxQhx1lE8BOs9z5BaqShFHv9a4xh3pg5gA40Yqo3uy4gFtk_oTW_aPSfpppytPKAdb-oYYt6FX5ajDN21C9yAIF3Ob8xBGGbBBoXKVXGE4g0AEan5HaSlUk2WxdY0PY" } }, + { ".AspNetCore.Session", new[] { "CfDJ8L/VJqbgbZ9AmItcsJeWhzGYBGDf0hQBOKYF9PXBQb+iCK/LWVuiTTVjmvN2NiKjtG08fe/7iqy/UwEmjtIf4RSZbvaAtdx5IjYu8J3t51dfons7ldcMWlvVu0hFrlB0aPuIiu25BAD1A4CXFuIfDIp+U3C/eCaHU9EJNLdKDh3c" } }, + { "umb_installId", new[] { "9a334af1-788e-473d-ae5c-ed64edc39f3a" } }, + { "SafeCookieKey", new[] { "SafeCookieValue&SameSite=Strict" } }, + { "UnsafeEmptyCookie", new[] { "SameSite=None" } } + } } }, - new List>() + new Dictionary() { - new Dictionary() - { - { AddressesConstants.RequestUriRaw, "/path/to/resource.php" }, - { AddressesConstants.RequestMethod, "GET" }, - { AddressesConstants.RequestQuery, new Dictionary { { "name", "datadog" }, { "index", "295" } } }, - { AddressesConstants.RequestBody, new Dictionary() }, - { AddressesConstants.RequestHeaderNoCookies, new Dictionary { { "user-agent", new string[] { "Arachni/v1.5.1" } }, { "x-forwarded-for", "1.2.3.4" }, { "Accept-Language", "en_UK" }, { "X-Custom-Header", "42" } } }, - { AddressesConstants.RequestCookies, new Dictionary { { "Expires ", "tomorrow" }, { "SessionToken", "12asd8ahjsd91j289" } } }, - { AddressesConstants.UserId, "non-admin" } - } + { AddressesConstants.RequestUriRaw, "/path/to/resource.php" }, + { AddressesConstants.RequestMethod, "GET" }, + { AddressesConstants.RequestQuery, new Dictionary { { "name", "datadog" }, { "index", "295" } } }, + { AddressesConstants.RequestBody, new Dictionary() }, + { AddressesConstants.RequestHeaderNoCookies, new Dictionary { { "user-agent", new string[] { "Arachni", "other" } }, { "x-forwarded-for", "1.2.3.4" }, { "Accept-Language", "en_UK" }, { "X-Custom-Header", "42" } } }, + { AddressesConstants.RequestCookies, new Dictionary { { "Expires ", "tomorrow" }, { "SessionToken", "12asd8ahjsd91j289" } } }, + { AddressesConstants.UserId, "non-admin" } } }; [Theory] - [InlineData(0, 4)] - [InlineData(1, 3)] - [InlineData(2, 3)] - public void GivenAFingerprintRequest_WhenRunWAF_FingerprintIsGenerated(int testIndex, int resultingHeaders) + [InlineData(0, 4, true)] + [InlineData(1, 3, true)] + [InlineData(2, 3, true)] + [InlineData(0, 4, false)] + [InlineData(1, 3, false)] + [InlineData(2, 3, false)] + public void GivenAFingerprintRequest_WhenRunWAF_FingerprintIsGenerated(int testIndex, int resultingHeaders, bool singleCall) { var ruleFile = "rasp-rule-set.json"; var context = InitWaf(true, ruleFile, new Dictionary(), out var waf); - List> args; + Dictionary args; - args = sampleData[testIndex]; - IResult result = null; - foreach (var data in args) + if (singleCall) + { + args = new Dictionary(sampleData[testIndex]) + { + { AddressesConstants.WafContextProcessor, new Dictionary { { "fingerprint", true } } } + }; + } + else { - result = context.Run(data, TimeoutMicroSeconds); - result.Timeout.Should().BeFalse("Timeout should be false"); + args = new Dictionary(sampleData[testIndex]); + _ = context.Run(args, TimeoutMicroSeconds); + args = new Dictionary() + { + { AddressesConstants.WafContextProcessor, new Dictionary { { "fingerprint", true } } } + }; } + var result = context.Run(args, TimeoutMicroSeconds); result.FingerprintDerivatives.Count.Should().Be(resultingHeaders); } diff --git a/tracer/test/Datadog.Trace.TestHelpers/EnvironmentHelper.cs b/tracer/test/Datadog.Trace.TestHelpers/EnvironmentHelper.cs index 4f6d5b5b6268..ea28880642ce 100644 --- a/tracer/test/Datadog.Trace.TestHelpers/EnvironmentHelper.cs +++ b/tracer/test/Datadog.Trace.TestHelpers/EnvironmentHelper.cs @@ -195,10 +195,6 @@ public void SetEnvironmentVariables( // see https://github.com/DataDog/dd-trace-dotnet/pull/3579 environmentVariables["DD_INTERNAL_WORKAROUND_77973_ENABLED"] = "1"; - // In some scenarios (.NET 6, SSI run enabled) enabling procdump makes - // grabbing a stack trace _crazy_ expensive (10s). Setting this "fixes" it. - environmentVariables["_NO_DEBUG_HEAP"] = "1"; - // Set a canary variable that should always be ignored // and check that it doesn't appear in the logs environmentVariables["SUPER_SECRET_CANARY"] = "MySuperSecretCanary"; diff --git a/tracer/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs b/tracer/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs index cbe051949bca..55024bdb842c 100644 --- a/tracer/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs +++ b/tracer/test/Datadog.Trace.TestHelpers/MockTracerAgent.cs @@ -38,10 +38,9 @@ public abstract class MockTracerAgent : IDisposable { private readonly CancellationTokenSource _cancellationTokenSource = new(); - protected MockTracerAgent(bool telemetryEnabled, TestTransports transport, bool optionalTelemetryHeaders = false) + protected MockTracerAgent(bool telemetryEnabled, TestTransports transport) { TelemetryEnabled = telemetryEnabled; - OptionalTelemetryHeaders = optionalTelemetryHeaders; TransportType = transport; } @@ -67,8 +66,6 @@ protected MockTracerAgent(bool telemetryEnabled, TestTransports transport, bool public bool TelemetryEnabled { get; } - public bool OptionalTelemetryHeaders { get; } - public Dictionary CustomResponses { get; } = new(); /// @@ -114,8 +111,8 @@ protected MockTracerAgent(bool telemetryEnabled, TestTransports transport, bool /// public bool ShouldDeserializeTraces { get; set; } = true; - public static TcpUdpAgent Create(ITestOutputHelper output, int? port = null, int retries = 5, bool useStatsd = false, bool doNotBindPorts = false, int? requestedStatsDPort = null, bool useTelemetry = false, bool optionalTelemetryHeaders = false, AgentConfiguration agentConfiguration = null) - => new TcpUdpAgent(port, retries, useStatsd, doNotBindPorts, requestedStatsDPort, useTelemetry, optionalTelemetryHeaders) { Output = output, Configuration = agentConfiguration ?? new() }; + public static TcpUdpAgent Create(ITestOutputHelper output, int? port = null, int retries = 5, bool useStatsd = false, bool doNotBindPorts = false, int? requestedStatsDPort = null, bool useTelemetry = false, AgentConfiguration agentConfiguration = null) + => new TcpUdpAgent(port, retries, useStatsd, doNotBindPorts, requestedStatsDPort, useTelemetry) { Output = output, Configuration = agentConfiguration ?? new() }; #if NETCOREAPP3_1_OR_GREATER public static UdsAgent Create(ITestOutputHelper output, UnixDomainSocketConfig config, AgentConfiguration agentConfiguration = null) => new UdsAgent(config) { Output = output, Configuration = agentConfiguration ?? new() }; @@ -600,21 +597,10 @@ private void HandlePotentialTelemetryData(MockHttpRequest request) { try { - request.Headers.TryGetValue(TelemetryConstants.ApiVersionHeader, out var apiVersion); - request.Headers.TryGetValue(TelemetryConstants.RequestTypeHeader, out var requestType); + var apiVersion = request.Headers.GetValue(TelemetryConstants.ApiVersionHeader); + var requestType = request.Headers.GetValue(TelemetryConstants.RequestTypeHeader); var body = request.ReadStreamBody(); - - if (OptionalTelemetryHeaders && (apiVersion == null || requestType == null)) - { - using var sr = new StreamReader(new MemoryStream(body)); - var text = sr.ReadToEnd(); - - var json = JObject.Parse(text); - apiVersion = json["api_version"].Value(); - requestType = json["request_type"].Value(); - } - using var stream = new MemoryStream(body); var telemetry = MockTelemetryAgent.DeserializeResponse(stream, apiVersion, requestType); @@ -1053,8 +1039,8 @@ public class TcpUdpAgent : MockTracerAgent private readonly Task _tracesListenerTask; private readonly Task _statsdTask; - public TcpUdpAgent(int? port, int retries, bool useStatsd, bool doNotBindPorts, int? requestedStatsDPort, bool useTelemetry, bool optionalTelemetryHeaders) - : base(useTelemetry, TestTransports.Tcp, optionalTelemetryHeaders) + public TcpUdpAgent(int? port, int retries, bool useStatsd, bool doNotBindPorts, int? requestedStatsDPort, bool useTelemetry) + : base(useTelemetry, TestTransports.Tcp) { port ??= TcpPortProvider.GetOpenPort(); if (doNotBindPorts) diff --git a/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs b/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs index 738c1109994e..09e5d6f678c7 100644 --- a/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs +++ b/tracer/test/Datadog.Trace.Tests/Configuration/TracerSettingsTests.cs @@ -1234,48 +1234,6 @@ public void InitializeHeaderTag(string tagName, bool headerTagsNormalizationFixE finalTagName.Should().Be(expectedTagName); } - [Theory] - [InlineData(null, null, "500-599")] - [InlineData(null, "400", "400")] - [InlineData("444", null, "444")] - [InlineData("444", "424", "444")] - public void ValidateServerErrorStatusCodes(string newServerErrorKeyValue, string deprecatedServerErrorKeyValue, string expectedServerErrorCodes) - { - const string httpServerErrorStatusCodes = "DD_TRACE_HTTP_SERVER_ERROR_STATUSES"; - const string deprecatedHttpServerErrorStatusCodes = "DD_HTTP_SERVER_ERROR_STATUSES"; - - var source = CreateConfigurationSource( - (httpServerErrorStatusCodes, newServerErrorKeyValue), - (deprecatedHttpServerErrorStatusCodes, deprecatedServerErrorKeyValue)); - - var errorLog = new OverrideErrorLog(); - var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); - var result = settings.HttpServerErrorStatusCodes; - - ValidateErrorStatusCodes(result, newServerErrorKeyValue, deprecatedServerErrorKeyValue, expectedServerErrorCodes); - } - - [Theory] - [InlineData(null, null, "400-499")] - [InlineData(null, "500", "500")] - [InlineData("555", null, "555")] - [InlineData("555", "525", "555")] - public void ValidateClientErrorStatusCodes(string newClientErrorKeyValue, string deprecatedClientErrorKeyValue, string expectedClientErrorCodes) - { - const string httpClientErrorStatusCodes = "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES"; - const string deprecatedHttpClientErrorStatusCodes = "DD_HTTP_CLIENT_ERROR_STATUSES"; - - var source = CreateConfigurationSource( - (httpClientErrorStatusCodes, newClientErrorKeyValue), - (deprecatedHttpClientErrorStatusCodes, deprecatedClientErrorKeyValue)); - - var errorLog = new OverrideErrorLog(); - var settings = new TracerSettings(source, NullConfigurationTelemetry.Instance, errorLog); - var result = settings.HttpClientErrorStatusCodes; - - ValidateErrorStatusCodes(result, newClientErrorKeyValue, deprecatedClientErrorKeyValue, expectedClientErrorCodes); - } - private void SetAndValidateStatusCodes(Action> setStatusCodes, Func getStatusCodes) { var settings = new TracerSettings(); @@ -1297,21 +1255,5 @@ private void SetAndValidateStatusCodes(Action> Assert.Empty(statusCodes); } - - private void ValidateErrorStatusCodes(bool[] result, string newErrorKeyValue, string deprecatedErrorKeyValue, string expectedErrorRange) - { - if (newErrorKeyValue is not null || deprecatedErrorKeyValue is not null) - { - Assert.True(result[int.Parse(expectedErrorRange)]); - } - else - { - var statusCodeLimitsRange = expectedErrorRange.Split('-'); - for (var i = int.Parse(statusCodeLimitsRange[0]); i <= int.Parse(statusCodeLimitsRange[1]); i++) - { - Assert.True(result[i]); - } - } - } } } diff --git a/tracer/test/Datadog.Trace.Tests/ManualInstrumentation/SettingsInstrumentationTests.cs b/tracer/test/Datadog.Trace.Tests/ManualInstrumentation/SettingsInstrumentationTests.cs index 86c36dfb8485..a17b60762065 100644 --- a/tracer/test/Datadog.Trace.Tests/ManualInstrumentation/SettingsInstrumentationTests.cs +++ b/tracer/test/Datadog.Trace.Tests/ManualInstrumentation/SettingsInstrumentationTests.cs @@ -293,8 +293,8 @@ private static string[] GetAutomaticTracerSettingKeys() => GetAllTracerSettingKeys() .Where( x => x is not "IsFromDefaultSources" - and not "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES" - and not "DD_TRACE_HTTP_SERVER_ERROR_STATUSES" + and not "DD_HTTP_CLIENT_ERROR_STATUSES" + and not "DD_HTTP_SERVER_ERROR_STATUSES" and not "DD_TRACE_SERVICE_MAPPING") .ToArray(); diff --git a/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json b/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json index d6b28db73736..4debf85185f7 100644 --- a/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json +++ b/tracer/test/Datadog.Trace.Tests/Telemetry/config_norm_rules.json @@ -331,8 +331,6 @@ "DD_TRACE_HTTP_CLIENT_EXCLUDED_URL_SUBSTRINGS": "trace_http_client_excluded_urls", "DD_HTTP_SERVER_ERROR_STATUSES": "trace_http_server_error_statuses", "DD_HTTP_CLIENT_ERROR_STATUSES": "trace_http_client_error_statuses", - "DD_TRACE_HTTP_SERVER_ERROR_STATUSES": "trace_http_server_error_statuses", - "DD_TRACE_HTTP_CLIENT_ERROR_STATUSES": "trace_http_client_error_statuses", "DD_TRACE_CLIENT_IP_HEADER": "trace_client_ip_header", "DD_TRACE_CLIENT_IP_ENABLED": "trace_client_ip_enabled", "DD_TRACE_KAFKA_CREATE_CONSUMER_SCOPE_ENABLED": "trace_kafka_create_consumer_scope_enabled", diff --git a/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/CiRunCommandTests.cs b/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/CiRunCommandTests.cs index a977dfb78bce..3c2b26fe5864 100644 --- a/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/CiRunCommandTests.cs +++ b/tracer/test/Datadog.Trace.Tools.Runner.IntegrationTests/CiRunCommandTests.cs @@ -118,7 +118,7 @@ private void RunExternalCoverageTest(string filePath) environmentVariables.Should().NotBeNull(); testSession.Should().NotBeNull(); - testSession.Meta.Should().NotContain(new KeyValuePair(CodeCoverageTags.Enabled, "true")); + testSession.Meta.Should().Contain(new KeyValuePair(CodeCoverageTags.Enabled, "true")); testSession.Metrics.Should().Contain(new KeyValuePair(CodeCoverageTags.PercentageOfTotalLines, 83.33)); } } diff --git a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/ConsoleTestHelper.cs b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/ConsoleTestHelper.cs index 859d68d44256..2127323fa1bc 100644 --- a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/ConsoleTestHelper.cs +++ b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/ConsoleTestHelper.cs @@ -21,12 +21,12 @@ protected ConsoleTestHelper(ITestOutputHelper output) { } - protected Task StartConsole(bool enableProfiler, params (string Key, string Value)[] environmentVariables) + protected Task StartConsole(bool enableProfiler, params (string Key, string Value)[] environmentVariables) { return StartConsole(EnvironmentHelper, enableProfiler, "wait", environmentVariables); } - protected Task StartConsoleWithArgs(string args, bool enableProfiler, params (string Key, string Value)[] environmentVariables) + protected Task StartConsoleWithArgs(string args, bool enableProfiler, params (string Key, string Value)[] environmentVariables) { return StartConsole(EnvironmentHelper, enableProfiler, args, environmentVariables); } @@ -49,7 +49,7 @@ protected Task StartConsoleWithArgs(string args, bool enabl return (executable, args); } - protected Task StartConsole(EnvironmentHelper environmentHelper, bool enableProfiler, string args, params (string Key, string Value)[] environmentVariables) + protected Task StartConsole(EnvironmentHelper environmentHelper, bool enableProfiler, string args, params (string Key, string Value)[] environmentVariables) { var (executable, baseArgs) = PrepareSampleApp(environmentHelper); args = $"{baseArgs} {args}"; @@ -57,7 +57,7 @@ protected Task StartConsole(EnvironmentHelper environmentHe return StartConsole(executable, args, environmentHelper, enableProfiler, environmentVariables); } - protected async Task StartConsole(string executable, string args, EnvironmentHelper environmentHelper, bool enableProfiler, params (string Key, string Value)[] environmentVariables) + protected async Task StartConsole(string executable, string args, EnvironmentHelper environmentHelper, bool enableProfiler, params (string Key, string Value)[] environmentVariables) { var processStart = new ProcessStartInfo(executable, args) { UseShellExecute = false, RedirectStandardError = true, RedirectStandardOutput = true }; @@ -65,7 +65,7 @@ protected async Task StartConsole(string executable, string if (enableProfiler) { - agent = MockTracerAgent.Create(Output, useTelemetry: true, optionalTelemetryHeaders: true); + agent = MockTracerAgent.Create(Output); environmentHelper.SetEnvironmentVariables( agent, @@ -129,20 +129,20 @@ protected async Task StartConsole(string executable, string throw new TimeoutException("Timeout when waiting for the target process to start"); } - public class CustomProcessHelper : ProcessHelper + private class CustomProcessHelper : ProcessHelper { + private readonly MockTracerAgent? _agent; + public CustomProcessHelper(MockTracerAgent? agent, Process process, Action? onDataReceived = null) : base(process, onDataReceived) { - Agent = agent; + _agent = agent; } - public MockTracerAgent? Agent { get; } - public override void Dispose() { base.Dispose(); - Agent?.Dispose(); + _agent?.Dispose(); } } } diff --git a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs index 16ff5a735ab7..5b69778a652c 100644 --- a/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs +++ b/tracer/test/Datadog.Trace.Tools.dd_dotnet.ArtifactTests/CreatedumpTests.cs @@ -3,11 +3,12 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. // +#if !NETFRAMEWORK + using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using System.Text.RegularExpressions; using System.Threading.Tasks; using Datadog.Trace.Telemetry; @@ -23,9 +24,7 @@ namespace Datadog.Trace.Tools.dd_dotnet.ArtifactTests; public class CreatedumpTests : ConsoleTestHelper { -#if !NETFRAMEWORK // Createdump is not supported on .NET Framework private const string CreatedumpExpectedOutput = "Writing minidump with heap to file /dev/null"; -#endif private const string CrashReportExpectedOutput = "The crash may have been caused by automatic instrumentation"; public CreatedumpTests(ITestOutputHelper output) @@ -43,7 +42,7 @@ private static (string Key, string Value) LdPreloadConfig { var path = Utils.GetApiWrapperPath(); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !File.Exists(path)) + if (!File.Exists(path)) { throw new FileNotFoundException($"LD wrapper not found at path {path}. Ensure you have built the profiler home directory using BuildProfilerHome"); } @@ -54,7 +53,6 @@ private static (string Key, string Value) LdPreloadConfig private static (string Key, string Value)[] CreatedumpConfig => [("COMPlus_DbgEnableMiniDump", "1"), ("COMPlus_DbgMiniDumpName", "/dev/null")]; -#if !NETFRAMEWORK [SkippableTheory] [InlineData("1", true)] [InlineData("0", false)] @@ -70,13 +68,12 @@ public async Task Passthrough(string passthrough, bool shouldCallCreatedump) // "was COMPlus_DbgEnableMiniDump set?" check. SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.Platform(SkipOn.PlatformValue.Windows); // This test is not needed on Windows because we don't hook createdump using var reportFile = new TemporaryFile(); (string, string)[] args = [LdPreloadConfig, .. CreatedumpConfig, ("DD_INTERNAL_CRASHTRACKING_PASSTHROUGH", passthrough), CrashReportConfig(reportFile)]; - using var helper = await StartConsoleWithArgs("crash-datadog", enableProfiler: true, args); + using var helper = await StartConsoleWithArgs("crash-datadog", false, args); await helper.Task; @@ -85,7 +82,6 @@ public async Task Passthrough(string passthrough, bool shouldCallCreatedump) assertionScope.AddReportable("stderr", helper.ErrorOutput); helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - File.Exists(reportFile.Path).Should().BeTrue(); if (shouldCallCreatedump) @@ -132,7 +128,6 @@ public async Task BashScript() helper.StandardOutput.Should().Contain(CreatedumpExpectedOutput); } -#endif [SkippableTheory] [InlineData(true)] @@ -141,22 +136,16 @@ public async Task DoNothingIfNotEnabled(bool enableCrashDumps) { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - if (enableCrashDumps) - { - // Crashtracking is not supported on Windows x86 - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); - } - using var reportFile = new TemporaryFile(); - (string, string)[] args = [LdPreloadConfig, CrashReportConfig(reportFile), ("DD_CRASHTRACKING_ENABLED", "0")]; + (string, string)[] args = [LdPreloadConfig, ("DD_CRASHTRACKING_ENABLED", "0")]; if (enableCrashDumps) { args = [.. args, .. CreatedumpConfig]; } - using var helper = await StartConsoleWithArgs("crash-datadog", enableProfiler: true, args); + using var helper = await StartConsoleWithArgs("crash-datadog", false, args); await helper.Task; @@ -164,12 +153,8 @@ public async Task DoNothingIfNotEnabled(bool enableCrashDumps) assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().NotContain(CrashReportExpectedOutput); - } + helper.StandardOutput.Should().NotContain(CrashReportExpectedOutput); -#if !NETFRAMEWORK if (enableCrashDumps) { helper.StandardOutput.Should().Contain(CreatedumpExpectedOutput); @@ -178,7 +163,6 @@ public async Task DoNothingIfNotEnabled(bool enableCrashDumps) { helper.StandardOutput.Should().NotContain(CreatedumpExpectedOutput); } -#endif File.Exists(reportFile.Path).Should().BeFalse(); } @@ -190,7 +174,6 @@ public async Task DoNothingIfNotEnabled(bool enableCrashDumps) public async Task DisableTelemetry(bool telemetryEnabled, bool crashdumpEnabled) { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); using var reportFile = new TemporaryFile(); @@ -203,7 +186,7 @@ public async Task DisableTelemetry(bool telemetryEnabled, bool crashdumpEnabled) args = [.. args, ("DD_INSTRUMENTATION_TELEMETRY_ENABLED", telemetryEnabled ? "1" : "0")]; - using var helper = await StartConsoleWithArgs("crash-datadog", enableProfiler: true, args); + using var helper = await StartConsoleWithArgs("crash-datadog", false, args); await helper.Task; @@ -211,7 +194,6 @@ public async Task DisableTelemetry(bool telemetryEnabled, bool crashdumpEnabled) assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); -#if !NETFRAMEWORK if (crashdumpEnabled) { helper.StandardOutput.Should().Contain(CreatedumpExpectedOutput); @@ -220,24 +202,15 @@ public async Task DisableTelemetry(bool telemetryEnabled, bool crashdumpEnabled) { helper.StandardOutput.Should().NotContain(CreatedumpExpectedOutput); } -#endif if (telemetryEnabled) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } - + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeTrue(); } else { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().NotContain(CrashReportExpectedOutput); - } - + helper.StandardOutput.Should().NotContain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeFalse(); } } @@ -246,13 +219,12 @@ public async Task DisableTelemetry(bool telemetryEnabled, bool crashdumpEnabled) public async Task WriteCrashReport() { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); using var reportFile = new TemporaryFile(); using var helper = await StartConsoleWithArgs( "crash-datadog", - enableProfiler: true, + false, [LdPreloadConfig, CrashReportConfig(reportFile)]); await helper.Task; @@ -261,10 +233,7 @@ public async Task WriteCrashReport() assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeTrue(); @@ -277,11 +246,7 @@ public async Task WriteCrashReport() .FirstOrDefault(t => t.StartsWith("exception:")); exception.Should().NotBeNull().And.StartWith("exception:Type: System.BadImageFormatException\nMessage: Expected\nStack Trace:\n"); - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - report["siginfo"]!["signum"]!.Value().Should().Be("6"); - } + report["siginfo"]!["signum"]!.Value().Should().Be("6"); } #if !NETFRAMEWORK @@ -312,7 +277,7 @@ public async Task WorksFromDifferentFolders(string subFolder) using var helper = await StartConsoleWithArgs( "crash-datadog", - enableProfiler: true, + false, [("LD_PRELOAD", newApiWrapperPath), CrashReportConfig(reportFile)]); await helper.Task; @@ -321,10 +286,7 @@ public async Task WorksFromDifferentFolders(string subFolder) assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeTrue(); } @@ -339,7 +301,6 @@ public async Task WorksFromDifferentFolders(string subFolder) public async Task NativeCrash() { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); if (Utils.IsAlpine()) { @@ -350,7 +311,7 @@ public async Task NativeCrash() using var helper = await StartConsoleWithArgs( "crash-native", - enableProfiler: true, + true, [LdPreloadConfig, CrashReportConfig(reportFile)]); await helper.Task; @@ -359,10 +320,7 @@ public async Task NativeCrash() assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeTrue(); } @@ -373,13 +331,12 @@ public async Task CheckThreadName() // Test that threads prefixed with DD_ are marked as suspicious even if they have nothing of Datadog in the stacktrace SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); using var reportFile = new TemporaryFile(); using var helper = await StartConsoleWithArgs( "crash-thread", - enableProfiler: true, + true, [LdPreloadConfig, CrashReportConfig(reportFile)]); await helper.Task; @@ -388,10 +345,7 @@ public async Task CheckThreadName() assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); File.Exists(reportFile.Path).Should().BeTrue(); } @@ -400,12 +354,13 @@ public async Task CheckThreadName() public async Task SendReportThroughTelemetry() { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); + + using var agent = new MockTelemetryAgent(TcpPortProvider.GetOpenPort()) { OptionalHeaders = true }; using var helper = await StartConsoleWithArgs( "crash-datadog", - enableProfiler: true, - [LdPreloadConfig]); + false, + [LdPreloadConfig, ("DD_TRACE_AGENT_URL", $"http://localhost:{agent.Port}")]); await helper.Task; @@ -413,58 +368,35 @@ public async Task SendReportThroughTelemetry() assertionScope.AddReportable("stdout", helper.StandardOutput); assertionScope.AddReportable("stderr", helper.ErrorOutput); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - } - - bool IsCrashReport(object payload) - { - if (payload is not TelemetryData data) - { - return false; - } - - if (data.TryGetPayload(TelemetryRequestTypes.RedactedErrorLogs) is not { } log) - { - return false; - } - - if (log.Logs.Count != 1) - { - return false; - } + helper.StandardOutput.Should().Contain(CrashReportExpectedOutput); - var report = JObject.Parse(log.Logs[0].Message); - return report["additional_stacktraces"] != null; - } + var data = agent.WaitForLatestTelemetry(d => d.IsRequestType(TelemetryRequestTypes.RedactedErrorLogs)); + data.Should().NotBeNull(); - var agent = helper.Agent; + var log = (LogsPayload)data.Payload; + log.Logs.Should().HaveCount(1); + var report = JObject.Parse(log.Logs[0].Message); - agent.WaitForLatestTelemetry(IsCrashReport).Should().NotBeNull(); + report["additional_stacktraces"].Should().NotBeNull(); } [SkippableFact] public async Task IgnoreNonDatadogCrashes() { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); using var reportFile = new TemporaryFile(); using var helper = await StartConsoleWithArgs( "crash", - enableProfiler: true, + false, [LdPreloadConfig, CrashReportConfig(reportFile)]); await helper.Task; - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - helper.StandardOutput.Should() + helper.StandardOutput.Should() .NotContain(CrashReportExpectedOutput) .And.EndWith("Crashing...\n"); // Making sure there is no additional output - } File.Exists(reportFile.Path).Should().BeFalse(); } @@ -473,13 +405,12 @@ public async Task IgnoreNonDatadogCrashes() public async Task ReportedStacktrace() { SkipOn.Platform(SkipOn.PlatformValue.MacOs); - SkipOn.PlatformAndArchitecture(SkipOn.PlatformValue.Windows, SkipOn.ArchitectureValue.X86); using var reportFile = new TemporaryFile(); using var helper = await StartConsoleWithArgs( "crash-datadog", - enableProfiler: true, + false, [LdPreloadConfig, CrashReportConfig(reportFile)]); await helper.Task; @@ -488,18 +419,18 @@ public async Task ReportedStacktrace() var reader = new StringReader(helper.StandardOutput); - int? mainThreadId = null; + int? expectedPid = null; var expectedCallstack = new List(); - var tidRegex = "Main thread: (?[0-9]+)"; + var pidRegex = "PID: (?[0-9]+)"; while (reader.ReadLine() is { } line) { - var tidMatch = Regex.Match(line, tidRegex); + var pidMatch = Regex.Match(line, pidRegex); - if (tidMatch.Success) + if (pidMatch.Success) { - mainThreadId = int.Parse(tidMatch.Groups["tid"].Value); + expectedPid = int.Parse(pidMatch.Groups["pid"].Value); continue; } @@ -509,7 +440,7 @@ public async Task ReportedStacktrace() } } - mainThreadId.Should().NotBeNull(); + expectedPid.Should().NotBeNull(); expectedCallstack.Should().HaveCountGreaterOrEqualTo(2); var report = JObject.Parse(reportFile.GetContent()); @@ -518,7 +449,7 @@ public async Task ReportedStacktrace() assertionScope.AddReportable("Report", report.ToString()); ValidateStacktrace(report["stacktrace"]); - ValidateStacktrace(report["additional_stacktraces"][mainThreadId.Value.ToString()]); + ValidateStacktrace(report["additional_stacktraces"][expectedPid.Value.ToString()]); void ValidateStacktrace(JToken callstack) { @@ -595,3 +526,5 @@ public void Dispose() } } } + +#endif diff --git a/tracer/test/test-applications/integrations/Samples.Console/Program.cs b/tracer/test/test-applications/integrations/Samples.Console/Program.cs index 05116fc5e15f..7ba48e19a24f 100644 --- a/tracer/test/test-applications/integrations/Samples.Console/Program.cs +++ b/tracer/test/test-applications/integrations/Samples.Console/Program.cs @@ -2,11 +2,9 @@ using System.ComponentModel; using System.Diagnostics; using System.IO; -using System.Linq; using System.Net; using System.Reflection; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; @@ -40,7 +38,7 @@ void DoCrash() var thread = new Thread( () => { - SetCurrentThreadName("DD_thread"); + Thread.CurrentThread.Name = "DD_thread"; DoCrash(); }); @@ -71,16 +69,6 @@ void DoCrash() } } - private static void SetCurrentThreadName(string name) - { -#if NETFRAMEWORK - // .NET Framework doesn't set the thread name at the OS level - SetThreadDescription(GetCurrentThread(), name); -#else - Thread.CurrentThread.Name = name; -#endif - } - // Can't use a "real" async Main because it messes up the callstack for the crash-report tests private static async Task AsyncMain(string[] args) { @@ -151,7 +139,7 @@ private static void DumpCallstackAndThrow(Exception exception) private static void Ready() { - Console.WriteLine($"Waiting - PID: {Process.GetCurrentProcess().Id} - Main thread: {GetMainThreadId()} - Profiler attached: {SampleHelpers.IsProfilerAttached()}"); + Console.WriteLine($"Waiting - PID: {Process.GetCurrentProcess().Id} - Profiler attached: {SampleHelpers.IsProfilerAttached()}"); } private static unsafe void NativeCrash() @@ -189,14 +177,8 @@ private static unsafe IntPtr CreateCrashReport(int pid) var nativeLibraryType = Type.GetType("Datadog.Trace.AppSec.Waf.NativeBindings.NativeLibrary, Datadog.Trace", throwOnError: true); var tryLoad = nativeLibraryType.GetMethod("TryLoad", BindingFlags.NonPublic | BindingFlags.Static); var getExport = nativeLibraryType.GetMethod("GetExport", BindingFlags.NonPublic | BindingFlags.Static); - -#if NETFRAMEWORK - const string profilerPathEnvironmentVariable = "COR_PROFILER_PATH"; -#else - const string profilerPathEnvironmentVariable = "CORECLR_PROFILER_PATH"; -#endif - - var folder = Path.GetDirectoryName(Environment.GetEnvironmentVariable(profilerPathEnvironmentVariable)); + + var folder = Path.GetDirectoryName(Environment.GetEnvironmentVariable("CORECLR_PROFILER_PATH")); var profilerPath = Path.Combine(folder, "Datadog.Profiler.Native" + (Environment.OSVersion.Platform == PlatformID.Win32NT ? ".dll" : ".so")); var arguments = new object[] { profilerPath, null }; @@ -209,19 +191,6 @@ private static unsafe IntPtr CreateCrashReport(int pid) return ((delegate* unmanaged[Stdcall])createCrashReport)(pid); } -#if NETFRAMEWORK - [DllImport("kernel32.dll", SetLastError = true)] - private static extern bool SetThreadDescription(IntPtr hThread, [MarshalAs(UnmanagedType.LPWStr)] string lpThreadDescription); - - [DllImport("kernel32.dll", SetLastError = true)] - internal static extern IntPtr GetCurrentThread(); -#endif - - private static int GetMainThreadId() - { - return Process.GetCurrentProcess().Threads.Cast().First().Id; - } - private class DummySynchronizationContext : SynchronizationContext { public override void Post(SendOrPostCallback d, object state) => d(state); diff --git a/tracer/test/test-applications/security/Samples.Security.AspNetCore2/rasp-rule-set.json b/tracer/test/test-applications/security/Samples.Security.AspNetCore2/rasp-rule-set.json index b7bc98a80758..b002cc34eeba 100644 --- a/tracer/test/test-applications/security/Samples.Security.AspNetCore2/rasp-rule-set.json +++ b/tracer/test/test-applications/security/Samples.Security.AspNetCore2/rasp-rule-set.json @@ -16,23 +16,22 @@ ], "processors": [ { - "id": "http-endpoint-fingerprint", + "id": "processor-001", "generator": "http_endpoint_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -63,27 +62,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-header-fingerprint", + "id": "processor-002", "generator": "http_header_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -99,27 +97,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-network-fingerprint", + "id": "processor-003", "generator": "http_network_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -135,27 +132,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "session-fingerprint", + "id": "processor-004", "generator": "session_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -181,7 +177,7 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true } ], @@ -459,56 +455,6 @@ "stack_trace", "block" ] - }, - { - "id": "rasp-932-400", - "name": "New exploit", - "enabled": true, - "tags": { - "type": "new_injection", - "category": "vulnerability_trigger", - "cwe": "77", - "capec": "1000/152/248/88", - "confidence": "0", - "module": "rasp" - }, - "conditions": [ - { - "parameters": { - "resource": [ - { - "address": "server.sys.shell.cmd" - } - ], - "params": [ - { - "address": "server.request.query" - }, - { - "address": "server.request.body" - }, - { - "address": "server.request.path_params" - }, - { - "address": "grpc.server.request.message" - }, - { - "address": "graphql.server.all_resolvers" - }, - - { - "address": "graphql.server.resolver" - } - ] - }, - "operator": "new_detector" - } - ], - "transformers": [], - "on_match": [ - "stack_trace" - ] } ] } \ No newline at end of file diff --git a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/rasp-rule-set.json b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/rasp-rule-set.json index b7bc98a80758..b002cc34eeba 100644 --- a/tracer/test/test-applications/security/Samples.Security.AspNetCore5/rasp-rule-set.json +++ b/tracer/test/test-applications/security/Samples.Security.AspNetCore5/rasp-rule-set.json @@ -16,23 +16,22 @@ ], "processors": [ { - "id": "http-endpoint-fingerprint", + "id": "processor-001", "generator": "http_endpoint_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -63,27 +62,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-header-fingerprint", + "id": "processor-002", "generator": "http_header_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -99,27 +97,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "http-network-fingerprint", + "id": "processor-003", "generator": "http_network_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -135,27 +132,26 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true }, { - "id": "session-fingerprint", + "id": "processor-004", "generator": "session_fingerprint", "conditions": [ { - "operator": "exists", + "operator": "equals", "parameters": { "inputs": [ { - "address": "waf.context.event" - }, - { - "address": "server.business_logic.users.login.failure" - }, - { - "address": "server.business_logic.users.login.success" + "address": "waf.context.processor", + "key_path": [ + "fingerprint" + ] } - ] + ], + "value": true, + "type": "boolean" } } ], @@ -181,7 +177,7 @@ } ] }, - "evaluate": false, + "evaluate": true, "output": true } ], @@ -459,56 +455,6 @@ "stack_trace", "block" ] - }, - { - "id": "rasp-932-400", - "name": "New exploit", - "enabled": true, - "tags": { - "type": "new_injection", - "category": "vulnerability_trigger", - "cwe": "77", - "capec": "1000/152/248/88", - "confidence": "0", - "module": "rasp" - }, - "conditions": [ - { - "parameters": { - "resource": [ - { - "address": "server.sys.shell.cmd" - } - ], - "params": [ - { - "address": "server.request.query" - }, - { - "address": "server.request.body" - }, - { - "address": "server.request.path_params" - }, - { - "address": "grpc.server.request.message" - }, - { - "address": "graphql.server.all_resolvers" - }, - - { - "address": "graphql.server.resolver" - } - ] - }, - "operator": "new_detector" - } - ], - "transformers": [], - "on_match": [ - "stack_trace" - ] } ] } \ No newline at end of file