From 3c4ae68b0737927336fe5d2a191515cb3e56ff67 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 09:15:33 -0700 Subject: [PATCH 1/6] asan --- CMakeSettings.json | 19 +++++++++++++++---- azure-pipelines.yml | 2 +- src/signalrclient/logger.cpp | 2 +- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CMakeSettings.json b/CMakeSettings.json index 0347ab87..6b11c709 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -10,8 +10,7 @@ "cmakeCommandArgs": "-DBUILD_SAMPLES=true -DUSE_CPPRESTSDK=true", "buildCommandArgs": "-v", "ctestCommandArgs": "", - "cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake", - "variables": [] + "cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake" }, { "name": "x64-Release", @@ -23,8 +22,20 @@ "buildCommandArgs": "-v", "ctestCommandArgs": "", "cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake", - "inheritEnvironments": [ "msvc_x64_x64" ], - "variables": [] + "inheritEnvironments": [ "msvc_x64_x64" ] + }, + { + "name": "x64-Release-AddressSanitizer", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "-DBUILD_SAMPLES=true -DUSE_CPPRESTSDK=false", + "buildCommandArgs": "-v", + "ctestCommandArgs": "", + "addressSanitizerEnabled": true, + "cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake", + "inheritEnvironments": [ "msvc_x64_x64" ] } ] } \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ab528a21..36db249d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,7 +90,7 @@ stages: agentOs: Windows jobName: Windows_Build_Test useCppRestSDK: false - cMakeRunArgs: '-A x64' + cMakeRunArgs: '-A x64 -E env CXXFLAGS="/fsanitize=address"' - template: .azure/default-build.yml parameters: diff --git a/src/signalrclient/logger.cpp b/src/signalrclient/logger.cpp index e8a84420..158bfe92 100644 --- a/src/signalrclient/logger.cpp +++ b/src/signalrclient/logger.cpp @@ -50,7 +50,7 @@ namespace signalr // add millisecond part // 5 = 3 digits of millisecond precision + 'Z' + null character ending - snprintf(timeString + sizeof(timeString) - 5, 5, "%03dZ", (int)milliseconds.count()); + snprintf(timeString + sizeof(timeString) - 2, 5, "%03dZ", (int)milliseconds.count()); std::stringstream os; os << timeString; From 1fbd9eb09675c451f5583eb3337a9555ff844eaf Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 09:23:52 -0700 Subject: [PATCH 2/6] try --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 36db249d..568919a3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -90,7 +90,7 @@ stages: agentOs: Windows jobName: Windows_Build_Test useCppRestSDK: false - cMakeRunArgs: '-A x64 -E env CXXFLAGS="/fsanitize=address"' + cMakeRunArgs: '-A x64 -DCMAKE_CXX_FLAGS="/fsanitize=address"' - template: .azure/default-build.yml parameters: From 90b2f8b251a091674e54709818e9621d7cff70f7 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 09:37:28 -0700 Subject: [PATCH 3/6] reldbg --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 568919a3..39354ac0 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,6 +91,7 @@ stages: jobName: Windows_Build_Test useCppRestSDK: false cMakeRunArgs: '-A x64 -DCMAKE_CXX_FLAGS="/fsanitize=address"' + configuration: RelWithDebInfo - template: .azure/default-build.yml parameters: From 7f983490bf8cb1cb312af75222df8f794a9022e0 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 10:18:55 -0700 Subject: [PATCH 4/6] q --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 39354ac0..0643f956 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -91,7 +91,7 @@ stages: jobName: Windows_Build_Test useCppRestSDK: false cMakeRunArgs: '-A x64 -DCMAKE_CXX_FLAGS="/fsanitize=address"' - configuration: RelWithDebInfo + configuration: 'RelWithDebInfo' - template: .azure/default-build.yml parameters: From 0d55580c2f1a35ed071f95bcf3d9335a9961e932 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 13:14:58 -0700 Subject: [PATCH 5/6] diag --- .azure/default-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/default-build.yml b/.azure/default-build.yml index 429bcc57..e72f33ce 100644 --- a/.azure/default-build.yml +++ b/.azure/default-build.yml @@ -62,7 +62,7 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Run tests - ${{ if eq(parameters.agentOs, 'Windows') }}: - - powershell: "& ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}" + - powershell: "ls; & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}" condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: Run tests From ca663743f52ae3bb05e8fe93beb5dda77e18d456 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Thu, 18 Mar 2021 16:05:10 -0700 Subject: [PATCH 6/6] ls --- .azure/default-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/default-build.yml b/.azure/default-build.yml index e72f33ce..fbd85c70 100644 --- a/.azure/default-build.yml +++ b/.azure/default-build.yml @@ -62,7 +62,7 @@ jobs: condition: eq( variables['Agent.OS'], 'Linux' ) displayName: Run tests - ${{ if eq(parameters.agentOs, 'Windows') }}: - - powershell: "ls; & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}" + - powershell: "ls ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}; & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}" condition: eq( variables['Agent.OS'], 'Windows_NT' ) displayName: Run tests