platform/upstream/dotnet/runtime.git
2 years agoadd gregsdennis to area-system-text-json (#67224)
Greg Dennis [Mon, 28 Mar 2022 14:23:52 +0000 (03:23 +1300)]
add gregsdennis to area-system-text-json (#67224)

2 years ago[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds...
Robin Lindner [Mon, 28 Mar 2022 14:14:09 +0000 (16:14 +0200)]
[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds, and timeouts (Group 1/3) (#64860)

2 years agox ^ 0 opt
Sychev Vadim [Mon, 28 Mar 2022 10:41:36 +0000 (13:41 +0300)]
x ^ 0 opt

2 years agoPort SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)
Egor Bogatov [Mon, 28 Mar 2022 09:47:11 +0000 (12:47 +0300)]
Port SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)

2 years agoDo not reorder HTTP header values (#65249)
feiyun0112 [Mon, 28 Mar 2022 08:51:11 +0000 (16:51 +0800)]
Do not reorder HTTP header values (#65249)

* Do not reorder HTTP header values

* fix complie error

* make the changes @ danmoseley recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* check array length

* fix unit test

* Update src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* make the changes @MihaZupan recommended

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* chang unit test

* GetParsedValueLength

* fix build error

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* unit test

* make changes @geoffkizer recommended

* CloneAndAddValue for InvalidValues

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Final nits

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
2 years agoCI matrix change: Windows (#58989)
Jan Jahoda [Mon, 28 Mar 2022 07:37:41 +0000 (09:37 +0200)]
CI matrix change: Windows (#58989)

* CI matrix change: Windows

* Remove Windows Server RS5

* Revert .net Framework change

* Add 19H1 to rolling

* Add Windows.Server.Core.20H2 to CI matrix

* Remove Windows 8.1

* Remove 20H2 as thhere is a PR for it #60054

* Typo

Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>
Co-authored-by: Andy Gocke <andy@commentout.net>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
2 years agoDon't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section...
Egor Chesakov [Sun, 27 Mar 2022 17:07:05 +0000 (10:07 -0700)]
Don't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section (#66855)

* Don't attempt to apply IMAGE_REL_BASED_REL32 when address doesn't belong to current block in src/coreclr/ToolBox/superpmi/superpmi-shared/compileresult.cpp

* Update "Exit Codes" section in the superpmi help command output

2 years agoAdd reciprocal and SinCos methods to IFloatingPoint (#59521)
Bar Arnon [Sun, 27 Mar 2022 14:34:56 +0000 (17:34 +0300)]
Add reciprocal and SinCos methods to IFloatingPoint (#59521)

2 years ago[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)
Egor Bogatov [Sat, 26 Mar 2022 21:07:40 +0000 (00:07 +0300)]
[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)

2 years agoUse generic `Enum` methods in more places. (#67147)
Theodore Tsirpanis [Sat, 26 Mar 2022 19:34:21 +0000 (21:34 +0200)]
Use generic `Enum` methods in more places. (#67147)

2 years agoFix race condition in loading assemblies with composite native images (#67000)
Tomáš Rylek [Sat, 26 Mar 2022 09:32:59 +0000 (10:32 +0100)]
Fix race condition in loading assemblies with composite native images (#67000)

I originally hit this bug when testing my Crossgen2 perf optimization
change involving only registering composite code range once but I
managed to disprove the bug was caused by this change. Indeed, it
was caused by my earlier change improving component assembly caching.

In my overzealous attempt to make sure the assembly gets always
registered I added a new method NativeImage::AddComponentAssemblyToCache
that registered the assembly which had triggered the native image load
in the first place. This was incorrect, by that point the assembly
wasn't yet fully initialized and putting it in the cache made it
visible to other threads that subsequently crashed trying to access
the assembly before it was fully loaded.

Furthermore it was unnecessary, once the assembly gets loaded, it
gets stored in the cache via the call to
SetNativeMetadataAssemblyRefInCache from ZapSig::DecodeModuleFromIndex.
Before the fix I was able to repro the bug locally typically after
about 500 iterations of the thread14 unit test, with the fix I was
unable to repro after 4500 iterations.

Thanks

Tomas

Fixes: https://github.com/dotnet/runtime/issues/66954
Probably also fixes: https://github.com/dotnet/runtime/issues/66210

2 years agoFix jit attach hang at Shutdown (#67166)
Noah Falk [Sat, 26 Mar 2022 04:52:22 +0000 (21:52 -0700)]
Fix jit attach hang at Shutdown (#67166)

Fixes #66715

We are seeing exceptions thrown at shutdown turn into hangs because the debugger
lock suspends threads at that point. We are mitigating that problem by disabling the
jit attach setup work and allowing WatsonLastChance to continue.

2 years agoFixes InvalidCastException when using other attributes (#67179)
Maryam Ariyan [Sat, 26 Mar 2022 04:27:51 +0000 (21:27 -0700)]
Fixes InvalidCastException when using other attributes (#67179)

- alongside LoggerMessageAttribute

Fixes #67167

2 years agoObsolete outdated constructors on Rfc2898DeriveBytes
Kevin Jones [Sat, 26 Mar 2022 00:27:20 +0000 (20:27 -0400)]
Obsolete outdated constructors on Rfc2898DeriveBytes

2 years agoRefactor HandleCollectionsAsync to an xunit Theory (#67126)
Eirik Tsarpalis [Fri, 25 Mar 2022 23:45:00 +0000 (23:45 +0000)]
Refactor HandleCollectionsAsync to an xunit Theory (#67126)

* Refactor HandleCollectionsAsync to a Theory

* add small buffer testing in StreamTests

* redisable test for mono/wasm platforms

2 years agoDisable multi-level lookup by default (#67022)
Elinor Fung [Fri, 25 Mar 2022 23:41:38 +0000 (16:41 -0700)]
Disable multi-level lookup by default (#67022)

2 years agoExpose the custom type marshalling types for source-generated interop. (#67052)
Jeremy Koritzinsky [Fri, 25 Mar 2022 22:54:39 +0000 (15:54 -0700)]
Expose the custom type marshalling types for source-generated interop. (#67052)

Co-authored-by: Elinor Fung <elfung@microsoft.com>
2 years agoUpdate Ubuntu version names in the workflow docs (#67169)
Andy Gocke [Fri, 25 Mar 2022 22:24:32 +0000 (15:24 -0700)]
Update Ubuntu version names in the workflow docs (#67169)

16.04 and 18.04 are out of support, but we always support the latest Ubuntu LTS

2 years agoPoC TLS resume on Linux client (#64369)
Tomas Weinfurt [Fri, 25 Mar 2022 22:08:09 +0000 (15:08 -0700)]
PoC TLS resume on Linux client (#64369)

* TLS resume on client

* shim functions introduced in 1.1.1

* add missing struct

* disable resume on old OpenSSL

* feedback from review

* fix source build

* update comment

* feedback from review

* feedback from review

* avoild client resume on old OpenSSL

2 years ago[wasm][aot] Run the high resource AOT tests on build machine itself (#67017)
Ankit Jain [Fri, 25 Mar 2022 21:32:27 +0000 (17:32 -0400)]
[wasm][aot] Run the high resource AOT tests on build machine itself (#67017)

Some library tests fail to AOT on helix by getting oomkill'ed. Since the
build machine have more resources than helix, we can AOT these specific
library tests there, and send the built output to helix to run.

Specifically:
- `System.Text.Json.SourceGeneration.Roslyn3.11.Tests`
- `System.Text.Json.SourceGeneration.Roslyn4.0.Tests`
- `System.Text.Json.Tests`
- `Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests`

This adds two new jobs to `runtime-wasm`, and for rolling builds - `LibraryTests_HighResource_AOT` for linux, and windows.

Fixes #65356
Fixes #65411
Fixes #61524
Fixes #66647

2 years agoAvoid empty array allocation in MethodBase.GetParameterTypes (#67149)
Stephen Toub [Fri, 25 Mar 2022 20:38:53 +0000 (16:38 -0400)]
Avoid empty array allocation in MethodBase.GetParameterTypes (#67149)

No parameters is very common.  Avoid a `new Type[0]` array in such cases.

2 years agoRemove some array allocations from RuntimeType.CreateInstanceImpl (#67148)
Stephen Toub [Fri, 25 Mar 2022 20:38:26 +0000 (16:38 -0400)]
Remove some array allocations from RuntimeType.CreateInstanceImpl (#67148)

- It's commonly used with zero args; we can use Type.EmptyTypes rather than new Type[0]
- It calls GetConstructors, which internally uses ListBuilder and then resizes if the created array isn't filled, but since we don't need the correctly sized array, we can just use the ListBuilder and avoid the resize
- It creates a List and then ToArray's it, but if none of the constructors are filtered out, it's better to just use the array we built up directly.

2 years ago[perf] Set job name for the performance jobs (#67124)
Ankit Jain [Fri, 25 Mar 2022 20:03:24 +0000 (16:03 -0400)]
[perf] Set job name for the performance jobs (#67124)

job.yml uses name instead of displayName to set the job's name. But perf jobs don't set that. Without this, pre-defined variables like System.PhaseName get value Job1.
This will help with differentiating builds in kusto.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.TraceSource...
Maksym Koshovyi [Fri, 25 Mar 2022 19:47:40 +0000 (21:47 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.TraceSource` (#66892)

2 years agoInfra for regeneration of third-party-notices file (#60091)
Nikola Milosavljevic [Fri, 25 Mar 2022 19:26:51 +0000 (12:26 -0700)]
Infra for regeneration of third-party-notices file (#60091)

* Infra for regeneration of third-party-notices file

* Update eng/regenerate-third-party-notices.proj

Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
* Addressing PR comments

* Updated copyright in all .cs files

* Update dotnet/liner repo name

* Add dotnet/emsdk to the list

Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
2 years agoDeduplicate project files with the same name in different folders (#64841)
Tomáš Rylek [Fri, 25 Mar 2022 19:16:08 +0000 (20:16 +0100)]
Deduplicate project files with the same name in different folders (#64841)

This is a somewhat annoying aspect hitting less than 10% of the
JIT/Methodical subtree: as the new merged wrapper logic is based
on simple assembly names, we cannot merge multiple test projects
that produce a test assembly with the same name otherwise such
assemblies stomp over each other when getting copied to the merged
wrapper folder. I have added a new option to ILTransform to include
the directory name in the project names in these cases. We can
remove some of this in the future when selectively merging actual
test source code (compiling multiple tests into a single asssembly).

Thanks

Tomas

2 years agoDelete unused native code in src/native (#67087)
Adeel Mujahid [Fri, 25 Mar 2022 19:02:35 +0000 (21:02 +0200)]
Delete unused native code in src/native (#67087)

* Delete unused native code in src/native

* Delete set_* functions from version types

2 years agoRevert "[mono][workload] Add workloads for win-arm64 using emulation (#65089)" (...
Larry Ewing [Fri, 25 Mar 2022 18:24:58 +0000 (13:24 -0500)]
Revert "[mono][workload] Add workloads for win-arm64 using emulation (#65089)" (#67154)

This reverts commit 4e7ccfa1d386670a57636231c3160c77c537d9b2.

2 years ago[mono][workload] Add workloads for win-arm64 using emulation (#65089)
Larry Ewing [Fri, 25 Mar 2022 18:22:06 +0000 (13:22 -0500)]
[mono][workload] Add workloads for win-arm64 using emulation (#65089)

* Add wasm workload for win-arm64 using emulation

* Add aliases for win-arm64 to all the win-x64 cases as well (android, ios)

2 years agoperf: Pass --dotnet-path to use dotnet-workload for wasm (#66795)
Ankit Jain [Fri, 25 Mar 2022 17:56:12 +0000 (13:56 -0400)]
perf: Pass --dotnet-path to use dotnet-workload for wasm (#66795)

This ensures that the the benchmarks project is always built with the same dotnet, avoid corrupted builds.

2 years agoFix error reporting for objects with unsupported property types (#67109)
Eirik Tsarpalis [Fri, 25 Mar 2022 16:51:11 +0000 (16:51 +0000)]
Fix error reporting for objects with unsupported property types (#67109)

* Fix error reporting for objects with unsupported property types

* refactor dictionary tests to use xunit theories

* lift test class to abstracted test harness

2 years agoJIT: block some struct promotion for OSR (#67131)
Andy Ayers [Fri, 25 Mar 2022 15:22:30 +0000 (08:22 -0700)]
JIT: block some struct promotion for OSR (#67131)

This undoes part of #65903. OSR methods can't rely solely on their own analysis
for struct promotion as they only see parts of methods.

2 years agoDisable multimodule test (#67137)
Michal Strehovský [Fri, 25 Mar 2022 15:07:42 +0000 (00:07 +0900)]
Disable multimodule test (#67137)

* Disable multimodule test

Can't use issues.targets because this is a compile failure and compilation runs during test build, not execution.

* Update MultiModule.csproj

2 years agoStabilize summary blobs (#67086)
Michal Strehovský [Fri, 25 Mar 2022 15:06:35 +0000 (00:06 +0900)]
Stabilize summary blobs (#67086)

I was trying to repro #66191 and assumed determinism is the root cause. I used `CoreRT_DeterminismSeed` to perturb the dependency node evaluation and it found differences.

Now, I don't think the differences really matter. We already seem to be deterministic in the multithreaded compilation (the outputs are always the same no matter how many times I try).

`CoreRT_DeterminismSeed` perturbs the order in which node dependencies are evaluated and that exposes more ordering issues than we practically have.

In normal multithreaded compilation we grab nodes in different order from the `NodeFactory` as part of method compilation, but the order in which those nodes are evaluated is still fixed. This means the nodes we grabbed are still getting marked in a deterministic order and we get stable ordering even without an explicit sort in this spot.

But maybe as part of https://github.com/dotnet/runtimelab/issues/1631 we should enable `CoreRT_Determinism` in our testing and for that we need this extra sorting.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.Debug` (...
Maksym Koshovyi [Fri, 25 Mar 2022 13:38:06 +0000 (15:38 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.Debug` (#66862)

Related to #43605

2 years agoAdd tighter bound to range check for matching Regex char classes (#67133)
Stephen Toub [Fri, 25 Mar 2022 12:40:06 +0000 (08:40 -0400)]
Add tighter bound to range check for matching Regex char classes (#67133)

When we emit a bitmap lookup for character classes containing only ASCII characters, we currently bound the check by 128, e.g.
```C#
if (ch < 128 && lookupTable[...])
```
but we can easily lower that 128 to instead be the actual exclusive upper bound based on the char set.  Doing so means we don't need to hit the lookup table for a larger set of characters.

(We could also actually shrink the size of the lookup table itself, but doing so would only save a few bytes, and it didn't seem worth the complexity right now.  We could also add a lower range check, but that's also additional checks to execute whereas this one is just improving an existing check that's also required for correctness.)

2 years agoEnable CA1822 (Mark members as static) analyzer (#66333)
Marek Safar [Fri, 25 Mar 2022 11:06:33 +0000 (12:06 +0100)]
Enable CA1822 (Mark members as static) analyzer (#66333)

2 years agoDon't throw PNSE on QuicImplementationProvider.IsSupported (#67036)
Radek Zikmund [Fri, 25 Mar 2022 10:37:41 +0000 (11:37 +0100)]
Don't throw PNSE on QuicImplementationProvider.IsSupported (#67036)

2 years ago[mono][wasm] Store the exception object in a GC handle while it is being thrown....
Zoltan Varga [Fri, 25 Mar 2022 07:34:40 +0000 (03:34 -0400)]
[mono][wasm] Store the exception object in a GC handle while it is being thrown. (#67121)

2 years agoExclude throwinnestedtrycatch_il_r from Arm runs (#67122)
Kunal Pathak [Fri, 25 Mar 2022 01:53:26 +0000 (18:53 -0700)]
Exclude throwinnestedtrycatch_il_r from Arm runs (#67122)

2 years agoReplace bool[] arrays with Span<bool> in XML deserialization (#66914)
Stephen Toub [Fri, 25 Mar 2022 01:38:46 +0000 (21:38 -0400)]
Replace bool[] arrays with Span<bool> in XML deserialization (#66914)

The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array.  We can instead stackalloc that for a reasonable number of properties.

2 years agoFix link and clarify how community members can edit notifications without portal...
Dan Moseley [Fri, 25 Mar 2022 01:24:15 +0000 (19:24 -0600)]
Fix link and clarify how community members can edit notifications without portal (#67073)

2 years agoAdd dynamic shim for SSL_CTX_set_options and SSL_set_options
Radek Zikmund [Fri, 25 Mar 2022 00:30:08 +0000 (01:30 +0100)]
Add dynamic shim for SSL_CTX_set_options and SSL_set_options

This works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
2 years agoEnable localization for LibraryImportGenerator (#67107)
Elinor Fung [Thu, 24 Mar 2022 23:21:51 +0000 (16:21 -0700)]
Enable localization for LibraryImportGenerator (#67107)

2 years agoImplement {Try}HashData on asymmetric algorithms
Kevin Jones [Thu, 24 Mar 2022 21:09:22 +0000 (17:09 -0400)]
Implement {Try}HashData on asymmetric algorithms

Historically, the asymmetric algorithm base classes have had the hashing routines as abstract (or virtual+throw).

Now the base classes provide an implementation for these methods, reducing the amount of redundant effort on the part of derived types.

2 years agoFix typo in a summary comment in SharedAttribute (#67120)
Dan Roberts [Thu, 24 Mar 2022 20:39:13 +0000 (20:39 +0000)]
Fix typo in a summary comment in SharedAttribute (#67120)

2 years ago[Android] Re-enable System.Security.Cryptography tests (#67057)
Steve Pfister [Thu, 24 Mar 2022 19:36:42 +0000 (15:36 -0400)]
[Android] Re-enable System.Security.Cryptography tests (#67057)

The crypto test suites were originally disabled as they would run out of memory on both emulators and devices somewhat frequently.

This change enables them again, with the difference being that xunit will run tests on a single thread.

Addresses #62547

2 years agoAvoid issuing connection attempts for already cancelled requests (#66992)
Miha Zupan [Thu, 24 Mar 2022 19:25:12 +0000 (12:25 -0700)]
Avoid issuing connection attempts for already cancelled requests (#66992)

* Avoid issuing connection attempts for already canceled requests

* Cancelled => Canceled

* Guard SocketsHttpHandler tests under SocketsHttpHandler.IsSupported

2 years agoDelete AssemblyBuilderData and ModuleBuilderData (#66996)
Jan Kotas [Thu, 24 Mar 2022 18:47:43 +0000 (11:47 -0700)]
Delete AssemblyBuilderData and ModuleBuilderData (#66996)

There is no good reason for these to be separate types.

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2 years agoDelete custom cmake config cache mechanism on Unix (#64370)
Adeel Mujahid [Thu, 24 Mar 2022 18:33:45 +0000 (20:33 +0200)]
Delete custom cmake config cache mechanism on Unix (#64370)

When cmake configuration fails due to missing dependency or manually terminated in the middle (Ctrl+C) for some reason, re-running the build command fails with these messages:

```
  CMake command line is unchanged. Reusing previous cache instead of regenerating.
  Unable to find generated build files for "native libraries component" project!
```

The workaround is to delete artifacts directory and rerun the build command, which is wasteful (as it repreforms all the previous steps including rebuilding the previous subsets). cmake has its own up-to-date caching mechanism which works well on Unix (it has some issues on Windows/MSBuild), so deleting the custom sentinel-based cache on Unix makes it more robust and saves some time. The one in `gen-buildsys.cmd` for Windows is kept intact.

2 years ago[main] Update dependencies from dotnet/xharness dotnet/msquic (#67094)
dotnet-maestro[bot] [Thu, 24 Mar 2022 18:19:44 +0000 (19:19 +0100)]
[main] Update dependencies from dotnet/xharness dotnet/msquic (#67094)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from dotnet/linker (#66985)
dotnet-maestro[bot] [Thu, 24 Mar 2022 18:17:10 +0000 (19:17 +0100)]
[main] Update dependencies from dotnet/linker (#66985)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix loop cloning for OSR (#67067)
Bruce Forstall [Thu, 24 Mar 2022 17:18:03 +0000 (10:18 -0700)]
Fix loop cloning for OSR (#67067)

Fix a previously unused piece of code to handle a loop cloning case
where the `head` block of a loop branches to the entry block.

2 years ago[mono] Ensure exception_message points to a string (#66991)
Stefan Schulze Frielinghaus [Thu, 24 Mar 2022 13:39:08 +0000 (14:39 +0100)]
[mono] Ensure exception_message points to a string (#66991)

2 years agoEnsure Sync stream serialization is handling IAsyncEnumerable correctly (#67035)
Eirik Tsarpalis [Thu, 24 Mar 2022 13:26:46 +0000 (13:26 +0000)]
Ensure Sync stream serialization is handling IAsyncEnumerable correctly (#67035)

* Fix #66687

* enable small buffer async tests for collections

2 years agoUpdate the latest node (#67060)
Kevin Jones [Thu, 24 Mar 2022 13:07:08 +0000 (09:07 -0400)]
Update the latest node (#67060)

2 years agoFix #66727. (#67041)
Eirik Tsarpalis [Thu, 24 Mar 2022 13:06:32 +0000 (13:06 +0000)]
Fix #66727. (#67041)

2 years agoUse stackalloc in NumberFormatterBase (#67003)
Trayan Zapryanov [Thu, 24 Mar 2022 12:46:37 +0000 (14:46 +0200)]
Use stackalloc in NumberFormatterBase (#67003)

Co-authored-by: Trayan Zapryanov <Traian.Zaprianov@docuware.com>
2 years agoFix entry point for EnumPrinters (#67081)
Elinor Fung [Thu, 24 Mar 2022 12:14:34 +0000 (05:14 -0700)]
Fix entry point for EnumPrinters (#67081)

2 years agoAdd timestamp-based expiration to cached SafeFreeCredentials (#66334)
Radek Zikmund [Thu, 24 Mar 2022 12:03:10 +0000 (13:03 +0100)]
Add timestamp-based expiration to cached SafeFreeCredentials (#66334)

* Add Expiry timestamp on SafeFreeCredentials handle

* Recalculate expiration timestamp based on CertificateContext

* Fix case when user provides CertificateContext

2 years agoCoreCLR runtime tests on Mono Windows x64. (#64281)
Johan Lorensson [Thu, 24 Mar 2022 07:54:35 +0000 (08:54 +0100)]
CoreCLR runtime tests on Mono Windows x64. (#64281)

Fixed and enabled CoreCLR runtime tests running on Mono Windows x64.

2 years ago[main] Update dependencies from 8 repositories (#66826)
dotnet-maestro[bot] [Thu, 24 Mar 2022 06:45:05 +0000 (23:45 -0700)]
[main] Update dependencies from 8 repositories (#66826)

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

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , 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.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22166.1 -> To Version 2.5.1-beta.22167.4

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220317.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22167.1

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

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , 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.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22166.1 -> To Version 2.5.1-beta.22168.2

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220318.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22168.1

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

runtime.native.System.IO.Ports , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json , Microsoft.NET.Sdk.IL
 From Version 7.0.0-preview.3.22163.2 -> To Version 7.0.0-preview.3.22171.1

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

Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.TargetFramework , 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.XUnitExtensions , Microsoft.DotNet.GenAPI , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.GenFacades , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk
 From Version 2.5.1-beta.22166.1 -> To Version 2.5.1-beta.22171.2

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22157.1 -> To Version 7.0.0-preview.4.22171.4

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220321.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.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22166.2 -> To Version 7.0.0-beta.22171.1

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.3.22167.1 -> To Version 7.0.0-preview.4.22171.3

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20220321.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.22164.2 -> To Version 1.0.2-alpha.0.22171.1

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-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 , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22164.2 -> To Version 11.1.0-alpha.1.22171.2

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

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.3.22121.1 -> To Version 7.0.0-preview.4.22172.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22121.1 -> To Version 7.0.0-preview.4.22172.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220322.1

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22172.1

* Revert changes from Roslyn-Analyzers

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
2 years agoImprove vectorization of String.Split (#64899)
Jesper Meyer [Thu, 24 Mar 2022 02:02:01 +0000 (03:02 +0100)]
Improve vectorization of String.Split (#64899)

2 years agoUpdate coding-style to include target-typed new() guideline (#67061)
Eric Erhardt [Thu, 24 Mar 2022 00:54:51 +0000 (19:54 -0500)]
Update coding-style to include target-typed new() guideline (#67061)

* Update coding-style to include target-typed new guideline

Similar to `var` usage, `new()` usage is only allowed when the Type can be understood from the same line.

Fix #53369

* Fix coding style violations

2 years agoAdd a --aot-lazy-assembly-load command line option to load assemblies… (#67024)
Zoltan Varga [Thu, 24 Mar 2022 00:45:31 +0000 (20:45 -0400)]
Add a --aot-lazy-assembly-load command line option to load assemblies… (#67024)

* Add a --aot-lazy-assembly-load command line option to load assemblies referenced by AOT images lazily.

Note that this requires the assemblies used at AOT time to exactly match
the assemblies loaded at runtime, otherwise the runtime will abort
when it loads the mismatching reference.

* Handle the options added by options.h in mono_jit_parse_options ().

2 years agoEat cancellation exceptions from WaitAsync in Parallel.ForEachAsync (#66712)
Stephen Toub [Wed, 23 Mar 2022 22:40:09 +0000 (18:40 -0400)]
Eat cancellation exceptions from WaitAsync in Parallel.ForEachAsync (#66712)

We can safely ignore cancellation exceptions due to WaitAsync being canceled.  They do not represent work that was started and interrupted, and we know exactly the source of the exception (as compared to if the exception emerged from either MoveNextAsync or the loop body).

2 years ago[mono] Optimize generic sharing for generic methods. (#64129)
Zoltan Varga [Wed, 23 Mar 2022 22:18:48 +0000 (18:18 -0400)]
[mono] Optimize generic sharing for generic methods. (#64129)

* [mono] Optimize generic sharing for generic methods.

  Previously, rgctx entries where stored either in the class rgctx
or the method rgctx in linked structures, and accessed using
rgctx trampolines (for non-llvmonly configuration), or
inline code and fallback C code (for llvmonly configuration).
However, if a method has an mrgctx parameter, all the rgctx entries
can be stored as an array in the mrgctx and accessed using a simple
load.
One complication is that the mrgctx might need to be allocated before
the method is compiled/loaded, so the rgctx entries need to be stored
in a separate array, and the array needs to be initialized on
demand.

* Add an 'entries' field to MonoMethodRuntimeGenericContext which stores
the rgctx entries.
* Add a MonoGSharedMethodInfo structure which stores the information
needed to initialize a MonoMethodRuntimeGenericContext, i.e. the
number of rgctx entries and their contents.
* Add a MONO_PATCH_INFO_GSHARED_METHOD_INFO patch type to refer
to the previous structure.
* Add a mini_init_method_rgctx () JIT icall, which initializes
an mrgctx if needed and generate code in the prolog of gshared methods
to call it.

* [mono] Pass an mrgctx to static/valuetype gshared methods.

Previously, these methods were passed a vtable. Passing the mrgctx
instead simplifies some runtime code and allows smaller/faster access to
rgctx entries.

* Add rgctx trampolines in get_ftnptr_for_method ().

* [mono][wasm] Avoid AOTing Microsoft.CodeAnalysis.dll as well.

2 years agoUpdate EventSourceLogger.cs (#67065)
Maksym Koshovyi [Wed, 23 Mar 2022 22:07:07 +0000 (00:07 +0200)]
Update EventSourceLogger.cs (#67065)

2 years agoRemove unnecessary XmlQualifiedName allocations from XsdBuilder.ProcessElement/Attrib...
Stephen Toub [Wed, 23 Mar 2022 22:02:11 +0000 (18:02 -0400)]
Remove unnecessary XmlQualifiedName allocations from XsdBuilder.ProcessElement/Attribute (#67045)

2 years agoAvoid bool[] allocation in MemberInfoCache.PopulateProperties (#66912)
Stephen Toub [Wed, 23 Mar 2022 22:01:33 +0000 (18:01 -0400)]
Avoid bool[] allocation in MemberInfoCache.PopulateProperties (#66912)

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventSource...
Maksym Koshovyi [Wed, 23 Mar 2022 21:02:09 +0000 (23:02 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventSource` (#66802)

* Annotate src

* Annotate ref

* Make internal parameters non-nullable if they never receive null

2 years agoRemove libunwind disabled warnings. (#67042)
Aaron Robinson [Wed, 23 Mar 2022 20:51:27 +0000 (16:51 -0400)]
Remove libunwind disabled warnings. (#67042)

2 years ago[resubmit] BigInteger parsing optimization for large decimal string (#55121)
keymoon [Wed, 23 Mar 2022 20:36:27 +0000 (05:36 +0900)]
[resubmit] BigInteger parsing optimization for large decimal string (#55121)

* implement divide-and-conquer method for parsing digits

* fix argument order in Assert when x equals to 0

* Apply format fix

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* add test for non-naive algorithm

* add description for naiveThreshold

* fix trivial part

* add check for boundary condition

* add assertions and descriptions

* change variable name

* remove inappropreate use of var

* to use ArrayPool<int>.Shared.Rent for newBuffer allocation

* move both algorithms to separate methods

* add and fix comments

* trivial fix

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoEnsure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if...
Tanner Gooding [Wed, 23 Mar 2022 20:35:33 +0000 (13:35 -0700)]
Ensure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if the ISA is unsupported (#66853)

* Ensure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if the ISA is unsupported

* Ensure fgMorphFieldToSimdGetElement is correctly checking for AdvSimd support on Arm64

* Ensure impExpandHalfConstEqualsSIMD checks for baseline simd support

2 years agoImprove nullable annotations for `ILogger.BeginScope` (#66960)
Maksym Koshovyi [Wed, 23 Mar 2022 18:35:24 +0000 (20:35 +0200)]
Improve nullable annotations for `ILogger.BeginScope` (#66960)

* BeginScope can return a null IDisposable. And TState is not nullable.

2 years agoGive end-marker symbols their own addresses to work around a linker bug (#66999)
Jakob Botsch Nielsen [Wed, 23 Mar 2022 17:13:00 +0000 (18:13 +0100)]
Give end-marker symbols their own addresses to work around a linker bug (#66999)

It seems there is a linker bug related to control-flow guard that is
causing #66969. In eb8460f a thunktemplates.asm file was added that has
a LEAF_END_MARKED at the end of the file. This creates two symbols for
the same upcoming address. Normally that should be fine, but in this
case it causes the linker to place the same address twice in a CFG table
in the PE file. This causes the kernel to fail while loading the image.

A simple workaround would be to add a nop at the end of
thunktemplates.asm, but @janvorli suggested giving these symbols their
own address in all cases for goodness when debugging. We already do so
for Windows x64 it looks like.

Fix #66969

2 years agoImproves handling of env prefixes containing __ (#65757)
David Edey [Wed, 23 Mar 2022 16:38:15 +0000 (16:38 +0000)]
Improves handling of env prefixes containing __ (#65757)

Both the un-altered and colon-normalized prefixes now match
environment variables in either the __ or colon formats.

The change includes minor refactors to
the EnvironmentVariablesConfigurationProvider
to make the code easier to follow and reduce the likelihood
of future regressions.

Test naming has been made clearer, and a comprehensive test
has been added.

Fix #65756

2 years agoAdd Fedora 37 RID (#67021)
Omair Majid [Wed, 23 Mar 2022 16:33:41 +0000 (12:33 -0400)]
Add Fedora 37 RID (#67021)

Fedora 37 has now started development, and the distribution now
identifies itself as Fedora 37 instead of Fedora 36:
https://fedorapeople.org/groups/schedule/f-37/f-37-key-tasks.html

This is a forward-port of https://github.com/dotnet/runtime/pull/65392

2 years agoAdd the CustomTypeMarshallerAttribute type to make it easier to identify marshaller...
Jeremy Koritzinsky [Wed, 23 Mar 2022 16:06:32 +0000 (09:06 -0700)]
Add the CustomTypeMarshallerAttribute type to make it easier to identify marshaller types (#65591)

2 years agoChange CoreCLR diagnostic resource production to remove cross-component build depende...
Jeremy Koritzinsky [Wed, 23 Mar 2022 16:05:54 +0000 (09:05 -0700)]
Change CoreCLR diagnostic resource production to remove cross-component build dependency (#67018)

2 years agoWorkaround NuGet error in Content_Types (#66744)
Eric StJohn [Wed, 23 Mar 2022 15:13:36 +0000 (08:13 -0700)]
Workaround NuGet error in Content_Types (#66744)

2 years agoDelete System.Runtime.Experimental leftovers (#66819)
Viktor Hofer [Wed, 23 Mar 2022 15:12:34 +0000 (16:12 +0100)]
Delete System.Runtime.Experimental leftovers (#66819)

* Delete System.Runtime.Experimental leftovers

e34e8dd85e7ffaaad8c884de0967cb8d845af5c6 merged the API surface of System.Runtime.Experimental inbox and deleted the project and the package. Hence we should delete leftovers that reference it.

* Update System.Runtime.csproj

2 years agoRemove delegate/closure allocations from DynamicAssemblies.IsTypeDynamic (#66797)
Stephen Toub [Wed, 23 Mar 2022 15:03:21 +0000 (11:03 -0400)]
Remove delegate/closure allocations from DynamicAssemblies.IsTypeDynamic (#66797)

2 years ago[mono][interp] Enable some tests (#66947)
Vlad Brezae [Wed, 23 Mar 2022 14:46:56 +0000 (16:46 +0200)]
[mono][interp] Enable some tests (#66947)

* [mono][interp] Enable all IL_Conformance tests

* [mono][interp] Enable tests

* [mono][interp] Enable test

* [tests] Fix ckfinite test

According to spec, ckfinite can throw ArithmeticException. CoreCLR throws OverflowException while mono throws ArithmeticException. Change test to catch all ArithmeticExceptions.

2 years agoReject mismatched symbol files (#67027)
Michal Strehovský [Wed, 23 Mar 2022 13:28:59 +0000 (22:28 +0900)]
Reject mismatched symbol files (#67027)

`UnmanagedPdbSymbolReader` will already perform a GUID check that rejects mismatched symbol files. Do the same for the portable symbol reader.

2 years agoBetter approach (#66902)
Egor Bogatov [Wed, 23 Mar 2022 11:54:20 +0000 (14:54 +0300)]
Better approach (#66902)

2 years agoAvoid an extra copy of T inside System.Diagnostics.Enumerator<T>. (#67012)
Mikel Blanchard [Wed, 23 Mar 2022 05:05:46 +0000 (22:05 -0700)]
Avoid an extra copy of T inside System.Diagnostics.Enumerator<T>. (#67012)

2 years agoSupport using the system version of brotli (#66462)
Omair Majid [Wed, 23 Mar 2022 03:49:50 +0000 (23:49 -0400)]
Support using the system version of brotli (#66462)

This is mainly motivated by the March 2022 release of .NET 5. .NET 5 was
found to be vulnerable to CVE-2020-8927, which was caused by the older
version of brotli built into .NET. .NET was vulernable even in
environments where a system-wide version of brotli was present and had
already received fixes for this CVE. We could have avoided a Remote Code
Execution vulnerability in such environments by using the system's
version of brotli.

This is similar to the existing support for disabling distro-agnostic
OpenSSL (except no OpenSSL is embedded) and using the system libunwind
(a copy of libunwind is embedded this repo).

One small twist is the presence of entrypoint verification. In a
system-brotli build, the verification fails, because the built library,
libSystem.IO.Compression.Native.so, doesn't include the symbols for
Brotli. Those symbols are instead used from the system brotli libraries.

2 years agoDelete create-codespaces-prebuild.yml (#67015)
Andy Gocke [Wed, 23 Mar 2022 03:44:24 +0000 (20:44 -0700)]
Delete create-codespaces-prebuild.yml (#67015)

* Delete create-codespaces-prebuild.yml

* Remove reference to the prebuild action and link to the codespaces doc instead.

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
2 years agoBump PreReleaseVersionIteration to 4 (#66962)
Carlos Sanchez [Tue, 22 Mar 2022 23:55:12 +0000 (16:55 -0700)]
Bump PreReleaseVersionIteration to 4 (#66962)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoFix revocation processing on expired chains.
Jeremy Barton [Tue, 22 Mar 2022 22:30:17 +0000 (15:30 -0700)]
Fix revocation processing on expired chains.

When adding tracing to the Linux X509Chain build, the "when do we process revocation" check got cleaned up to avoid doing wasteful work. But it got cleaned a bit too aggressively.

With this change, fully-valid and valid-except-for-validity chains will both move into active revocation checks.

2 years ago[mono] Remove the llvmonly exception handling code, its not used any more. (#66875)
Zoltan Varga [Tue, 22 Mar 2022 21:10:50 +0000 (17:10 -0400)]
[mono] Remove the llvmonly exception handling code, its not used any more. (#66875)

2 years agoConsolidate sync/async JsonSerializer test abstractions (#66729)
Eirik Tsarpalis [Tue, 22 Mar 2022 21:07:37 +0000 (21:07 +0000)]
Consolidate sync/async JsonSerializer test abstractions (#66729)

* Consolidate sync/async JsonSerializer test abstractions

* Rename wrapper properties

2 years agoRemove OfType/ToArray usage from ReflectTypeDescriptionProvider (#66949)
Stephen Toub [Tue, 22 Mar 2022 21:05:50 +0000 (17:05 -0400)]
Remove OfType/ToArray usage from ReflectTypeDescriptionProvider (#66949)

2 years agoRelease `CordbUnmanagedThread` instance from `CordbProcess` member (#66910)
Aaron Robinson [Tue, 22 Mar 2022 19:00:35 +0000 (15:00 -0400)]
Release `CordbUnmanagedThread` instance from `CordbProcess` member (#66910)

* Release CordbUnmanagedThread from CordbProcess member

The m_lastDispatchedIBEvent was not being cleared during shutdown, which was causing a memory leak assert to fire.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoRelease `CordbUnmanagedThread` instance from `CordbProcess` member (#66910)
Aaron Robinson [Tue, 22 Mar 2022 19:00:14 +0000 (15:00 -0400)]
Release `CordbUnmanagedThread` instance from `CordbProcess` member (#66910)

* Release CordbUnmanagedThread from CordbProcess member

The m_lastDispatchedIBEvent was not being cleared during shutdown, which was causing a memory leak assert to fire.

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years ago[wasm] Emscripten 3.1.1 bump (#63894)
Radek Doulik [Tue, 22 Mar 2022 17:25:01 +0000 (18:25 +0100)]
[wasm] Emscripten 3.1.1 bump (#63894)

* Initial changes for emscripten 2.0.34

* Use emcc-link.rsp in build targets

* Use updated docker images

* Fix compiler warnings

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
* Put `--profiling-funcs` to `_EmccLinkFlags`

* Fix build

    src/mono/mono/mini/mini-runtime.c:3407:25: error: ‘invoke’ undeclared (first use in this function); did you mean ‘revoke’?
       3407 |                         invoke = mono_marshal_get_runtime_invoke_dynamic ();

* Add shell to the environment

Environment setting https://github.com/emscripten-core/emscripten/blob/2.0.34/src/settings.js#L616-L641

From emscripten 2.0.25 release notes

    - Support for the 'shell' environment is now disabled by default.  Running under
      `d8`, `js`, or `jsc` is not something that most emscripten users ever want to
      do, so including the support code is, more often than not, unnecessary.  Users
      who want shell support can enable it by including 'shell' in `-s ENVIRONMENT`
      (#14535).

Example of the the size increase for bench sample:

    -a---          12/10/2021  3:35 PM         382113 dotnet.js
    -a---          12/13/2021 10:37 AM         383589 dotnet.js

* Add emcc-link.rsp to PlatformManifestFileEntry

* Feedback

https://github.com/emscripten-core/emscripten/blob/2fda25eea756c78c8cb024aa5b6c2b188bf7990f/src/settings.js#L1173-L1176

-s EXPORT_ES6 is link option

* Bump emscripten version

* Bump llvm package version and use its libclang

* Use newer docker images with emscripten 3.1.1

* Remove unused variable

* Add note about icu repo

* Add comment to improve code readability

* Bump the ICU and emsdk versions

* disable non-wasm builds

* disable wasm jobs in runtime, and runtime-staging, as we'll be running runtime-wasm manually

* [wasm] Re-enable tests that were disabled due to the earlier emsdk bump

System.Linq.Tests.csproj: https://github.com/dotnet/runtime/issues/64774

System.Text.Json.Tests.csproj: https://github.com/dotnet/runtime/issues/64775

System.Text.RegularExpressions.Tests.csproj: https://github.com/dotnet/runtime/issues/64769

System.Threading.Channels.Tests.csproj: https://github.com/dotnet/runtime/issues/65012

System.Collections.Immutable.Tests.csproj: https://github.com/dotnet/runtime/issues/65335

* [wasm] Disable nodejs tests

They are still unstable, and fail with:

```
[01:27:29] fail: /datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97
[01:27:29] fail: if (typeof globalThis.crypto === 'undefined') {
[01:27:29] fail: ^
[01:27:29] fail:
[01:27:29] fail: ReferenceError: globalThis is not defined
[01:27:29] fail:     at Object.<anonymous> (/datadisks/disk1/work/A3DA08F7/w/B1B30976/e/test-main.js:97:1)
[01:27:29] fail:     at Module._compile (internal/modules/cjs/loader.js:778:30)
[01:27:29] fail:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
[01:27:29] fail:     at Module.load (internal/modules/cjs/loader.js:653:32)
[01:27:29] fail:     at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
[01:27:29] fail:     at Function.Module._load (internal/modules/cjs/loader.js:585:3)
[01:27:29] fail:     at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
[01:27:29] fail:     at startup (internal/bootstrap/node.js:283:19)
[01:27:29] fail:     at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
```

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

* fix wbt build

* Update path to node in helix commands.

* disable non-wasm builds

* [wasm] Make emscripten version mismatch an error on CI

* Bump emscripten packages used to preview3, which has emsdk 3.1.1

* Update emscripten package version in Versions.props tooo

* Re-enable wasm jobs

* enable non-wasm jobs

* Add more missing exports

* __dl_seterr shouldn't be needed

* Fix MicrosoftNETCoreRuntimeICUTransportVersion

* Put back the 3.1.1 docker images after merge

* Revert "fix wbt build"

This reverts commit f7c77d995e36130118dd9d98c2c66809aaf42fe2.

* Revert "[wasm] Disable nodejs tests"

This reverts commit 7b90965638b7e90bf4d35c69696f2f361a04ef20.

* Use newer ICU package, last that still had 3.1.1

* Try different helix queue parameter

* Revert "Try different helix queue parameter"

This reverts commit a34230f7fe04760df30c5e63e14826575f1a7545.

* Fix helix queue with docker tag

* Try to set PYTHONPATH for emscripten

* [wasm] Do not set _WasmDevel=true for blazor projects

* Increase timeout

The AOT tests are canceled after timeout

* Fix WBT tests

Co-authored-by: Ankit Jain <radical@gmail.com>
* [wasm] Export more functions

`htons,ntohs,_get_daylight,_get_timezone,_get_tzname`

.. to fix:

```
EXEC : warning : undefined symbol: htons (referenced by $inetPton6__deps: ['htons','$jstoi_q'], referenced by $writeSockaddr__deps: ['$Sockets','$inetPton4','$inetPton6','$zeroMemory'], referenced by __syscall_accept4__deps: ['$getSocketFromFD','$writeSockaddr','$DNS','$SYSCALLS'], referenced by top-level compiled C/C++ code) [C:\helix\work\workitem\e\publish\ProxyProjectForAOTOnHelix.proj]
EXEC : warning : undefined symbol: ntohs (referenced by $inetNtop6__deps: ['$inetNtop4','ntohs'], referenced by $readSockaddr__deps: ['$Sockets','$inetNtop4','$inetNtop6','ntohs'], referenced by $getSocketAddress__deps: ['$readSockaddr','$FS','$DNS'], referenced by __syscall_bind__deps: ['$getSocketFromFD','$getSocketAddress','$SYSCALLS'], referenced by top-level compiled C/C++ code) [C:\helix\work\workitem\e\publish\ProxyProjectForAOTOnHelix.proj]
EXEC : warning : undefined symbol: _get_daylight (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code) [C:\helix\work\workitem\e\publish\ProxyProjectForAOTOnHelix.proj]
EXEC : warning : undefined symbol: _get_timezone (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code) [C:\helix\work\workitem\e\publish\ProxyProjectForAOTOnHelix.proj]
EXEC : warning : undefined symbol: _get_tzname (referenced by tzset_impl__deps: ['_get_daylight','_get_timezone','_get_tzname'], referenced by tzset__deps: ['tzset_impl'], referenced by localtime_r__deps: ['tzset'], referenced by top-level compiled C/C++ code) [C:\helix\work\workitem\e\publish\ProxyProjectForAOTOnHelix.proj]
```

```
Starting:    Microsoft.Extensions.Logging.Tests.dll
Message1
:
testKey3:testValue, testKey2:, testKey1:
missing function: ntohs
Error
    at Object.onAbort (test-main.js:176:60)
    at abort (./dotnet.js:1316:24)
    at _ntohs (./dotnet.js:4990:35)
    at readSockaddr (./dotnet.js:5091:18)
    ...
```

* fix exported function names

Co-authored-by: Radek Doulik <radekdoulik@google.com>
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Marek Fišera <mara@neptuo.com>
2 years agoFix heap walking with global allocation context (#66844)
Andrew Au [Tue, 22 Mar 2022 17:06:49 +0000 (10:06 -0700)]
Fix heap walking with global allocation context (#66844)

2 years agoFix #41618 Correct marshalling of SortKey objects on Linux (#65548)
Luca Leonardo Scorcia [Tue, 22 Mar 2022 16:41:33 +0000 (17:41 +0100)]
Fix #41618 Correct marshalling of SortKey objects on Linux (#65548)

2 years agoInclude method instantiation MethodTables in compilation (#66984)
Michal Strehovský [Tue, 22 Mar 2022 14:38:09 +0000 (23:38 +0900)]
Include method instantiation MethodTables in compilation (#66984)

* Include method instantiation MethodTables in compilation

We'll need to load the `MethodTable` so that we can search for it in GVM tables.

* Regression test