platform/upstream/dotnet/runtime.git
2 years ago[wasm] Enable tests blocked by IL2105 (#57457)
Larry Ewing [Tue, 17 Aug 2021 21:28:09 +0000 (16:28 -0500)]
[wasm] Enable tests blocked by IL2105 (#57457)

* Disable ReflectionCachesUpdateHandler_CachesCleared with aggressive trimming

* Enable more tests stopped by 2105

* Create tests.mobile.targets

Suppress IL2025

* Remove comment enabling trim warnings

* Mark more active issues

2 years agodon't try to test module path if we can't load the module (#57590)
Adam Sitnik [Tue, 17 Aug 2021 20:48:02 +0000 (22:48 +0200)]
don't try to test module path if we can't load the module (#57590)

2 years agoFix the string search behavior when using ICU (#57078)
Tarek Mahmoud Sayed [Tue, 17 Aug 2021 20:41:34 +0000 (13:41 -0700)]
Fix the string search behavior when using ICU (#57078)

2 years agoFix crashreport for stack overflow (#57428)
Mike McLaughlin [Tue, 17 Aug 2021 20:02:14 +0000 (13:02 -0700)]
Fix crashreport for stack overflow (#57428)

* Fix crashreport for stack overflow

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

The stack overflow managed exception wasn't been set/written out.

Changed the "unmanaged_frames" value to "stack_frames" because it includes both native and managed frames.

Aggregated the repeated stack frames adding a "repeated"/repeated_frames value/array for the time of times the sequence was repeated.

Looks like this:

    {
      "repeated" : "0x1542",
      "repeated_frames" : [
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce020",
        "native_address" : "0x11b9ee8c9",
        "native_offset" : "0x29",
        "token" : "0x600006f",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo2()",
        "timestamp" : "0xa8561820",
        "sizeofimage" : "0xe000",
        "filename" : "Macson.Client.dll",
        "guid" : "49cd869a682942bc95c0c34ca206c61d"
       },
       {
        "is_managed" : "true",
        "module_address" : "0x10e402000",
        "stack_pointer" : "0x7000045ce040",
        "native_address" : "0x11b9ee879",
        "native_offset" : "0x29",
        "token" : "0x6000070",
        "il_offset" : "0x0",
        "method_name" : "Macson.Client.Diagnostics.CrashyClass.Foo1()",
        ...
       },
      ]
    }

* Update createdump doc

* Fix Windows triage dump flags

* Code review feedback

2 years agoAdd --make-repro-path option to crossgen2 (#57543)
David Wrighton [Tue, 17 Aug 2021 19:42:07 +0000 (12:42 -0700)]
Add --make-repro-path option to crossgen2 (#57543)

- This is used to create repro packages for customer discovered issues with CrossGen2
- Customers will use this by setting the PublishCrossGen2ExtraArgs property to something like `--make-repro-path:c:\repro\crossgen2repro`
- Then the build will run, and produce zip files in the specified directory, one for each crossgen2 run that occurs during that build.
- Hopefully, then it is straightforward to package the failure up and send it in.

In addition, this tech can be used to transfer a full set of repro details from a Unix to Windows machine for easier debugging.

2 years agoUpdate dependencies from https://github.com/dotnet/msquic build 20210817.1 (#57581)
dotnet-maestro[bot] [Tue, 17 Aug 2021 19:37:43 +0000 (12:37 -0700)]
Update dependencies from https://github.com/dotnet/msquic build 20210817.1 (#57581)

System.Net.MsQuic.Transport
 From Version 6.0.0-preview.7.21416.1 -> To Version 6.0.0-preview.7.21417.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoThe FilterLoggingBuilderExtensions public API's (#57485)
Feng Gao [Tue, 17 Aug 2021 19:35:04 +0000 (03:35 +0800)]
The FilterLoggingBuilderExtensions public API's (#57485)

document doesn't reflect the acutal type.  Change
it from the ILoggingBuilder to LoggerFilterOptions.

Fix #57482

2 years agodon't dispose client control stream before closing connection (#57223)
Geoff Kizer [Tue, 17 Aug 2021 19:31:26 +0000 (12:31 -0700)]
don't dispose client control stream before closing connection (#57223)

* don't dispose client control stream before closing connection

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
2 years agoRemove codesign before bundling (#57532)
Andy Gocke [Tue, 17 Aug 2021 18:52:10 +0000 (11:52 -0700)]
Remove codesign before bundling (#57532)

* Remove codesign before bundling

* Change tests to sign by default and check for signing

* Use standard .NET style

Fixes #57242

2 years agoRemove validation to stat call for symlinks since is a breaking change (#57551)
David Cantú [Tue, 17 Aug 2021 18:51:46 +0000 (11:51 -0700)]
Remove validation to stat call for symlinks since is a breaking change (#57551)

* Remove validation to stat call for symlinks since is a breaking change, subsequently remove the symlink cache logic as is no longer needed

* Undo try-catch workaround in PhysicalFileProvider

* Fix tests that were failing due to changes

2 years agoDon't fgMorphCommutative when the optimization can violate VN invariants or remove...
Egor Chesakov [Tue, 17 Aug 2021 18:41:32 +0000 (11:41 -0700)]
Don't fgMorphCommutative when the optimization can violate VN invariants or remove an active CSE candidate (#57160)

2 years agoFix ARM64 unsigned div by const perf regression (#57400)
Pent Ploompuu [Tue, 17 Aug 2021 18:38:19 +0000 (21:38 +0300)]
Fix ARM64 unsigned div by const perf regression (#57400)

2 years agoNumber handling with converters (#57525)
Steve Harter [Tue, 17 Aug 2021 18:35:10 +0000 (13:35 -0500)]
Number handling with converters (#57525)

Co-authored-by: Layomi Akinrinade <laakinri@microsoft.com>
2 years agoAdd tests for notification profilers (#57429)
David Mason [Tue, 17 Aug 2021 18:32:20 +0000 (11:32 -0700)]
Add tests for notification profilers (#57429)

Add CI tests for notification profilers, and fix a couple things to make life with multiple profilers easier
  * Reduced default timeout for profiler detach - we used to try at 300ms, 600ms, 5s, 10s, and then 10 minutes. The check is just a read of an int, so there's no reason to wait 10 minutes
  * Got rid of a couple asserts that were wrong since switching from the dedicated profiler attach thread to the diagnostics server implementation
  * ProfControlBlock::GetProfilerInfo would only work for active profilers, not attaching profilers, which could cause subtle bugs

2 years agoMake all interpolated string handlers pass by ref (#57536)
Stephen Toub [Tue, 17 Aug 2021 18:17:14 +0000 (14:17 -0400)]
Make all interpolated string handlers pass by ref (#57536)

We currently pass all of our interpolated string handlers to their destination methods by ref, with the exception of those for Debug.  I think it makes sense to centralize on the pattern of always passing by ref: it doesn’t negatively impact the user experience, these are typically larger structs and so by ref helps (though it doesn’t matter for Debug), making it a ref makes it even less attractive to try to call directly / makes it look even more special, and most importantly, it gives us the opportunity to more safely clean up at the end of the operation.  This changes the Debug.Assert/Write{Line}If overloads we added in Preview 7 to pass the handler’s by ref.

This also then updates the Debug.Write{Line}If methods to create the StringBuilder used via StringBuilderCache, just in case these are used in a scenario where true is frequently passed.

2 years agoFix hanging HTTP cancelation test. (#57573)
Pavel Savara [Tue, 17 Aug 2021 18:17:05 +0000 (20:17 +0200)]
Fix hanging HTTP cancelation test. (#57573)

* fix hanging http cancelation test. On wasm, the loopback could never get to read the headers

* feedback

2 years agoRevert "Change IOptionsSnapshot to reuse options instances across scopes (#56271...
Eric Erhardt [Tue, 17 Aug 2021 18:13:13 +0000 (13:13 -0500)]
Revert "Change IOptionsSnapshot to reuse options instances across scopes (#56271)" (#57570)

* Revert "Change IOptionsSnapshot to reuse options instances across scopes (#56271)"

This reverts commit 8f5f9d049a6a98b138f88fa1d9d6a96c40c03aa7.

* Add a test to ensure ASP.NET's scenario isn't broken again

2 years ago[mono][debugger] Fix deadlock when debugging AOTed class (#57574)
Thays Grazia [Tue, 17 Aug 2021 18:11:49 +0000 (15:11 -0300)]
[mono][debugger] Fix deadlock when debugging AOTed class (#57574)

* Fix deadlock when debugging AOTed class

* fix comment.

2 years agoUse Type.GetTypeCode() instead of private extension (#57540)
Steve Molloy [Tue, 17 Aug 2021 18:11:38 +0000 (11:11 -0700)]
Use Type.GetTypeCode() instead of private extension (#57540)

* Use official Type.GetTypeCode() instead of the extension that was added to fill the gap in the earlier days of .Net Core.
* Bring reflection-based serializer in line with RefEmit behavior for 'object' serialization.

2 years agoSgen: Update GetTempAssemblyName according to #46499 (#57026)
Tal Aloni [Tue, 17 Aug 2021 18:11:00 +0000 (21:11 +0300)]
Sgen: Update GetTempAssemblyName according to #46499 (#57026)

* Update GetTempAssemblyName according to #46499

In #46499 we corrected Compilation.GetTempAssemblyName in order for it to be not deterministic under .NET Core.
In this PR we update the generated filename to match the new logic.

* Update Microsoft.XmlSerializer.Generator.csproj

* Update SGen.cs

Avoid using external dependency

* Update Microsoft.XmlSerializer.Generator.csproj

Avoid using external dependency

* Update Sgen.cs

Fixed compilation

2 years agoFix source indexer failing official builds (#57336) (#57593)
Alexander Köplinger [Tue, 17 Aug 2021 18:10:45 +0000 (20:10 +0200)]
Fix source indexer failing official builds (#57336) (#57593)

Works around https://github.com/dotnet/arcade/issues/7747 to unblock official builds.
This change will revert itself with the next Arcade update.

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoPublish VS workloads assets in requested folder layout to BAR (#57559)
Alexander Köplinger [Tue, 17 Aug 2021 18:08:38 +0000 (20:08 +0200)]
Publish VS workloads assets in requested folder layout to BAR (#57559)

See discussion in https://github.com/dotnet/runtime/issues/57154

2 years ago[Android][libraries] Throw PNSE for PersistKeySet flags (#57494)
Mitchell Hwang [Tue, 17 Aug 2021 18:06:02 +0000 (14:06 -0400)]
[Android][libraries] Throw PNSE for PersistKeySet flags (#57494)

* [Android][libraries] Throw PNSE for Exportable and PersistKeySet flags

* Ignore exportable flag

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
2 years agoAdd checks for missing SSA numbers (#57274)
Jakob Botsch Nielsen [Tue, 17 Aug 2021 17:48:38 +0000 (19:48 +0200)]
Add checks for missing SSA numbers (#57274)

In several places there were cases where we were checking lvaInSsa for
the lcl num of a local tree node, but then proceeded to use the ssa
number directly after. It is possible for a local to be in SSA without
tree nodes themselves having SSA form built for them, for example if
unreachable code makes it to SSA building. This adds some additional
check for missing SSA numbers.

2 years agocommenting out an assert that could be triggered on Win7 (#57524)
Vladimir Sadov [Tue, 17 Aug 2021 17:21:27 +0000 (10:21 -0700)]
commenting out an assert that could be triggered on Win7 (#57524)

2 years ago[wasm] Add incremental build support (#57113)
Ankit Jain [Tue, 17 Aug 2021 16:58:50 +0000 (12:58 -0400)]
[wasm] Add incremental build support (#57113)

* Update tasks to support incremental build

MonoAOTCompiler:
- Compiles assemblies to .bc files.
- Hashes for the .bc files are stored in a json cache file.
- And uses .depfile generated by mono-aot-cross, to figure out the
  if any of the dependencies have changed
- Writes out the actual .bc file only if the assembly, or it's
  dependencies changed

EmccCompile.cs: Support a `%(Dependencies)` metadata on the source
files, to compile the files only when needed.

* Update wasm targets

* don't pass unncessary args to RunTests

* Add tests for incremental builds

* Disable non-wasm builds, for testing

* Add miggins LogAsErrorException.cs

* Bump sdk for workload testing to 6.0.100-rc.1.21410.3

* fix build

* MonoAOTCompiler: use the full path to copy the final .bc file

* Make the method used with `MemberData`, static

otherwise xunit just shows a cryptic:
```
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [STARTING]
    Wasm.Build.Tests.RebuildTests.NoOpRebuild [FAIL]
      System.NotSupportedException : Specified method is not supported.
```

* add back builds

* Split Wasm.Build.Tests into multiple helix jobs

* Revert "add back builds"

This reverts commit 1d031c04e13780ec73180ba6f06a37ee42c24203.

* Split up native rebuild tests

* remove non-test classes

* add back builds

This reverts commit b008130a7886c2e2b9f16c83641c1b8c936082f6.

* MonoAOTCompiler: make cache optional

* MonoAOTCompiler: handle the case where we have a cache entry, but the file on disk doesn't exist

* Fix aot compiler task output

* MonoAOTCompiler: Use hashes of .bc files instead of assemblies

`--depfile` isn't supported on aot config used by android, and fails
with:

```
* Assertion at /__w/1/s/src/mono/mono/mini/aot-compiler.c:14216, condition `acfg->aot_opts.llvm_only && acfg->aot_opts.asm_only && acfg->aot_opts.llvm_outfile' not met
```

Instead, use hashes of the .bc.tmp files generated, with the existing
.bc files.

* MonoAOTCompiler: Support more than one output file

The earlier implementation assumed that there would be only one output
file. But in some cases (eg. android), there are more than one, like
`.s`, `.dll-llvm.o`.

* -bump sdk for workload testing

* MonoAOTCompiler: don't use tmp files at all, when cache isn't being

.. used.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years ago[main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/arcade...
dotnet-maestro[bot] [Tue, 17 Aug 2021 16:42:43 +0000 (18:42 +0200)]
[main] Update dependencies from dnceng/internal/dotnet-optimization dotnet/arcade dotnet/icu dotnet/llvm-project dotnet/runtime-assets dotnet/msquic (#57563)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210816.5

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.21411.3 -> To Version 1.0.0-prerelease.21416.5

* Update dependencies from https://github.com/dotnet/arcade build 20210813.4

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21412.1 -> To Version 6.0.0-beta.21413.4

* Update dependencies from https://github.com/dotnet/icu build 20210816.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-rc.1.21410.2 -> To Version 6.0.0-rc.1.21416.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20210816.1

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.21409.1 -> To Version 11.1.0-alpha.1.21416.1

* Update dependencies from https://github.com/dotnet/runtime-assets build 20210816.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 6.0.0-beta.21411.3 -> To Version 6.0.0-beta.21416.1

* Update dependencies from https://github.com/dotnet/msquic build 20210816.1

System.Net.MsQuic.Transport
 From Version 6.0.0-preview.7.21413.1 -> To Version 6.0.0-preview.7.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUpdate dependencies from https://github.com/mono/linker build 20210816.1 (#57565)
dotnet-maestro[bot] [Tue, 17 Aug 2021 16:41:14 +0000 (18:41 +0200)]
Update dependencies from https://github.com/mono/linker build 20210816.1 (#57565)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21413.1 -> To Version 6.0.100-preview.6.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoAdd dedicated wasm implementation for Parallel.Invoke and Parallel.For (#57283)
Katelyn Gadd [Tue, 17 Aug 2021 16:40:02 +0000 (09:40 -0700)]
Add dedicated wasm implementation for Parallel.Invoke and Parallel.For (#57283)

Introduces a simple single-threaded implementation for Parallel.Invoke, .For, and .ForEach that bypasses Task and wait primitives so that in browser environments parallel loop operations complete synchronously on the current thread

2 years agoupdate msquic to 1.7 (#57541)
Tomas Weinfurt [Tue, 17 Aug 2021 16:37:59 +0000 (09:37 -0700)]
update msquic to 1.7 (#57541)

2 years agoAdd UnmanagedCallersOnly attribute to SafeDeleteSslContext.ReadFromConnection/WriteTo...
Maxim Lipnin [Tue, 17 Aug 2021 16:33:06 +0000 (19:33 +0300)]
Add UnmanagedCallersOnly attribute to SafeDeleteSslContext.ReadFromConnection/WriteToConnection methods (#55947)

* Add UnmanagedCallersOnly attribute to  SafeDeleteSslContext.ReadFromConnection/WriteToConnection methods

* Fix the build

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Fix the build

* Add SslSetConnection interop method to make sure the right SafeDeleteSslContext instance is associated to an ssl session

* Update entrypoints.c with new DllImport

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoUse OID constructor for certificate SignatureAlgorithm.
Kevin Jones [Tue, 17 Aug 2021 15:58:13 +0000 (11:58 -0400)]
Use OID constructor for certificate SignatureAlgorithm.

This fixes an issue where it was not possible to get the SignatureAlgorithm
on Windows if the signature algorithm does not have a FriendlyName, like
a GOST certificate. This changes the SignatureAlgorithm property to use the
OID constructor so that the value can always be accessed, and the FriendlyName
is lazily resolve when the property is accessed.

2 years agoJIT: Don't fold NEG(NEG(X)) to X when NEG(x) is a CSE candidate (#57478)
Egor Bogatov [Tue, 17 Aug 2021 15:27:11 +0000 (18:27 +0300)]
JIT: Don't fold NEG(NEG(X)) to X when NEG(x) is a CSE candidate (#57478)

2 years ago[wasm] [debugger] Cache debugger information on Proxy side to avoid going to debugger...
Thays Grazia [Tue, 17 Aug 2021 15:22:09 +0000 (12:22 -0300)]
[wasm] [debugger] Cache debugger information on Proxy side to avoid going to debugger-agent everytime. (#57404)

* Caching some debugger information to avoid going to debugger-agent everytime.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

* Adding cache for generic type.

* Fix merge.

* Fixing test behavior.

* Fixing debuggerproxy.

* Fixing merge
Fixing tests.

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years agoAvoid most of the (small) regressions for seeded and derived Random instances (#57530)
Stephen Toub [Tue, 17 Aug 2021 15:07:31 +0000 (11:07 -0400)]
Avoid most of the (small) regressions for seeded and derived Random instances (#57530)

* Split Random compat implementation to address most regressions

When we introduced the new Random algorithm, we did so by factoring the old algorithm out into an implementation strategy class that is instantiated for all use other than `new Random()`.  This ends up penalizing other uses (providing a seed and/or deriving from Random) by adding more virtual dispatch than is strictly necessary, in particular for `new Random(seed)`.  This PR negates most of that (expected) regression by splitting the compat implementation in two, one class for `new Random(seed)` and one for `new DerivedRandom()`/`new DerivedRandom(seed)`; the former no longer needs to make virtual calls back out to the parent type.  The former is also one that a consumer can't really do anything to improve, whereas in the derived case, the derivation may override to provide a more optimal implementation.

* Change NextUInt64 implementation to reduce number of calls

We haven't shipped this yet, so we can change its implementation to make 3 calls instead of 8 and to delegate to a different overload of Next.

* Consolidate NextBytes to use span

2 years agoSkip CSE for non-hoistable floats (#57438)
Egor Bogatov [Tue, 17 Aug 2021 15:06:04 +0000 (18:06 +0300)]
Skip CSE for non-hoistable floats (#57438)

2 years agoAdd `zip` tool to the install list for Android tests (#57569)
Vitek Karas [Tue, 17 Aug 2021 15:00:48 +0000 (17:00 +0200)]
Add `zip` tool to the install list for Android tests (#57569)

On default WSL Ubuntu `zip` is not installed, and trying to build Android tests fails with rather cryptic errors.

2 years ago[iOS] [Android] Remove PNSE from some HttpClientHandler methods (#57555)
Steve Pfister [Tue, 17 Aug 2021 14:52:51 +0000 (10:52 -0400)]
[iOS] [Android] Remove PNSE from some HttpClientHandler methods (#57555)

Since HttpClientHandler on mobile can support both the underlying native handler and SocketsHttpHandler, it doesn't make sense to always throw PNSE on some methods due to only the native handler not supporting them.

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

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[mono] Check for additional implemented variant interfaces (#57086)
Aleksey Kliger (λgeek) [Tue, 17 Aug 2021 14:23:31 +0000 (10:23 -0400)]
[mono] Check for additional implemented variant interfaces (#57086)

* [class-setup-vtable] Use flags bitmask in check_interface_method_override

No funcitonal change yet.

* [class-setup-vtable] Check additional slots when explicitly implementing variant interfaces

If a class implements a variant interface, consider whether it is explicitly
implementing (as opposed to obtaining by being a subclass of some base class)
some variant interfaces.

Two examples:
public interface IFactory<out T> { T Get(); }
public class Foo {}
public class Bar : Foo {}
public class FooFactory : IFactory<Foo> { public Foo Get() => new Foo(); }
public class BarFactory : FooFactory, IFactory<Bar> { public new Bar Get() => new Bar(); }

In this case, BarFactory explicitly implements IFactory<Bar> and also
IFactory<Foo>.

Conversely for contravariant gparams:
interface ITaker<in T> { string Consume (T x); }
class Foo {}
class Bar : Foo {}
class BarTaker : ITaker<Bar> { public string Consume (Bar x) => "consumed Bar"; }
class FooTaker : BarTaker, ITaker<Foo> { public string Consume (Foo x) =>
"consumed Foo"; }

In this case FooTaker implements ITaker<Foo> but also ITaker<Bar>.

When this happens, the signature of the implementing method 'Bar
BarFactory:Get()' doesn't match the signature of the implemented interface
method 'Foo IFactory<Foo>:Get()'.

We should check the signature parameters of the candidate method and the
implemented method, but I think the interface setup code already checks this
for us.

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

* oops, disable vtable tracing

* Use explicit variant interface to implement base type interfaces

2 years agoFix DacHeapWalker for USE_REGIONS (#56796)
Andrew Au [Tue, 17 Aug 2021 14:18:47 +0000 (07:18 -0700)]
Fix DacHeapWalker for USE_REGIONS (#56796)

2 years ago[QUIC] QuicStream add ReadsCompleted (#57492)
Natalia Kondratyeva [Tue, 17 Aug 2021 12:22:06 +0000 (14:22 +0200)]
[QUIC] QuicStream add ReadsCompleted (#57492)

Add ReadsCompleted API that exposes ReadState=ReadsCompleted, set ReadState to ReadsCompleted if FIN flag arrives in RECEIVE event, fix ReadState changing to final stauses, expand ReadState transition description

Fixes #55707

2 years ago[main] Update dependencies from dotnet/runtime dotnet/emsdk (#57491)
dotnet-maestro[bot] [Tue, 17 Aug 2021 10:58:38 +0000 (12:58 +0200)]
[main] Update dependencies from dotnet/runtime dotnet/emsdk (#57491)

* Update dependencies from https://github.com/dotnet/runtime build 20210815.6

Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.DotNetHost , runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , System.Runtime.CompilerServices.Unsafe , System.Text.Json
 From Version 6.0.0-rc.1.21411.3 -> To Version 6.0.0-rc.1.21415.6

* Update dependencies from https://github.com/dotnet/emsdk build 20210816.1

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.1.21415.1 -> To Version 6.0.0-rc.1.21416.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoSystem.Net.NetworkInformation UnsupportedOSPlatform attributes (#57281)
Marie Píchová [Tue, 17 Aug 2021 10:44:11 +0000 (12:44 +0200)]
System.Net.NetworkInformation UnsupportedOSPlatform attributes (#57281)

* Added UnsupportedOSPlatform attributes to PNSE thowing methods

* Replaced unix with the list of OSes

2 years agoFix System.Text.Json IAsyncEnumerator disposal on cancellation (#57505)
Eirik Tsarpalis [Tue, 17 Aug 2021 10:16:27 +0000 (11:16 +0100)]
Fix System.Text.Json IAsyncEnumerator disposal on cancellation (#57505)

* Ensure WriteStack.Pending task is awaited on exception. Ensure IAsyncDisposable instances are disposed exactly once.

Fixes #57360.

* Update src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs

2 years agoMove Select_AcceptNonBlocking_Success to non-parallel collection (#57503)
Anton Firszov [Tue, 17 Aug 2021 09:13:40 +0000 (11:13 +0200)]
Move Select_AcceptNonBlocking_Success to non-parallel collection (#57503)

2 years agoRe-enable NameResolution tests on SLES, Debian 9 and Ubuntu 16.04 (#57509)
Karel Zikmund [Tue, 17 Aug 2021 08:40:14 +0000 (10:40 +0200)]
Re-enable NameResolution tests on SLES, Debian 9 and Ubuntu 16.04 (#57509)

The underlying infrastructure issue was addressed in https://github.com/dotnet/core-eng/issues/13889

Fixes #55271
Fixes #56295

2 years agodon't fail LongModuleFileNamesAreSupported test if we can't load assembly on x86...
Adam Sitnik [Tue, 17 Aug 2021 07:49:41 +0000 (09:49 +0200)]
don't fail LongModuleFileNamesAreSupported test if we can't load assembly on x86  (#57471)

2 years ago[wasm] Redesign of JS objects marshaling and lifecycle (#57098)
Pavel Savara [Tue, 17 Aug 2021 04:48:45 +0000 (06:48 +0200)]
[wasm] Redesign of JS objects marshaling and lifecycle (#57098)

* thenable and datetime cleanup

* removed ownsHandle for readability, removed AnyRef from hierarchy, removed old refcount debug code

* rename _csOwnedObjects

* rename _csOwnedObjects

* redirect to Inflight counter

* renames

* rename and move

* rename

* New+BindCoreObject -> CreateCsOwnedObject single call

* remove refcount frames

* differentiate gcHandles

* get rid of weak GCHandle

* feedback

* added MappedType enum

* naming consistency

* feedback

* rename _cs_owned_objects_by_js_handle

* split and rename files

* shouldAddInflight to more methods

* improved in-flight references

* assert for JSObject not disposed

* introduce in-flight assert

* move should_add_in_flight arg to fisrt position, so that we could bind it in convert

* doc

* cleanup

* doc

* implement fallback for missing support of FInalizationRegistry/WeakRef in onlder browsers

* feedback

* no polyfill feedback

* feedback

* name consistency feedback

* use symbols for helper fields

* feedback

2 years agoInitialize gtUseNum before use (#57256)
Kunal Pathak [Tue, 17 Aug 2021 04:35:39 +0000 (21:35 -0700)]
Initialize gtUseNum before use (#57256)

* Initialize gtUseNum

* Add test case

* catch the exceptions in test case

* kind of disable test

* try to exclude the test one more time

2 years agoAdd more Metrics API overloads taking tags (#56940)
Tarek Mahmoud Sayed [Tue, 17 Aug 2021 04:08:12 +0000 (21:08 -0700)]
Add more Metrics API overloads taking tags (#56940)

* Add more Metrics API overloads taking tags

2 years agoFix handling of new connection in MsQuicListener (#57319)
Tomas Weinfurt [Tue, 17 Aug 2021 01:35:26 +0000 (18:35 -0700)]
Fix handling of new connection in MsQuicListener (#57319)

* update

* feedback from review

2 years agoSet CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS (#57507)
Alexander Köplinger [Tue, 17 Aug 2021 01:28:31 +0000 (03:28 +0200)]
Set CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS (#57507)

* Set CMAKE_OSX_DEPLOYMENT_TARGET for all Mono AOT compilers on macOS

Not just if we're targetting iOS/tvOS/macOS since the AOT compiler for WASM or Android can run on macOS too.

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

* Use RealTargetOS if it's available

2 years agoAdd linux mariner to rolling builds for libraries tests (#57322)
Santiago Fernandez Madero [Tue, 17 Aug 2021 01:01:52 +0000 (18:01 -0700)]
Add linux mariner to rolling builds for libraries tests (#57322)

* Add linux mariner to rolling builds for libraries tests

* Adjust ChasChaPoly crypto test for mariner

* Disable tests failing on mono

2 years ago[mono][llvm] Access mono_thread_interruption_request_flag directly from llvm generate...
Zoltan Varga [Tue, 17 Aug 2021 00:18:51 +0000 (20:18 -0400)]
[mono][llvm] Access mono_thread_interruption_request_flag directly from llvm generated code, similarly to mono_polling_required. (#57263)

2 years agoCheck for OpenSSL availability for OpenSsl asymmetric primitives
Kevin Jones [Mon, 16 Aug 2021 23:52:08 +0000 (19:52 -0400)]
Check for OpenSSL availability for OpenSsl asymmetric primitives

If you attempt to use any of the *OpenSsl primitives on macOS, this will currently abort the whole process.
This changes them to check for OpenSSL's presence and throw an appropriate exception instead of aborting.

When used as an internal implementation, the aborting behavior remains.

2 years agoRevert "[mono] Fix a few corner case overflow operations (#57407)" (#57501)
Sam Patel [Mon, 16 Aug 2021 23:18:10 +0000 (19:18 -0400)]
Revert "[mono] Fix a few corner case overflow operations (#57407)" (#57501)

This reverts commit e81efc832ae56978ae26ff0dbf17cb5622cee735.

2 years agoLocalized file check-in by OneLocBuild Task (#57384)
dotnet bot [Mon, 16 Aug 2021 21:57:42 +0000 (14:57 -0700)]
Localized file check-in by OneLocBuild Task (#57384)

2 years ago[debugger][wasm] Support DebuggerProxyAttribute (#56872)
Thays Grazia [Mon, 16 Aug 2021 21:52:06 +0000 (18:52 -0300)]
[debugger][wasm] Support DebuggerProxyAttribute (#56872)

* Implementing debugger proxy

* fix compilation

* Implement debuggerproxy attribute.

* Reusing code for DebuggerProxy method and DebuggerDisplay method.

* Fix unit tests.

* Fixing unit tests that uses List<T>.

* Fix unit tests that uses List.

* Addressing @radical comments.

* Using flags enum as suggested by @lewing.

* Fixing merge.

* Addressing @radical comments.

* Addressing @radical comments.

Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years agoAccount for type mismatch of `FIELD_LIST` members in LSRA (#57450)
SingleAccretion [Mon, 16 Aug 2021 21:22:06 +0000 (00:22 +0300)]
Account for type mismatch of `FIELD_LIST` members in LSRA (#57450)

* Add the test

* Fix the bug

Assertion propagation can replace a TYP_UBYTE field
in a field list with a TYP_INT constant, so LSRA
must use the actual field type when deciding whether
an internal register to allocate must be byteable.

2 years agoQualify `sorted_table` allocation with `nothrow` (#57467)
Michal Strehovský [Mon, 16 Aug 2021 20:49:28 +0000 (05:49 +0900)]
Qualify `sorted_table` allocation with `nothrow` (#57467)

It's clearly what we intended, given the following line.

2 years agoRename transport packages to follow convention (#57504)
Viktor Hofer [Mon, 16 Aug 2021 20:18:08 +0000 (22:18 +0200)]
Rename transport packages to follow convention (#57504)

* Rename transport packages to follow convention

As agreed on in https://github.com/dotnet/windowsdesktop/pull/1936, we
want to follow a common schema when naming our transport packages.

Also updating the docs to reflect the name changes and to also
accomodate for the WindowsDesktop transport package.

* Update src.proj

* Update src.proj

2 years agoGenerate proper DWARF reg num for ARM32 (#57443)
Andrii Kurdiumov [Mon, 16 Aug 2021 19:46:26 +0000 (01:46 +0600)]
Generate proper DWARF reg num for ARM32 (#57443)

After introduction of VFP-v3 ARM S0-S31 no longer can be generated using LLVM because  numbering of registers to start from 256 and only D0-D31 are used.
So this change encode S0 as D0, S2 as D1, etc. Also use reg nums for DXX registers.
This change fix generation of CFI codes,
which trigger issue with generation of DWARF using LLVM in NativeAOT
See https://developer.arm.com/documentation/ihi0040/c/?lang=en#dwarf-register-names
See https://github.com/dotnet/runtimelab/issues/1388

2 years agoEnable System.Linq.Queryable and disable https://github.com/dotnet/runtime/issues...
Larry Ewing [Mon, 16 Aug 2021 18:49:20 +0000 (13:49 -0500)]
Enable System.Linq.Queryable and disable https://github.com/dotnet/runtime/issues/50712 (#57464)

2 years agoMark individual tests for 51211 (#57463)
Larry Ewing [Mon, 16 Aug 2021 18:43:18 +0000 (13:43 -0500)]
Mark individual tests for 51211 (#57463)

2 years agoFix Length for ReadOnlySequence created out of sliced Memory owned by MemoryManager...
Adam Sitnik [Mon, 16 Aug 2021 18:12:38 +0000 (20:12 +0200)]
Fix Length for ReadOnlySequence created out of sliced Memory owned by MemoryManager (#57479)

2 years agoAdd JsonConverter.Write/ReadAsPropertyName APIs (#57302)
Eirik Tsarpalis [Mon, 16 Aug 2021 16:46:06 +0000 (17:46 +0100)]
Add JsonConverter.Write/ReadAsPropertyName APIs (#57302)

* add JsonConverter.Write/ReadAsPropertyName APIs

* address feedback

2 years agoRemove workaround for dotnet/sdk#19482 (#57453)
Larry Ewing [Mon, 16 Aug 2021 14:31:54 +0000 (09:31 -0500)]
Remove workaround for dotnet/sdk#19482 (#57453)

2 years agoDo not drain HttpContentReadStream if the connection is disposed (#57287)
Anton Firszov [Mon, 16 Aug 2021 13:59:10 +0000 (15:59 +0200)]
Do not drain HttpContentReadStream if the connection is disposed (#57287)

Fixes #56159.

2 years ago[mono] Fix a few corner case overflow operations (#57407)
Vlad Brezae [Mon, 16 Aug 2021 13:34:10 +0000 (16:34 +0300)]
[mono] Fix a few corner case overflow operations (#57407)

* [interp] Fix a few overflow conversions

Comparison for overflow was incorrect because for example, (int8)-128.5 = -128, without overflows, even if -128.5 is smaller than the minimum integer. We use instead the float equality comparison between trunc (val) and (int)val.

* [mono][jit] Fix invalid uses of SHL instead of MUL optimization

mono_is_power_of_two is meant to be used only on unsigned numbers. In some cases we pass a signed value instead. This is typically not a problem because negative numbers are not detected as a power of two, except for the special number -2147483648, which is coded as 0x80000000, therefore a power of two.

* Enable tests

2 years agomake use of ports in SPN optional (#57159)
Tomas Weinfurt [Mon, 16 Aug 2021 10:16:07 +0000 (03:16 -0700)]
make use of ports in SPN optional (#57159)

* make port optional in SPN

* fix tests

* feedback from review

* Update src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/AuthenticationHelper.NtAuth.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* fix build

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoFixed H/3 stress server after the last Kestrel change (#57356)
Marie Píchová [Mon, 16 Aug 2021 09:02:17 +0000 (11:02 +0200)]
Fixed H/3 stress server after the last Kestrel change (#57356)

2 years agodisable a failing stress test. (#57473)
Sergey Andreenko [Mon, 16 Aug 2021 08:51:16 +0000 (01:51 -0700)]
disable a failing stress test. (#57473)

2 years agoEliminate temporary byte array allocations in the static constructor of `IPAddress...
Theodore Tsirpanis [Mon, 16 Aug 2021 04:34:59 +0000 (07:34 +0300)]
Eliminate temporary byte array allocations in the static constructor of `IPAddress`. (#57397)

2 years agoUpdate dependencies from https://github.com/dotnet/emsdk build 20210815.1 (#57447)
dotnet-maestro[bot] [Sun, 15 Aug 2021 21:17:00 +0000 (16:17 -0500)]
Update dependencies from https://github.com/dotnet/emsdk build 20210815.1 (#57447)

Microsoft.NET.Workload.Emscripten.Manifest-6.0.100
 From Version 6.0.0-rc.1.21409.2 -> To Version 6.0.0-rc.1.21415.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from mono/linker (#57344)
dotnet-maestro[bot] [Sun, 15 Aug 2021 21:14:18 +0000 (16:14 -0500)]
[main] Update dependencies from mono/linker (#57344)

* Update dependencies from https://github.com/mono/linker build 20210812.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21409.3 -> To Version 6.0.100-preview.6.21412.1

* Update dependencies from https://github.com/mono/linker build 20210813.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21409.3 -> To Version 6.0.100-preview.6.21413.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
2 years agoImprove serializer performance (#57327)
Steve Harter [Sun, 15 Aug 2021 20:30:47 +0000 (15:30 -0500)]
Improve serializer performance (#57327)

2 years ago[wasm] Don't use workload for tfm < net6.0 (#56606)
Ankit Jain [Sun, 15 Aug 2021 18:10:26 +0000 (14:10 -0400)]
[wasm] Don't use workload for tfm < net6.0 (#56606)

* Bump sdk used for testing to 6.0.100-rc.1.21402.6

* InstallWorkloadFromArtifacts: Add OnlyUpdateManifests parameter

* [wasm] Run Wasm.Build.Tests with sdk/no-workload/+EMSDK

Currently, Wasm.Build.Tests are run in two modes:

1. sdk(`$(SdkVersionForWorkloadTesting)`)+workload installed
2. sdk(from global.json)+EMSDK+LocalBuild targets

this commit changes (2) to:

2. sdk(`$(SdkVersionForWorkloadTesting)`), no workload installed, +
   EMSDK+LocalBuild targets

This makes it closer to what a user would actually use.

Also, for the workload tests, this removes `$(WasmNativeWorkload)`
always being set to `true`. The workload should be setting that, and not
the tests.

* Wasm.Build.Tests: Add test for net5.0 blazor projects

* Disable unrelated builds for now

* Revert "Disable unrelated builds for now"

This reverts commit 6fa0efe2ffcfdbcfaba3bdf519a7717809c22672.

* Rename OnlyWasmBuildTests -> TestWasmBuildTests

2 years agoSupport long module path (#57335)
Adam Sitnik [Sun, 15 Aug 2021 11:32:09 +0000 (13:32 +0200)]
Support long module path (#57335)

* Support long path

* while (true)

* Calculate new length based on array length

* Add a test

* use a smaller value to ensure that at least for DEBUG builds

we test the code path that rents a bigger array from ArrayPool

* add few extra asserts to the test to see why it fails in CI

* Assembly.LoadFile used the way this test is implemented fails on Mono

* don't run the test on Windows 7, for some reason it does not work

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* handle truncated module names, simplify the implementation and dispose tmp modules before throwing exception

* make sure that when the module is not found by the test, the test runner prints available module paths

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* polishing

Co-authored-by: NextTurn <45985406+NextTurn@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoUpdate source-index-stage1.yml (#57435)
Viktor Hofer [Sun, 15 Aug 2021 08:48:57 +0000 (10:48 +0200)]
Update source-index-stage1.yml (#57435)

Again apply https://github.com/dotnet/runtime/commit/c842beb5a94642e7ddd06e262c50f67e297ce986 as the fix was overridden in the latest Arcade update.

2 years agoFix `FileProviders.Physical.GetLastWriteTimeUtc` crash (#57415)
Maksym Koshovyi [Sun, 15 Aug 2021 00:57:36 +0000 (03:57 +0300)]
Fix `FileProviders.Physical.GetLastWriteTimeUtc` crash (#57415)

* Update PollingFileChangeToken.cs

* Return min date on fail

2 years ago[hot_reload] Allow the .ctor token to change for CustomAttribute updates (#57388)
Aleksey Kliger (λgeek) [Sat, 14 Aug 2021 23:46:48 +0000 (19:46 -0400)]
[hot_reload] Allow the .ctor token to change for CustomAttribute updates (#57388)

* [hot_reload] Allow the .ctor token to change for CustomAttribute updates.

If the "type" (really .ctor) token is a MemberRef, it won't be literally the
same token value in the update as in the baseline because Roslyn emits
additional MemberRef, TypeRef and AssemblyRef rows instead of trying to reuse
the baseline ones.

We could try to resolve the baseline and delta tokens and check that they map
to the same MonoMethod*, but that is problematic (it may trigger assembly
loading and class initialization) and also unnecessary - without the
ChangeCustomAttribute capability Roslyn will not allow edits that change the
constructor or its arguments.  So just drop the extra check.

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

* Add testcase

2 years agoILCompiler.Reflection.ReadyToRun has to target netstandard2.0 for ILSpy usage (#57416)
Andrew Au [Sat, 14 Aug 2021 22:52:27 +0000 (15:52 -0700)]
ILCompiler.Reflection.ReadyToRun has to target netstandard2.0 for ILSpy usage (#57416)

2 years agoIOException path (#57389)
Dan Moseley [Sat, 14 Aug 2021 22:25:26 +0000 (16:25 -0600)]
IOException path (#57389)

2 years ago[tests] Set the EventSourceSupport feature switch (#57374)
Radek Doulik [Sat, 14 Aug 2021 20:08:23 +0000 (22:08 +0200)]
[tests] Set the EventSourceSupport feature switch (#57374)

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

The `EventSource_ExistsWithCorrectId` test requires the event source
switch be set to true to work correctly after aggressive linking.

2 years ago[main] Update dependencies from dotnet/arcade dotnet/hotreload-utils dotnet/roslyn...
dotnet-maestro[bot] [Sat, 14 Aug 2021 18:26:10 +0000 (18:26 +0000)]
[main] Update dependencies from dotnet/arcade dotnet/hotreload-utils dotnet/roslyn-analyzers dotnet/msquic (#57402)

[main] Update dependencies from dotnet/arcade dotnet/hotreload-utils dotnet/roslyn-analyzers dotnet/msquic

2 years ago[main] Update dependencies from mono/linker (#57203)
dotnet-maestro[bot] [Sat, 14 Aug 2021 18:01:58 +0000 (13:01 -0500)]
[main] Update dependencies from mono/linker (#57203)

* Update dependencies from https://github.com/mono/linker build 20210811.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21409.3 -> To Version 6.0.100-preview.6.21411.1

* Update dependencies from https://github.com/mono/linker build 20210811.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21409.3 -> To Version 6.0.100-preview.6.21411.2

* Update dependencies from https://github.com/mono/linker build 20210811.3

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21409.3 -> To Version 6.0.100-preview.6.21411.3

* Suppress trimmer warning

* Fix warning code value

* Fix netstandard build of libs

* Revert the code fix and just fix the XML suppression

* Revert project change

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
2 years ago[wasm] Make sure the TargetOS is capitalized (#54927)
Radek Doulik [Sat, 14 Aug 2021 12:15:56 +0000 (14:15 +0200)]
[wasm] Make sure the TargetOS is capitalized (#54927)

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

The $(TargetOS) is used in $(TargetFrameworks) and is case sensitive.
Make sure it is capitalized for Browser, so that build.cmd works when
used like:

    ./build.cmd -bl -os browser -subset libs

It fixes build errors like:

    C:\r\src\libraries\shims\manual\System.forwards.cs(8,88): error CS0234: The type or namespace name 'ZLibException' does not exist in the namespace 'System.IO.Compression' (are you missing an assembly reference?) [C:\r\src\libraries\shims\manual\System.csproj]
    C:\r\src\libraries\shims\manual\System.forwards.cs(9,77): error CS0234: The type or namespace name 'CookieVariant' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [C:\r\src\libraries\shims\manual\System.csproj]
    C:\r\src\libraries\shims\manual\System.forwards.cs(10,77): error CS0234: The type or namespace name 'PathList' does not exist in the namespace 'System.Net' (are you missing an assembly reference?) [C:\r\src\libraries\shims\manual\System.csproj]

2 years agoProperly account for padding in PUTARG_SPLIT with GT_FIELD_LIST (#57279)
Jakob Botsch Nielsen [Sat, 14 Aug 2021 09:10:06 +0000 (11:10 +0200)]
Properly account for padding in PUTARG_SPLIT with GT_FIELD_LIST (#57279)

We were writing the stack part to the outgoing stack area by a loop
incrementing the offset by the written size in each iteration. However,
it is possible due to padding and optimization that the written size is
smaller than the delta to the next field. Instead, use the offset of
each field minus the offset of the first stack field to find the offset
in the outgoing arg area.

Fix #57064

2 years agoHarvest signatures of methods being compiled by the token resolver (#57366)
Tomáš Rylek [Sat, 14 Aug 2021 07:50:40 +0000 (09:50 +0200)]
Harvest signatures of methods being compiled by the token resolver (#57366)

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

I believe this is the primary fix for the issue; when a type only
ever occurs in method signatures in an assembly, never in the
implementation IL, JIT never calls resolveToken for it and so it
doesn't make it to the module token resolver table.

My investigation revealed additional potential problems in the
product around exported type resolution and the IL linker;
I described them in the issue thread but I believe this to be
both the most appropriate and the safest primary fix.

Thanks

Tomas

2 years agoAvoid finalizer race in the SslStreamNetworkStreamTests cert creation (#57381)
Jeremy Barton [Sat, 14 Aug 2021 05:01:22 +0000 (22:01 -0700)]
Avoid finalizer race in the SslStreamNetworkStreamTests cert creation (#57381)

2 years ago[libraries] Update System.Runtime.Extensions tests for iOS,MacCatalyst,tvOS (#57210)
Mitchell Hwang [Sat, 14 Aug 2021 04:54:28 +0000 (00:54 -0400)]
[libraries] Update System.Runtime.Extensions tests for iOS,MacCatalyst,tvOS (#57210)

* [libraries] Update AppDomainTests for iOS,MacCatalyst,tvOS

* Update skip reasons

* Add MacCatalyst to Case Insensitive and remove ActiveIssues

* Replace ActiveIssue with ConditionalTheory based on RemoteExecutor

* Fix test for iOS/tvOS/Catalyst

* Skip UserName test on iOS tvOS

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoFix thread pool completed work item counter to remove finalized nodes (#57305)
Koundinya Veluri [Sat, 14 Aug 2021 04:52:46 +0000 (21:52 -0700)]
Fix thread pool completed work item counter to remove finalized nodes (#57305)

* Fix thread pool completed work item counter to remove finalized nodes

- New nodes are being added to the set but finalized ones were not being removed
- This would result in double-counting the completed work item count for a thread that exits, and memory would grow over time

* Add a separate finalization helper for each node to track thread-local lifetimes

* Remove unnecessary IDisposable

* Fix nullability issues

* Update initialization of thread-local as suggested

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoAdd UnsupportedOSPlatform to RC2.Create for Android (#57289)
Kevin Jones [Sat, 14 Aug 2021 04:51:34 +0000 (00:51 -0400)]
Add UnsupportedOSPlatform to RC2.Create for Android (#57289)

* Add UnsupportedOSPlatform to RC2.Create for Android

* Add missing resource

* Reuse existing resource string

* Code review feedback

2 years agoFix compile issue with escaped characters in logging generator message (#57379)
Maryam Ariyan [Sat, 14 Aug 2021 04:49:22 +0000 (00:49 -0400)]
Fix compile issue with escaped characters in logging generator message (#57379)

2 years agoIgnore IOException in PollingFileChangeToken (#57376)
David Cantú [Sat, 14 Aug 2021 03:02:07 +0000 (20:02 -0700)]
Ignore IOException in PollingFileChangeToken (#57376)

* Ignore IOException in PollingFileChangeToken

* Don't use local method since FileStatus is a struct

* errno needs to be saved before calling InvalidateCaches

2 years agoImprove AppendLiteral for short literals (#57217)
Stephen Toub [Sat, 14 Aug 2021 02:48:00 +0000 (22:48 -0400)]
Improve AppendLiteral for short literals (#57217)

* Improve AppendLiteral for short literals

DefaultInterpolatedStringHandler.AppendLiteral is special, in that the 99.9% use case is it's called as part of string interpolation by compiler-generated code where the argument is always a literal.  That means when the method is inlined, the JIT can specialize the implementation based on knowing the literal's Length is a constant.  Which means we can provide specialized implementations for common lengths, resulting in faster and smaller code.  This does so for strings of length 1 and 2, as they're quite common in code bases examined, and it does so for both the default handler and also the handler used to format into a span.

The exact same code as before gets generated by the JIT for literals of length > 2.  The main downside here is if someone does manually call this CompilerServices method with a variable, the call site will end up bloated with the special cases.

* Address PR feedback

* Disable some CodeDom tests on mono interpreter

2 years agoimul instruction size misprediction (#57179)
Kunal Pathak [Sat, 14 Aug 2021 00:54:23 +0000 (17:54 -0700)]
imul instruction size misprediction (#57179)

* Add assert

* Remove the assert in emitInsSizeCV

* Add a check for includeRexPrefixSize

* Remove the codeSize() capping code added to fix #12840

* Make immediate only 4bytes long for non-mov instructions

* Delete a commented code

2 years agoAdd Capture.ValueSpan (#57357)
Stephen Toub [Fri, 13 Aug 2021 22:58:55 +0000 (18:58 -0400)]
Add Capture.ValueSpan (#57357)

2 years agoFix Build Failures if there are no packages produced in the release branch (#57311)
Anirudh Agnihotry [Fri, 13 Aug 2021 22:28:03 +0000 (15:28 -0700)]
Fix Build Failures if there are no packages produced in the release branch (#57311)

* no packages

* Update eng/pipelines/libraries/build-job.yml

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
* change parameter name and add main condition to running of tests

* remove package testing condition as we no longer run package testing on helix

* Update eng/pipelines/libraries/build-job.yml

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
* Update upload-intermediate-artifacts-step.yml

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
2 years agoremove non -required package downloads and package reference (#57367)
Anirudh Agnihotry [Fri, 13 Aug 2021 22:27:39 +0000 (15:27 -0700)]
remove non -required package downloads and package reference (#57367)