116439 Commits
Author SHA1 Message Date
Tomáš Rylek a2448b0240 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
2022-03-26 10:32:59 +01:00
Noah Falk a30a2510c9 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.
2022-03-25 22:52:22 -06:00
Maryam Ariyan 0713627a3b Fixes InvalidCastException when using other attributes (#67179)
- alongside LoggerMessageAttribute

Fixes #67167
2022-03-26 00:27:51 -04:00
Kevin Jones e961b10944 Obsolete outdated constructors on Rfc2898DeriveBytes 2022-03-25 17:27:20 -07:00
Eirik Tsarpalis 0ceb116d74 Refactor HandleCollectionsAsync to an xunit Theory (#67126)
* Refactor HandleCollectionsAsync to a Theory

* add small buffer testing in StreamTests

* redisable test for mono/wasm platforms
2022-03-25 23:45:00 +00:00
Elinor Fung 5098d45cc1 Disable multi-level lookup by default (#67022) 2022-03-25 16:41:38 -07:00
Jeremy KoritzinskyandElinor Fung 32320b11c9 Expose the custom type marshalling types for source-generated interop. (#67052)
Co-authored-by: Elinor Fung <[email protected]>
2022-03-25 15:54:39 -07:00
Andy Gocke 9047692595 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
2022-03-25 15:24:32 -07:00
Tomas Weinfurt f8d5706ab6 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
2022-03-25 15:08:09 -07:00
Ankit Jain 286492c981 [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
2022-03-25 17:32:27 -04:00
Stephen Toub cc4d26d5d5 Avoid empty array allocation in MethodBase.GetParameterTypes (#67149)
No parameters is very common.  Avoid a `new Type[0]` array in such cases.
2022-03-25 16:38:53 -04:00
Stephen Toub 0c0c7c6ef7 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.
2022-03-25 16:38:26 -04:00
Ankit Jain c8c08765b2 [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.
2022-03-25 16:03:24 -04:00
Maksym Koshovyi a6d2b10396 [Group 4] Enable nullable annotations for Microsoft.Extensions.Logging.TraceSource (#66892) 2022-03-25 12:47:40 -07:00
Nikola MilosavljevicandDavis Goodin ca8ddae2e0 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 <[email protected]>

* 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 <[email protected]>
2022-03-25 12:26:51 -07:00
Tomáš Rylek 93957c6da9 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
2022-03-25 20:16:08 +01:00
Adeel Mujahid 5978738b58 Delete unused native code in src/native (#67087)
* Delete unused native code in src/native

* Delete set_* functions from version types
2022-03-25 12:02:35 -07:00
Larry Ewing 67f26ca4fb Revert "[mono][workload] Add workloads for win-arm64 using emulation (#65089)" (#67154)
This reverts commit 4e7ccfa1d3.
2022-03-25 14:24:58 -04:00
Larry Ewing 4e7ccfa1d3 [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)
2022-03-25 13:22:06 -05:00
Ankit Jain 55f204501f 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.
2022-03-25 13:56:12 -04:00
Eirik Tsarpalis e63d21947e 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
2022-03-25 16:51:11 +00:00
Andy Ayers 6627183454 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.
2022-03-25 08:22:30 -07:00
Michal Strehovský 938f2e3105 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
2022-03-25 08:07:42 -07:00
Michal Strehovský 343d8eecde 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.
2022-03-25 08:06:35 -07:00
Maksym Koshovyi 000e1a8409 [Group 4] Enable nullable annotations for Microsoft.Extensions.Logging.Debug (#66862)
Related to #43605
2022-03-25 08:38:06 -05:00
Stephen Toub 55e012eb91 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.)
2022-03-25 08:40:06 -04:00
Marek Safar 6a889d2342 Enable CA1822 (Mark members as static) analyzer (#66333) 2022-03-25 12:06:33 +01:00
Radek Zikmund e216e1300b Don't throw PNSE on QuicImplementationProvider.IsSupported (#67036) 2022-03-25 11:37:41 +01:00
Zoltan Varga ba0f8e13cb [mono][wasm] Store the exception object in a GC handle while it is being thrown. (#67121) 2022-03-25 03:34:40 -04:00
Kunal Pathak cd5beb14b0 Exclude throwinnestedtrycatch_il_r from Arm runs (#67122) 2022-03-24 18:53:26 -07:00
Stephen Toub 1f90082fd4 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.
2022-03-24 21:38:46 -04:00
Dan Moseley 47601dc175 Fix link and clarify how community members can edit notifications without portal (#67073) 2022-03-24 19:24:15 -06:00
aea7c73b6b 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 <[email protected]>
Co-authored-by: Tomas Weinfurt <[email protected]>
2022-03-24 17:30:08 -07:00
Elinor Fung 3b17fb8c99 Enable localization for LibraryImportGenerator (#67107) 2022-03-24 16:21:51 -07:00
Kevin Jones 56979871c7 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.
2022-03-24 14:09:22 -07:00
Dan Roberts 5705c98635 Fix typo in a summary comment in SharedAttribute (#67120) 2022-03-24 13:39:13 -07:00
Steve Pfister f1dbe2ec06 [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
2022-03-24 15:36:42 -04:00
Miha Zupan 8c7120e28d 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
2022-03-24 12:25:12 -07:00
Jan KotasandTheodore Tsirpanis c74a3fdf01 Delete AssemblyBuilderData and ModuleBuilderData (#66996)
There is no good reason for these to be separate types.

Co-authored-by: Theodore Tsirpanis <[email protected]>
2022-03-24 11:47:43 -07:00
Adeel Mujahid d22aceff4b 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.
2022-03-24 19:33:45 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] 0d59046238 [main] Update dependencies from dotnet/xharness dotnet/msquic (#67094)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-03-24 19:19:44 +01:00
dotnet-maestro[bot]anddotnet-maestro[bot] 1bd76b21a5 [main] Update dependencies from dotnet/linker (#66985)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2022-03-24 19:17:10 +01:00
Bruce Forstall 3fe2959f3e 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.
2022-03-24 10:18:03 -07:00
Stefan Schulze Frielinghaus 0e35b8d338 [mono] Ensure exception_message points to a string (#66991) 2022-03-24 09:39:08 -04:00
Eirik Tsarpalis 2bf30a03b3 Ensure Sync stream serialization is handling IAsyncEnumerable correctly (#67035)
* Fix #66687

* enable small buffer async tests for collections
2022-03-24 13:26:46 +00:00
Kevin Jones 3c7453247d Update the latest node (#67060) 2022-03-24 06:07:08 -07:00
Eirik Tsarpalis 53bb7dd10d Fix #66727. (#67041) 2022-03-24 13:06:32 +00:00
Trayan ZapryanovandTrayan Zapryanov 9836d5a14c Use stackalloc in NumberFormatterBase (#67003)
Co-authored-by: Trayan Zapryanov <[email protected]>
2022-03-24 13:46:37 +01:00
Elinor Fung c49593c0c1 Fix entry point for EnumPrinters (#67081) 2022-03-24 06:14:34 -06:00
Radek Zikmund e97af55009 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
2022-03-24 13:03:10 +01:00