Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add hooks to debug OpenSSL memory #101626

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security.Cryptography.X509Certificates;
Expand Down Expand Up @@ -170,5 +171,117 @@

return bytes;
}

[LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_SetMemoryTracking")]
private static unsafe partial int SetMemoryTracking(delegate* unmanaged<MemoryOperation, UIntPtr, UIntPtr, int, char*, int, void> trackingCallback);

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-riscv64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build android-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release NativeAOT_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Release AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-arm64 Debug AllSubsets_CoreCLR_ReleaseRuntimeLibs)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build linux-x64 release Runtime_Release)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 176 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs

View check run for this annotation

Azure Pipelines / runtime

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs#L176

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Crypto.cs(176,81): error CS0246: (NETCORE_ENGINEERING_TELEMETRY=Build) The type or namespace name 'MemoryOperation' could not be found (are you missing a using directive or an assembly reference?)

[LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_GetMemoryUse")]
internal static partial int GetMemoryUse(ref int memoryUse, ref int allocationCount);

public static int GetOpenSslAllocatedMemory()
{
int used = 0;
int count = 0;
GetMemoryUse(ref used, ref count);
return used;
}

public static int GetOpenSslAllocationCount()
{
int used = 0;
int count = 0;
GetMemoryUse(ref used, ref count);
return count;
}
#if DEBUG
[StructLayout(LayoutKind.Sequential)]
private unsafe struct MemoryEntry
{
public int Size;
public int Line;
public char* File;
}

private enum MemoryOperation
{
Malloc = 1,
Realloc = 2,
Free = 3,
}

private static readonly unsafe UIntPtr Offset = (UIntPtr)sizeof(MemoryEntry);
jkotas marked this conversation as resolved.
Show resolved Hide resolved
private static HashSet<UIntPtr>? _allocations;
rzikm marked this conversation as resolved.
Show resolved Hide resolved

[UnmanagedCallersOnly]
private static unsafe void MemoryTrackinCallback(MemoryOperation operation, UIntPtr ptr, UIntPtr oldPtr, int size, char* file, int line)
{
Span<MemoryEntry> entry = new Span<MemoryEntry>((void*)ptr, 1);
jkotas marked this conversation as resolved.
Show resolved Hide resolved

Debug.Assert(entry[0].File != null);
Debug.Assert(ptr != UIntPtr.Zero);

switch (operation)
{
case MemoryOperation.Malloc:
Debug.Assert(size == entry[0].Size);
lock (_allocations!)
{
_allocations!.Add(ptr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood the original comment from @jkotas, then this is still a potential problem

#101626 (comment)

Or does that hold only for the malloc/free calls and not GC-allocated memory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not safe to use any managed code if this can be called from places like thread destructor. #101626 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right. I split the change now into two parts. The basic counters are implemented in native as @janvorli suggested. That also eliminates need to fiddle with the crypto initialization.

Now for the managed part. I made this whole section #if DEBUG for now to limit the exposure. While this limits use in production it would allow us to experiment more and perhaps hook it to test runs. I'm yet to see case where it actually fails. Since this can be set during run for some particular operation(s) it may avoid the cases we are concern about e.g. threads operations. AFAIK there is API to get loaded providers so we may for example check FIPS or 3rd party modules.

}
break;
case MemoryOperation.Realloc:
lock (_allocations!)
{
if ((IntPtr)oldPtr != IntPtr.Zero)
{
_allocations!.Remove(oldPtr);
}
_allocations!.Add(ptr);
}
break;
case MemoryOperation.Free:
lock (_allocations!)
{
_allocations!.Remove(ptr);
}
break;
}
}

public static unsafe void EnableTracking()
{
_allocations ??= new HashSet<UIntPtr>();
_allocations!.Clear();
SetMemoryTracking(&MemoryTrackinCallback);
}

public static unsafe void DisableTracking()
{
SetMemoryTracking(null);
_allocations!.Clear();
}

public static unsafe Tuple<UIntPtr, int, string>[] GetIncrementalAllocations()
{
if (_allocations == null || _allocations.Count == 0)
{
return Array.Empty<Tuple<UIntPtr, int, string>>();
}

lock (_allocations!)
{
Tuple<UIntPtr, int, string>[] allocations = new Tuple<UIntPtr, int, string>[_allocations.Count];
int index = 0;
foreach (UIntPtr ptr in _allocations)
{
Span<MemoryEntry> entry = new Span<MemoryEntry>((void*)ptr, 1);
jkotas marked this conversation as resolved.
Show resolved Hide resolved
allocations[index] = new Tuple<UIntPtr, int, string>(ptr + Offset, entry[0].Size, $"{Marshal.PtrToStringAnsi((IntPtr)entry[0].File)}:{entry[0].Line}");
index++;
}

return allocations;
}
}
#endif
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,39 +33,11 @@

internal static unsafe partial class CryptoInitializer
{
internal struct MemoryEntry
{
public char* File;
public int Size;
public int Line;
}

private static readonly bool DebugMemory = GetMemoryDebug("DOTNET_SYSTEM_NET_SECURITY_OPENSSL_MEMORY_DEBUG");
private static readonly bool ValidateMemory = GetMemoryDebug("DOTNET_SYSTEM_NET_SECURITY_OPENSSL_MEMORY_VALIDATE");
private static readonly IntPtr Offset = sizeof(MemoryEntry);
private static HashSet<IntPtr>? _allocations;
private static HashSet<IntPtr>? _allocationsDiff;
private static bool _trackIncrementalAllocations;

internal static long TotalAllocatedMemory;
internal static long TotalAllocations;

rzikm marked this conversation as resolved.
Show resolved Hide resolved
#pragma warning disable CA1810
static unsafe CryptoInitializer()
{
if (DebugMemory)
{
// we need to prepare everything as some allocations do happen during initialization itself.
_allocations = new HashSet<IntPtr>();
_allocationsDiff = new HashSet<IntPtr>();

// prevent trimming
EnableTracking();
DisableTracking();
GetIncrementalAllocations();
}

if (EnsureOpenSslInitialized(DebugMemory ? &CryptoMalloc : null, DebugMemory ? &CryptoRealloc : null, DebugMemory ? &CryptoFree : null) != 0)
if (EnsureOpenSslInitialized() != 0)
{
// Ideally this would be a CryptographicException, but we use
// OpenSSL in libraries lower than System.Security.Cryptography.
Expand All @@ -75,196 +47,27 @@
// these libraries will be unable to operate correctly.
throw new InvalidOperationException();
}

rzikm marked this conversation as resolved.
Show resolved Hide resolved
}
#pragma warning restore CA1810

internal static void Initialize()
{
// No-op that exists to provide a hook for other static constructors.
}

private static bool GetMemoryDebug(string name)
{
string? value = Environment.GetEnvironmentVariable(name);
if (int.TryParse(value, CultureInfo.InvariantCulture, out int enabled))
{
return enabled == 1;
}

return false;
}

internal static void EnableTracking()
{
_allocationsDiff!.Clear();
_trackIncrementalAllocations = true;
}

internal static Tuple<IntPtr, int, string>[] GetIncrementalAllocations()
{
lock (_allocationsDiff!)
string? value = Environment.GetEnvironmentVariable("DOTNET_SYSTEM_NET_SECURITY_OPENSSL_MEMORY_DEBUG");
if (int.TryParse(value, CultureInfo.InvariantCulture, out int enabled) && enabled == 1)
{
Tuple<IntPtr, int, string>[] allocations = new Tuple<IntPtr, int, string>[_allocationsDiff.Count];
int index = 0;
foreach (IntPtr ptr in _allocationsDiff)
{
Span<MemoryEntry> entry = new Span<MemoryEntry>((void*)ptr, 1);
allocations[index] = new Tuple<IntPtr, int, string>(ptr+Offset, entry[0].Size, $"{Marshal.PtrToStringAnsi((IntPtr)entry[0].File)}:{entry[0].Line}");
index++;
}

return allocations;
Crypto.GetOpenSslAllocationCount();

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Threading)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_LLVMJIT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build maccatalyst-x64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build osx-x64 release Runtime_Release)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'

Check failure on line 60 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L60

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(60,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocationCount'
Crypto.GetOpenSslAllocatedMemory();

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build wasi-wasm linux Release LibraryTests_Smoke)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Smoke_AOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_EAT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build browser-wasm linux Release LibraryTests_Threading)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build ios-arm64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Release AllSubsets_Mono_LLVMJIT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build maccatalyst-x64 Release AllSubsets_Mono)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build tvos-arm64 Release AllSubsets_NativeAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Release NativeAOT_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'

Check failure on line 61 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / dotnet-linker-tests (Build osx-x64 release Runtime_Release)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L61

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(61,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetOpenSslAllocatedMemory'
#if DEBUG
Crypto.EnableTracking();

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'

Check failure on line 63 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L63

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(63,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'EnableTracking'
Crypto.GetIncrementalAllocations();

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux_musl-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug AllSubsets_Mono_LLVMAOT)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'

Check failure on line 64 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L64

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(64,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'GetIncrementalAllocations'
Crypto.DisableTracking();

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-x64 Debug Mono_Interpreter_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime-dev-innerloop (Build linux-x64 debug Libraries_AllConfigurations)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug Mono_MiniJIT_LibrariesTests)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build linux-arm64 Debug Libraries_CheckedCoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-x64 Debug CoreCLR_Libraries)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'

Check failure on line 65 in src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs

View check run for this annotation

Azure Pipelines / runtime (Build osx-arm64 Debug AllSubsets_CoreCLR)

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs#L65

src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.Initialization.cs(65,24): error CS0117: (NETCORE_ENGINEERING_TELEMETRY=Build) 'Interop.Crypto' does not contain a definition for 'DisableTracking'
#endif
}
}

internal static void DisableTracking()
{
_trackIncrementalAllocations = false;
_allocationsDiff!.Clear();
}

[LibraryImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EnsureOpenSslInitialized")]
private static unsafe partial int EnsureOpenSslInitialized(delegate* unmanaged<UIntPtr, char*, int, void*> mallocFunction, delegate* unmanaged<void*, UIntPtr, char*, int, void*> reallocFunction, delegate* unmanaged<void*, void> freeFunction);

[UnmanagedCallersOnly]
internal static unsafe void* CryptoMalloc(UIntPtr size, char* file, int line)
{
void* ptr = NativeMemory.Alloc(size + (UIntPtr)Offset);
Debug.Assert(ptr != null);

if (ptr == null)
{
return null;
}

Span<MemoryEntry> entry = new Span<MemoryEntry>(ptr, 1);
entry[0].Line = line;
entry[0].File = file;
entry[0].Size = (int)size;

if (ValidateMemory)
{
lock (_allocations!)
{
Debug.Assert(_allocations!.Add((IntPtr)ptr));
}
}
if (_trackIncrementalAllocations)
{
lock (_allocationsDiff!)
{
Debug.Assert(_allocationsDiff!.Add((IntPtr)ptr));
}
}
Interlocked.Add(ref TotalAllocatedMemory, (long)size);
Interlocked.Increment(ref TotalAllocations);

return (void*)((IntPtr)ptr + Offset);
}

[UnmanagedCallersOnly]
internal static unsafe void* CryptoRealloc(void* oldPtr, UIntPtr size, char* file, int line)
{
void * ptr;
Span<MemoryEntry> entry;

if (oldPtr != null)
{
IntPtr entryPtr = (IntPtr)oldPtr - Offset;
entry = new Span<MemoryEntry>((void*)entryPtr, 1);

if (ValidateMemory)
{
lock (_allocations!)
{
if (!_allocations!.Remove(entryPtr))
{
Environment.FailFast($"Failed to find OpenSSL memory 0x{(IntPtr)oldPtr:x}");
}
}
}

if (_trackIncrementalAllocations)
{
lock (_allocationsDiff!)
{
// this may fail as we may start tracking after given chunk was allocated
_allocationsDiff!.Remove(entryPtr);
}
}

Interlocked.Add(ref TotalAllocatedMemory, -((long)entry[0].Size));
ptr = NativeMemory.Realloc((void*)entryPtr, size + (UIntPtr)Offset);
}
else
{
ptr = NativeMemory.Alloc(size + (UIntPtr)Offset);
}


Debug.Assert(ptr != null);
if (ptr == null)
{
return null;
}

if (ValidateMemory)
{
lock (_allocations!)
{
Debug.Assert(_allocations!.Add((IntPtr)ptr));
}
}
if (_trackIncrementalAllocations)
{
lock (_allocationsDiff!)
{
Debug.Assert(_allocationsDiff!.Add((IntPtr)ptr));
}
}
Interlocked.Add(ref TotalAllocatedMemory, (long)size);
Interlocked.Increment(ref TotalAllocations);

entry = new Span<MemoryEntry>((void*)ptr, 1);
entry[0].Line = line;
entry[0].File = file;
entry[0].Size = (int)size;

return (void*)((IntPtr)ptr + Offset);
}

[UnmanagedCallersOnly]
internal static unsafe void CryptoFree(void* ptr)
{
if (ptr != null)
{
IntPtr entryPtr = (IntPtr)ptr - Offset;
if (ValidateMemory)
{
lock (_allocations!)
{
{
if (!_allocations!.Remove(entryPtr))
{
Environment.FailFast($"Failed to find OpenSSL memory 0x{(IntPtr)ptr:x}");
}
}
}
}
if (_trackIncrementalAllocations)
{
lock (_allocationsDiff!)
{
// this may fail as we may start tracking after given chunk was allocated
_allocationsDiff!.Remove(entryPtr);
}
}

Span<MemoryEntry> entry = new Span<MemoryEntry>((void*)entryPtr, 1);
Interlocked.Add(ref TotalAllocatedMemory, -((long)entry[0].Size));

NativeMemory.Free((void*)entryPtr);
}
}
private static unsafe partial int EnsureOpenSslInitialized();
}
}
6 changes: 1 addition & 5 deletions src/libraries/System.Net.Http/src/System.Net.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -432,11 +432,6 @@
Link="Common\System\Net\Security\CertificateHelper.Unix.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'browser' and '$(TargetPlatformIdentifier)' != 'osx' and '$(TargetPlatformIdentifier)' != 'ios' and '$(TargetPlatformIdentifier)' != 'tvos'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'browser'">
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
Expand Down Expand Up @@ -476,6 +471,7 @@
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Diagnostics.StackTrace" />
jkotas marked this conversation as resolved.
Show resolved Hide resolved
<Reference Include="System.Memory" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.InteropServices" />
Expand Down