dotnet-runtime / data /raw /sample /diffs /000142d2876d424ad9e7b0e1f67f4fb5ca4d5a69.diff
Ubuntu
Update dir structure
06bbd08
diff --git a/src/coreclr/src/inc/clrconfigvalues.h b/src/coreclr/src/inc/clrconfigvalues.h
index 32d07226003dc7..f92167f0dfdb5b 100644
--- a/src/coreclr/src/inc/clrconfigvalues.h
+++ b/src/coreclr/src/inc/clrconfigvalues.h
@@ -712,7 +712,7 @@ RETAIL_CONFIG_DWORD_INFO(INTERNAL_EventPipeProcNumbers, W("EventPipeProcNumbers"
//
// Diagnostics Ports
//
-RRETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DiagnosticPortSuspend, W("DOTNET_DiagnosticPortSuspend"), 1, "This will cause the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command.", CLRConfig::DontPrependCOMPlus_);
+RETAIL_CONFIG_DWORD_INFO_EX(EXTERNAL_DOTNET_DiagnosticPortSuspend, W("DOTNET_DiagnosticPortSuspend"), 0, "This will cause the runtime to pause during startup before major subsystems are started. Resume using the Diagnostics IPC ResumeStartup command.", CLRConfig::DontPrependCOMPlus_);
RETAIL_CONFIG_STRING_INFO_EX(EXTERNAL_DOTNET_DiagnosticPorts, W("DOTNET_DiagnosticPorts"), "A semicolon delimited list of additional Diagnostic Ports, where a Diagnostic Port is a NamedPipe path without '\\\\.\\pipe\\' on Windows or the full path of Unix Domain Socket on Linux/Unix followed by optional tags, e.g., '<path>,listen,nosuspend;<path>,connect'", CLRConfig::DontPrependCOMPlus_);
//
diff --git a/src/coreclr/src/vm/ipcstreamfactory.cpp b/src/coreclr/src/vm/ipcstreamfactory.cpp
index df18c7602585a0..75b7fb3a0c4117 100644
--- a/src/coreclr/src/vm/ipcstreamfactory.cpp
+++ b/src/coreclr/src/vm/ipcstreamfactory.cpp
@@ -15,11 +15,11 @@ CQuickArrayList<LPSTR> split(LPSTR string, LPCSTR delimiters)
{
CQuickArrayList<LPSTR> parts;
char *context;
- char *portConfig = nullptr;
+ char *part = nullptr;
for (char *cursor = string; ; cursor = nullptr)
{
- if ((portConfig = strtok_s(cursor, delimiters, &context)) != nullptr)
- parts.Push(portConfig);
+ if ((part = strtok_s(cursor, delimiters, &context)) != nullptr)
+ parts.Push(part);
else
break;
}
@@ -110,11 +110,14 @@ bool IpcStreamFactory::Configure(ErrorCallback callback)
ASSERT(portConfigParts.Size() >= 1);
if (portConfigParts.Size() == 0)
+ {
+ fSuccess &= false;
continue;
+ }
- builder.WithPath(portConfigParts.Pop());
- while (portConfigParts.Size() > 0)
+ while (portConfigParts.Size() > 1)
builder.WithTag(portConfigParts.Pop());
+ builder.WithPath(portConfigParts.Pop());
const bool fBuildSuccess = BuildAndAddPort(builder, callback);
STRESS_LOG1(LF_DIAGNOSTICS_PORT, LL_INFO10, "IpcStreamFactory::Configure - Diagnostic Port creation succeeded? %d \n", fBuildSuccess);
diff --git a/src/coreclr/src/vm/ipcstreamfactory.h b/src/coreclr/src/vm/ipcstreamfactory.h
index 80554b7d523884..cfd286beee0bba 100644
--- a/src/coreclr/src/vm/ipcstreamfactory.h
+++ b/src/coreclr/src/vm/ipcstreamfactory.h
@@ -32,7 +32,7 @@ class IpcStreamFactory
DiagnosticPortType Type = DiagnosticPortType::LISTEN;
DiagnosticPortSuspendMode SuspendMode = DiagnosticPortSuspendMode::NOSUSPEND;
- DiagnosticPortBuilder WithPath(LPSTR path) { Path = _strdup(path); return *this; }
+ DiagnosticPortBuilder WithPath(LPSTR path) { Path = path != nullptr ? _strdup(path) : nullptr; return *this; }
DiagnosticPortBuilder WithType(DiagnosticPortType type) { Type = type; return *this; }
DiagnosticPortBuilder WithSuspendMode(DiagnosticPortSuspendMode mode) { SuspendMode = mode; return *this; }
DiagnosticPortBuilder WithTag(LPSTR tag)
diff --git a/src/tests/tracing/eventpipe/common/IpcUtils.cs b/src/tests/tracing/eventpipe/common/IpcUtils.cs
index bf17e1e27e837b..73e817859ad828 100644
--- a/src/tests/tracing/eventpipe/common/IpcUtils.cs
+++ b/src/tests/tracing/eventpipe/common/IpcUtils.cs
@@ -21,8 +21,8 @@ namespace Tracing.Tests.Common
{
public static class Utils
{
- public static readonly string DiagnosticsMonitorAddressEnvKey = "DOTNET_DiagnosticsMonitorAddress";
- public static readonly string DiagnosticsMonitorPauseOnStartEnvKey = "DOTNET_DiagnosticsMonitorPauseOnStart";
+ public static readonly string DiagnosticPortsEnvKey = "DOTNET_DiagnosticPorts";
+ public static readonly string DiagnosticPortSuspend = "DOTNET_DiagnosticPortSuspend";
public static async Task<T> WaitTillTimeout<T>(Task<T> task, TimeSpan timeout)
{
diff --git a/src/tests/tracing/eventpipe/pauseonstart/pauseonstart.cs b/src/tests/tracing/eventpipe/pauseonstart/pauseonstart.cs
index 4065cd586feef1..e87d367651b06b 100644
--- a/src/tests/tracing/eventpipe/pauseonstart/pauseonstart.cs
+++ b/src/tests/tracing/eventpipe/pauseonstart/pauseonstart.cs
@@ -28,7 +28,7 @@ public static async Task<bool> TEST_RuntimeResumesExecutionWithCommand()
var server = new ReverseServer(serverName);
Task<bool> subprocessTask = Utils.RunSubprocess(
currentAssembly: Assembly.GetExecutingAssembly(),
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } },
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } },
duringExecution: async (_) =>
{
Stream stream = await server.AcceptAsync();
@@ -56,7 +56,7 @@ public static async Task<bool> TEST_TracesHaveRelevantEvents()
using var memoryStream = new MemoryStream();
Task<bool> subprocessTask = Utils.RunSubprocess(
currentAssembly: Assembly.GetExecutingAssembly(),
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } },
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } },
duringExecution: async (pid) =>
{
Stream stream = await server.AcceptAsync();
@@ -114,7 +114,7 @@ public static async Task<bool> TEST_MultipleSessionsCanBeStartedWhilepaused()
using var memoryStream3 = new MemoryStream();
Task<bool> subprocessTask = Utils.RunSubprocess(
currentAssembly: Assembly.GetExecutingAssembly(),
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } },
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } },
duringExecution: async (pid) =>
{
Stream stream = await server.AcceptAsync();
@@ -207,7 +207,7 @@ public static async Task<bool> TEST_CanStartAndStopSessionWhilepaused()
using var memoryStream3 = new MemoryStream();
Task<bool> subprocessTask = Utils.RunSubprocess(
currentAssembly: Assembly.GetExecutingAssembly(),
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } },
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } },
duringExecution: async (pid) =>
{
Stream stream = await server.AcceptAsync();
@@ -271,7 +271,7 @@ public static async Task<bool> TEST_DisabledCommandsError()
using var memoryStream3 = new MemoryStream();
Task<bool> subprocessTask = Utils.RunSubprocess(
currentAssembly: Assembly.GetExecutingAssembly(),
- environment: new Dictionary<string,string> { { Utils.DiagnosticsMonitorAddressEnvKey, serverName } },
+ environment: new Dictionary<string,string> { { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,suspend" } },
duringExecution: async (pid) =>
{
Stream stream = await server.AcceptAsync();
diff --git a/src/tests/tracing/eventpipe/reverse/reverse.cs b/src/tests/tracing/eventpipe/reverse/reverse.cs
index 05436e574d6436..6ce09ea82b81b7 100644
--- a/src/tests/tracing/eventpipe/reverse/reverse.cs
+++ b/src/tests/tracing/eventpipe/reverse/reverse.cs
@@ -28,8 +28,7 @@ public static async Task<bool> TEST_RuntimeIsResilientToServerClosing()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (_) =>
{
@@ -59,8 +58,7 @@ public static async Task<bool> TEST_RuntimeConnectsToExistingServer()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (_) =>
{
@@ -85,8 +83,7 @@ public static async Task<bool> TEST_CanConnectServerAndClientAtSameTime()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (int pid) =>
{
@@ -139,8 +136,7 @@ public static async Task<bool> TEST_ServerWorksIfClientDoesntAccept()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (int pid) =>
{
@@ -181,8 +177,7 @@ public static async Task<bool> TEST_ServerIsResilientToNoBufferAgent()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (int pid) =>
{
@@ -220,8 +215,7 @@ public static async Task<bool> TEST_StandardConnectionStillWorksIfReverseConnect
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (int pid) =>
{
diff --git a/src/tests/tracing/eventpipe/reverseouter/reverseouter.cs b/src/tests/tracing/eventpipe/reverseouter/reverseouter.cs
index ff01fbc0f449f1..6d3c0e4657cd84 100644
--- a/src/tests/tracing/eventpipe/reverseouter/reverseouter.cs
+++ b/src/tests/tracing/eventpipe/reverseouter/reverseouter.cs
@@ -28,8 +28,7 @@ public static async Task<bool> TEST_ReverseConnectionCanRecycleWhileTracing()
currentAssembly: Assembly.GetExecutingAssembly(),
environment: new Dictionary<string,string>
{
- { Utils.DiagnosticsMonitorAddressEnvKey, serverName },
- { Utils.DiagnosticsMonitorPauseOnStartEnvKey, "0" }
+ { Utils.DiagnosticPortsEnvKey, $"{serverName},connect,nosuspend" }
},
duringExecution: async (int pid) =>
{