platform/upstream/dotnet/runtime.git
3 years agoSPMI: adjust near differ offset compare logic (#48245)
Andy Ayers [Sun, 14 Feb 2021 17:45:14 +0000 (09:45 -0800)]
SPMI: adjust near differ offset compare logic (#48245)

Add a clause that maps result1 and result2 offsets to a common base and
then compares that result.

This fixes some noisy diffs from instrumented Tier0 compiles, where the
probe addresses can vary from run to run.

3 years agoOptimize Enumerable.Min/Max<T> with Comparer<T>.Default intrinsic (#48273)
Stephen Toub [Sun, 14 Feb 2021 13:45:54 +0000 (08:45 -0500)]
Optimize Enumerable.Min/Max<T> with Comparer<T>.Default intrinsic (#48273)

3 years agoMemorify DeflateManagedStream in System.IO.Compression (#48085)
Newell Clark [Sun, 14 Feb 2021 10:13:42 +0000 (05:13 -0500)]
Memorify DeflateManagedStream in System.IO.Compression (#48085)

3 years agoRemove dead code (#48241)
Dan Moseley [Sun, 14 Feb 2021 03:51:21 +0000 (19:51 -0800)]
Remove dead code (#48241)

* Remove unnecessary dead creds from S.DS.AM

* Remove hardcoded test cred from process

* remove invalid param

* Update src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoskip SslStream_ClientCertificate_SendsChain test if chain is not valid (#48261)
Tomas Weinfurt [Sat, 13 Feb 2021 21:38:58 +0000 (13:38 -0800)]
skip SslStream_ClientCertificate_SendsChain test if chain is not valid (#48261)

* skip SslStream_ClientCertificate_SendsChain test if chain is not valid

* make test conditional

3 years agoUpdate dependencies from https://github.com/dotnet/runtime-assets build 20210212...
dotnet-maestro[bot] [Sat, 13 Feb 2021 17:03:21 +0000 (17:03 +0000)]
Update dependencies from https://github.com/dotnet/runtime-assets build 20210212.1 (#48268)

[master] Update dependencies from dotnet/runtime-assets

3 years agoMove corehost under src/native (#48071)
Adeel Mujahid [Sat, 13 Feb 2021 16:33:56 +0000 (18:33 +0200)]
Move corehost under src/native (#48071)

* Move corehost under src/native

* Move content out of cli/ directory

* Update configurations post-move

* Update docs

3 years ago[mono] Remove the unused attach support. (#48262)
Zoltan Varga [Sat, 13 Feb 2021 14:56:50 +0000 (09:56 -0500)]
[mono] Remove the unused attach support. (#48262)

3 years ago[master] Update dependencies from mono/linker (#48231)
dotnet-maestro[bot] [Sat, 13 Feb 2021 08:35:59 +0000 (08:35 +0000)]
[master] Update dependencies from mono/linker (#48231)

[master] Update dependencies from mono/linker

3 years agoAdd typeforwards for Stack<T> and Queue<T> to mscorlib shim (#48258)
Alexander Köplinger [Sat, 13 Feb 2021 04:32:38 +0000 (05:32 +0100)]
Add typeforwards for Stack<T> and Queue<T> to mscorlib shim (#48258)

Old Xamarin implemented these types in mscorlib so we need to add typeforwarders for them.

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

3 years ago[wasm][bindings] Treat null string as null when converting (#47341)
Larry Ewing [Sat, 13 Feb 2021 02:40:32 +0000 (20:40 -0600)]
[wasm][bindings] Treat null string as null when converting (#47341)

* Treat null string as null objects

3 years agoMono: Remove remoting code. (#48227)
Zoltan Varga [Sat, 13 Feb 2021 01:20:53 +0000 (20:20 -0500)]
Mono: Remove remoting code. (#48227)

* Remove remoting code.

* Remove more unused code.

3 years agoAdd hostfxr_get_dotnet_environment_info API (#48097)
Mateo Torres-Ruiz [Sat, 13 Feb 2021 00:48:48 +0000 (16:48 -0800)]
Add hostfxr_get_dotnet_environment_info API (#48097)

* Add hostfxr_get_dotnet_environment_info

* Change access modifiers in structs

* Remove unnecessary context local

* Use global install location if no dotnet_root is specified

* Add framework tests

* Update framework_info comparison

* Remove commented code

* Remove unnecessary marshaling
Export fn

* Add hostfxr_get_dotnet_environment_info to hostfxr exports

* Fail if result is nullptr
Validate size of structs
Test that result_context isn't modified

* Remove version_as_str
Update tests

* Add tests for invalid args

3 years agoSuperpmi on Microbenchmarks (#47900)
Kunal Pathak [Sat, 13 Feb 2021 00:43:34 +0000 (16:43 -0800)]
Superpmi on Microbenchmarks (#47900)

* Superpmi on Microbenchmarks

* Fix the mch file path name

* distribute the benchmarks in 30 partitions

* Set input directory for benchmarks

* Some fixes to superpmi_benchmarks

Also update the GUID so we don't overwrite the existing collections.

* fix the name of partition_index and partition_count

* Point the core_root path to the superpmi script

* fix python to invoke for setup

* Add verbosity and include all benchmarks

* Fix the benchmarks invocation

* use benchmarks_ci.py script

* run all benchmarks

* fix the performance source code path

* see why dotnet install fails

* Comment all jobs except benchmarks

* update the right fork

* Switch back to doing installing dotnet on azure machine

* Put dotnet in script

* fix dumpMap, revert change in superpmi.py

* Produce artifacts in temp folder

- Disable mcs -strip for now
- Pass the JitName variable

* Experimental: Exit on failure

* Revert "Produce artifacts in temp folder"

This reverts commit afdfbd4b03a684d780ef06f644dba0dcf0621438.

* Use JitName

* Use workitem folder instead of correlation

* fix typo in WorkItemDirectory

* Set the payload directory

* print error message before exiting

* fix some linux issues

* Make dotnet executable

* resolve merge conflicts

* fix typo from merge conflict

* add logging around chmod

* fix the is_windows condition

* cleanup and disable linux arm/arm64

* remove the unwanted parameter

3 years agoRID for Exherbo linux (#47232)
Maxime SORIN [Fri, 12 Feb 2021 23:01:15 +0000 (00:01 +0100)]
RID for Exherbo linux (#47232)

* RID for Exherbo linux

* delete versions

3 years agoSPMI: tolerate null pResolvedToken (#48208)
Andy Ayers [Fri, 12 Feb 2021 20:54:18 +0000 (12:54 -0800)]
SPMI: tolerate null pResolvedToken (#48208)

We can see this from `getTailCallHelpers` for indirect calls.
Fixes a few recording failures when running coreclr tests under spmi.

3 years agoInline platform package version (#48230)
Viktor Hofer [Fri, 12 Feb 2021 20:27:33 +0000 (21:27 +0100)]
Inline platform package version (#48230)

* Inline platform package version

The platform package version doesn't need to be defined centrally anymore.

3 years agoShow state on failed assertion in EmptyAiaResponseIsIgnored
Kevin Jones [Fri, 12 Feb 2021 19:38:55 +0000 (14:38 -0500)]
Show state on failed assertion in EmptyAiaResponseIsIgnored

3 years agoOptimize readonly char[] in System.Text.Encodings.Web (#48181)
Eric Erhardt [Fri, 12 Feb 2021 19:30:09 +0000 (13:30 -0600)]
Optimize readonly char[] in System.Text.Encodings.Web (#48181)

* Optimize readonly char[] in System.Text.Encodings.Web

Also replace some unsafe code with Span.

* Convert to use const strings.

3 years agoAvoid race conditions when building linker tests (#48028)
Viktor Hofer [Fri, 12 Feb 2021 19:16:27 +0000 (20:16 +0100)]
Avoid race conditions when building linker tests (#48028)

* Avoid race conditions when building linker tests

3 years agoRemove some linker warnings from NullableTypeInfo (#48002)
Andy Gocke [Fri, 12 Feb 2021 18:08:29 +0000 (10:08 -0800)]
Remove some linker warnings from NullableTypeInfo (#48002)

Removes all nullable warnings from NullableTypeInfo by using boxing to
retrieve the underlying value from `Nullable<T>` instead of `Value/HasValue`.

3 years ago[master] Update dependencies from mono/linker (#48222)
dotnet-maestro[bot] [Fri, 12 Feb 2021 18:04:37 +0000 (18:04 +0000)]
[master] Update dependencies from mono/linker (#48222)

[master] Update dependencies from mono/linker

3 years ago[RyuJIT] Devirtualize Comparer<T>.Default (#48160)
Egor Bogatov [Fri, 12 Feb 2021 16:56:39 +0000 (19:56 +0300)]
[RyuJIT] Devirtualize Comparer<T>.Default (#48160)

3 years agoInitial Android SSLStream impl (#47690)
Egor Bogatov [Fri, 12 Feb 2021 16:56:02 +0000 (19:56 +0300)]
Initial Android SSLStream impl (#47690)

3 years agoAllow only HTTP requests during X509 chain building
Krzysztof Wicher [Fri, 12 Feb 2021 16:55:01 +0000 (17:55 +0100)]
Allow only HTTP requests during X509 chain building

Specifically, do not follow an HTTP->HTTPS redirect.  Primary HTTPS URLs were already ignored.

3 years agoRefactor ForbidHtmlCharacters to allow for more trimming. (#48172)
Eric Erhardt [Fri, 12 Feb 2021 15:41:36 +0000 (09:41 -0600)]
Refactor ForbidHtmlCharacters to allow for more trimming. (#48172)

Having a static method on an uninstanstiated class is causing the class to be preserved along with its base hierarchy. And any overriden methods to satisfy abstract base methods.

3 years agoOnly use ninja on Windows for Mono cross AOT compiler build (#48218)
Alexander Köplinger [Fri, 12 Feb 2021 15:10:45 +0000 (16:10 +0100)]
Only use ninja on Windows for Mono cross AOT compiler build (#48218)

* Only use ninja on Windows for Mono cross AOT compiler build

Ninja isn't installed on the CentOS Linux Docker image we're using. This got broken by https://github.com/dotnet/runtime/pull/47589.

* Fix Windows leg

3 years ago[Mono] Fix EnumCompareTo for small integers (#48192)
Egor Bogatov [Fri, 12 Feb 2021 15:10:34 +0000 (18:10 +0300)]
[Mono] Fix EnumCompareTo for small integers (#48192)

3 years agoAdd Mono EventPipe Sample Profiler support. (#47858)
Johan Lorensson [Fri, 12 Feb 2021 14:20:46 +0000 (15:20 +0100)]
Add Mono EventPipe Sample Profiler support. (#47858)

Implement support for EventPipe Sample Profiler on Mono inline with CoreClr Sample Profiler behaviour. By default CoreClr sample profiler tries to run at 1000 hertz (every ms) and on each sample it will stop runtime, snap callstacks for all managed threads, submit EventPipe sample profile events and resume runtime. Doing a full stop/restart of the runtime on every sample could be quite invasive, but is probably the most portable way of implementing it working on most platforms.

This PR implements the same logic, but on Mono runtime, stopping the runtime, record all callstacks for all managed threads that should be sampled, restart runtime and then write all sample profile events into EventPipe. Note that events are written after the runtime has resumed since all code executed when runtime is stopped needs to be async safe (needed when running in preemptive mode) so we can't call into EventPipe at that point.

Going forward we should investigate alternative ways to do sample profiling depending on underlying platform and OS support. Currently implementation will work on all supported platforms, but it will not be as accurate as it could be (especially when using safe points and coop enabled runtime) and impacts measured target. Mono's profiler uses Signals/SuspendThread and for platforms supporting these API's, that could be an alternative implementation. It could also be worth to look into CPU hardware counters using ETW kernel log session on Windows and perf_event_open on Linux.

3 years agoRemove duplication with regard to ReadyToRun compiler resolution (#48201)
Tomáš Rylek [Fri, 12 Feb 2021 08:29:33 +0000 (09:29 +0100)]
Remove duplication with regard to ReadyToRun compiler resolution (#48201)

3 years ago[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet...
dotnet-maestro[bot] [Fri, 12 Feb 2021 07:27:42 +0000 (07:27 +0000)]
[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade dotnet/xharness (#48054)

[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu dotnet/arcade dotnet/xharness

 - Update arcade tfm package deps to netcoreapp3.1

3 years agoFix failure with `reimportSpillClique=true`. (#48152)
Sergey Andreenko [Fri, 12 Feb 2021 07:16:59 +0000 (23:16 -0800)]
Fix failure with `reimportSpillClique=true`.  (#48152)

* add asserts that we don't create void asg and lclVars.

* Fix the issue.

* Add test repro.

* update the comments.

3 years agoBackport docs for System.Numerics.Vectors (#47725)
Carlos Sanchez [Fri, 12 Feb 2021 05:30:27 +0000 (21:30 -0800)]
Backport docs for System.Numerics.Vectors (#47725)

* Unavoidable refresh by Visual Studio of the csproj file.

* Backport Matrix3x2

* Backport Matrix4x4

* Backport Plane

* Backport Quaternion

* Backport Vector

* Backport Vector2

* Backport Vector3

* Backport Vector4

* Manually fix Plane &lt; and &gt;

* Manually fix Vector wrong param names

* Manually fix Vector2 &lt; and &gt;

* Manually fix Vector3 &lt; and &gt;

* Manually fix Vector4 &lt; and &gt;

* Add GenerateDocumentationFile to csproj

* Revert csproj GenerateDocumentationFile change

* Revert file fully

* Fix typo "Multiples" => "Multiplies"

* Use <typeparamref name="T" /> instead of <c>T</c>

* Matrix3x2 adjust remarks.

* Quaternion address remarks.

* Plane adjust remarks.

* Vector4 adjust remarks.

* Matrix4x4 adjust remarks.

* Vector2 adjust remarks.

* Vector3 adjust remarks.

* Address tannergooding and gewarren suggestions.

* Matrix4x4 tries to invert.

* Bring back GenerateDocumentationFile in csproj

* Revert sln change

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
3 years agoflush CachedDirectoryStoreProvider on X509Store changes (#48149)
Tomas Weinfurt [Fri, 12 Feb 2021 04:38:30 +0000 (20:38 -0800)]
flush CachedDirectoryStoreProvider on X509Store changes (#48149)

* flush CachedDirectoryStoreProvider on X509Store changes

* reset _forceRefresh

3 years agoRevert "Support marshalling of null SafeHandle. (#47944)" (#48193)
Aaron Robinson [Fri, 12 Feb 2021 04:02:06 +0000 (20:02 -0800)]
Revert "Support marshalling of null SafeHandle. (#47944)" (#48193)

This reverts commit c3ae456615040b1e826a7d817de47b1dd214c3fd.

3 years agoTurn off PGO builds until I can get a proper fix in (#48170)
Andy Gocke [Fri, 12 Feb 2021 00:44:00 +0000 (16:44 -0800)]
Turn off PGO builds until I can get a proper fix in (#48170)

3 years agoAdd Activity Trace Id Custom Generation Support (#48138)
Tarek Mahmoud Sayed [Fri, 12 Feb 2021 00:17:00 +0000 (16:17 -0800)]
Add Activity Trace Id Custom Generation Support (#48138)

* Add Activity Trace Id Custom Generation Support

* Address the feedback

* Update src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoplatform version (#48175)
Anirudh Agnihotry [Thu, 11 Feb 2021 22:21:52 +0000 (14:21 -0800)]
platform version (#48175)

3 years agoRemove helix xunit reporter from test runs (#48132)
Santiago Fernandez Madero [Thu, 11 Feb 2021 22:21:23 +0000 (14:21 -0800)]
Remove helix xunit reporter from test runs (#48132)

3 years agoSmall pgo cleanup (#48145)
Andy Ayers [Thu, 11 Feb 2021 20:01:27 +0000 (12:01 -0800)]
Small pgo cleanup (#48145)

On the runtime side, intitialize the schema field so that the jit does not
internally think all optimized builds have pgo data with mismatched IL.

Quiet down some of the jit dumping when doing edge instrumentation.

Remove a few unused COMPlus vars from the jit.

3 years agoRefactored INTRINS_OVR to include type infomration, and use it to generate add_intrin...
Nathan Ricci [Thu, 11 Feb 2021 18:20:32 +0000 (13:20 -0500)]
Refactored INTRINS_OVR to include type infomration, and use it to generate add_intrinsic (#47731)

Co-authored-by: Nathan Ricci <naricc@xam-emag-01.redmond.corp.microsoft.com>
3 years agoUpdate dependencies from https://github.com/mono/linker build 20210211.1 (#48164)
dotnet-maestro[bot] [Thu, 11 Feb 2021 18:18:21 +0000 (18:18 +0000)]
Update dependencies from https://github.com/mono/linker build 20210211.1 (#48164)

[master] Update dependencies from mono/linker

3 years agoReduce the number of C literal strings emitted for icalls etc. a bit. (#48150)
Zoltan Varga [Thu, 11 Feb 2021 17:11:37 +0000 (12:11 -0500)]
Reduce the number of C literal strings emitted for icalls etc. a bit. (#48150)

3 years agoRemove the parsing of .config files from get_runtimes_from_exe (). (#48147)
Zoltan Varga [Thu, 11 Feb 2021 16:00:43 +0000 (11:00 -0500)]
Remove the parsing of .config files from get_runtimes_from_exe (). (#48147)

3 years agoXCode.cs: Statically link libraries when forcing AOT (#48156)
Alexander Köplinger [Thu, 11 Feb 2021 14:35:36 +0000 (15:35 +0100)]
XCode.cs: Statically link libraries when forcing AOT (#48156)

The fix in https://github.com/dotnet/runtime/pull/48135 wasn't fully correct since it just fixed the problem for libSystem.Native but not the other libraries.

The real problem is that we're setting `preferDylib` to true via `!isDevice` but still generate the pinvoke mapping to `__Internal` for all files where an `.a` file is found.

The reason why this works in the simulator on non-AOT cases is because we only call the `register_dllmap` function when we're actually forcing AOT on the simulator: https://github.com/dotnet/runtime/blob/42009d1f33b52e40e5471d5c0d3ff4a8d5b2b83a/src/tasks/AppleAppBuilder/Templates/runtime.m#L239-L240

The better fix is to extend the check to always apply when forceAOT is true.

3 years agoDo not use /dev/zero to mmap anonymous memory (#48140)
Vladimir Sadov [Thu, 11 Feb 2021 13:47:35 +0000 (05:47 -0800)]
Do not use /dev/zero to mmap anonymous memory (#48140)

* return void

* Always use MAP_ANON

* remove HAVE_MMAP_DEV_ZERO config

3 years ago[browser][websockets] Support for CloseOutputAsync (#47906)
Kenneth Pouncey [Thu, 11 Feb 2021 11:48:23 +0000 (12:48 +0100)]
[browser][websockets] Support for CloseOutputAsync (#47906)

* Set the WebSocketException to Faulted to fix tests

* Fix the exceptions that are being thrown to coincide with test expectations

* Fix Dispose we are not processing it multiple times.

* Fix Abort code so the messages align correctly with the tests.

example from tests:

```
Assert.Equal() Failure
  info: Expected: Aborted
  info: Actual:   Closed
```

* Set the WebSocketException to Faulted to fix test expectations

* Close the connections correctly.

* Fix Abort test Abort_CloseAndAbort_Success

- This was causing a never ending Task when aborted after a Close already executed.
- Never ended which was a cause of memory errors after left running.
- See also https://github.com/dotnet/runtime/issues/45586

* - Fixes for ReceiveAsyncTest

- Exception text not sent correctly.  This test was expecting 'Aborted'.
- Mismatched expected exception messages
- Make sure the connection is torn down.
- Multiple GC calls that end in running out of memory fixed.  https://github.com/dotnet/runtime/issues/45586

```
//  [FAIL] System.Net.WebSockets.Client.Tests.CancelTest.ReceiveAsync_AfterCancellationDoReceiveAsync_ThrowsWebSocketException(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
//   info: Assert.Equal() Failure
//   info:                                  ↓ (pos 39)
//   info: Expected: ··· an invalid state ('Aborted') for this operation. Valid state···
//   info: Actual:   ··· an invalid state ('Open') for this operation. Valid states a···
//   info:                                  ↑ (pos 39)

```

* Remove ActiveIssue attributes that should be fixed

* Add back code after merge conflict

- Update tests that are resolved.

* Fix tests that were failing when expecting CloseSent as a valid state.

```
// fail: [FAIL] System.Net.WebSockets.Client.Tests(server: ws://corefx-net-http11.azurewebsites.net/WebSocket/EchoWebSocket.ashx)
//   info: Assert.Throws() Failure
//   info: Expected: typeof(System.OperationCanceledException)
//   info: Actual:   typeof(System.Net.WebSockets.WebSocketException): The WebSocket is in an invalid state ('Aborted') for this operation. Valid states are: 'Open, CloseSent'
```

* Fix the Abort and Cancel never ending tests.

- Fix the clean up of the task and set or cancel the task cleanly.

* Add ActiveIssue to websocket client SendRecieve tests

* Add ActiveIssue to websocket client SendRecieve tests

- intermittently failing with System.OperationCanceledException : The operation was canceled.

* Add extra time to timeout for a couple of tests that were intermittently failing with System.OperationCanceledException : The operation was canceled.

- This was an ActiveIssue https://github.com/dotnet/runtime/issues/46909 but extending the time seems to do the job.

* Add ActiveIssue to websocket client SendRecieve tests

- [browser][websocket] Hang with responses without ever signaling "end of message"
- [ActiveIssue("https://github.com/dotnet/runtime/issues/46983", TestPlatforms.Browser)]  // JS Fetch does not support see issue

* Remove `Interlocked` code as per review comment.

* Fix comment

* Fix Abort tests on non chrome browsers.

- Fix for those browsers that do not set Close and send an onClose event in certain instances i.e. firefox and safari.
- Chrome will send an onClose event and we tear down the websocket there.  Other browsers need to be handled differently.

* We should not throw here.

- Closing an already-closed ClientWebSocket should be a no-op.

* Add `CloseOutputAsync` implementation

- The browser websocket implementation does not support this so we fake it the best we can.

* Remove `ActiveIssue` and add more tests

- Remove `[ActiveIssue("https://github.com/dotnet/runtime/issues/45468", TestPlatforms.Browser)]`
- Add more tests

* Address timeout implementation review

* Add code as per SignalR comments to prevent long wait times in some cases

As per comments
- We clear all events on the websocket (including onClose),
- call websocket.close()
- then call the user provided onClose method manually.

* Update src/libraries/System.Net.WebSockets.Client/tests/SendReceiveTest.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update src/libraries/System.Net.WebSockets.Client/src/System/Net/WebSockets/BrowserWebSockets/BrowserWebSocket.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Address review comments for using `TrySet*` variants

* Address review about using PascalCasing

* Change test to be a platform check and not an ActiveIssue as per review

Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDo not align cloned loops (#48090)
Kunal Pathak [Thu, 11 Feb 2021 07:43:32 +0000 (23:43 -0800)]
Do not align cloned loops (#48090)

* Do not align cloned loops

3 years ago[wasm] Silence more warnings in the wasm runtime build (#48141)
Larry Ewing [Thu, 11 Feb 2021 07:08:33 +0000 (01:08 -0600)]
[wasm] Silence more warnings in the wasm runtime build (#48141)

3 years ago[mono] Remove verifier (#48142)
Aleksey Kliger (λgeek) [Thu, 11 Feb 2021 05:30:21 +0000 (00:30 -0500)]
[mono] Remove verifier (#48142)

* remove DISABLE_VERIFIER

* Remove metadata-verify and calls to verifier-disabled functions

* Chase down callers of mini_method_verify and remove

3 years agoRe-enable iOS AOT functional test (#48096)
Maxim Lipnin [Thu, 11 Feb 2021 04:00:17 +0000 (07:00 +0300)]
Re-enable iOS AOT functional test (#48096)

3 years agoInitial support for System.Runtime.Intrinsics.Arm.Aes (#48114)
Fan Yang [Thu, 11 Feb 2021 03:08:50 +0000 (22:08 -0500)]
Initial support for System.Runtime.Intrinsics.Arm.Aes (#48114)

3 years agoStatically link System.Native into the final exe on ios, since the pinvoke mapping...
Zoltan Varga [Thu, 11 Feb 2021 02:03:26 +0000 (21:03 -0500)]
Statically link System.Native into the final exe on ios, since the pinvoke mapping maps calls to it to __Internal. (#48135)

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

3 years agoFix official build (#48139)
Santiago Fernandez Madero [Thu, 11 Feb 2021 00:52:17 +0000 (16:52 -0800)]
Fix official build (#48139)

3 years agoCheck whether EventSource is supported before initializing RuntimeEventSource (#48121)
Sung Yoon Whang [Thu, 11 Feb 2021 00:22:10 +0000 (16:22 -0800)]
Check whether EventSource is supported before initializing RuntimeEventSource (#48121)

3 years agoEnable Portable ThreadPool events to be written using NativeRuntimeEventSource (...
Sung Yoon Whang [Thu, 11 Feb 2021 00:21:39 +0000 (16:21 -0800)]
Enable Portable ThreadPool events to be written using NativeRuntimeEventSource (#47829)

* match up the GUID

* why is this returning nothing

* Make ThreadPool emit events via NativeRuntimeEventSource

* found error...

* hack around having duplicate events generated

* make portable threadpool fire events through nativeruntimeeventsource

* make the initializer live in correct namespace

* EventListener tests are passing now

* make native QCall endpoints that sink into LTTng

* send events through XplatEventLogger sink

* Fix merge error

* double registration

* fix callback not getting handled when lttng is enabled

* cleanup 1

* rename file

* remove stale comments

* remove stale comment

* undo useless change

* fix broken EventListener

* apply code review feedback

* fix windows build

* fix incorrect qcall

* fix up ifdefs for Windows builds

* fix ifdef

* put back removed code

* tests pass now

* Fix NativeRuntimeEventSource not getting enabled for lttng

* Add some more comments

* Add comment in generated code

* fix mono build

* PR feedback

* fix typo

* code review feedback

3 years ago[master] Update dependencies from mono/linker (#48098)
dotnet-maestro[bot] [Wed, 10 Feb 2021 23:13:00 +0000 (23:13 +0000)]
[master] Update dependencies from mono/linker (#48098)

[master] Update dependencies from mono/linker

3 years agoFix build (#48127)
Andy Gocke [Wed, 10 Feb 2021 22:47:21 +0000 (14:47 -0800)]
Fix build (#48127)

Accidentally deleted formatting in runtime.yml

3 years agoFix Restoring the Original Activity Parent (#48034)
Tarek Mahmoud Sayed [Wed, 10 Feb 2021 22:45:59 +0000 (14:45 -0800)]
Fix Restoring the Original Activity Parent (#48034)

3 years agoReorganize protection flipping (#48118)
Jan Vorlicek [Wed, 10 Feb 2021 22:44:36 +0000 (14:44 -0800)]
Reorganize protection flipping (#48118)

Get rid of explicit protection change to RW

3 years agoAdd pgo instrument job (#47745)
Andy Gocke [Wed, 10 Feb 2021 21:41:15 +0000 (13:41 -0800)]
Add pgo instrument job (#47745)

Adds a new flag for building packages instrumented with PGO data. The
packages have new names as well, <package>.PGO.

Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
3 years agoAdd source index build step (#46823)
Alex Perovich [Wed, 10 Feb 2021 21:40:24 +0000 (13:40 -0800)]
Add source index build step (#46823)

* Add source index build step

* dotnet.cmd is breaking things, rename it in the source-index build

* Add missing parameter

* another fix

* roll forward

* Change common yaml template back to main version

* Remove PR run of source index build for now

3 years agoFixup feeds (#48065)
dotnet bot [Wed, 10 Feb 2021 21:32:21 +0000 (13:32 -0800)]
Fixup feeds (#48065)

Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
3 years agoRemoving 2 rooted types related to EventSource FeatureSwitch (#48104)
Lakshan Fernando [Wed, 10 Feb 2021 21:14:59 +0000 (13:14 -0800)]
Removing 2 rooted types related to EventSource FeatureSwitch (#48104)

* eh fix

* Removing 2 rooted types related to EventSource Feature Switch

* typo

* NativeRuntimeEventSource needs to remain for now

3 years agoAdd System.Linq Chunk extension method (#47965)
Robert Andersson [Wed, 10 Feb 2021 19:41:59 +0000 (20:41 +0100)]
Add System.Linq Chunk extension method (#47965)

* Add System.Linq Chunk extension method

Fix #27449

* Use explicit types instead of type inference

* Seperate inner and outer loop

* Rename parameter maxSize to size

* Add missing license header

* Remove Chunk.SpeedOpt.cs

* Add tests to verify Chunk works after mutations

* Add/remove before getting enumerator in tests

* Test content of chunk method for IQueryable<T>

3 years agoFix JIT disasm for xor reg, reg (#47980)
Pent Ploompuu [Wed, 10 Feb 2021 19:13:07 +0000 (21:13 +0200)]
Fix JIT disasm for xor reg, reg (#47980)

3 years agoRemove superfluous #nullable enables (#48033)
Stephen Toub [Wed, 10 Feb 2021 19:04:48 +0000 (14:04 -0500)]
Remove superfluous #nullable enables (#48033)

And enable nullable annotations in test projects

3 years agoMake superpmi collection with command more convenient (#48092)
Bruce Forstall [Wed, 10 Feb 2021 19:00:46 +0000 (09:00 -1000)]
Make superpmi collection with command more convenient (#48092)

* Make superpmi collection with command more convenient

Allow a command to be searched for on the PATH.

* Allow searching core_root for tool

Fix help string

3 years agoUpdate AppleRunnerTemplate.sh (#48103)
Maxim Lipnin [Wed, 10 Feb 2021 18:18:52 +0000 (21:18 +0300)]
Update AppleRunnerTemplate.sh (#48103)

3 years ago[RyuJIT] Implement Interlocked.And and Interlocked.Or for arm64-v8.1 (#46253)
Egor Bogatov [Wed, 10 Feb 2021 18:03:35 +0000 (21:03 +0300)]
[RyuJIT] Implement Interlocked.And and Interlocked.Or for arm64-v8.1 (#46253)

3 years agoClarify distro-agnostic OpenSSL 1.0 check and non-portable comment
Davis Goodin [Wed, 10 Feb 2021 16:44:46 +0000 (10:44 -0600)]
Clarify distro-agnostic OpenSSL 1.0 check and non-portable comment

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoBring up Android and Browser cross-compilers on Windows (#47589)
Jo Shields [Wed, 10 Feb 2021 15:56:12 +0000 (10:56 -0500)]
Bring up Android and Browser cross-compilers on Windows (#47589)

For now, this only adds Android x64. arm, arm64 & x86 will need to come later.

3 years agoRemove unused mono data (#48100)
Marek Safar [Wed, 10 Feb 2021 15:45:42 +0000 (16:45 +0100)]
Remove unused mono data (#48100)

3 years agoUpdate area-owners.md (#48099)
Karel Zikmund [Wed, 10 Feb 2021 14:48:42 +0000 (15:48 +0100)]
Update area-owners.md (#48099)

3 years agoUpdate apicompat ref pack compare version to 5.0.0 (#47044)
Viktor Hofer [Wed, 10 Feb 2021 13:53:34 +0000 (14:53 +0100)]
Update apicompat ref pack compare version to 5.0.0 (#47044)

* Update apicompat ref pack compare verison to 5.0.0

* Baseline attribute changes

3 years agoFix DisableSourceLink value (#47931)
Viktor Hofer [Wed, 10 Feb 2021 11:52:21 +0000 (12:52 +0100)]
Fix DisableSourceLink value (#47931)

3 years ago[master] Update dependencies from mono/linker (#48080)
dotnet-maestro[bot] [Wed, 10 Feb 2021 09:29:54 +0000 (10:29 +0100)]
[master] Update dependencies from mono/linker (#48080)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years ago[browser] Fix System.Delegate.DynamicInvoke method can not be resolved (#47519)
Kenneth Pouncey [Wed, 10 Feb 2021 08:58:35 +0000 (09:58 +0100)]
[browser] Fix System.Delegate.DynamicInvoke method can not be resolved (#47519)

3 years agoremove bounds checks for some more unsigned comparisons (#43568)
nathan-moore [Wed, 10 Feb 2021 07:58:08 +0000 (02:58 -0500)]
remove bounds checks for some more unsigned comparisons (#43568)

* Remove bound checks for unsigned <= with constant integers

* formatting

* update comment and add next edge tests

3 years ago[wasm] Add `Microsoft.NET.Runtime.WebAssembly.Sdk` for use with workloads (#48021)
Ankit Jain [Wed, 10 Feb 2021 06:56:05 +0000 (01:56 -0500)]
[wasm] Add `Microsoft.NET.Runtime.WebAssembly.Sdk` for use with workloads (#48021)

3 years agofixed a few issues for regions (#48043)
Maoni Stephens [Wed, 10 Feb 2021 05:58:00 +0000 (21:58 -0800)]
fixed a few issues for regions (#48043)

+ We cannot call set_brick with 0 for UOH regions - UOH should always have bricks of 0 and set_brick with 0 sets the brick to 1. I fixed the delete_heap_segment to clear the bricks for SOH regions so if we do get a region where an SOH region used to be we can assert the bricks are 0.

+ We cannot call verify_regions on gen0 regions when we are getting a UOH region and vice versa since they take different more space locks. So I created a new overload of verify_regions (gen_number) and only call the original verify_regions at places where we know we can verify all generations.

+ In decide_on_compacting we need to implement the non production detection for regions as well.

+ In sweep_uoh_objects we need to re-check if o is >= allocated when we advance to the next region or we could AV.

3 years agoReturn failure code when SafeHandle tests fail. (#48083)
Aaron Robinson [Wed, 10 Feb 2021 04:25:51 +0000 (20:25 -0800)]
Return failure code when SafeHandle tests fail. (#48083)

* Return failure code when SafeHandle tests fail.

* Disable SafeHandle tests on mono.

* Handle platform specific exception type.

3 years agoadd security attributes (#48026)
Anirudh Agnihotry [Wed, 10 Feb 2021 04:04:44 +0000 (20:04 -0800)]
add security attributes (#48026)

3 years agoMoving Microsoft.Extensions.Hosting* from Extensions to Runtime (#47686)
Anirudh Agnihotry [Wed, 10 Feb 2021 04:04:26 +0000 (20:04 -0800)]
Moving Microsoft.Extensions.Hosting* from Extensions to Runtime (#47686)

* Project move from extensions

* addding ref and some analyzer changes

* header changes and ref file for system.md

* add ref projects

* minor formating

* packaging

* adding sln files

* address feedbacl

* correct case of Directory.build.props

* add net461 dll to package

* Remove usage of startsWith

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoSPMI: make method identity dependent on jit flags and isa flags (#48082)
Andy Ayers [Wed, 10 Feb 2021 03:21:08 +0000 (19:21 -0800)]
SPMI: make method identity dependent on jit flags and isa flags (#48082)

This makes it possible for SPMI tooling to retain multiple contexts for methods
that only differ by flag settings. In particular, running SPMI with tiered
compilation, SPMI can retain both the Tier0 and Tier1 contexts.

3 years agoRemove internal EventPipe API and redundant tests (#48053)
Sung Yoon Whang [Wed, 10 Feb 2021 02:41:41 +0000 (18:41 -0800)]
Remove internal EventPipe API and redundant tests  (#48053)

* remove EventPipe type

* remove outdated tests

* remove GitHub_22247

3 years agoSupport marshalling of null SafeHandle. (#47944)
Aaron Robinson [Wed, 10 Feb 2021 02:01:54 +0000 (18:01 -0800)]
Support marshalling of null SafeHandle. (#47944)

* Support marshalling of null SafeHandle.

* Consume nullable SafeHandle marshalling in OSX Crypto P/Invokes.

* Match SafeHandle behavior on Mono.

3 years agoMake corelib crossgen incremental (#48086)
Sven Boemer [Wed, 10 Feb 2021 01:35:04 +0000 (17:35 -0800)]
Make corelib crossgen incremental (#48086)

* Make corelib crossgen incremental

* Fix typo

3 years agoMove Android arm64 to the staging pipeline (#48064)
Steve Pfister [Wed, 10 Feb 2021 00:42:05 +0000 (19:42 -0500)]
Move Android arm64 to the staging pipeline (#48064)

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
3 years agoResolve ILLink warnings in System.Linq.Expressions (Round 3) (#47938)
Eric Erhardt [Wed, 10 Feb 2021 00:19:06 +0000 (18:19 -0600)]
Resolve ILLink warnings in System.Linq.Expressions (Round 3) (#47938)

* Resolve ILLink warnings in System.Linq.Expressions (Round 3)

Contributes to #45623

* Resolve a few more ILLink warnings in System.Linq.Expressions

3 years agoAssist MSVC dependency analysis when using include sources in EventPipe. (#48050)
Johan Lorensson [Tue, 9 Feb 2021 22:48:55 +0000 (23:48 +0100)]
Assist MSVC dependency analysis when using include sources in EventPipe. (#48050)

MSVC have troubles detect changes in included sources and rebuild needed
changes. Fix will set the define into in cmake making sure ep-source.c
and ds-source.c always get rebuild when included source files changes.

3 years agoBig endian fixes for dotnet runtime (#47981)
Neale Ferguson [Tue, 9 Feb 2021 21:54:23 +0000 (07:54 +1000)]
Big endian fixes for dotnet runtime (#47981)

3 years agoFileSystem.AccessControl tests not cleaning files properly (#47074)
Carlos Sanchez [Tue, 9 Feb 2021 21:11:29 +0000 (13:11 -0800)]
FileSystem.AccessControl tests not cleaning files properly (#47074)

* FileSystem.AccessControl tests not cleaning files properly

The TempDirectory helper class is disposable. The finalizer calls a function that deletes the folders left behind, without throwing exceptions on fail.

This protective try catch hid some additional errors that were not caught when these unit tests were first written, so I'm fixing them:

- I created a class that inherits from TempDirectory to override the folder deleting method
- In the finalizer, I iterate through all the files and folders created by the test, ensure their ACLs give me full control (in case the tests prevent deletion), then attempt to delete the tree.
- To verify my changes, I did not put the finalizer code in a try catch, so I could see the errors thrown when attempting to delete the tree.
- The deletion exceptions helped me find that GetAccessControl needs to be called with the AccessControlSections.Access argument, otherwise they throw "PrivilegeNotHeldException: The process does not possess the 'SeSecurityPrivilege' privilege which is required for this operation."
- I avoided creating files and directories using a FileSecurity or DirectorySecurity that did not have its access rules defined. Files and folders created this way could not be deleted.
- I avoided testing AccessControlType.Deny. This would also cause deletion exceptions.
- Moved some repeated code into common methods.

* Temp commit to verify files and dirs deleted without try catch

* Set directory security first, then file security, in DeleteDirectory. Bring back InlineData for test, but only when a Read is included.

* Restore try catch before merging.

* Address suggestions.

* Bring back tests that consume the parameterless security constructors. Bring back all FileSystemRights with annotations on why some need to be skipped. Ensure DeleteDirectory can successfully reset permissions before deleting all files and folders deleted by the unit test.

* NotFound test

* FileShare.None

* InlineData FileMode

* Rename method that creates per platform. Bring back inline data.

* Address suggestions

* Address suggestions

* Address suggestions

* Reverting Verify_FileSecurity_CreateFile to the original arguments

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
3 years agoupdate the package index to have the latest stable package for harvesting (#48075)
Anirudh Agnihotry [Tue, 9 Feb 2021 20:41:53 +0000 (12:41 -0800)]
update the package index to have the latest stable package for harvesting (#48075)

* update the pi

* add the missing entry

3 years agoRevert "Use same code to DetectCiphersuiteConfiguration for portable and non-portable...
Davis Goodin [Tue, 9 Feb 2021 19:26:59 +0000 (13:26 -0600)]
Revert "Use same code to DetectCiphersuiteConfiguration for portable and non-portable builds" (#48013)

This reverts commit 464010d9d0241bbdcbfbda25b32e78991ddf6093.

3 years agoAdd test for COM + dynamic keyword with IntPtr/UIntPtr (#48038)
Elinor Fung [Tue, 9 Feb 2021 18:40:59 +0000 (10:40 -0800)]
Add test for COM + dynamic keyword with IntPtr/UIntPtr (#48038)

3 years agoUpdate dependencies from https://github.com/mono/linker build 20210209.1 (#48055)
dotnet-maestro[bot] [Tue, 9 Feb 2021 17:37:14 +0000 (12:37 -0500)]
Update dependencies from https://github.com/mono/linker build 20210209.1 (#48055)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.21108.2 -> To Version 6.0.0-alpha.1.21109.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoSplit HttpClient.Send/SendAsync implementation (#47916)
Stephen Toub [Tue, 9 Feb 2021 17:21:32 +0000 (12:21 -0500)]
Split HttpClient.Send/SendAsync implementation (#47916)

Any use of HttpClient.SendAsync ends up preventing synchronous code paths (e.g. HttpContent.LoadIntoBuffer) from being trimmed, because both Send and SendAsync are just delegating with a bool to a shared helper.  While that makes sense for sharing a lot of code in SocketsHttpHandler, with very little code duplication we can avoid it in HttpClient and enable the sync code paths to be trimmed away for a Blazor wasm app.  This also means we no longer need to pragma warning disable platform compatibility errors.

3 years agoFixing impMathIntrinsic to not insert unnecessary casts (#47923)
Tanner Gooding [Tue, 9 Feb 2021 17:17:18 +0000 (09:17 -0800)]
Fixing impMathIntrinsic to not insert unnecessary casts (#47923)

* Add the Math benchmarks as tests

* Fixing impMathIntrinsic to not insert unnecessary casts

3 years agoRefactor Number.NumberToFloatingPointBits so System.Half can be trimmed (#47933)
Tanner Gooding [Tue, 9 Feb 2021 17:15:45 +0000 (09:15 -0800)]
Refactor Number.NumberToFloatingPointBits so System.Half can be trimmed (#47933)