platform/upstream/dotnet/runtime.git
3 years agoDisable cache clearing S.CM.TC test from running in parallel (#52428)
Dan Moseley [Fri, 7 May 2021 15:05:51 +0000 (08:05 -0700)]
Disable cache clearing S.CM.TC test from running in parallel (#52428)

3 years ago[wasm][debugger] - RuntimeError: memory access out of bounds (#51859)
Pavel Savara [Fri, 7 May 2021 14:48:49 +0000 (16:48 +0200)]
[wasm][debugger] - RuntimeError: memory access out of bounds (#51859)

- fix null reference in describe_value() + add tests for it
- fix null reference in PDB load
- improved handling of targetCrashed in Inspector
- add windows chrome to probe path
- include debugging payload into test failure exception for easier debugging
- make it possible to compile with WasmBuildNative=true
- make it possible to compile with Debug runtime

3 years agoFixes COM warnings (#52176)
Lakshan Fernando [Fri, 7 May 2021 14:39:16 +0000 (07:39 -0700)]
Fixes COM warnings (#52176)

* Fixes COm warnings

* fb

* feedback

* missed one name change

* Update docs/workflow/trimming/feature-switches.md

Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
3 years agoUse unprivileged socket to send ping on macOS/iOS/tvOS/Mac Catalyst (#52240)
Filip Navara [Fri, 7 May 2021 14:05:11 +0000 (16:05 +0200)]
Use unprivileged socket to send ping on macOS/iOS/tvOS/Mac Catalyst (#52240)

Revival of #42006 with some feedback incorporated.

This improves Ping behavior on macOS/iOS family. For unprivileged users, it allows to send/receive buffer with custom content and removes craft around spawning new process. (uses [this example](https://developer.apple.com/library/archive/samplecode/SimplePing/Introduction/Intro.html)).

It adds new macOS/iOS/tvOS targets for the assembly that exclude the process creation code.

Fixes #36941
Fixes #51395

Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
3 years agoUpdate MetadataUpdateHandlers (#52409)
Pranav K [Fri, 7 May 2021 14:01:15 +0000 (07:01 -0700)]
Update MetadataUpdateHandlers (#52409)

3 years agoMore EventListener overhead reductions (#52092)
Miha Zupan [Fri, 7 May 2021 11:59:31 +0000 (13:59 +0200)]
More EventListener overhead reductions (#52092)

* More EventListener overhead reductions

* Use Type.GetTypeCode instead of RuntimeTypeHandle.GetCorElementType

* Fix int32 enum case

* Revert back from span to array

* DecodeObject => DecodeObjects

3 years agoAdd profiler startup command to the diagnostics command set (#52175)
David Mason [Fri, 7 May 2021 07:51:39 +0000 (00:51 -0700)]
Add profiler startup command to the diagnostics command set (#52175)

Add a diagnostics IPC command to load a startup profiler

3 years agoFix Mono async stackwalk when hitting AOT frames in stacks. (#52309)
Johan Lorensson [Fri, 7 May 2021 07:27:37 +0000 (09:27 +0200)]
Fix Mono async stackwalk when hitting AOT frames in stacks. (#52309)

EventPipe sample profiler on Mono hit a couple of issues doing async stack walks when having AOT frames in stack.

EventPipe background threads (diagnostic server and streaming threads) where not part of sample profiler STW. Include all except threads marked as no GC threads in STW, but don't include threads marked as no sample in sampling.

Aot jit info is cached in a separate list when doing async stackwalks, that list is then not visible through regular jit table meaning that EventPipe session rundown won't include mappings for these IP's. Fix is to detect that a stack walk includes async frames and then (after world as been restarted), registers these IP's in regular JIT table.

Fixed a couple of cases in decode_exception_debug_info that still took runtime locks even when in async mode leading to deadlocks.

Aot jit info cache used in async mode could leak a lot of memory the way its currently grow the list and was only designed to include a small number of jit info structs. Change it into a simple fixed sized hash table with a max bucket size of 32, hash table get allocated on first need and each jit info will be placed into its bucket based on its method id. Running on a full AOT version of S.P.C we have ~30K methods, this will allocate a little under 1000 buckets consuming 8KB of memory on x64. Other alternative would be to alloc full array using amodule->info.nmethods, that would however be much more memory intensive and would consume ~240KB for S.P.C on x64.

3 years agoUse MSVC compiler host architecture defines where applicable. (#52375)
Johan Lorensson [Fri, 7 May 2021 07:26:32 +0000 (09:26 +0200)]
Use MSVC compiler host architecture defines where applicable. (#52375)

Use MSVC compiler host architecture defines where applicable.

There are a couple of places where gcc/clang compiler host architecture
defines are in used, missing compilers like MSVC. Commit adds MSVC host
architecture defines in places where they make sense and can be applied.

NOTE, part of this already worked since it will fallbacks to TARGET_XXX
in a couple of places and currently this is the same as host architecture
on Windows, still adding MSVC host architecture defines for completeness
and future when host != target might differ.

3 years agoFix multiple MonoDebugMethodJitInfo memory leaks. (#52386)
Johan Lorensson [Fri, 7 May 2021 07:26:05 +0000 (09:26 +0200)]
Fix multiple MonoDebugMethodJitInfo memory leaks. (#52386)

3 years agoFix Mono build warnings on Windows. (#52387)
Johan Lorensson [Fri, 7 May 2021 07:25:51 +0000 (09:25 +0200)]
Fix Mono build warnings on Windows. (#52387)

3 years agoReduce loop inversion JitDump output (#52425)
Bruce Forstall [Fri, 7 May 2021 05:40:12 +0000 (22:40 -0700)]
Reduce loop inversion JitDump output (#52425)

If it is guaranteed that no IR changes were made, then return an
appropriate Phase status to suppress end phase IR dumps.

3 years ago Make PInvokeStaticSigInfo always report errors (#52405)
Elinor Fung [Fri, 7 May 2021 03:01:25 +0000 (20:01 -0700)]
 Make PInvokeStaticSigInfo always report errors (#52405)

3 years agoAdd counters to System.Runtime.Caching.MemoryCache (#51760)
Steve Molloy [Fri, 7 May 2021 02:19:00 +0000 (19:19 -0700)]
Add counters to System.Runtime.Caching.MemoryCache (#51760)

* Bring back counters for Core via EventSource et al.

* Change turnover to a rate counter. Add a test for counters.

* Exclude counter tests on wasm.

3 years agoEnhancements to MCS dumpMap (#52412)
Andy Ayers [Fri, 7 May 2021 01:36:53 +0000 (18:36 -0700)]
Enhancements to MCS dumpMap (#52412)

I've been trying to correlate methods in SPMI collections with methods
seen in profile data (say perfview). But for generic classes or generic
methods this is not easy.

To make it more feasible, in the "extra query" mode, get the names of
all the generic parameters, and then add these to the class name in MCS's
dumpMap output.

Also dump out the jit flags, so it's easier to find a particular instance
if the method was jitted more than once.

3 years agoImprove loop inversion (#52347)
Bruce Forstall [Fri, 7 May 2021 01:35:24 +0000 (18:35 -0700)]
Improve loop inversion (#52347)

* Improve loop inversion

When doing loop inversion, we duplicate the condition block to the
top of the loop to create a fall-through zero trip test. Improve
this by redirecting all incoming branches to the condition block
that appear to be coming from outside the potential loop body
to branch to the new duplicated condition block. This improves the
ability of the loop recognizer to find loops, whereas before we
would reject the loops as "multi-entry".

There are good diffs where more loops are detected, leading to
better optimization and more loop alignment. There are also
asm diffs regressions.

* Formatting

* Updates

1. Allow scratch block to be the loop head, since we introduce a
new block to duplicate the condition, so the scratch block becomes
a BBJ_NONE, which is fine.
2. Fix issue on x86 where a catch return, which is a BBJ_ALWAYS on
x86, can't be the "head" block of the loop.

3 years ago[wasm] Normalize WasmAppDir path (#52421)
Ankit Jain [Fri, 7 May 2021 01:27:59 +0000 (21:27 -0400)]
[wasm] Normalize WasmAppDir path (#52421)

3 years agoreturn true for IsDynamicCodeSupported when interpreter is available (#52422)
Larry Ewing [Fri, 7 May 2021 01:10:16 +0000 (20:10 -0500)]
return true for IsDynamicCodeSupported when interpreter is available (#52422)

3 years ago[wasm][aot] Update disabled tests to track new fixes on `main` (#52396)
Ankit Jain [Fri, 7 May 2021 00:39:37 +0000 (20:39 -0400)]
[wasm][aot] Update disabled tests to track new fixes on `main` (#52396)

* [wasm][aot] System.Runtime.Tests failing with a different issue now

The earlier one (https://github.com/dotnet/runtime/issues/51960) was
fixed.
New: https://github.com/dotnet/runtime/issues/52393

* Enable Common.Tests test tracked in https://github.com/dotnet/runtime/issues/50955, already fixed on main

* [wasm] System.Reflection.Tests - update to track change from crash to a

.. test failure.
Issue: https://github.com/dotnet/runtime/issues/51673

* Re-enable System.Collections.Tests, issue: https://github.com/dotnet/runtime/issues/51037

* Disable Microsoft.Extensions.Logging.Generators, and System.IO.Pipelines

Issue: https://github.com/dotnet/runtime/issues/52384
Issue: https://github.com/dotnet/runtime/issues/50959

* Enable two System.Reflection.Metadata* tests

Issue: https://github.com/dotnet/runtime/issues/51958

* Fix path for Microsoft.Extensions.Logging.Generators.Tests

3 years agoFix for hill climbing not working sometimes (#52397)
Koundinya Veluri [Thu, 6 May 2021 23:39:12 +0000 (16:39 -0700)]
Fix for hill climbing not working sometimes (#52397)

Updated the time intervals used in the hill climbing check to be unsigned to prevent wrap-around. This also prevents the check from failing when the current time is negative since the prior and next times are initialized to zero, and matches the previous implementation.

Fixes https://github.com/dotnet/runtime/issues/51935

3 years agoRemove SSE2-specific logic from UTF-16 validation code (#52349)
Levi Broderick [Thu, 6 May 2021 22:36:31 +0000 (15:36 -0700)]
Remove SSE2-specific logic from UTF-16 validation code (#52349)

If a device does not support SSE41 but does support SIMD hardware acceleration, this method will fall back down generalized Vector-enabled code paths.

3 years agoDo not count page cache towards cgroup’s memory load (#51738)
Marcin Krystianc [Thu, 6 May 2021 22:34:34 +0000 (00:34 +0200)]
Do not count page cache towards cgroup’s memory load (#51738)

* Do not consider file cache pages as used memory

Since file cache pages can be easily evicted and re-used  they should not be considered as used memory.

* free stat_filename

* consider dirty pages

* diff noise

* use memory.stat only

* unix/cgroup.cpp

* diff noise

* use array

* PR remarks

3 years agoReduce unnecessary allocation of SeldomUsedFields in MemoryCache. (#51761)
Steve Molloy [Thu, 6 May 2021 22:23:46 +0000 (15:23 -0700)]
Reduce unnecessary allocation of SeldomUsedFields in MemoryCache. (#51761)

* Don't create SeldomUsedFields for an empty dependency collection.

* comment typo

Co-authored-by: Christopher Watford <christopher.watford@gmail.com>
Co-authored-by: Christopher Watford <christopher.watford@gmail.com>
3 years agoRe-enable some iOS tests (#52385)
Filip Navara [Thu, 6 May 2021 19:25:59 +0000 (21:25 +0200)]
Re-enable some iOS tests (#52385)

* [mobile][testing] Remove AppBundlePath directory to save space on CI

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoAllocate initial regions (#51752)
Andrew Au [Thu, 6 May 2021 19:14:31 +0000 (12:14 -0700)]
Allocate initial regions (#51752)

3 years agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Thu, 6 May 2021 18:55:06 +0000 (20:55 +0200)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210505.6 (#52338)

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21228.9 -> To Version 1.0.0-prerelease.21255.6

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoArm64: Use zero register where appropriate (#52269)
Kunal Pathak [Thu, 6 May 2021 18:48:34 +0000 (00:18 +0530)]
Arm64: Use zero register where appropriate (#52269)

3 years ago[main] Update dependencies from dotnet/arcade dotnet/xharness (#52382)
dotnet-maestro[bot] [Thu, 6 May 2021 18:34:34 +0000 (18:34 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/xharness (#52382)

[main] Update dependencies from dotnet/arcade dotnet/xharness

3 years agoUse function pointers for interop in System.Net.NetworkInformation (#52192)
Jan Kotas [Thu, 6 May 2021 18:30:01 +0000 (11:30 -0700)]
Use function pointers for interop in System.Net.NetworkInformation (#52192)

3 years ago[main] Update dependencies from mono/linker (#52295)
dotnet-maestro[bot] [Thu, 6 May 2021 18:09:05 +0000 (18:09 +0000)]
[main] Update dependencies from mono/linker (#52295)

[main] Update dependencies from mono/linker

3 years agoObsolete the Rijndael and RijndaelManaged classes
Jeff Handley [Thu, 6 May 2021 16:28:41 +0000 (09:28 -0700)]
Obsolete the Rijndael and RijndaelManaged classes

3 years agoSystem.Data.* missed Equals nullable annotations (#52165)
hrrrrustic [Thu, 6 May 2021 16:08:58 +0000 (19:08 +0300)]
System.Data.* missed Equals nullable annotations  (#52165)

3 years agoSocket.SendFileAsync based on SendPacketsAsync (#52208)
Günther Foidl [Thu, 6 May 2021 15:44:25 +0000 (17:44 +0200)]
Socket.SendFileAsync based on SendPacketsAsync (#52208)

* Socket.SendFileAsync layered on top of SendPacketsAsync

* Tests

* Cleanup

* Set SendPacketsFlags

* Check if the socket is connection orientated

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625922176

* Try to re-use the SendPacketsElement-array

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625346014

* Fixed test

Cf. https://github.com/dotnet/runtime/pull/52208#discussion_r625316709

* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.Tasks.cs

3 years ago[metadata-update] Make a copy of the DIL when applying updates (#52344)
Aleksey Kliger (λgeek) [Thu, 6 May 2021 14:48:40 +0000 (10:48 -0400)]
[metadata-update] Make a copy of the DIL when applying updates (#52344)

Otherwise we may point into memory that is cleaned up by the GC

3 years agoUse MicrosoftDotNet500 cert for executable files (#52336)
Matt Mitchell [Thu, 6 May 2021 14:40:35 +0000 (07:40 -0700)]
Use MicrosoftDotNet500 cert for executable files (#52336)

Use this for .msi files, and update the incoming arcade provided defaults with MicrosoftDotNet500.
Do not use the UseDotNetCertificate property as this repo does not use Publish.proj

3 years agoJIT: more general value class devirtualization (#52210)
Andy Ayers [Thu, 6 May 2021 14:29:57 +0000 (07:29 -0700)]
JIT: more general value class devirtualization (#52210)

When devirtualization knows that the `this` object is a boxed value class,
it now attempts to update the call to invoke the unboxed entry (when there
is one).

This extends an existing optimization that worked on calls where the box was
local and only fed the call. We now handle calls that dispatch on boxed value
classes more generally,  even if their creation is not local or is local but
in a form the existng opt could not handle.

These new cases either come from failed local box removal opts (say multi-use
boxes) or from guarded devirtualization.

The "boxed" entry for value class methods is an un-inlineable VM stub. This
transformation effectively inlines the stub and unblocks inlining of the
underlying method.

3 years ago[mono][aot] Avoid an assert on wasm+aot on methods with vararg calling conventions...
Zoltan Varga [Thu, 6 May 2021 14:06:30 +0000 (10:06 -0400)]
[mono][aot] Avoid an assert on wasm+aot on methods with vararg calling conventions. (#52369)

Fixes https://github.com/dotnet/runtime/issues/51960.

3 years ago[mono] Fix the type argument to the byval llvm attribute. (#52354)
Zoltan Varga [Thu, 6 May 2021 13:58:08 +0000 (09:58 -0400)]
[mono] Fix the type argument to the byval llvm attribute. (#52354)

Fixes a problem with https://github.com/dotnet/runtime/pull/52290.

3 years ago[wasm][debugger][tests] move setting of the unit test locale to code (#52193)
Pavel Savara [Thu, 6 May 2021 13:53:43 +0000 (15:53 +0200)]
[wasm][debugger][tests] move setting of the unit test locale to code (#52193)

* move setting of the unit test locale to code. Build on windows doesn't depend n Makefile.

3 years agoRe-enable DNS tests on SLES
Karel Zikmund [Thu, 6 May 2021 13:30:01 +0000 (15:30 +0200)]
Re-enable DNS tests on SLES

The tests were failing previously due to infra on SLES, which is now fixed. We can re-enable the tests.

Fixes #48751

3 years agoBundle test data from subdirectories in AppleAppBuilder (#52372)
Filip Navara [Thu, 6 May 2021 12:54:56 +0000 (14:54 +0200)]
Bundle test data from subdirectories in AppleAppBuilder (#52372)

Fixes #52104

Helps with these issues:
#51389
#38031
#51334
#51333
#51336
#51378
#51374
#51385
#51387
#51412

3 years ago[mono] Add a null check to Array.GetRawArrayData (), its needed on platforms (#52355)
Zoltan Varga [Thu, 6 May 2021 08:36:37 +0000 (04:36 -0400)]
[mono] Add a null check to Array.GetRawArrayData (), its needed on platforms (#52355)

which use explicit null checks.

Fixes https://github.com/dotnet/runtime/issues/50960.

3 years agoWork around a `ClrRestoreNonvolatileContext` issue for a case (#52342)
Koundinya Veluri [Thu, 6 May 2021 08:16:28 +0000 (01:16 -0700)]
Work around a `ClrRestoreNonvolatileContext` issue for a case (#52342)

Work around a `ClrRestoreNonvolatileContext` issue for a case

3 years agoHTTP/3 test fixes (#52326)
Marie Píchová [Thu, 6 May 2021 08:08:22 +0000 (10:08 +0200)]
HTTP/3 test fixes (#52326)

* Fixed H/3 tests failing with cert validation.

* Fixed never-ending loop for version upgrade.

When QUIC is supported but H/3 authority hasn't been advertised via Alt-Svc yet, TrySendUsingHttp3Async would never end the while-loop.

* Updated readme, Quic works with the newest msquic version.

3 years agoUse dotnet pack for other Microsoft.extensions* projects (#52084)
Anirudh Agnihotry [Thu, 6 May 2021 07:15:39 +0000 (00:15 -0700)]
Use dotnet pack for other Microsoft.extensions* projects (#52084)

* remove pkgprojs from other extensions projects

* make resolver non shipping

* add comments

* move packageDescripition to src project

* Fix linker tests

* revert ectensions change because of the new generator

* set is packable to false for logging abstactions.

* remove pkgproj for the extensions.logging as we moved the gen out of it

* add isSrcProject condition

* Update Directory.Build.props

* Update Directory.Build.props

3 years ago[mono][aot] Share more vtypes in get_wrapper_shared_vtype (). (#52337)
Zoltan Varga [Thu, 6 May 2021 05:20:00 +0000 (01:20 -0400)]
[mono][aot] Share more vtypes in get_wrapper_shared_vtype (). (#52337)

Use Mono.ValueTuple in cases where a vtype has the right size/alignment
even if its field don't match the fields of a ValueTuple instance, only
the size/alignment has to match.

3 years agoDon't trim if cache is already empty. (#51762)
Steve Molloy [Thu, 6 May 2021 05:05:00 +0000 (22:05 -0700)]
Don't trim if cache is already empty. (#51762)

3 years agoMove ServiceCollection to abstractions (#52284)
David Fowler [Thu, 6 May 2021 04:22:55 +0000 (21:22 -0700)]
Move ServiceCollection to abstractions (#52284)

Move the assembly to Microsoft.Extensions.DependencyInjection.Abstractions

3 years ago[mono][aot] Avoid compiling huge (> 100K IL) methods with llvm on wasm. (#52346)
Zoltan Varga [Thu, 6 May 2021 03:19:00 +0000 (23:19 -0400)]
[mono][aot] Avoid compiling huge (> 100K IL) methods with llvm on wasm. (#52346)

The compile times are too long (> 10 minutes).

3 years agoMove CallConvBuilder and helpers to separate file (#52330)
Elinor Fung [Thu, 6 May 2021 02:34:16 +0000 (19:34 -0700)]
Move CallConvBuilder and helpers to separate file (#52330)

3 years agoMove to main channel (#52350)
Drew Scoggins [Thu, 6 May 2021 00:59:30 +0000 (17:59 -0700)]
Move to main channel (#52350)

3 years agoUpdate the loop table after flow graph optimization (#52333)
Bruce Forstall [Thu, 6 May 2021 00:37:39 +0000 (17:37 -0700)]
Update the loop table after flow graph optimization (#52333)

In the flow graph optimization that inverts a BBJ_COND
branch over an empty BBJ_ALWAYS block, if the BBJ_ALWAYS
block is the bottom of a loop, we want to update the loop
table with the inverted BBJ_COND as the new bottom.

There are no diffs from this change. In fact, I found it
by getting an assert generating a DOT flow graph dump after
PHASE_OPT_UPDATE_FLOW_GRAPH. It seems reasonable to do this
update, although it's not clear if any subsequent code
currently cares.

3 years agoFix ImageAnimator to render the correct frames (#52236)
Jeff Handley [Thu, 6 May 2021 00:37:03 +0000 (17:37 -0700)]
Fix ImageAnimator to render the correct frames (#52236)

3 years agoMove loop cloning code (#52325)
Bruce Forstall [Wed, 5 May 2021 23:25:23 +0000 (16:25 -0700)]
Move loop cloning code (#52325)

Move it out of optimizer.cpp and into the pre-existing loopcloning.cpp,
where many loop cloning helper classes already existed.

No code changes, just code movement.

3 years agoImprove DOT flow graph dumping (#52329)
Bruce Forstall [Wed, 5 May 2021 23:24:43 +0000 (16:24 -0700)]
Improve DOT flow graph dumping (#52329)

1. Do not include EH and Loop regions in the graph for inlinees. The
data required for them is not valid in the inlinee compiler.
2. Do not include Loop regions in phases starting with the rationalizer.
The loop table is not maintained, and decays, but we don't ever mark it
as invalid. This is an arbitrary point after which it seems to be
unmaintained (and can lead to asserts when using it).
3. Add the text "(inlinee)" to the function name in inlinee graph output,
to distinguish it.
4. Fix a bug where the block map was using incorrect block number count
for inlinees.
5. Fix a region insert bug when inserting a parent region after a child
region where they share the end block (but the parent start block is earlier
than the child). This happens in some EH region tables. Added some comments
about all the different forms of region that need to be handled.
6. Add a `Verify` function to validate the constructed region tree.
7. Stop adding removed loops to the output.

3 years agoReenable48001 (#52322)
Steve MacLean [Wed, 5 May 2021 23:05:08 +0000 (19:05 -0400)]
Reenable48001 (#52322)

* Remove generic issues from Apple Silicon disables

ParallelCrash & ParallelCrashWorkerThreads are disabled for all macOS platfroms above

tracing/eventpipe/eventsvalidation/ThreadPool/* is disable for all platforms above

* Apple Silicon reenable crossgen2 tests

3 years ago[mono] Fix leak in assembly-specific dllmap lookups (#52307)
Ryan Lucia [Wed, 5 May 2021 21:25:58 +0000 (17:25 -0400)]
[mono] Fix leak in assembly-specific dllmap lookups (#52307)

3 years agoAdd ChaCha20Poly1305 skeleton (#52030)
Levi Broderick [Wed, 5 May 2021 21:25:08 +0000 (14:25 -0700)]
Add ChaCha20Poly1305 skeleton (#52030)

- Also adds AesGcm.IsSupported and AesCcm.IsSupported
- The IsSupported APIs will return false on browser rather than throw PNSE

The current ChaCha20Poly1305 implementation only works on recent Win10 builds. However, we should be set up for somebody to add support for other OSes in the near future, assuming we can ride on top of other publicly-exposed implementations.

3 years agoSmall fixed error in code (#51821)
Maxim [Wed, 5 May 2021 21:21:39 +0000 (00:21 +0300)]
Small fixed error in code (#51821)

* Fix bool-check call and add nullptr

* Add lvar dataSize

If def DISPLAY_SIZES = 1 in jit.h, then gives and error

* Remove type def

If def DISPLAY_SIZES = 1, gives an error

* Move def dataSize

* Update codegen.h

* Update compiler.h

* Rename "dataSize" to "eDataSize" (EmitDataSize)

because of intersection of names "dataSize" between "compiler.h" and in "codegenarm64.cpp"

* Grammar fix compiler.h

* Grammar fix

* update codegencommon.cpp

transfer local declaration for dataSize

* Delete codegencommon.cpp

* Add files via upload

* Update compiler.cpp

* eDataSize -> dataSize back

* Update gentree.cpp

* Update compiler.cpp

* Update codegencommon.cpp

* Update compiler.h

* Update codegencommon.cpp

3 years agoRemove invalid text (#51820)
Andrii Kurdiumov [Wed, 5 May 2021 21:20:24 +0000 (03:20 +0600)]
Remove invalid text (#51820)

I found this piece of text which indicate that long time ago,
about 3 years (https://github.com/dotnet/coreclr/pull/16353), ago infra has not .NET core 2.0 on build agents,
and test in this folder cannot be compiled with dotnet sdk
This is not longer true.
Moreother, this project is disabled https://github.com/dotnet/runtime/blob/main/src/tests/Common/dirs.proj#L17
for same amount of time (3 years)
With this PR I want to raise a question, do somebody need this folder, so it can be reenabled, or it can be removed?

3 years agoInstroduce the DPAD feature (Dynamic Promotion And Demotion) feature for regions...
Maoni Stephens [Wed, 5 May 2021 20:30:23 +0000 (13:30 -0700)]
Instroduce the DPAD feature (Dynamic Promotion And Demotion) feature for regions (#52187)

Introduce the DPAD feature (Dynamic Promotion And Demotion) feature for regions

This feature consists of the following -

1) Record promoted bytes per region so we can make decisions which regions to promote

I'm reusing g_mark_list_piece to record the survived and old card survived per region since it's not used during the
mark phase till sort_mark_list is called. So this is now defined for both wks and svr GC.

old card survived is only used if the plan_gen_num for that GC isn't max_generation already, otherwise we'd be
promoting into max_generation anyway.

Note the way I'm calculating the survived for UOH regions isn't correct (I'd need to merge them from each basic region) but I also don't need the survived bytes for UOH.

For dbg builds I also record the survived bytes with the g_promoted to validate that survived_per_region is correct.

REGIONS TODO: we should treat g_mark_list_piece as part of the GC bookkeeping data structures and allocate it as such.

REGIONS TODO: currently we only make use of SOH's promoted bytes to make decisions whether we want to compact or sweep
a region. We should also enable this for LOH compaction.

2) SIP (Swept In Plan) regions

This feature introduces SIP regions. Previously, the compact or sweep decision is only made after the plan phase is complete.
But since we know how much each region survives before the plan phase, and if a region's survival rate is very high, we know
it's not productive to compact it. Therefore we do not need to plan it, we can just sweep it when we encounter it during plan.
And if most of that survival is due to card marking from gen2, we also know that very unlikely it'd be productive to promote it
into gen2 right away, instead of going through gen1 then gen2. So we do that too.

This means SIP regions cannot be used as generation_allocation_segment for allocate_in_condemned_generations and in the later phases they need to skip them as we are already done with them during plan (which means their plan_gen_num is preserved since we already decided in plan). In process_last_np_surv_region/process_remaining_regions when we are going through regions we also need to make sure we do not change the plan_gen_num for SIP regions there.

SIP regions' bricks are not built the same way we build bricks in plan as there's no need - we will not need to go through them
via the tree. So we build the bricks accurately with objects since we know exactly which objects will be in this region. This
does mean in relocate_address we need to make sure to not look at the brick table and return the same address if we are asked to relocate an address in an SIP region. For relocate_survivors of course we do need to relocate refs in these regions but in a very
different fashion - we do this in relocate_advance_to_non_sip which will only return non SIP regions to relocate_survivors.

Complications these SIP regions introduce -

+ When we decide if we should make a region SIP, if the plan_gen_num of a generation is not maxgen, and if we want to make every region in that generation maxgen, we need to make sure we can get a new region for this generation so we can guarantee each generation has at least one region. If we can't get a new region, we need to make sure we leave at least one region in that gen to guarantee our invariant.

This new region we get needs to be temporarily recorded instead of being on the free_regions list because we can't use it for other purposes.

+ In sweep_region_in_plan, we temporarily thread the large enough free objects onto the region's own FL which will then be threaded onto the appropriate generation's FL. We don't thread this right away because we might need to restore gen2's FL if we decide to sweep.

+ In allocate_in_condemned_generations we need to be careful - if we are skipping regions when we go to the next region, we need to adjust the alloc ptr accordingly otherwise it'd be out of sync with alloc limit which will cause problems for detecting pinned plugs.

+ In relocate phase when we check for demotion we have a new scenario with SIP -

A points to B
A starts out as a gen0 obj
B starts out as a gen1 obj
no cards are needed in this case
but A is now a gen2 obj, so a card is needed. In the current check_for_demotion_helper we only need to check if the child object is in a region that's demoted but for this new scenario we need to check the child obj's plan_gen_num against the parent's plan_gen_num which is handled by the new check_demotion_helper_sip.

+ For sweep, we do need to promote all regions as this is a contract right now with the handle table. So I do promote them as sweep normally does. Requires more work to change this and I will not include it with this PR.

REGIONS TODO: make SIP regions keep their plan_gen_num during sweep.

3) Rewrote the final region threading

A region in a condemned generation can end up in any generation.

Got rid of generation_plan_start_segment. I found keeping it to be counter productive especially with the introduction of SIP
regions which made going through regions more complicated. It also made it so that we can return any empty region back to the free region pool.

In find_first_valid_region thread the FL for SIP regions onto their corresponding generation's FL.

--

Misc

+ Added some code to stress SIP but for the checkin I disabled it as making a lot of regions SIP would just make us run out of
memory quickly.

REGIONS TODO: this can be improved, eg, don't make a region SIP unless it fits the SIP criteria during a full blocking GC so
we don't get premature OOM.

+ In process_remaining_regions, if a gen0 regions that only contain pinned plugs have too much survived, we don't demote it.

+ Fixed a bug when setting the internal basic region's gen_num on UOH regions, this should be the logic gen num 2 instead of
physical gen num for these generations.

+ I've made gen_num in heap_segment a byte instead of an int.

REGIONS TODO: Should do the same with plan_gen_num. There are more optimizations we can do to shrink this datastructure.

+ We always use MARK_LIST so got rid of the MARK_LIST define.

--

More REGIONS TODO

+ dd_survived_size includes padding but the promoted bytes we record don't. Should unify this.

+ I don't actually need survived_per_region for WKS, I can get rid of it for WKS to keep the datastructure only allocated for SVR. I actually could make the decision for SIP regions as soon as we are done with marking so I don't need to store `survived` and `old_card_survived` on `heap_segment` (it however could be potentially nice for instrumentation purpose). But I'll leave this for another PR.

+ possible optimization for get_promoted_bytes (note that when we switch to only use the used part of our reserved range it means most regions we look at will be used).

===============

What I tested -

WKS:
corerun gcperfsim.dll -tc 2 -tagb 64 -tlgb 0.05 -lohar 0 -sohsi 10 -lohsi 0 -pohsi 0 -sohpi 0 -lohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType reference -testKind time -printEveryNthIter 60000
corerun gcperfsim.dll -tc 2 -tagb 64 -tlgb 0.05 -lohar 100 -sohsi 10 -lohsi 100 -pohsi 0 -sohpi 0 -lohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType reference -testKind time -printEveryNthIter 60000

SVR: same cmdline except -tc 4 -tagb 128
with
set complus_GCGen0MaxBudget=1000000

3 years agoAnnotate System.Console APIs as unsupported on iOS/tvOS (#52245)
Maxim Lipnin [Wed, 5 May 2021 20:21:56 +0000 (23:21 +0300)]
Annotate System.Console APIs as unsupported on iOS/tvOS (#52245)

* Annotate System.Console APIs as unsupported on iOS/tvOS

* Add autogenerated ref-part

* Annotate AnsiParsingLogConsole class as unsupported on iOS/tvOS

3 years ago[mono] Actually make a copy of vtype arguments on wasm. (#52290)
Zoltan Varga [Wed, 5 May 2021 19:54:24 +0000 (15:54 -0400)]
[mono] Actually make a copy of vtype arguments on wasm. (#52290)

Fixes https://github.com/dotnet/runtime/issues/50955.

3 years ago[main] Update dependencies from dotnet/runtime dotnet/arcade dotnet/icu dotnet/xharne...
dotnet-maestro[bot] [Wed, 5 May 2021 18:26:23 +0000 (18:26 +0000)]
[main] Update dependencies from dotnet/runtime dotnet/arcade dotnet/icu dotnet/xharness dotnet/llvm-project dotnet/runtime-assets (#51981)

[main] Update dependencies from dotnet/runtime dotnet/arcade dotnet/icu dotnet/xharness dotnet/llvm-project dotnet/runtime-assets

3 years agofix return value (#52206)
hrrrrustic [Wed, 5 May 2021 18:18:27 +0000 (21:18 +0300)]
fix return value (#52206)

3 years agoAdd AOT WASM SoD for template and BlazingPizza (#52089)
Drew Scoggins [Wed, 5 May 2021 17:48:41 +0000 (10:48 -0700)]
Add AOT WASM SoD for template and BlazingPizza (#52089)

* Add AOT WASM SoD for template and BlazingPizza

* Update SOD dirs location for Pizza App

3 years agoSome cleanup around PInvokeStaticSigInfo (#52232)
Elinor Fung [Wed, 5 May 2021 17:31:47 +0000 (10:31 -0700)]
Some cleanup around PInvokeStaticSigInfo (#52232)

3 years agoMove Logging Generator and attribute to Logging.Abstractions (#52256)
Maryam Ariyan [Wed, 5 May 2021 15:57:28 +0000 (11:57 -0400)]
Move Logging Generator and attribute to Logging.Abstractions (#52256)

* Move Logging Generator and LoggerMessageAttribute to Logging.Abstractions

Fixes: #52222

3 years ago[debugger][mono] Run icordbg tests on android (#52127)
Thays Grazia [Wed, 5 May 2021 14:37:50 +0000 (11:37 -0300)]
[debugger][mono] Run icordbg tests on android (#52127)

Run icordbg debuggert tests on android

3 years agoAdd entries to the glossary (#52291)
Hadrian Tang [Wed, 5 May 2021 14:26:35 +0000 (22:26 +0800)]
Add entries to the glossary (#52291)

3 years ago[wasm] Move EnableAggressiveTrimming build to `runtime` pipeline (#52252)
Ankit Jain [Wed, 5 May 2021 13:58:59 +0000 (09:58 -0400)]
[wasm] Move EnableAggressiveTrimming build to `runtime` pipeline (#52252)

.. from runtime-staging, so any changes that break that can be caught,
and fixed. Any test failures in runtime-staging don't fail the job
itself, so it gets missed.

3 years agoAdd support to disable default diagnostic server listener. (#52184)
Johan Lorensson [Wed, 5 May 2021 13:56:10 +0000 (15:56 +0200)]
Add support to disable default diagnostic server listener. (#52184)

3 years ago[tests] Fix integer rounding error in GetTestFileName (#52266)
Mitchell Hwang [Wed, 5 May 2021 13:46:17 +0000 (09:46 -0400)]
[tests] Fix integer rounding error in GetTestFileName (#52266)

* [tests] Fix integer rounding error in GetTestFileName

* Update src/libraries/Common/tests/TestUtilities/System/IO/FileCleanupTestBase.cs

* Update src/libraries/Common/tests/TestUtilities/System/IO/FileCleanupTestBase.cs

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoDont throw exception in SerialStream constructor if dtr or rts is not available ...
Stephan van Leeuwen [Wed, 5 May 2021 13:35:52 +0000 (15:35 +0200)]
Dont throw exception in SerialStream constructor if dtr or rts is not available (#48577)

* Dont throw exception in SerialStream constructor

Dont throw IOException in SerialStream constructor when using a virtual port on
linux.
Setting DtrEnable or RtsEnable are not possible due to the termios commands not
implemented by socat sockets. This fix ensures no exception is thrown in the
constructor when we didn't even set the dtrEnable or rtsEnable parameters
explicitly and allows the usage of SerialStream with those virtual ports.

* Remove unused variables

* Only swallow the exception if it is set to false

3 years agoRelease GCHandle in FSEventStreamContext release callback (#52275)
Jan Kotas [Wed, 5 May 2021 13:28:58 +0000 (06:28 -0700)]
Release GCHandle in FSEventStreamContext release callback (#52275)

The callbacks are sometimes delivered even after the FSEventStream is disposed

3 years agoHkdf check output length (#52260)
Daniel Hix [Wed, 5 May 2021 13:23:25 +0000 (08:23 -0500)]
Hkdf check output length (#52260)

* Add tests to check for output legnth and outputLength size

* Change Expand and DeriveKey to check the output size

* PR change requests

* Add newline back

* XML tidying, and swapped the exception text and type

* Some more exception xml cleanup

* Combined exception text, and updated tests

3 years agoTrim unnecessary AssemblyMetadataAttribute attributes (#50903)
Marek Safar [Wed, 5 May 2021 09:55:12 +0000 (11:55 +0200)]
Trim unnecessary AssemblyMetadataAttribute attributes (#50903)

* Trim unnecessary AssemblyMetadataAttribute attributes

* Feedback

3 years agoPrepare JIT backend for structs in registers. (#52039)
Sergey Andreenko [Wed, 5 May 2021 08:33:25 +0000 (01:33 -0700)]
Prepare JIT backend for structs in registers. (#52039)

* Prepare backend for structs in registers.

* restore an old assert about normalizeOnStore

* Add `GetActualRegisterType`.

* improve siVarLoc logic.

* Bruce's suggestion.

3 years agoRemove two dead props (#52263)
Viktor Hofer [Wed, 5 May 2021 06:58:01 +0000 (08:58 +0200)]
Remove two dead props (#52263)

* Remove two dead props

* Update Versions.props

3 years agoDelete Microsoft.NETCore.Targets package (#52261)
Viktor Hofer [Wed, 5 May 2021 06:56:29 +0000 (08:56 +0200)]
Delete Microsoft.NETCore.Targets package (#52261)

That package was needed in the 1.x timeframe and later in 2.x brought
back to trim out 1.x runtime references. As the live version of that
package isn't directly referenced anymore by any component in at least
the dotnet org. Source build has a checked in state so that the
dependent packages in 2.x can still build with it.

3 years agoFix crash in mono_resolve_patch_target_ext when method is NULL. (#52243)
Johan Lorensson [Wed, 5 May 2021 06:44:10 +0000 (08:44 +0200)]
Fix crash in mono_resolve_patch_target_ext when method is NULL. (#52243)

3 years agoDon't run "reserved device names" tests on Win10 (#52282)
Levi Broderick [Wed, 5 May 2021 05:14:04 +0000 (22:14 -0700)]
Don't run "reserved device names" tests on Win10 (#52282)

3 years agoFixes issue #51612 (#52231)
Egor Chesakov [Wed, 5 May 2021 03:17:57 +0000 (20:17 -0700)]
Fixes issue #51612 (#52231)

* Add regression test for https://github.com/dotnet/runtime/issues/51612

* Allocate a dummy local when an inlinee needs GSCookie but the root method does not in src/coreclr/jit/fginline.cpp

3 years agoAdd CopyToAsync optimized implementations for StreamPipeReader (#52159)
Emmanuel André [Wed, 5 May 2021 03:04:16 +0000 (05:04 +0200)]
Add CopyToAsync optimized implementations for StreamPipeReader (#52159)

* Add CopyToAsync optimized implementations for StreamPipeReader

3 years ago[wasm] Fix Emscripten SDK provisioning for tests (#52273)
Ankit Jain [Wed, 5 May 2021 02:11:10 +0000 (22:11 -0400)]
[wasm] Fix Emscripten SDK provisioning for tests (#52273)

- For running on AOT tests on helix, we need to send emsdk as a payload
- On the CI machines, emscripten is available in `/usr/local/emscripten/`
- but the helix tasks try to write a `.payload` file in that dir, which fails
  because of permissions

- So, we copy emsdk to local `src/mono/wasm/emsdk`
- But we were doing it as part of *every* test build!
    - this meant unncessarily copying, and races causing errors like:

```
/__w/1/s/eng/testing/tests.wasm.targets(138,5):
    error MSB3026: Could not copy "/usr/local/emscripten/emsdk/node/14.15.5_64bit/bin/node" to "/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node".

    Beginning retry 1 in 1000ms. The process cannot access the file '/__w/1/s/src/mono/wasm/emsdk/node/14.15.5_64bit/bin/node' because it is being used by another process.  [/__w/1/s/src/libraries/System.Collections.Specialized/tests/System.Collections.Specialized.Tests.csproj]
```

- Instead, do that once when preparing work items for helix

Fixes https://github.com/dotnet/runtime/issues/52254 .

3 years agoFix Hosting tests in runtime-staging runs (#52265)
Eric Erhardt [Wed, 5 May 2021 01:29:18 +0000 (20:29 -0500)]
Fix Hosting tests in runtime-staging runs (#52265)

* Fix HostFactoryResolverTests to work with EnableAggressiveTrimming

* Disable hosting tests on Windows running on mono

See https://github.com/dotnet/runtime/issues/34582

3 years agoImprove SuperPMI missing data asserts (#52129)
Bruce Forstall [Tue, 4 May 2021 22:31:30 +0000 (15:31 -0700)]
Improve SuperPMI missing data asserts (#52129)

* Improve SuperPMI missing data asserts

SuperPMI has many asserts for missing data that are specially handled
to return a "missing data" error code. We typically ignore these, except
to note that a new collection might be needed. In particular, we prefer a
"missing data" error to an unidentified (caught) crash, which might indicate a JIT crash.

A recent change exposed a case where we were missing an assert, leading
to a crash. I went through all the methodcontext.cpp "rep" functions and added
appropriate asserts to all cases where they were missing.

To do this, add new `AssertMapExists`, `AssertKeyExists`, and `AssertMapAndKeyExist`
macros to make this consistent, easy, and compact, and converted all existing map and key
asserts to use these new forms.

In addition,
1. Rewrite the code to be much more regular and consistent.
2. Add many missing `DEBUG_REC` and `DEBUG_REP` cases, and fix some that were wrong.
3. Create a `key` variable almost everywhere, to avoid repeated `CastHandle` calls.
4. Simplify/commonize the `ZeroMemory` calls.
5. Remove all BOOL; use bool as appropriate.

There are no asm diffs (as expected). I verified the new asserts properly fire by using
`superpmi.py replay -jitoption JitStress=2`.

(Re-revert change, with fix)

* Fix clang compilation failures, more

clang is less permissive about empty variatic macros `__VA_ARGS__`,
so add `AssertMapExistsNoMessage`, `AssertKeyExistsNoMessage`, and
`AssertMapAndKeyExistNoMessage` for cases where we haven't bothered
to write a failure message, to avoid compiler problems. It's also more
clear in the code.

Change all the functions to explicity compute and use a `value` variable
for the key=>value map, to reduce duplicate casting, and make the code
more clear.

* clang build fix

3 years agoReduce the memory footprint of ManagedWebSocket (#52022)
Ivan Zlatanov [Tue, 4 May 2021 22:10:20 +0000 (01:10 +0300)]
Reduce the memory footprint of ManagedWebSocket (#52022)

Removed unused CancellationTokenSource. Using RandomNumberGenerator.Fill instead of custom instance of RandomNumberGenerator.

3 years agoAllow DataContractSerializer to serialize MemoryStream instances (#50830)
Levi Broderick [Tue, 4 May 2021 21:43:56 +0000 (14:43 -0700)]
Allow DataContractSerializer to serialize MemoryStream instances (#50830)

3 years agoRename S.T.J.Node namespace to S.T.J.Nodes (#52200)
Steve Harter [Tue, 4 May 2021 20:36:41 +0000 (15:36 -0500)]
Rename S.T.J.Node namespace to S.T.J.Nodes (#52200)

3 years agoupdate enterpriseTests setup (#48804)
Tomas Weinfurt [Tue, 4 May 2021 19:19:36 +0000 (12:19 -0700)]
update enterpriseTests setup (#48804)

* update enterpriseTests setup

* add ntlm & digest tests

* update README

3 years agoAdd a tag to the type declarations generated by `TYPED_HANDLE_DECL`. (#52250)
imhameed [Tue, 4 May 2021 19:10:29 +0000 (12:10 -0700)]
Add a tag to the type declarations generated by `TYPED_HANDLE_DECL`. (#52250)

Workaround for https://reviews.llvm.org/D74103.

3 years agoUnify QuicTestBase and add test repros for flaky under-stress failures (#52050)
Natalia Kondratyeva [Tue, 4 May 2021 18:51:16 +0000 (20:51 +0200)]
Unify QuicTestBase and add test repros for flaky under-stress failures (#52050)

Removed MsQuicTestBase class as it was essentially the same as QuicTestBase. Updated ActiveIssue comments with newly created issues #52047 and #52048 and added repros from them as new tests.

3 years ago[mono] Revert Mac Catalyst arm64 JITing hack (#52249)
Aleksey Kliger (λgeek) [Tue, 4 May 2021 18:32:27 +0000 (14:32 -0400)]
[mono] Revert Mac Catalyst arm64 JITing hack (#52249)

JITing in Catalyst apps is not allowed on Apple Silicon.

Partly reverts a9f1207d9f14d6bdf6e4be0f206d11df8e032382

3 years agoUpdate the SDK to 6.0 Preview 3 (#52196)
Viktor Hofer [Tue, 4 May 2021 18:29:02 +0000 (20:29 +0200)]
Update the SDK to 6.0 Preview 3 (#52196)

* Update the SDK to 6.0 Preview 3

Updating the minimum and target version of the SDK to 6.0 Preview 3.

Contributes to https://github.com/dotnet/runtime/issues/51716

* Fix Linker Trimming tests

* Fix ILLink warnings for latest SDK

- Remove ILLink.Descriptors entry for non-existant method
- Suppress ILLink warnings in mobile tests

Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoDownload Mono AOT workload .nupkg in prepare-artifacts.proj (#52247)
Alexander Köplinger [Tue, 4 May 2021 17:19:09 +0000 (19:19 +0200)]
Download Mono AOT workload .nupkg in prepare-artifacts.proj (#52247)

* Download Mono AOT workload .nupkg in prepare-artifacts.proj

Fixes the official build failure since the pattern we were using didn't include it.

* PR feedback

3 years agomono.proj: skip running CMake configure if the arguments didn't change (#51754)
Alexander Köplinger [Tue, 4 May 2021 16:45:45 +0000 (18:45 +0200)]
mono.proj: skip running CMake configure if the arguments didn't change (#51754)

This speeds up the incremental build. Similar to what coreclr/libraries do here: https://github.com/dotnet/runtime/blob/44ae6ca9cdf75e4892e054f9ac37deb52903b51c/eng/native/gen-buildsys.cmd#L77-L84

3 years agoUse live pkcs build instead of packagereference (#52239)
Viktor Hofer [Tue, 4 May 2021 16:40:05 +0000 (18:40 +0200)]
Use live pkcs build instead of packagereference (#52239)

3 years ago[iOS/macOS] Split S.S.C.Native.Apple into platform specific files where needed
Filip Navara [Tue, 4 May 2021 16:23:36 +0000 (18:23 +0200)]
[iOS/macOS] Split S.S.C.Native.Apple into platform specific files where needed

Instead of using #if to remove functions that don't work/make sense on iOS,
move them to a file that is conditionally included in the library compile.

3 years agoPlace HKDF info in to a temporary buffer if required.
Kevin Jones [Tue, 4 May 2021 16:11:49 +0000 (12:11 -0400)]
Place HKDF info in to a temporary buffer if required.

If the info input overlaps with the output destination, copy
the info to a temporary buffer first. As the HKDF expansion
is performed, the output buffer is filled by hash size. However
this will overwrite the info, should the buffers overlap.

The other parameters, like prk, salt, and ikm do not need any addional
handling for overlaps.