dotnet-maestro[bot] [Wed, 17 Mar 2021 11:13:51 +0000 (11:13 +0000)]
Update dependencies from https://github.com/dotnet/xharness build
20210315.2 (#49745)
[main] Update dependencies from dotnet/xharness
Adam Sitnik [Wed, 17 Mar 2021 10:55:35 +0000 (11:55 +0100)]
FileStream rewrite part II (#48813)
* introduce WindowsFileStreamStrategy
* introduce SyncWindowsFileStreamStrategy
* introduce AsyncWindowsFileStreamStrategy
* only DerivedFileStreamStrategy needs to have a reference to FileStream
remove finalizer from FileStream, keep it only in DerivedFileStreamStrategy and LegacyFileStreamStrategy
* use the new strategies when buffering is not enabled
* introduce BufferedFileStreamStrategy
* use the Legacy strategy by default for now, add tests for the other implementation
* Apply suggestions from code review
Co-authored-by: David Cantú <dacantu@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Anton Firszov [Wed, 17 Mar 2021 10:49:39 +0000 (11:49 +0100)]
Fix stress-http and stress-ssl builds on Linux (#49706)
Ben Adams [Wed, 17 Mar 2021 10:43:48 +0000 (10:43 +0000)]
CollectionsMarshal.GetValueRef(Dictionary) (#49388)
Ulrich Weigand [Wed, 17 Mar 2021 10:42:35 +0000 (11:42 +0100)]
Big-endian fix for JsonClassInfo.GetKey (#49708)
* Big-endian fix for JsonClassInfo.GetKey
* Skip assertion in JsonClassInfo.GetKey on big-endian
(code will not ensure the properties tested here)
* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Alexander Köplinger [Wed, 17 Mar 2021 10:34:25 +0000 (11:34 +0100)]
Fix build on platforms without gsharedvt (#49710)
A `MonoMemoryManager*` parameter was added to `mono_arch_get_gsharedvt_call_info()` in https://github.com/dotnet/runtime/commit/
34c68c7edf6d61c8ff3d2631003ed86353415479 that was missed in arch-stubs.c
Kuinox [Wed, 17 Mar 2021 09:16:30 +0000 (10:16 +0100)]
ReadOnlySequence: Don't leak the flags that are on _startInteger and _endInteger. (#47969)
* ReadOnlySequence: Don't leak the flags that are on _startInteger and _endInteger.
* Typo fix.
* Added more tests + review fixes.
Michael Croes [Wed, 17 Mar 2021 06:18:30 +0000 (07:18 +0100)]
System.IO.Pipelines.PipeReader: Fix TryRead summary (#49603)
Add missing 'from' to the summary for TryRead.
Aaron Robinson [Wed, 17 Mar 2021 05:55:58 +0000 (22:55 -0700)]
Unify corerun test runner (#49529)
* Remove unused files.
* Rewrite corerun so that it runs on all platforms.
Remove the unixcorerun implementation but fold in
those its features.
Attach debugger is supported on Windows and macOS.
CORE_ROOT can now be set the same way on all platforms:
--clr-path, CORE_ROOT, corerun dir.
* Dump the computed configuration for runtime if a failure to
initialize or execute the entry assembly occurs.
Remove -v flag.
* Add debugger attach support for systems with procfs.
* Remove the corerun option for setting System.Globalization.Invariant.
Tomas Weinfurt [Wed, 17 Mar 2021 04:28:45 +0000 (21:28 -0700)]
rework ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed test (#49348)
Anirudh Agnihotry [Wed, 17 Mar 2021 04:09:59 +0000 (21:09 -0700)]
Port hosting tests from extensions to runtime (#49716)
* port hosting tests
* add nrt461 to test matrix and net6.0 -> netcoreappcurrent
* update the license header
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Tom Deseyn [Wed, 17 Mar 2021 02:03:36 +0000 (03:03 +0100)]
AnonymousPipeStreams.Linux, Process.Unix Streams: perform async I/O by using Socket implementation (#44647)
* experiment: use read/write for socket operations instead of recvmsg/sendmsg
* AnonymousPipeStreams: perform async I/O by using Socket implementation
* PipeStream.Unix: use sync/async functions on Socket
* Refactor Socket creation
* Cleanup
* Fix broken comment
* Allow passing pipe fd to Socket/SafeSocketHandle public ctor
* macOS: Handle EPIPE on registration
* Refactor IsPipe to IsSocket
* Move registration error handling in to single method
* Process: use AnonymousPipeClientStream for redirected streams.
* Remove unneeded BufferedStream
* PR feedback
* PipeStream.Unix: enable cancelation tests
* Add back Ctor_SafeHandle_Invalid_ThrowsException test
* SysRead/SysWrite: Assert not used for socket-type handle
Anton Lapounov [Wed, 17 Mar 2021 01:35:25 +0000 (18:35 -0700)]
Use new VS detection script in DacTableGen (#49729)
Ulrich Weigand [Wed, 17 Mar 2021 00:33:19 +0000 (01:33 +0100)]
Big-endian test case fixes: System.Reflection (#49693)
* Fix endian assumptions in tests operating on PE headers / IL metadata
(this is always encoded in little-endian byte order)
* Fix expected result for BlobReader test (always little-endian)
* Fix expected results for GUID tests
Ulrich Weigand [Wed, 17 Mar 2021 00:31:16 +0000 (01:31 +0100)]
Big-endian fix: Marvin hash (#49707)
* Fix endian assumptions in Marvin.ComputeHash32OrdinalIgnoreCase
(use the same logic that already exists in Marvin.ComputeHash32)
Michal Strehovský [Wed, 17 Mar 2021 00:30:54 +0000 (01:30 +0100)]
Put tests that depend on non-zero lower bounds arrays behind condition (#49721)
I assume these are new.
David Wrighton [Wed, 17 Mar 2021 00:28:48 +0000 (17:28 -0700)]
Armel support in crossgen2 (#43706)
This change adds support for armel target compilation in crossgen2
To use the feature compile an application using the --targetos Linux and --targetarch armel flags.
Summary of changes
- To avoid bloating the compilation matrix, the #ifdefs used in the JIT that were conditional on ARM_SOFTFP behavior have been changed in to variable checks. To avoid perf penalties, this dynamic behavior is only enabled for the jit intended for compiling using crossgen2.
- Armel abi processing was integrated into the various parts of the managed crossgen2 codebase that correspond to components with special handling in the coreclr codebase
- HFA support is disabled for Armel targets
- Floating point registers are not used when passing arguments
With this change it becomes possible to run crossgen2 on a Windows or Linux machine and target a Linux Armel target.
Brian Robbins [Wed, 17 Mar 2021 00:24:08 +0000 (17:24 -0700)]
Fix AppHost Save From MemoryMappedFile. (#49730)
Michal Strehovský [Tue, 16 Mar 2021 23:48:42 +0000 (00:48 +0100)]
Condition new tests depending on Ref.Emit on Ref.Emit support (#49722)
Ryan Lucia [Tue, 16 Mar 2021 23:10:57 +0000 (19:10 -0400)]
[mono] Prefix bundle loads with culture if applicable (#49534)
Jeremy Koritzinsky [Tue, 16 Mar 2021 21:47:03 +0000 (14:47 -0700)]
[AndroidCrypto] Fix remaining Algorithms test failures. (#49501)
Ulrich Weigand [Tue, 16 Mar 2021 21:39:35 +0000 (22:39 +0100)]
Big-endian test case fixes: System.Runtime (#49691)
* Byte-swap input/output for BitConverter tests
* Update byte index for GetByte/SetByte tests on big-endian systems
Sergey Andreenko [Tue, 16 Mar 2021 21:33:38 +0000 (14:33 -0700)]
add STRESS_PROMOTE_LESS_STRUCTS mode. (#49084)
* add STRESS_PROMOTE_LESS_STRUCTS mode.
* add comment
* Disable failing tests.
* review
* fix build break
Andrew Au [Tue, 16 Mar 2021 19:34:56 +0000 (12:34 -0700)]
Do not pin free object for STRESS_REGIONS (#49547)
Viktor Hofer [Tue, 16 Mar 2021 18:59:44 +0000 (19:59 +0100)]
Move dotnet-sdk snaps into the installer repo (#49697)
John Salem [Tue, 16 Mar 2021 17:36:07 +0000 (10:36 -0700)]
Prevent unbounded lock holds in BufferManager of EventPipe (#48435)
Thays Grazia [Tue, 16 Mar 2021 17:17:59 +0000 (14:17 -0300)]
[mono][debugger] Disable by default the generation of mscordbi (#49596)
* Disable by default compilation of mscordbi, it will be generated by default only on CI.
To generate it use /p:MonoMsCorDbi=true
Fixes #49590
* Changing what was suggested by @jkotas and @akoeplinger.
Thanks @directhex for your help.
* Update eng/Subsets.props
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Larry Ewing [Tue, 16 Mar 2021 17:05:00 +0000 (12:05 -0500)]
[wasm] current dedup breaks blazor template apps (#49678)
Kevin Jones [Tue, 16 Mar 2021 16:28:23 +0000 (12:28 -0400)]
Permit ST as a friendly name alias for stateOrProvinceName OID.
Jo Shields [Tue, 16 Mar 2021 15:42:02 +0000 (11:42 -0400)]
Disable Interop test which is killing our pass rate on Mac ARM64 (#49703)
Jo Shields [Tue, 16 Mar 2021 15:40:41 +0000 (11:40 -0400)]
ActiveIssue for failing Windows threading test (#49701)
Mateo Torres-Ruiz [Tue, 16 Mar 2021 15:28:19 +0000 (08:28 -0700)]
Move StartupHookerProvider from shared descriptor file (#49669)
* Move StartupHook substitution from shared descriptor
* Put things in proper descriptor
* Subs
* Add subs xml in SPCL
* Fix assembly name
Ulrich Weigand [Tue, 16 Mar 2021 14:55:10 +0000 (15:55 +0100)]
Big-endian test case fixes: PKCS crypto (#49695)
* Fix endian assumption in Rfc3161 test case
(serial number must always be in big-endian byte order)
Ulrich Weigand [Tue, 16 Mar 2021 14:52:20 +0000 (15:52 +0100)]
Big-endian test case fixes: BinaryWriter (#49688)
* Fix endian assumption in BinaryWriter_WriteSpan
(BinaryWriter always uses little-endian byte order)
Ulrich Weigand [Tue, 16 Mar 2021 14:51:57 +0000 (15:51 +0100)]
Big-endian test case fixes: unsafe compiler services (#49692)
* Update expected values for endian-dependent test cases
Ulrich Weigand [Tue, 16 Mar 2021 14:43:34 +0000 (15:43 +0100)]
Big-endian test case fixes: Visual Basic (#49696)
* Enable Randomize_SetsExpectedState test case on big-endian systems
(VBMath.Randomize already handles big-endian systems)
Jo Shields [Tue, 16 Mar 2021 14:14:07 +0000 (10:14 -0400)]
Move Windows Mono to Staging (Closes: #49569) (#49641)
* Move Windows Mono to Staging (Closes: #49569)
Ulrich Weigand [Tue, 16 Mar 2021 13:45:48 +0000 (14:45 +0100)]
Big-endian test case fixes: XML (#49689)
* Update expected results for endian-dependent tests BinHex_9/BinHex_10
* Input strings for XML encode/decode tests are hard-coded little-endian
Ulrich Weigand [Tue, 16 Mar 2021 13:45:24 +0000 (14:45 +0100)]
Big-endian test case fixes: System.Memory tests (#49690)
* Fix endian assumptions in preparing input byte patterns
* Enable tests that were disabled on big-endian systems
Ulrich Weigand [Tue, 16 Mar 2021 13:44:24 +0000 (14:44 +0100)]
Big-endian test case fixes: big-integer numerics (#49694)
* Fix endian assumptions in CtorByteArray tests
(the byte array must always be in little-endian byte order)
* Fix endian assumptions in left-/right-shift tests
(byte array representing shift count must be in little-endian)
Stephen Toub [Tue, 16 Mar 2021 13:36:14 +0000 (09:36 -0400)]
Reduce startup allocation from event pipe metadata (#49303)
* Reduce startup allocation from event pipe metadata
A "hello world" console app results in EventPipeMetadataGenerate.GenerateEventMetadata making almost 500 calls to factory methods on ScalarTypeInfo, each of which allocates a new ScalarTypeInfo object and a Func delegate, but they're all immutable objects that could be cached on first use and reused for all subsequent use. Eliminating the need for the funcs entirely and caching the ScalarTypeInfo objects saves almost 1000 object allocations and 66K of allocation at startup. It does mean we'll end up holding on to a few objects (9 objects == ~575 bytes) for the duration of the app that we would otherwise have dropped (plus the static fields).
* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs
Viktor Hofer [Tue, 16 Mar 2021 13:35:30 +0000 (14:35 +0100)]
Dev Innerloop pipeline timeout was passed in wrong (#49702)
Stephen Toub [Tue, 16 Mar 2021 13:35:19 +0000 (09:35 -0400)]
Avoid forcing parsing of DefaultRequestHeaders and from message.ToString() (#49673)
* Avoid forcing parsing of DefaultRequestHeaders
In the past, this was done because every request would parse all headers as part of sending them, so it was better to parse once then on every request. But we changed the behavior for sending in SocketsHttpHandler to actually respect TryAddWithoutValidation, such that we wouldn't forcefully validate unless the developer asked us to. This makes DefaultRequestHeaders consistent with that.
* Avoid forcing parsing when ToString()'ing request and response messages
This not only can change behavior in the debugger just by hovering over a message, it can change behavior at runtime due to the request/response messages getting logged.
* Add another test
Zoltan Varga [Tue, 16 Mar 2021 04:17:30 +0000 (00:17 -0400)]
Wasm build improvements (#49658)
* Avoid passing mono libs twice when linking dotnet.wasm.
* Build aot-instances.dll in deterministic mode.
* Add a helper target for building the mono runtime + cross compiler without building dotnet.wasm.
Useful when working with AOT, since AOT will rebuild dotnet.wasm anyway.
* Avoid emitting a double -Oz into emcc-flags.txt
* Quiet emsdk_env.sh.
* Add a _WasmDevel internal property which can be used to pass -O0 to the wasm linker, speeding up builds.
* Disable native stripping for wasm tests.
* Revert unrelated changes.
* Don't overwrite EmccFlags.
Ankit Jain [Tue, 16 Mar 2021 03:25:58 +0000 (23:25 -0400)]
[wasm] Remove extraneous emission of MONO_PATH value (#49672)
David Fowler [Mon, 15 Mar 2021 22:27:16 +0000 (15:27 -0700)]
Clear the buffers fields (#49575)
- This makes it easier to reason about gcroots in dumps
Sergey Andreenko [Mon, 15 Mar 2021 22:00:41 +0000 (15:00 -0700)]
Add Andy's stress mode for byrefs. (#49636)
Andrii Kurdiumov [Mon, 15 Mar 2021 21:11:16 +0000 (03:11 +0600)]
Remove reference to non-existing parameter (#49630)
Eric Erhardt [Mon, 15 Mar 2021 20:45:26 +0000 (15:45 -0500)]
Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2) (#49467)
* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2)
Contributes to #45623
* Change ComNativeDescriptorProxy so the linker can see the Type (when it is available) by using Type.GetType.
Viktor Hofer [Mon, 15 Mar 2021 18:12:06 +0000 (19:12 +0100)]
Update buildtriage.md (#49651)
* Update buildtriage.md
Tarek Mahmoud Sayed [Mon, 15 Mar 2021 18:05:00 +0000 (11:05 -0700)]
Suppress the exception thrown when DiagnosticSourceEventSource access object properties (#49567)
Elinor Fung [Mon, 15 Mar 2021 17:26:54 +0000 (10:26 -0700)]
Add non-RC2 content encryption test data for Pkcs test suite (#49564)
Radek Doulik [Mon, 15 Mar 2021 16:49:26 +0000 (17:49 +0100)]
[wasm] Add "Installation of JavaScript engines" to README (#49650)
Add information about `jsvu` and how to install it on mac.
Eric StJohn [Mon, 15 Mar 2021 16:41:38 +0000 (09:41 -0700)]
Push Evidence down to System.Security.AccessControl (#49411)
* Push Evidence down to System.Security.AccessControl
This can avoid the dependency
System.Security.Cryptography.Xml > System.Security.Permissions
* Fix nullable annotations and ObsoleteAttributes
scharnyw [Mon, 15 Mar 2021 14:53:02 +0000 (22:53 +0800)]
Improve docs for StringValues.IsNullOrEmpty for empty strings (#49629)
Fix #49626
Co-authored-by: Guanbo Wang <GWang26@slb.com>
Stephen Toub [Mon, 15 Mar 2021 13:02:57 +0000 (09:02 -0400)]
Replace LINQ's custom Set with HashSet (#49591)
Egor Bogatov [Mon, 15 Mar 2021 12:24:57 +0000 (15:24 +0300)]
[RyuJIT] Fix rel32 for calls/data (#49549)
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Zoltan Varga [Mon, 15 Mar 2021 12:09:48 +0000 (08:09 -0400)]
Disable /OPT:ICF on windows, it merges identical functions breaking icall symbol lookup. (#49622)
Ryan Lucia [Mon, 15 Mar 2021 11:49:50 +0000 (07:49 -0400)]
Add null check for WaitInfo (#49628)
* Add null check for WaitInfo
* Remove OnThreadExiting static from WaitSubsystem
Newell Clark [Mon, 15 Mar 2021 10:29:00 +0000 (06:29 -0400)]
Implement struct enumerator for Tensor<T> (#46497)
* Added struct enumerator to Tensor<T>
Fix issue #28391
* Added struct enumerator to Tensor<T>
Added unit test for element enumeration.
Fix issue #28391
* Added xml doc comments
* Apply suggested edit to System.Numerics.Tensor.Enumerator
Co-authored-by: Günther Foidl <gue@korporal.at>
* Fixed naming
* Forgot to change back Current to auto-prop
* Apply suggested changes
-Make Reset and Dispose public
-Fix null ref bug with Reset
-Added tests for Reset and Dispose
Co-authored-by: Günther Foidl <gue@korporal.at>
Ben Adams [Mon, 15 Mar 2021 03:42:26 +0000 (03:42 +0000)]
Non-generic StringComparer conversion for dict and hashset (#49608)
David Wrighton [Sun, 14 Mar 2021 22:46:35 +0000 (15:46 -0700)]
Profile guided compilation fixes (#49516)
- Fix issue where if we can't load a token during profile data resolution, we crash with a NullReferenceException
- Fix issue where when profile specified methods are added to the compilation, they cause methods not specified to be compiled as well. This caused about a 3X bloat in method compilation when working off of profile specified data
- Fixed by adding a dependency phase model to dependency analyzer
- Then using that to tie into method compilation and dependencies so that some extra dependencies are trimmed by our dependency analysis flow
Anton Lapounov [Sun, 14 Mar 2021 21:48:27 +0000 (14:48 -0700)]
Consolidate VS detection logic (#49593)
Tarek Mahmoud Sayed [Sun, 14 Mar 2021 18:07:56 +0000 (11:07 -0700)]
Fix DateTime Tests (#49560)
* Fix DateTime Tests
David Fowler [Sun, 14 Mar 2021 14:45:34 +0000 (07:45 -0700)]
Pass the cancellation token to FlushAsync (#49594)
Zoltan Varga [Sun, 14 Mar 2021 05:36:41 +0000 (00:36 -0500)]
Handle cleanup (#49578)
* Remove unused named handle support.
* Remove more unused code.
Jan Kotas [Sun, 14 Mar 2021 02:57:18 +0000 (18:57 -0800)]
Delete a few more unused files (#49584)
Jan Kotas [Sun, 14 Mar 2021 01:08:06 +0000 (17:08 -0800)]
Use same brick size for both x64 and ARM64 (#49581)
Jan Kotas [Sat, 13 Mar 2021 21:22:05 +0000 (13:22 -0800)]
Delete Utf8Extensions.* (#49582)
Unused left over from the Utf8String prototype
Aleksey Kliger (λgeek) [Sat, 13 Mar 2021 18:22:31 +0000 (13:22 -0500)]
[mono][mbr] Implement DOTNET_MODIFIABLE_ASSEMBLIES support (#49507)
Implements https://github.com/dotnet/runtime/issues/47274 for Mono.
1. `DOTNET_MODIFIABLE_ASSEMBLIES` environment variable must be set to `debug` for hot reload to be enabled (in addition to the interpreter being enabled)
2. Assemblies must be compiled in Debug mode - we check `DebuggableAttribute` for the `DisableOptimizations` bit. If an assembly doesn't have the bit set, it can't be reloaded.
3. In the interpreter - don't try to inline when hot reload is enabled and the caller or callee has the DisableOptimizations bit set.
* [mbr] Check DOTNET_MODIFIABLE_ASSEMBLIES for hot reload support
If it's set to "debug" (case insensitive) then hot reload is enabled for assemblies compiled in debug mode. Otherwise hot reload is disabled
* [mbr] Disable inlining for DebuggerAttribue assemblies
with the optimizer disabled flag
* [mbr] Update samples
* [mbr] Throw InvalidOperationException is hot reload is not supported
On a per-assembly basis
* [mbr] Stub implementations if !ENABLE_METADATA_UPDATE
Steve Pfister [Sat, 13 Mar 2021 15:32:45 +0000 (10:32 -0500)]
Support loading ICU data from managed Interop (#49406)
In iOS we support loading a custom dat file when working with ICU. The way this worked originally was the mono runtime exported a function that native code would call into (similar to wasm). After thinking about it a bit, it makes more sense to load this the same way we do on desktop, but with the ability to provide the path to an ICU dat file via an AppContext key `ICU_DAT_FILE_PATH`. This can be provided before Xamarin iOS calls `monovm_initialize` and they won't have to worry about calling some special function.
Ryan Lucia [Sat, 13 Mar 2021 07:33:05 +0000 (02:33 -0500)]
Port some CoreRT Threading classes to Mono (#47333)
Alex-ABWorld [Sat, 13 Mar 2021 03:26:57 +0000 (03:26 +0000)]
Remove Redundant "If" Check (#49324)
Remove a redundant "NULL" check on a clearly NULL value, and corrected comments to correctly represent the current state of the function.
There are no longer any security checks, and as such the mentions of it are also redundant and have been removed.
Bruce Forstall [Sat, 13 Mar 2021 02:24:24 +0000 (18:24 -0800)]
Remove SuperPMI upload of clrjit.dll (#49565)
We never used the uploaded JITs, and we have a JIT rolling build
that gives us a better set of DLLs.
Bruce Forstall [Sat, 13 Mar 2021 00:41:02 +0000 (16:41 -0800)]
Enable crossgen2 SuperPMI for Linux (#49531)
* Fix SuperPMI on Linux for crossgen2
1. crossgen2 doesn't call DllMain (https://github.com/dotnet/runtime/issues/49525),
so add a call to initialize the PAL and other things in jitStartup() (the JIT does
it this way already). Note that crossgen2 doesn't call DllMain for shutdown, either,
so we won't properly shut down the logger. Normally, however, we don't use the logger
during collections.
1.1. I only changed the collector, not the other two shims (which aren't used).
2. We don't seem to be able to get the correct exception code for exceptions thrown
from crossgen2. So, as a workaround, instead of assuming we're going to succeed,
assume we're going to fail with a non-zero exception code, and then set it to zero
if no exception was thrown. This only applies to the `getCallInfo` API.
* Add crossgen2 collections for Linux platforms
* Clarify comment
Noah Falk [Fri, 12 Mar 2021 22:46:46 +0000 (14:46 -0800)]
Adding an EventPipe README (#49542)
* Adding an EventPipe README
Dong-Heon Jung [Fri, 12 Mar 2021 22:38:03 +0000 (07:38 +0900)]
Minor fix in dotnet-pgo.md (#49527)
David Wrighton [Fri, 12 Mar 2021 22:27:39 +0000 (14:27 -0800)]
Skip compilation of simple methods that just throw in crossgen2 (#49514)
* Skip compilation of simple methods that just throw
- Significant savings when compiling System.Private.CoreLib. In particular, there are *many* intrinsic functions that we can now avoid compilation of
- X64 build drops about 3,000 functions from compilation
* Update src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Zoltan Varga [Fri, 12 Mar 2021 19:16:45 +0000 (14:16 -0500)]
Wasm dedup (#49538)
* [wasm] Disable the linkonce linking of wrappers for now, the aot metadata about wrappers is not dedup-ed, so a separate dedup pass still saves more space.
* [wasm] Add dedup support to the build to avoid generating generic instances etc. multiple times.
This works as follows:
* Controlled by a new public 'WasmDedup' property, defaults to true.
* All assemblies are AOT compiled with the 'dedup-skip' option, which causes
the AOT compiler to avoid generating generic instances, certain wrappers etc.
* A new internal assembly called aot-instances.dll is added to the build.
* When aot-instances.dll is AOTed, all the other assemblies are AOTed together,
but only the generic instances/wrappers are emitted into its AOT image.
Aleksey Kliger (λgeek) [Fri, 12 Mar 2021 18:44:04 +0000 (13:44 -0500)]
[mono][jit] read DebuggableAttribute(DebuggingModes) ctor; move to metadata/ (#49505)
* [jit] read DebuggableAttribute(DebuggingModes) ctor; move to metadata/
Pull is_jit_optimizer_disabled out of mini into metadata.
Also support reading the DebuggingModes ctor
* fix whitespace
Co-authored-by: Thays Grazia <thaystg@gmail.com>
Marc Sallin [Fri, 12 Mar 2021 17:36:53 +0000 (18:36 +0100)]
Baggage and Tags for activity tracking options (#46571) (#48722)
Co-authored-by: Sallin Marc, I212 <marc.sallin@post.ch>
Thays Grazia [Fri, 12 Mar 2021 17:17:46 +0000 (14:17 -0300)]
[wasm][debugger] Detect exception/error when calling runtime_invoke (#49498)
* Related to #49206.
When we call runtime_invoke on wasm the exception always returns NULL and the error returns OK.
This was a problem because we were trying to get value of this new static property in DateTime type:
private static ReadOnlySpan<byte> DaysInMonth365 => new byte[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
As we don't know that we were getting an exception, the value that returns to the test was wrong.
The goal of this PR is detect that we got an exception when running runtime_invoke and return the expected value to debugger.
This is a temporary solution, I think the final solution is to fix runtime_invoke to return exception correctly on WASM.
We also need to support it: https://github.com/dotnet/runtime/blob/
b3411852caa6a3de8ab9fa27f7860c76ef43e384/src/mono/mono/metadata/object.c#L6298
* Fix compilation error
* Update src/mono/mono/mini/mini-wasm-debugger.c
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Adding comment as suggested by @lambdageek
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Thays Grazia [Fri, 12 Mar 2021 17:00:59 +0000 (14:00 -0300)]
[mono][debugger] Implementing mscordbi to support iCorDebug on mono runtime (#47639)
* Implementing mscordbi on mono to support icordebug
* Fix eval, fix step and cancel step, remove suspend status on mscordbi
* Using log from coreclr as mscordbi does
* Missing files
* Removing eglib from implementation
* Compiling on Mac
* Compiling and Working on windows.
Changing what @lambdageek suggested about mono_atomic_inc_i32
* Generating libmscordbi on mac
* Fix socket on mac
* Counting references, deleting objects, removing unecessary properties,
formating with cland-format, renaming properties to follow the used
pattern.
* Checking error when get reply from debugger
* Fix format, reuse regmeta from coreclr and try to fix compilation on
windows
* Dont build when target is android or ios or wasm
* Fix error unused variable
* Fixing error: 'CFUserNotificationDisplayAlert' is unavailable: not
available on macCatalyst
* Fix compilation error on Linux
* Fix function not found in maccatalyst
Fix warning as error of macro redefinition
* Dont compile mscordbi on maccatalyst
* Fix compilation on linux
* Fix compilation on android, ios and browser
* Fix compilation on linux
* Fix cross compiling
* Fix compilation x86 windows
* Fix x86 compilation
* Fix compilation on windows
* Fix cmake error
* Fix cmake
* Fix arm64 mac
* Fix windows compilation
* Fix memory leak
* Returning E_NOTIMPL where it was possible and it's not implemented as
suggested by @cshung
* Fix what @cshung
* Use only one ref count
* Adding ex_try everywhere that we could have an allocation failure.
* Implementing get class
* Apply suggestions from code review
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
* Fix what @noahfalk suggested in his review.
* Fixing what was suggested by @viniciusjarina
* Fix what was suggested by @viniciusjarina
* Changing what @noahfalk suggested
* Accept more than 1 stepper per thread
* Changing what was suggested by @noahfalk
* Using CORDB_ADDRESS to return addresses from debugged process
* Fix eval
* Update src/mono/mono/mini/debugger-agent.c
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Using 1:1 with runtime for cordbtype and cordbclass
* Rnaming methods as suggested by @lambdageek
* Update src/mono/dbi/cordb-process.h
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update CMakeLists.txt
* Fix arm64 compilation
* Fix arm64 compilation
* Fix error cmake
* fix arm64 compilation
* Fix arm64 compilation
* Fix arm64 compilation
* Fix arm64 compilation
* Revert "Fix arm64 compilation"
This reverts commit
25f24bc7ac66966fe59805e54e4009c909608b2c.
* Revert "Fix arm64 compilation"
This reverts commit
a8f0318881d7b3e6b5a69b1b56c17478a71fdb4f.
* Revert "fix arm64 compilation"
This reverts commit
b5de06dcf00bf296f2c8f4b47aa2492afbd73acd.
* Revert "Fix error cmake"
This reverts commit
2aae4636499d073ca5aa6fb9319d84875be6e08e.
* Revert "Fix arm64 compilation"
This reverts commit
ae5f701589c3bd8ca04b9d9369af2b285a5d9bd0.
* Revert "Fix arm64 compilation"
This reverts commit
94d957c7416a900c9e90dec53900a104572ea6a1.
* Removing arm64 compilation
* Remove arm64 compilation
Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Vlad Brezae [Fri, 12 Mar 2021 15:03:37 +0000 (17:03 +0200)]
[interp] Rework the allocation of offsets for variables (#49072)
* [interp] Cleanup get_interp_local_offset
Use it just for allocating an offset for a var, at the top of the locals space.
* [interp] Save the args inside call instructions
This will aid later optimizations, in order to easily detect the call args for an opcode. This is stored as a -1 terminated array of var indexes. Also change the structure of newobj_reg_map array, so it can reuse this format (newobj_reg_map should be killed at some point anyway).
* [interp] Pass target_ip in a normal var to MINT_CALLI_NAT_FAST
Making it consistent with other calli opcodes and simplifies a little bit the code generation path.
* [interp] Add explicit return for CallArgs opcodes
Before this change, calls used to receive a single special dreg argument. This was resolved to an offset. At this offset, the call could find all the parameters and the return value was also written at the same offset. With this change we move towards having an explicit dreg return. For calls, the last sreg must be of the special type MINT_CALL_ARGS_SREG. The var offset allocator should ensure all call args are allocated one after the other and that this special reg type is resolved to the offset where these args reside.
* [interp] Remove call args flag from code generation / optimization phases
This flag should only be relevant to the var offset allocator
* [interp] Add new local offset allocator
This change aims to simplify the handling of vars during optimizations. Before this change we had different types of vars : managed locals, var residing on the execution stack, vars that are the argument of a call. Multiple restrictions applied to vars residing on the execution stack and to call args. Following this change, all vars share the same semantics during optimizations passes. At the very end, we allocate offsets for them and we will end up with 3 types of vars : global vars (used from multiple bblocks), local vars (used in a single bblock) and call arg vars. Call arg vars are always local.
The first step of the allocator is to detect all global vars and allocate offsets for them by doing a full iteration over the code. They will reside in the first section of the stack frame and they are allocated one after the other in the order they are detected. The param area (containing call arg vars) will have to be allocated after the local var space, otherwise a call would overwrite vars in the calling method. These vars are allocated for one basic block at a time.
For simple local vars we do an initial iteration over the bblock instructions and we set the liveness information for each referenced var (live_start and live_end). We will maintain a list of active vars and the current top of stack. As a var becomes alive we allocate it at the current offset and add it to the active_vars array. As a var becomes dead, we remove entries from the active_vars array and update the current top of stack, if space has been freed at the end of the stack.
For call args, because we must control the offset at which these vars are allocated, in the initial pass we generate MOVs from the var to a new local var, if the call arg was initially global. Afterwards, call arg vars are allocated in a similar manner to normal local vars. The space for them is tied to the param area of the call, so the entire space is allocated at once. A call become active when any of its args is first written. The liveness of the call ends when the actual call is done, at which point we resolve the offset of every arg relative to the start of the param area of the method. Once all normal local vars are allocated, we will compute the final offset of the call arg vars.
* [interp] Improve dumping for call instructions
* [interp] Fix var type of valuetype this
* [interp] Re-enable copy propagation
* [interp] Rename MINT_NEWOBJ opcodes
* [interp] Disable tracking of offsets on the execution stack during codegen
They are no longer needed. We generate offsets for every var at the very end.
* [interp] Remove memmove of args during newobj
The offset allocator is allocating the vars at the right offset in the param area. We also used `push_types` to add the arguments back on the stack, which was allocating new vars for each argument. We no longer do this, so newobj_reg_map is not needed anymore.
* [interp] Re-enable inlining of constructors
For object ctors, MINT_NEWOBJ_INLINED allocates an object which will be used both as a `this` arg to the ctor as well as the return var from the newobj operation.
For valuetype ctors, we need to first inform the var offset allocator that the valuetype exists before the MINT_NEWOBJ_VT_INLINED invocation, which will take its address, which will be used as `this` arg to the inline method. We also need to dummy use the valuetype, so it never dies before the ctor is inlined, otherwise `this` points to garbage. We use this def/dummy_use mechanism in order to avoid promoting the valuetype to a global var, as it happens with normal vars that have their address taken (via ldloca).
* [interp] Avoid optimization if newobj is guarded
MINT_NEWOBJ* should not store into a local if the ctor might throw, because we set the return value before the ctor starts executing, and a guarding clause can see this variable as being set.
* [interp] Refactor the active vars code a bit
* [interp] Add missing implicit conversion
When passing an argument or returning a value from a method. The stack contents are not necessarily matching the signature type, in which case we add conversions.
* [interp] Disable test using excessive stack space
This test was exceeding the stack limit even before the new offset allocator, it was just not reported.
Aaron Robinson [Fri, 12 Mar 2021 15:00:19 +0000 (07:00 -0800)]
Address flakey behavior testing COM lifetime cleanup. (#49266)
* Address flakey behavior testing COM lifetime cleanup.
* Add new lifetime test for COM.
imhameed [Fri, 12 Mar 2021 14:57:08 +0000 (06:57 -0800)]
[mono] Implement AdvSimd (#49260)
This change adds AdvSimd and AdvSimd.Arm64 support to LLVM-enabled Mono.
Most aarch64 LLVM intrinsic functions are overloaded and have names determined
by an invariant base string prepended to a string representation of one or two
type parameters. Intrinsic functions used by an LLVM module must have a
declaration somewhere in memory when JITting or somewhere in the output bitcode
file when AOTing. Currently Mono maintains a hash table that maps internal
intrinsic IDs to LLVM intrinsic declarations. These IDs have been extended: a
simplified type representation is added to the key's upper bits. This
representation is not especially compact, and currently uses 9 bits to label 18
states, but it's easy to look at in a debugger. (A simple base-18 encoding
could encode three parameters in 13 bits.)
These overload-tagged IDs can be passed to
`OP_XOP_OVR{_,_SCALAR,_BYSCALAR}X_{X,X_X,X_X_X}`. The return type of the
intrinsic that generates these mini ops is used to derive the overload tag to
find the corresponding LLVM intrinsic function declaration.
`MonoLLVMModule::intrins_by_id` is removed, because LLVM intrinsic lookup keys
are no longer small contiguous integers. It only seemed to serve as a lookup
table for data already contained in a hash table.
The corresponding instructions for some of these .NET-level intrinsics take
immediate parameters. For some of these instructions, the LLVM IR code that
selects these immediate-argument instructions can emit a fallback for
non-constant parameters, either by using an equivalent instruction with a
register operand or by using a longer and less-efficient instruction sequence.
For the rest, a branching code sequence is emitted. Helper functions
(`immediate_unroll_begin` etc.) are added to make this a little less
repetitious.
Some operations take an immediate operand denoting a lane to select in a vector
before proceeding with another generic vector or scalar operation. These are
decomposed into a sequence of `OP_ARM64_SELECT_SCALAR` followed by the
non-lane-specific operation. LLVM can still optimize this to the lane-selecting
instruction when possible, and can generate fallback code for non-immediate
lane selection.
The tables describing the intrinsics supported by the runtime are extended to
support intrinsics with different target instructions for signed, unsigned and
floating point parameters. Whenever possible, .NET-level intrinsics that
correspond to a single LLVM intrinsic function are stored as a single entry in
these tables. Unfortunately many intrinsics need to be translated into a
sequence of LLVM IR operations; for these, new mini IR opcodes are added to
select the LLVM IR builder code that should run.
Ryan Lucia [Fri, 12 Mar 2021 14:37:38 +0000 (09:37 -0500)]
Add Libs.Pretest to make runtime (#48799)
monojenkins [Fri, 12 Mar 2021 12:10:16 +0000 (07:10 -0500)]
Don't include mono-dtrace.h when generating offsets (#49482)
offsets-tool can run before mono-dtrace.h is generated which leads to a compiler error about the file missing.
This happened with the mac arm64 sdks build where we didn't disable dtrace like we do for iOS.
It was racy since it depends on whether we already built the target mono before we're building the cross compiler mono.
Co-authored-by: akoeplinger <akoeplinger@users.noreply.github.com>
Sven Boemer [Fri, 12 Mar 2021 08:20:50 +0000 (00:20 -0800)]
Remove DynamicDependency workaround (#49523)
The linker no longer needs these DynamicDependency attributes because it
can resolve the assemblies when it sees the strings passed to GetType.
Tarek Mahmoud Sayed [Fri, 12 Mar 2021 04:29:04 +0000 (20:29 -0800)]
Support Time Zone IANA Ids and Windows Ids in all platforms (#49412)
* Support Time Zone IANA Ids <-> Windows Ids conversions
Thays Grazia [Fri, 12 Mar 2021 03:18:11 +0000 (00:18 -0300)]
[wasm][debugger] Replace Mono.Cecil with MetadataReader. (#49440)
* Removing the usage of Mono.Cecil and using MetadataReader to read Assembly information and Pdb information.
* Fixing tests...
Having problems with async methods.
* Update src/mono/wasm/debugger/BrowserDebugProxy/DebugStore.cs
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Fix tests which calls async methods.
* Fix packaging of BrowserDebugHost.
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Viktor Hofer [Fri, 12 Mar 2021 02:57:41 +0000 (03:57 +0100)]
Update SDK's target version to 6.0 Preview 2 (#49509)
* Update target version of SDK to 6.0 preview 2
Not updating the minimum required version as that's considered a breaking change that needs to go through the monthly infra rollout.
* Remove msbuild hack in Tools.props
* Remove sendtohelixhelp hack with P1 SDK
Zoltan Varga [Fri, 12 Mar 2021 02:05:38 +0000 (21:05 -0500)]
[wasm] Turn off canonization of NaNs. It doesn't seem to be needed, and it causes test failures. (#49475)
Fixes https://github.com/dotnet/runtime/issues/49245.
David Wrighton [Fri, 12 Mar 2021 01:52:57 +0000 (17:52 -0800)]
Exclude out of range fp test on arm32 (#49519)
Stephen Toub [Fri, 12 Mar 2021 01:42:00 +0000 (20:42 -0500)]
Remove a few more unnecessary StringBuilders (#49488)
Stephen Toub [Fri, 12 Mar 2021 01:41:32 +0000 (20:41 -0500)]
Tweak Process.GetEnvironmentVariablesBlock (#49484)
* Tweak Process.GetEnvironmentVariablesBlock
Mostly a cleanup (e.g. the comment refers to Windows 2000), but removes some interface dispatch as part of simplifying the code.
* Update src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Windows.cs
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Stephen Toub [Fri, 12 Mar 2021 01:41:07 +0000 (20:41 -0500)]
Fix polling on https connections in HttpConnectionPool (#49474)
* Fix polling on https connections in HttpConnectionPool
Avoid performing read-aheads on such connections, which can result in long-pinned buffers and unnecessary faulted tasks when the connections are torn down.
* Update src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
Co-authored-by: Cory Nelson <phrosty@gmail.com>
Co-authored-by: Cory Nelson <phrosty@gmail.com>
Kunal Pathak [Fri, 12 Mar 2021 01:24:35 +0000 (17:24 -0800)]
Try to upload collections from successful partition (#49496)
If SPMI collection of few partitions fail, try best attempt to merge
the successful partition and upload them to azure. However, if none
of the partition succeeded, `merge-mch` would fail and we should skip
upload step.
monojenkins [Fri, 12 Mar 2021 00:33:10 +0000 (19:33 -0500)]
[marshal] Fix VARIANT marshaling in structs (#49451)
Partial revert of mono/mono#8732
If a managed struct is declared as
public struct StructWithVariant
{
[MarshalAs (UnmanagedType.Struct)]
public object data;
};
Then the `data` field should be marshalled as a VARIANT.
The fix checks that the field's type is `object` and uses VARIANT for marshaling, otherwise it continues as in mono/mono#8732 and uses MONO_MARSHAL_CONV_OBJECT_STRUCT.
---
Also added tests for BSTR marshaling inside structs. This actually works on mono master thanks to https://github.com/mono/mono/pull/19701 but there was no test covering this case.
Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
Mike McLaughlin [Fri, 12 Mar 2021 00:27:25 +0000 (16:27 -0800)]
Remote unwinder's put_unwind_info function needs to cleanup for FEATURE_USE_SYSTEM_LIBUNWIND (#49444)
Fixes issue: https://github.com/dotnet/runtime/issues/42561