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
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.
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
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>
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>
Andrew Au [Thu, 6 May 2021 19:14:31 +0000 (12:14 -0700)]
Allocate initial regions (#51752)
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>
Kunal Pathak [Thu, 6 May 2021 18:48:34 +0000 (00:18 +0530)]
Arm64: Use zero register where appropriate (#52269)
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
Jan Kotas [Thu, 6 May 2021 18:30:01 +0000 (11:30 -0700)]
Use function pointers for interop in System.Net.NetworkInformation (#52192)
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
Jeff Handley [Thu, 6 May 2021 16:28:41 +0000 (09:28 -0700)]
Obsolete the Rijndael and RijndaelManaged classes
hrrrrustic [Thu, 6 May 2021 16:08:58 +0000 (19:08 +0300)]
System.Data.* missed Equals nullable annotations (#52165)
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
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
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
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.
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.
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.
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.
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
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
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.
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
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.
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
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.
Steve Molloy [Thu, 6 May 2021 05:05:00 +0000 (22:05 -0700)]
Don't trim if cache is already empty. (#51762)
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
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).
Elinor Fung [Thu, 6 May 2021 02:34:16 +0000 (19:34 -0700)]
Move CallConvBuilder and helpers to separate file (#52330)
Drew Scoggins [Thu, 6 May 2021 00:59:30 +0000 (17:59 -0700)]
Move to main channel (#52350)
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.
Jeff Handley [Thu, 6 May 2021 00:37:03 +0000 (17:37 -0700)]
Fix ImageAnimator to render the correct frames (#52236)
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.
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.
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
Ryan Lucia [Wed, 5 May 2021 21:25:58 +0000 (17:25 -0400)]
[mono] Fix leak in assembly-specific dllmap lookups (#52307)
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.
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
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?
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
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
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.
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
hrrrrustic [Wed, 5 May 2021 18:18:27 +0000 (21:18 +0300)]
fix return value (#52206)
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
Elinor Fung [Wed, 5 May 2021 17:31:47 +0000 (10:31 -0700)]
Some cleanup around PInvokeStaticSigInfo (#52232)
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
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
Hadrian Tang [Wed, 5 May 2021 14:26:35 +0000 (22:26 +0800)]
Add entries to the glossary (#52291)
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.
Johan Lorensson [Wed, 5 May 2021 13:56:10 +0000 (15:56 +0200)]
Add support to disable default diagnostic server listener. (#52184)
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>
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
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
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
Marek Safar [Wed, 5 May 2021 09:55:12 +0000 (11:55 +0200)]
Trim unnecessary AssemblyMetadataAttribute attributes (#50903)
* Trim unnecessary AssemblyMetadataAttribute attributes
* Feedback
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.
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
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.
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)
Levi Broderick [Wed, 5 May 2021 05:14:04 +0000 (22:14 -0700)]
Don't run "reserved device names" tests on Win10 (#52282)
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
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
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 .
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
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
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.
Levi Broderick [Tue, 4 May 2021 21:43:56 +0000 (14:43 -0700)]
Allow DataContractSerializer to serialize MemoryStream instances (#50830)
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)
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
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.
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.
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
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>
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
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
Viktor Hofer [Tue, 4 May 2021 16:40:05 +0000 (18:40 +0200)]
Use live pkcs build instead of packagereference (#52239)
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.
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.
Layomi Akinrinade [Tue, 4 May 2021 15:48:13 +0000 (08:48 -0700)]
Address feedback from STJ source-gen PR #51300 (#52147)
* Address feedback from STJ source-gen PR #51300
* Address review feedback
Peter Sollich [Tue, 4 May 2021 15:46:32 +0000 (17:46 +0200)]
Fix issue 47805 (#52183)
Fix issue https://github.com/dotnet/runtime/issues/47805 - in this case, the BGC_MARKED_BY_FGC bit (0x2) set in the method table leaked out and caused issues for the user program.
In the cases that I've been able to repro, this happened because the bit got set for a short object right in front of a pinned plug, and then saved away by enque_pinned_plug.
Later on, in the case of mark & sweep, we check for the bit and reset it, but later we copy the saved object back by calling recover_saved_pinned_info which calls recover_plug_info to do the actual work. This isn't a problem for the compact case, because we copy the saved object back during compact_plug, turn the bit off, then save it again at the end of compact_plug.
The fix is to turn off the extra bits at the beginning of enque_pinned_plug and save_post_plug_info for the copy that is later restored in mark & sweep (there are actually two copies saved, one for use during compact and one for use during mark & sweep). This builds on an earlier fix by Maoni for a similar problem with another bit.
Ryan Lucia [Tue, 4 May 2021 15:10:22 +0000 (11:10 -0400)]
[mono] Assume C99 support (#51504)
We don't seem to have been setting this define properly, but we can just remove the ifdef entirely
Larry Ewing [Tue, 4 May 2021 14:13:27 +0000 (09:13 -0500)]
[wasm] Don't use EMSDK_PATH in external builds (#52215)
* Don't use EMSDK_PATH in external builds only when in-tree
monojenkins [Tue, 4 May 2021 13:37:37 +0000 (09:37 -0400)]
Remove !sig->is_inflated assert from icall wrapper generator. (#52241)
If the method or type containing the icall instruction has a
generic parameter, the resulting signature is "inflated" even if
the generic parameter is not used in the signature. This breaks
some methods in SlimDX, and probably other C++/CLI code.
<!--
Thank you for your Pull Request!
If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.
Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->
Co-authored-by: madewokherd <madewokherd@users.noreply.github.com>
Jan Kotas [Tue, 4 May 2021 13:18:23 +0000 (06:18 -0700)]
Delete empty test project (#52216)
Fixes #52119
imhameed [Tue, 4 May 2021 12:41:05 +0000 (05:41 -0700)]
[mono] LLVM 11 support (#51993)
Changes:
- `CallSite` was removed. Add attributes to call/invoke instructions by using a
coercion to `CallBase` instead.
- `llvm/InitializePasses.h` must be included to get the prototypes for
`llvm::initializeCore` etc.
- Intrinsic IDs have been split into several different architecture-specific
enumeration types. These enumeration types collectively contain definitions
with non-overlapping values. Each intrinsic in `llvm-intrinsics.h` is now
tagged with an architecture.
- `createLegacyLookupResolver` passes a `StringRef` to the lookup function. We
still call functions that demand an `std::string` (and that demand
zero-termination), so it is necessary to copy the `StringRef` bytes into a new
`std::string`.
- Alignment values are wrapped in what is effectively a newtype: `llvm::Align`.
- `llvm.prefetch` is overloaded in its first parameter LLVM 10 and above.
- Values of type `llvm::Align` must be non-zero. Sometimes 0 is passed to
`mono_llvm_build_alloca`; handle this by falling back to `CreateAlloca`, which
computes a default alignment based on the type of the alloca.
Some notes on LLVM 11:
- `createDefCfa` and `createDefCfaOffset` were replaced with `cfiDefCfa` and
`cfiDefCfaOffset`. Neither negates the offset parameter. All calling code was
adjusted to compensate. See
https://github.com/llvm/llvm-project/commit/
7e49dc6184ef3baf421a5bb0190466cbb1a87785
and
https://github.com/llvm/llvm-project/commit/
0840d725c4e7c98bb440db7b886054525be6ddf1.
- The non-Mono DWARF emitter used to unnecessarily negate the offsets for
`DW_CFA_def_cfa` and `DW_CFA_def_cfa_offset` directives. This has since been
fixed in
https://github.com/llvm/llvm-project/commit/
773f8dbd1da8409f1b62e8c5692cb9a5d199d6c8
and
https://github.com/llvm/llvm-project/commit/
c693b9c321d5a40d012340619674cf790c9ac86c.
- `AsmPrinter::emitAlignment` no longer takes the base-2 logarithm of the
desired alignment--it directly accepts a power of two alignment now. This is
checked dynamically by `llvm::Align`.
Vlad Brezae [Tue, 4 May 2021 12:03:57 +0000 (15:03 +0300)]
[interp] Optimize conditional branches (#52130)
* [interp] Try emitting ldc_0 instead of initlocal if possible
Unlike initlocal ldc_0 are propagated, also having smaller instruction footprint. Signal retry of cprop when we are adding such instructions, also in other cases. We could dynamically update the state, but let's not overcomplicate the cprop pass, for now.
* [interp] Also update def_index when swapping dreg
* [interp] Refactor special static field access
On netcore, there are no context static fields so all special static fields are thread static. These thread static accessors are not very common, so just remove redundant opcodes for them, and use ldind/ldobj.vt and stind/stobj.vt instead.
* [interp] Remove MINT_LDFLD_VT_* opcodes
These opcodes were used for loading a field of a VT var. This means the opcodes were loading a value from an immediate offset added to a var offset. We can use the standard MINT_MOV opcodes for this, however we need to resolve the offsets at the very end, so it doesn't interfere with other compilation passes, since the final offset is not the real offset of a variable, but rather an offset inside a VT var.
* [interp] Remove MINT_CHECKPOINT opcode
It was used to check for abort requests during backward branches. Also stop checking for abort requests in other places.
* [interp] Add super instructions for conditional branches
We include the safepoint in the instruction and also the immediate comparison value if possible. Doing the safepoint by default in branching opcodes is questionable since, in a typical program, forward branches are far more common than backward branches.
We should really remove many of the branching opcodes. We now have the possibility to swap the src vars order, and use the opposite comparison instead.
dotnet-maestro[bot] [Tue, 4 May 2021 11:48:05 +0000 (11:48 +0000)]
Update dependencies from https://github.com/mono/linker build
20210503.3 (#52238)
[main] Update dependencies from mono/linker
John Call [Tue, 4 May 2021 10:57:12 +0000 (03:57 -0700)]
Add parameter descriptions (#51845)
Daniel Hix [Tue, 4 May 2021 08:15:25 +0000 (03:15 -0500)]
Changed all tests using random to use a seed in JIT/Methodical (#50767)
* Changed all tests using random to use a seed in JIT/Methodical
* Cleaned up code from suggestion
* Added seeds to the tests using unseeded random in JIT
* Update Span indexer to not rely on the order of random data
* Change circle in convex to not rely on specific random values
* Undo changes to tests with seed specified
Viktor Hofer [Tue, 4 May 2021 06:03:46 +0000 (08:03 +0200)]
Stop harvesting S.Security.Cryptography.Pkcs (#52045)
* Stop harvesting S.Sec.Cryptography.Pkcs
The removed configurations (netstandard1.3, netcoreapp2.1, net46)
of the touched packages aren't built anymore. Instead
the already built matching binaries from the latest available packages
are redistributed when packaging these libraries.
Dropping these assets as the minimum supported set of platforms are ones
that support netstandard2.0 and are still in-support. As an example,
also dropping the netcoreapp2.1 asset which isn't supported anymore and
adding a target to prevent the package being used for netcoreapp2.x.
For .NET Framework, there's still a net461
configuration present to avoid binding redirect issues.
Contributes to #47530
* Fix the build
* Remove workaround and mark Xamarin supported
Kevin Jones [Tue, 4 May 2021 03:44:28 +0000 (23:44 -0400)]
Dispose of hash handles for Windows 7. (#52213)
The handle will never be null, it will be an owned handle that points
to nothing. Dispose of it so it doesn't need to get finalized.
Zoltan Varga [Tue, 4 May 2021 02:25:40 +0000 (22:25 -0400)]
[aot] Avoid associating the same AOT image with multiple assemblies (#52181)
loaded in different ALCs.
This caused crashes in the generic sharing code on wasm.
Larry Ewing [Tue, 4 May 2021 01:12:06 +0000 (20:12 -0500)]
Fix incorrect quoting (#52219)
Fan Yang [Tue, 4 May 2021 00:43:43 +0000 (20:43 -0400)]
Remove unreachable code (#52207)
* Remove unreached code
* Remove all the remaining reference to reflectionOly
Mike McLaughlin [Tue, 4 May 2021 00:31:40 +0000 (17:31 -0700)]
Generate coredumps on signals (#52024)
Generate coredumps on signals
On MacOS, coredumps are generated if there is an unhandled managed exception
but signals don't generate them.
Enable a stripped down version of the Linux signal handlers for MacOS.
Add a SIGABRT handler so calls to abort() in other native code causes dump to be generated.
Add COMPlus_EnableDumpOnSigTerm that enables dump generation on SIGTERM.
Moved the "generate dump on SIGTERM" logic out of the PAL into runtime's
HandleTerminationRequest callback and passed a new SCA enum down to
SafeExitProcess that calls TerminateProcess instead of ExitProcess
which generates a core dump.
Steve MacLean [Mon, 3 May 2021 23:48:24 +0000 (19:48 -0400)]
Apple Silicon use default XCode version (#52214)
Current default for vmImage 10.15 is XCode 12.4
Remove pin to Xcode 12.2 for Apple Silicon
Filip Navara [Mon, 3 May 2021 22:10:04 +0000 (00:10 +0200)]
Use data keys on macOS for RSA, EC cryptography