platform/upstream/dotnet/runtime.git
3 years agoUnpin Roslyn compiler (#43241)
Jan Kotas [Sat, 10 Oct 2020 02:38:12 +0000 (19:38 -0700)]
Unpin Roslyn compiler (#43241)

3 years agoRemove OSX arm64 from libraries outerloop build (#43242)
Santiago Fernandez Madero [Sat, 10 Oct 2020 01:35:05 +0000 (20:35 -0500)]
Remove OSX arm64 from libraries outerloop build (#43242)

3 years agoDelete VirtualNetwork{Stream} test code (#43155)
Stephen Toub [Sat, 10 Oct 2020 00:40:02 +0000 (20:40 -0400)]
Delete VirtualNetwork{Stream} test code (#43155)

* Delete VirtualNetwork{Stream} test code

Replace it with a CreateConnectedStream helper.

* Address PR feedback

* Fix test I must have gotten interrupted while fixing

3 years agoImplement RandomNumberGenerator.GetBytes(int)
Kevin Jones [Fri, 9 Oct 2020 23:23:54 +0000 (19:23 -0400)]
Implement RandomNumberGenerator.GetBytes(int)

3 years agoDifferentiate between IMPL_LIMITATION and NO_WAY (#43070)
David Wrighton [Fri, 9 Oct 2020 22:38:49 +0000 (15:38 -0700)]
Differentiate between IMPL_LIMITATION and NO_WAY (#43070)

Differentiate between `IMPL_LIMITATION` and `NO_WAY` in the JIT by making `IMPL_LIMITATION` return `CORJIT_IMPLLIMITATION` and handle that value such that crossgen2 behavior behaves better in the presence of an `IMPL_LIMITATION`.

Also, change a `NO_WAY` in the X86 JIT to `IMPL_LIMITATION` to better reflect the issue in code.

The effect of these changes is that a test which encounters an `IMPL_LIMITATION` while running crossgen2 in our test suite will not cause the test to fail, but instead will only cause it to fail if the limitation is also present at runtime. This addresses the last issue known to cause the Pri0 X86 Crossgen2 tests to fail.

3 years agoFix crossbuild on CentOS (#43189)
Jan Vorlicek [Fri, 9 Oct 2020 22:27:16 +0000 (00:27 +0200)]
Fix crossbuild on CentOS (#43189)

* Fix crossbuild on CentOS

This change fixes the crossbuilding to work on CentOS. Clang
frontend presets some of the compiler options based on the
host OS and I guess that's causing the need to add the
`--rpath-link`.
The ranlib change to use llvm ranlib fixed a problem where
cmake attempted to use ranlib from the rootfs for some
reason.

* Reflect PR feedback

3 years ago[master] Update dependencies from Microsoft/vstest mono/linker (#43224)
dotnet-maestro[bot] [Fri, 9 Oct 2020 22:19:34 +0000 (22:19 +0000)]
[master] Update dependencies from Microsoft/vstest mono/linker (#43224)

[master] Update dependencies from Microsoft/vstest mono/linker

3 years ago[wasm][debugger][tests] Make `dotnet test DebuggerTestSuite.csproj` work (#43158)
Ankit Jain [Fri, 9 Oct 2020 22:11:50 +0000 (18:11 -0400)]
[wasm][debugger][tests] Make `dotnet test DebuggerTestSuite.csproj` work (#43158)

* [wasm][debugger][tests] Simplify test project files

Now, the tests can be run with `dotnet test DebuggerTestSuite.csproj`.
and the existing `make run-debugger-tests` still works.

Changes:

- We don't need to use wasmAppBuilder for all the test projects, only
`debugger-test`.
- Other assemblies just get bundled with `debugger-test`

- Move common properties to `Directory.Build.*`
- And move the settings being used for debugger-test in the Makefile to
msbuild:
- RuntimeConfiguration defaults to Release, same as what the
Makefile did

- build all the debugger-tests in artifacts dir
- And instead of `TEST_SUITE_PATH`, determine the debugger-tests path
based on the testsuite itself.

- We can then remove `build-debugger-test-app`

* [wasm][debugger] add debugger.sln

* [wasm][debugger][tests] fix warnings - remove explicit xunit packageref

3 years agoEnable building .NET Core osx-arm64 in CI (#43187)
Steve MacLean [Fri, 9 Oct 2020 22:02:51 +0000 (18:02 -0400)]
Enable building .NET Core osx-arm64 in CI (#43187)

* Enable building .NET Core osx-arm64 in CI
* For osx-arm64 xcode-select xcode_12.2
* Use vmImage macOS-10.15 for all platforms

3 years agoAddress outstanding issues with System.Net MatchingRefApiCompatBaselines (#43230)
Stephen Toub [Fri, 9 Oct 2020 21:18:36 +0000 (17:18 -0400)]
Address outstanding issues with System.Net MatchingRefApiCompatBaselines (#43230)

3 years agoFix link to wasm build instructions (#43229)
Ryan Lucia [Fri, 9 Oct 2020 21:00:41 +0000 (17:00 -0400)]
Fix link to wasm build instructions (#43229)

* Fix link to wasm build instructions

* Update docs/workflow/building/mono/README.md

Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoUpdate TargetFramework.Sdk and react to changes (#43218)
Viktor Hofer [Fri, 9 Oct 2020 20:27:39 +0000 (22:27 +0200)]
Update TargetFramework.Sdk and react to changes (#43218)

3 years agoUpdate area-owners.md (#43233)
Dan Moseley [Fri, 9 Oct 2020 20:13:35 +0000 (13:13 -0700)]
Update area-owners.md (#43233)

@jeffschwMSFT I see @swaroop-sridhar left the team. Are these the correct edits?

3 years agoFix libraries jitstress jobs (#43191)
Bruce Forstall [Fri, 9 Oct 2020 17:13:57 +0000 (10:13 -0700)]
Fix libraries jitstress jobs (#43191)

leading to pipeline failures in the libraries jitstress jobs.
This fixes up the references.

3 years agoCleanup more EventSource calls in SPC to work better with illinker (#40539)
Marek Safar [Fri, 9 Oct 2020 17:00:27 +0000 (19:00 +0200)]
Cleanup more EventSource calls in SPC to work better with illinker (#40539)

Co-authored-by: Koundinya Veluri <kouvel@users.noreply.github.com>
3 years ago[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/icu mono...
dotnet-maestro[bot] [Fri, 9 Oct 2020 16:46:44 +0000 (18:46 +0200)]
[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/icu mono/linker (#43181)

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

Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
 From Version 5.0.0-beta.20478.3 -> To Version 5.0.0-beta.20506.7

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20478.2 -> To Version 6.0.0-alpha.1.20508.4

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

runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk
 From Version 9.0.1-alpha.1.20505.1 -> To Version 9.0.1-alpha.1.20506.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-alpha.1.20505.1 -> To Version 6.0.0-alpha.1.20506.2

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20478.2 -> To Version 6.0.0-alpha.1.20509.2

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20478.2 -> To Version 6.0.0-alpha.1.20509.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years ago[wasm][net] System.Net.Mail should not throw PNSE for full assembly. (#42974)
Kenneth Pouncey [Fri, 9 Oct 2020 13:09:46 +0000 (15:09 +0200)]
[wasm][net] System.Net.Mail should not throw PNSE for full assembly. (#42974)

* [wasm][net] System.Net.Mail should not throw PNSE for full assembly.

* Address review comment.  Remove comment line

* Address review comments.  Remove redundant defs

* Activate tests on CI

- SmtpClient relevant tests are not supported

* Add `[UnsupportedOSPlatform("browser")]` to SmtpClient

* Add back System.Net.Mail Unit tests

* Remove redundant $(TargetsBrowser) from ItemGroup

* Add `[UnsupportedOSPlatform("browser")]` to SmtpClient methods and properties

- It does not hurt to have this.

* Remove unnecessary Unsupported attribute at the method level

* Remove unnecessary Unsupported attribute at the method level

* Modify message on skipped test.

* Address review comments and remove string resource

* Remove redundant AssemblyInfo per review comment

* Remove condition attribute

* Attribute is needed

* Fix build issues

3 years agoFix some issues with background thread compilation (#42986)
Maryam Ariyan [Fri, 9 Oct 2020 11:52:46 +0000 (04:52 -0700)]
Fix some issues with background thread compilation (#42986)

- Resolve dependencies before counting to avoid the race
where its possible for the background thread to run before
the main thread resulting in singletons being resolved during
compilation (it's meant to be side effect free).

- We also avoid capturing the ExecutionContext on the background thread
to avoid capture of async locals.

Fixes dotnet/extensions#3566

Taken from https://github.com/dotnet/extensions/pull/3569/commits/07e4459b6e81d10c9b3a6561f4cc0fe5a6cbcf8b

3 years agoFix TypeBuilder's base type in ref (#42947)
Stephen Toub [Fri, 9 Oct 2020 10:14:22 +0000 (06:14 -0400)]
Fix TypeBuilder's base type in ref (#42947)

* Fix Type/Enum/GenericTypeParameterBuilders' base types in ref

* Fix mono's EnumBuilder.IsAssignableFrom implementation

With the ref change, a test started failing because the C# compiler started generating a call to TypeInfo's IsAssignableFrom(TypeInfo) rather than Type's IsAssignableFrom(TypeInfo).

3 years agouse new CancellationToken.UnsafeRegister overload in StreamBuffer (#43197)
Geoff Kizer [Fri, 9 Oct 2020 10:13:17 +0000 (03:13 -0700)]
use new CancellationToken.UnsafeRegister overload in StreamBuffer (#43197)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoImplement ZLibStream and fix SocketsHttpHandler deflate support (#42717)
Stephen Toub [Fri, 9 Oct 2020 10:12:47 +0000 (06:12 -0400)]
Implement ZLibStream and fix SocketsHttpHandler deflate support (#42717)

* Implement ZLibStream and fix SocketsHttpHandler deflate support

- Implements ZLibStream, exposes it in the ref, and add tests
- Fixes SocketsHttpHandler to use ZLibStream instead of DeflateStream

* Add comment about deflate content encoding

* Apply suggestions from code review

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
* Fix netfx build

Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com>
3 years agoSimplify DynamicWinsockMethods (#43190)
Jan Kotas [Fri, 9 Oct 2020 05:20:48 +0000 (22:20 -0700)]
Simplify DynamicWinsockMethods (#43190)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoPublish all packages generated from the experiment branch when in runtimelab (#156...
Santiago Fernandez Madero [Fri, 9 Oct 2020 03:37:08 +0000 (22:37 -0500)]
Publish all packages generated from the experiment branch when in runtimelab (#156) (#43193)

* Publish all packages generated from the experiment branch

* Change publishing to follow installer publish infrastructure

* React to name suffix change in all configurations

3 years agominor quic improvements (#43151)
Geoff Kizer [Fri, 9 Oct 2020 01:59:38 +0000 (18:59 -0700)]
minor quic improvements (#43151)

* minor quic improvements

* address PR feedback

* more feedback

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoAdd CancellationToken.Register with callback accepting token (#43114)
Stephen Toub [Fri, 9 Oct 2020 01:57:38 +0000 (21:57 -0400)]
Add CancellationToken.Register with callback accepting token (#43114)

* Add CancellationToken.Register with callback accepting token

* Address PR feedback

3 years agoUpdate analyzer versions (#43038)
Stephen Toub [Fri, 9 Oct 2020 01:56:53 +0000 (21:56 -0400)]
Update analyzer versions (#43038)

3 years ago[System.Drawing.Common] Work around libgdiplus use after free (#43074)
Aleksey Kliger (λgeek) [Thu, 8 Oct 2020 23:07:08 +0000 (19:07 -0400)]
[System.Drawing.Common] Work around libgdiplus use after free (#43074)

* [System.Drawing.Common] Work around libgdiplus use after free

On Windows, both of the following are legal

    Metafile mf = ... ; // get a metafile instance
    Graphics g = Graphics.FromImage(mf);
    g.Dispose(); mf.Dispose();

and

    Metafile mf = ... ; // get a metafile instance
    Graphics g = Graphics.FromImage(mf);
    mf.Dispose(); g.Dispose();

On Unix, libgdiplus has a use after free bug for the second form - the metafile
native image is disposed, but the graphics instance still has a pointer to the
memory that it will use during cleanup.  If the memory is reused, the graphics
instance will see garbage values and crash.

The workaround is to add a MetadataHolder class and to transfer responsibility
for disposing of the native image instance to it if the Metafile is disposed
before the Graphics.

Note that the following is not allowed (throws OutOfMemoryException on GDI+ on
Windows), so there's only ever one instance of Graphics associated with a
Metafile at a time.

    Graphics g = Graphics.FromImage(mf);
    Graphics g2 = Graphics.FromImage(mf); // throws

Addresses https://github.com/dotnet/runtime/issues/37838

* Formatting fixes

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
* Address review feedback

* Inilne unhelpful helper

* formatting

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
3 years agoPort ComWrappers 5.0 diagnostic changes back to master and add stowed exception array...
David Mason [Thu, 8 Oct 2020 21:09:12 +0000 (14:09 -0700)]
Port ComWrappers 5.0 diagnostic changes back to master and add stowed exception array to minidumps (#43164)

3 years agoDisable SetDateTimeMax test on Linux (#43178)
Stephen Toub [Thu, 8 Oct 2020 19:44:23 +0000 (15:44 -0400)]
Disable SetDateTimeMax test on Linux (#43178)

3 years ago[master] Update dependencies from dotnet/arcade dotnet/runtime-assets dotnet/llvm...
dotnet-maestro[bot] [Thu, 8 Oct 2020 18:11:56 +0000 (20:11 +0200)]
[master] Update dependencies from dotnet/arcade dotnet/runtime-assets dotnet/llvm-project dotnet/xharness dotnet/icu (#43084)

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

Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.ApiCompat
 From Version 5.0.0-beta.20474.4 -> To Version 5.0.0-beta.20478.3

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

System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
 From Version 5.0.0-beta.20476.1 -> To Version 5.0.0-beta.20505.2

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

runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk
 From Version 9.0.1-alpha.1.20475.1 -> To Version 9.0.1-alpha.1.20505.1

* Update dependencies from https://github.com/dotnet/xharness build 20201005.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.20502.4 -> To Version 1.0.0-prerelease.20505.1

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-alpha.1.20475.1 -> To Version 6.0.0-alpha.1.20505.1

* Don't downgrade Microsoft.DotNet.Helix.Sdk

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoAdding Official Build Support for runtimelab (#43146)
Santiago Fernandez Madero [Thu, 8 Oct 2020 18:03:44 +0000 (13:03 -0500)]
Adding Official Build Support for runtimelab (#43146)

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
3 years agofix issue with duplicate completion in MultipleConnectAsync (#43112)
Geoff Kizer [Thu, 8 Oct 2020 15:59:08 +0000 (08:59 -0700)]
fix issue with duplicate completion in MultipleConnectAsync (#43112)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[wasm] Implement System.Console.Clear (#43002)
campersau [Thu, 8 Oct 2020 15:30:56 +0000 (17:30 +0200)]
[wasm] Implement System.Console.Clear (#43002)

* [wasm] Implement System.Console.Clear

* Add dummy console.clear implementation if it does not exist

* Initialize console in Clear

* Apply suggestions from codereview

3 years ago[threads] Switch foreign threads to GC Safe in mono_thread_detach (#42758)
monojenkins [Thu, 8 Oct 2020 14:31:28 +0000 (10:31 -0400)]
[threads] Switch foreign threads to GC Safe in mono_thread_detach (#42758)

* [test] Invoke from foreign threads then try to GC and shutdown

   Even if the non-Mono threads that once called Mono are looping or deadlocked,
   they shouldn't prevent us from doing a GC (in hybrid suspend mode) or from
   shutting down if they detached from the runtime.

* [tests] update .gitignore

   Ignore AOT build artifacts in subdirectories of mono/tests/, too

* [threads] Make mono_thread_attach external only

   Runtime should use mono_thread_internal_attach

* [threads] Mark mono_thread_detach external only; switch to GC Safe

   Runtime threads should call mono_thread_internal_detach

   Addresses https://github.com/mono/mono/issues/20290 and https://github.com/mono/mono/issues/20283

   If a foreign thread (that was created outside the runtime) calls
   mono_thread_detach, leave it in a preemptively-suspendable state, since we
   can't expect it to coop suspend.

   Conversely in mono_thread_attach (external only), ensure that we always leave
   the thread in GC Unsafe (aka RUNNING) state, for cases like

       while (cond) {
         t = mono_thread_attach (domain);
         <...>
         mono_thread_detach (t);
       }

* Tests fixup

   Delete test that invokes the runtime in a loop forever.
   This is just exercising a race between mono_thread_attach and the
   runtime shutdown.  Instead update the invoke_foreign_thread test to
   loop a few times to check that attach/detach loops are ok.

  In the deadlock test, wait for the foreign thread to finish calling
  the runtime before the test thread returns from native back to managed
   to avoid a race between shutdown and the invoke.

* [interp] Set context to null when freeing

   If a foreign thread runs this loop

       for (...) {
         mono_thread_attach;
         mono_runtime_invoke;
         mono_thread_detach;
      }

   on the second iteration it will get a ThreadContext that was already freed
   during the detach.  Set the TLS variable to null before freeing the context.

* [threads] Switch to GC Unsafe before creating managed thread object

   For a re-attaching move the thread state transition to happen earlier so that
   create_internal_thread_object (which does a managed allocation) is always done
   in GC Unsafe mode.

* fixup eventpipe to use mono_thread_internal_{attach,detach}

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
3 years agoAdd issues.targets entry for UnitTest_GVM, #42924 (#43100)
Tomáš Rylek [Thu, 8 Oct 2020 14:03:34 +0000 (16:03 +0200)]
Add issues.targets entry for UnitTest_GVM, #42924 (#43100)

3 years agoFix ilasm managed resource lookup on Linux. (#42735)
Markus Lindström [Thu, 8 Oct 2020 11:41:44 +0000 (13:41 +0200)]
Fix ilasm managed resource lookup on Linux. (#42735)

* Fix ilasm managed resource lookup on Linux.

ILAsm did not properly find managed resources if they were not in the
working directory of ILAsm itself. While there was a provision for
Windows-based systems using backslashes as directory separators, there
was no such provision for *nix-based systems using forward slashes.

This commit enables ILAsm to lookup using both types of directory
separators.

* Use DIRECTORY_SEPARATOR_CHAR_A instead of hardcoded backslashes.

This fixes path handling on *nix targets.

* Only consider colon as a special path character on Windows.

3 years agoAdd UnsupportedOsPlatform(browser) to more synchronous http apis (#43102)
Larry Ewing [Thu, 8 Oct 2020 11:09:38 +0000 (06:09 -0500)]
Add UnsupportedOsPlatform(browser) to more synchronous http apis (#43102)

3 years agoEnable EventPipe BufferSize CoreCLR test on Mono runtime. (#43085)
Johan Lorensson [Thu, 8 Oct 2020 07:49:02 +0000 (09:49 +0200)]
Enable EventPipe BufferSize CoreCLR test on Mono runtime. (#43085)

3 years agoDo not define X509_new as local_X509_new
Omair Majid [Thu, 8 Oct 2020 05:55:52 +0000 (01:55 -0400)]
Do not define X509_new as local_X509_new

This was only being done for OpenSSL 1.0. X509_new is actually available
to use in OpenSSL 1.0 and doesn't need to be re-defined:
https://www.openssl.org/docs/man1.0.2/man3/X509_new.html. That document
even says: "X509_new() and X509_free() are available in all versions of
SSLeay and OpenSSL".

The current libraries code doesn't contain an implementation of
local_X509_new. If we define X509_new as local_X509_new, it breaks the
build when it's being compiled non-portable against OpenSSL 1.0.

3 years agoFixes Issue 42787 (#43077)
Brian Sullivan [Thu, 8 Oct 2020 04:31:39 +0000 (21:31 -0700)]
Fixes Issue 42787 (#43077)

* Fixes Issue 42787

The GS COOKIE phase can create a new Basic Block and this will later cause an assert failure:
Assertion failed 'topBB->bbNum <= botBB->bbNum'
Previously this was hidden by an unconditional call to fgRenumberBlocks() which was removed in PR 42664

* Add a call to fgRenumberBlocks in the morphGlobalPhase when it creates new basic blocks

3 years agoAdd initial support for Apple Silicon (#40435)
Steve MacLean [Thu, 8 Oct 2020 01:01:28 +0000 (21:01 -0400)]
Add initial support for Apple Silicon (#40435)

* Add CoreCLR compilation support for Apple Silicon
    * Use CMAKE_OSX_ARCH rework
    * Set clang -arch flag
    * Workaround uname arch reporting emulated arch

* Fix native code compilation issues
* Implement missing osx-arm64 functionality
* Prototype fix for write no execute issues
* Strip libunwind pointer authentication bits

* Review feedback
* Does not fix Arm64 ABI issues

Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
3 years agoAdd a new net6.0 TargetFramework (#42709)
Anirudh Agnihotry [Wed, 7 Oct 2020 22:36:58 +0000 (15:36 -0700)]
Add a new net6.0 TargetFramework (#42709)

* upgrade to net6.0

* add comment and update package version

* address feedback and fix failures

* address feedbacl

* address feedback

3 years agoDisable SatelliteLoadCorrectly_FromName on Browser (#43104)
Ryan Lucia [Wed, 7 Oct 2020 18:48:26 +0000 (14:48 -0400)]
Disable SatelliteLoadCorrectly_FromName on Browser (#43104)

3 years agofix condition to align method at 32 bytes (#42909)
Kunal Pathak [Wed, 7 Oct 2020 18:02:14 +0000 (11:02 -0700)]
fix condition to align method at 32 bytes (#42909)

In #2249, we started doing alignment of methods to 32-byte boundary for Tier1. However, a method having loops bypass tiering and hence this condition was never executed. Fixed it to make sure we do the alignment for optimized methods only and don't do it for prejitted methods.

3 years agoAllow enregistering more structs args (#39326)
Carol Eidt [Wed, 7 Oct 2020 17:00:14 +0000 (10:00 -0700)]
Allow enregistering more structs args (#39326)

* Allow enregistering more structs args

Allow HFAs and other structs with matching fields and registers.

Contributes to #37924

3 years agoExtend use of w32subset API partitioning to cover more Win32 functions. (#42977)
monojenkins [Wed, 7 Oct 2020 12:44:42 +0000 (08:44 -0400)]
Extend use of w32subset API partitioning to cover more Win32 functions. (#42977)

Expand usage of w32subset API partitioning making it possible to include/exclude/use/replace different subset of Win32 API's.

Merge UWP source files into regular Windows specific source files keeping one set of Windows implementation files in upstream repro leverage w32subset.h to support CLASSIC or UWP API subsets.

PR also extend capabilities to replace API usage using HAVE_EXTERN_DEFINED_WIN32* making it possible to exclude and replace API usage in downstream repositories.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
3 years agoConsole.Unix: reset terminal at exit in less cases to avoid blocking the parent....
Tom Deseyn [Wed, 7 Oct 2020 02:25:43 +0000 (04:25 +0200)]
Console.Unix: reset terminal at exit in less cases to avoid blocking the parent. (#42303)

* Console.Unix: reset terminal at exit in less cases to avoid blocking the parent.

When a parent is fetching the Console.Cursor position, it configures the terminal
to not echo, writes an escape sequence to query the position, and then reads the
position from stdin.

Because this doesn't happen atomically a child process can overwrite the terminal
settings to echo before the parent starts reading. This causes the position to
be echoed to the user, and the parent gets stuck waiting for input on stdin.

Currently terminal settings are reset at exit for applications that use the
Console or Process class. This change tracks whether the application has
changes the terminal settings and only then resets the terminal settings.

This doesn't fix the issue, but makes it less likely to occur.

* TermInfo changes are no longer needed

* Only configure terminal for child if we've touched the settings.

* minor change to comment wording

3 years agoadd System.Net.Quic assembly and use it in HttpClient (#43076)
Geoff Kizer [Wed, 7 Oct 2020 02:01:33 +0000 (19:01 -0700)]
add System.Net.Quic assembly and use it in HttpClient (#43076)

* add System.Net.Quic assembly and use it in HttpClient

* fix build issue

* remove old quic code from shared directory

* fix Common.Tests project

* fix WinHttp tests

* fix typo

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoAdd MemoryMappedFile tests involving AcquirePointer (#42800)
Stephen Toub [Tue, 6 Oct 2020 23:14:03 +0000 (19:14 -0400)]
Add MemoryMappedFile tests involving AcquirePointer (#42800)

3 years agoStart stopwatch immediately before sending http request (#41537)
Anas Mazioudi [Tue, 6 Oct 2020 22:36:11 +0000 (00:36 +0200)]
Start stopwatch immediately before sending http request (#41537)

* Start stopwatch immediately before sending http request

* Remove extra line

* Remove trailing white space

3 years agoJit: Remove bounds checks with tests against length. (#40180)
nathan-moore [Tue, 6 Oct 2020 20:36:08 +0000 (16:36 -0400)]
Jit: Remove bounds checks with tests against length. (#40180)

* Introduce a concept of minimum array length into range check

* Some cleanup

* fix potential underflow

* bug fix and cleanup

* Revert string changes

* Allow elimination of arr[0] with  len != 0 test

* Revert "Revert string changes"

This reverts commit 6f77bf8c8acce1f5382bb704875384c6f8e2f984.

* Fix up tests

* reverting lower bound merging as it may be unsound

* Fix CI exposed bug and add a couple of test cases

* code review feedback

* comment nit

* feedback

* Add missing break

3 years agoRoslyn update response (#43056)
Aaron Robinson [Tue, 6 Oct 2020 20:11:35 +0000 (13:11 -0700)]
Roslyn update response (#43056)

* Update function pointer syntax usage to official.

* Fix warnings with new Roslyn

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoLock CoreDisTools package version to 1.0.1-prerelease-00005 in stress_dependencies...
Egor Chesakov [Tue, 6 Oct 2020 19:41:28 +0000 (12:41 -0700)]
Lock CoreDisTools package version to 1.0.1-prerelease-00005 in stress_dependencies.csproj (#42968)

3 years agoCoreDisTools and R2RDump support Arm Thumb2 disassembling (#42964)
Egor Chesakov [Tue, 6 Oct 2020 19:27:20 +0000 (12:27 -0700)]
CoreDisTools and R2RDump support Arm Thumb2 disassembling (#42964)

* Clear the low bit of "Function Start RVA" on Arm Thumb2 machines in ReadyToRunMethod.cs

* Remove restrictions on InputArchitecture in ReadyToRunReader.cs and R2RDump.cs

3 years agoSmall optimization in LSRA for RMW intrinsics (#42564)
Egor Chesakov [Tue, 6 Oct 2020 18:58:34 +0000 (11:58 -0700)]
Small optimization in LSRA for RMW intrinsics (#42564)

RMW intrinsic operands doesn't have to be marked as "delay-free" when they can be assigned the same register as op1Reg (i.e. read-modify-write operand) and one of them is the last use.

3 years agoChanging the free list from singly linked to doubly linked (#43021)
Maoni Stephens [Tue, 6 Oct 2020 18:53:50 +0000 (11:53 -0700)]
Changing the free list from singly linked to doubly linked (#43021)

One of the problems with BGC sweep is it zeros out the gen2 FL at the beginning which means we might need to increase gen2 size before it builds up enough FL to accommodate gen1 survivors. To lift this limitation I'm changing this to a doubly linked list so we can easily take items off and thread new ones back on.

Note that this is the initial checkin for the feature - there needs to be more stress testing and perf testing done on this so I'm checking in with the feature DOUBLY_LINKED_FL undefined. I've done some stress testing but not a whole lot.

This is only used for gen2 FL, not UOH - we already don't allow UOH allocations while we are sweeping UOH (which should be quite quick). In the future we will make it work so UOH allocs are allowed while it's being swept but that's beyond the scope of this feature (it would require work in the synchronization between the allocator and BGC sweep).

2 new bits were introduced -

Previously we didn't need to care about bgc mark bits at all since we can't possibly compact into the part of the heap that hasn't been swept. But now we can. So if we compact into a free item that hasn't been swept, we need to set the mark bits correctly. So we introduce a new bit:

// This bit indicates that we'll need to set the bgc mark bit for this object during an FGC.
// We only do this when we decide to compact.

Also now we don't have the luxury to allocate a min obj in the plan phase if what's allocated in this alloc context is too short. Previously we have this situation:

SB|MT|L|N

and if we plan allocated a min obj in this free item, we can allocate a min free obj right after it because the min free obj will not overwrite anything of that free item:

SB|MT|L|N
min free:
        SB|MT|Payload

since we don't touch SB. But now we have this:

SB|MT|L|N|P

and if we only allocated 3 ptr size into this free item, and if we want to allocate a min free obj, we'd be over writing P (previous pointer of this free item):

SB|MT|L|N |P
        SB|MT|Payload

One note on this is that we check the "allocated size" with (alloc_ptr - start_region), but start_region is updated every time we pad in the same free item. And it's really only necessary for the actual alloc context start (because we just need to preserve that free item's prev). But this is saved by the fact that in gen2 we don't pad. If we do pad in gen2 it would be good to handle this.

This is handled by set_free_obj_in_compact_bit (which sets the new MAKE_FREE_OBJ_IN_COMPACT bit) in adjust_limit where we set the bit and record the size of the "filler object". and we'll actually make the filler obj in gcmemcopy. This means this feature is as of now ONLY FOR 64-bit as the bit we use to do this means we are taking up 3 bits in MT to do our bookkeeping. We could make it work for 32-bit by finding bits in the gap - I haven't done that.

Major areas changed were -
+ allocate_in_older_generation - this also has a complication wrt repair and commit. I introduced the new added list concept so we can repair and commit quickly, with one exception for bucket 0. For b0 since we do discard items, we do need to set prev of discarded items to PREV_EMPTY because we need to indicate that it's not the freelist anymore. However, we can still recover by going through the original head and set the prev of the discarded items one by one which wouldn't be fast so I choose to not do it - the discarded items are generally very small anyway.

+ gcmemcopy - this needs to care about the bits we added.

+ background_sweep - this takes items off of the FL and thread new ones back on. Since this never happens at the same time as the gen1 GCs using these items we don't need synchronization here.

+ allocator class - obviously this needs to care about the prev field now. The principle is we don't touch the prev field in unlink_item (except for the special b0 case) so when we repair we don't need to go repair the prev fields. When we commit, we do need to set the new prev field accordingly (unless for the added list which we would have already set the prev correctly).

---

Fixed some existing bugs -

The refactor change stopped updating next_sweep_obj but it's incorrect because it's used by the verification code in sos so brought that back.

More accounting to count free_list/obj spaces correctly.

---

TODO

Optimizations we can do in background_sweep -

+ Don't need to actually take items off if we are just going to thread back on the same one (and others from my design notes);

+ If there's a big item we may not want to remove, imagine this simplied scenario - we have 1 2-mb free item on the list and we just removed it. Now current_num_objs happens to be big enough so we left an FGC happen and this FGC is gen1 and now it doesn't find any free space and would have to grow gen2.

It's actually beneficial to switch to using the added list even for singly linked list so we could consider enabling it even when the feature is not on.

3 years agoCorrectly report struct types in asCorInfoType for normalized structs (#43068)
David Wrighton [Tue, 6 Oct 2020 18:50:58 +0000 (11:50 -0700)]
Correctly report struct types in asCorInfoType for normalized structs (#43068)

- Fix last issue causing significant misbehavior in X86 Crossgen2 testing
  - Correctly report struct types in asCorInfoType for normalized structs
  - Previous efforts would not report the struct if it was normalized, where the correct behavior was to normalize, and report the struct if it isn't an enum

3 years agoRemove pr: none clause from several CoreCLR pipelines (#42933)
Tomáš Rylek [Tue, 6 Oct 2020 17:51:17 +0000 (19:51 +0200)]
Remove pr: none clause from several CoreCLR pipelines (#42933)

3 years agoRemove unneeded licenses ingested from dotnet/diagnostics repo (#43064)
Nikola Milosavljevic [Tue, 6 Oct 2020 17:32:00 +0000 (10:32 -0700)]
Remove unneeded licenses ingested from dotnet/diagnostics repo (#43064)

3 years agoFix for 'not fully instantiated' Crossgen2 issue bucket (#43054)
Tomáš Rylek [Tue, 6 Oct 2020 17:31:06 +0000 (19:31 +0200)]
Fix for 'not fully instantiated' Crossgen2 issue bucket (#43054)

Around September 25 several dozens of Crossgen2 tests started
failing with a runtime error around incomplete instantiation of
GetArrayDataReference. I believe that for generic methods we
should skip the METHOD_ENTRY_DEF_TOKEN shortcut, otherwise we
lose the instantiation information and cause the runtime problem.

I originally thought this may be related to JanK's function
pointer changes but I no longer believe it is the case
(my apologies to Jan for the false accusation). I rather think
that some ambient code change caused a subtle difference in IL
encoding of access to the method that started tripping the
"shortcut" code path.

Thanks

Tomas

3 years agoExpose BackgroundService.ExecuteTask (#42981)
Eric Erhardt [Tue, 6 Oct 2020 17:23:31 +0000 (12:23 -0500)]
Expose BackgroundService.ExecuteTask (#42981)

* Expose BackgroundService.ExecuteTask

Expose the task that executes the background service, so consumers can check if it is running and/or has ran to competition or faulted.

Use the new ExecuteTask to log exceptions when a BackgroundService fails after await, instead of appearing to hang.

Fix #35991
Fix #36017

3 years agoChanged mono exception type from execution engine to not supported (#43009)
Shreyas Jejurkar [Tue, 6 Oct 2020 17:15:35 +0000 (22:45 +0530)]
Changed mono exception type from execution engine to not supported (#43009)

3 years agoIntegrate changes in shared files from dotnet/runtimelab:NativeAOT (#43075)
Jan Kotas [Tue, 6 Oct 2020 13:51:56 +0000 (06:51 -0700)]
Integrate changes in shared files from dotnet/runtimelab:NativeAOT (#43075)

3 years agoImprove detection of unsupported OS in resource updater (#43080)
Vitek Karas [Tue, 6 Oct 2020 13:43:57 +0000 (06:43 -0700)]
Improve detection of unsupported OS in resource updater (#43080)

Per https://github.com/dotnet/runtime/pull/43058#discussion_r499896492

3 years agoAdd dac apis for comwrappers style ccws/rcws (#42942)
David Mason [Tue, 6 Oct 2020 07:39:15 +0000 (00:39 -0700)]
Add dac apis for comwrappers style ccws/rcws (#42942)

3 years agofix async logic in MultipleConnectAsync to avoid lock reentrancy issues (#42919)
Geoff Kizer [Tue, 6 Oct 2020 04:51:10 +0000 (21:51 -0700)]
fix async logic in MultipleConnectAsync to avoid lock reentrancy issues (#42919)

* fix async logic in MultipleConnectAsync to avoid lock reentrancy issues

* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/MultipleConnectAsync.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoUse correct size_t when determining if a value fits in a byte (#42987)
David Wrighton [Tue, 6 Oct 2020 00:20:42 +0000 (17:20 -0700)]
Use correct size_t when determining if a value fits in a byte (#42987)

- Use target_size_t when determining if a value fits in a byte when value is represented in the function as a ssize_t or cnssval_ssize_t. This drops the upper 32bits of a possibly 64bit size_t when performing the comparison on TARGET_X86 platforms. Those bits are uninitialized if the value not a reloc.

3 years agoDistinguish when we SPMI R2R compilation. (#42995)
Sergey Andreenko [Tue, 6 Oct 2020 00:04:45 +0000 (17:04 -0700)]
Distinguish when we SPMI R2R compilation. (#42995)

Don't try to stash field values because in R2R case Jit does not try to read them. It happens only in CoreRun for static readonly fields.

3 years agoenable superpmi collection pipeline (#43040)
Kunal Pathak [Mon, 5 Oct 2020 22:42:11 +0000 (15:42 -0700)]
enable superpmi collection pipeline (#43040)

* enable superpmi collection pipeline

In #42053, I forgot to push a change to enable the superpmi pipeline.
This change will trigger it every Sunday at 9:00 AM PST.

* fix space changes

3 years agoUpdate Helix SDK manually (#43011)
Viktor Hofer [Mon, 5 Oct 2020 22:24:14 +0000 (00:24 +0200)]
Update Helix SDK manually (#43011)

* Update Helix SDK manually

For follow up / if you see 504s

3 years agoimprove detection of TLS13 on Windows (#42937)
Tomas Weinfurt [Mon, 5 Oct 2020 20:36:20 +0000 (13:36 -0700)]
improve detection of TLS13 on Windows (#42937)

3 years agoFix SPMI dump. (#42867)
Sergey Andreenko [Mon, 5 Oct 2020 20:22:05 +0000 (13:22 -0700)]
Fix SPMI dump. (#42867)

* Fix SPMI dump.

* add a message when we have collisions.

3 years agoAdd other openssl path to PKG_CONFIG_PATH (#43041)
Alexander Köplinger [Mon, 5 Oct 2020 18:21:27 +0000 (20:21 +0200)]
Add other openssl path to PKG_CONFIG_PATH (#43041)

Follow-up to https://github.com/dotnet/runtime/pull/43037#discussion_r499726268

3 years agobuild-commons.sh: check for OpenSSL 1.1 on macOS (#43037)
Alexander Köplinger [Mon, 5 Oct 2020 17:04:13 +0000 (19:04 +0200)]
build-commons.sh: check for OpenSSL 1.1 on macOS (#43037)

We're installing openssl@1.1 from Homebrew so we should check that version.
It looks like CI Macs don't set the /usr/local/opt/openssl symlink anymore.

3 years agoHandle libunwind_xdac partial C11 support (#42997)
Steve MacLean [Mon, 5 Oct 2020 16:40:00 +0000 (12:40 -0400)]
Handle libunwind_xdac partial C11 support (#42997)

For newer Windows SDKs, the stdalign.h header is present, but the alignas macr is not
defined unless the compiler adds the std:c11 or newer.

Until we can set the std:c11 flag, work around the missing alignas macro using cmake config.

3 years agoFix various typos in comments (#43019)
John Doe [Mon, 5 Oct 2020 16:05:56 +0000 (09:05 -0700)]
Fix various typos in comments (#43019)

* accross -> across

* additionaly -> additionally

* adddress -> address

* addrees -> address

* addresss -> address

* aligment -> alignment

* Alignement -> Alignment

* alredy -> already

* argment -> argument

* Argumemnts -> Arguments

3 years ago[sdb] Add support for function pointers. (#42936)
monojenkins [Mon, 5 Oct 2020 13:59:38 +0000 (09:59 -0400)]
[sdb] Add support for function pointers. (#42936)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoReenable MUSL ARM tests (#42202)
Jan Vorlicek [Mon, 5 Oct 2020 12:40:57 +0000 (14:40 +0200)]
Reenable MUSL ARM tests (#42202)

* Reenable MUSL ARM tests

The packages for MUSL ARM should now be available, so reenable the
libraries tests in the CI

* Update DotnetHost and DotnetHostPolicy versions

* Add Linux arm musl to libraries queues

* Reenabling the arm32 queue in the coreclr templates queues

* Updated versions by darc tool, reverted libraries/helix-queues-setup.yml

3 years agoImprove WASM test output via xharness (#42860)
Alexander Köplinger [Mon, 5 Oct 2020 10:37:49 +0000 (12:37 +0200)]
Improve WASM test output via xharness (#42860)

With https://github.com/dotnet/xharness/pull/315 we can now make the test output similar to the regular xunit desktop runner.
It no longer prints the passed tests by default, only failing tests. To get the old behavior, add the `-v` flag back to xharness in tests.mobile.targets or check the new wasm-console.log file in the xharness-output folder.

```
  XHarness command issued: wasm test --app=. --engine=V8 --engine-arg=--stack-trace-limit=1000 --js-file=runtime.js --output-directory=/Users/alexander/dev/runtime/artifacts/bin/System.Runtime.Handles.Tests/net5.0-Release/browser-wasm/AppBundle/xharness-output -- --run WasmTestRunner.dll System.Runtime.Handles.Tests.dll -notrait category=OuterLoop -notrait category=failing
  info: 21:57:45.3244690 v8 --expose_wasm --stack-trace-limit=1000 runtime.js -- --run WasmTestRunner.dll System.Runtime.Handles.Tests.dll -notrait category=OuterLoop -notrait category=failing
  info: Arguments: --run,WasmTestRunner.dll,System.Runtime.Handles.Tests.dll,-notrait,category=OuterLoop,-notrait,category=failing
  info: console.debug: MONO_WASM: Initializing mono runtime
  info: console.debug: MONO_WASM: ICU data archive(s) loaded, disabling invariant mode
  info: console.debug: mono_wasm_runtime_ready fe00e07a-5519-4dfe-b35a-f867dbaf2e28
  info: Initializing.....
  info: Discovering: System.Runtime.Handles.Tests.dll (method display = ClassAndMethod, method display options = None)
  info: Discovered:  System.Runtime.Handles.Tests.dll (found 14 of 15 test cases)
  info: Starting:    System.Runtime.Handles.Tests.dll
  fail: [FAIL] SafeWaitHandleTests.SafeWaitHandle_False
  info: Assert.False() Failure
  info: Expected: False
  info: Actual:   True
  info:    at SafeWaitHandleTests.SafeWaitHandle_False()
  info:    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
  info: Finished:    System.Runtime.Handles.Tests.dll
  info:
  info: === TEST EXECUTION SUMMARY ===
  info: Total: 14, Errors: 0, Failed: 1, Skipped: 0, Time: 0.097211s
  info:
  info: 21:57:46.3323620 Process exited with 1
```

3 years agoPR handling port of Diagnostic Server C++ library from CoreCLR into a C (#41872)
Johan Lorensson [Mon, 5 Oct 2020 07:23:38 +0000 (09:23 +0200)]
PR handling port of Diagnostic Server C++ library from CoreCLR into a C (#41872)

library that can be shared between Mono as well as CoreCLR runtime.

Port follows same guidelines setup for event pipe port #34600.
Diagnostic server library is currently hosted as part of event pipe
library but hosting its own runtime shim as well as source files
(so could be split into separate library if ever make sense).
Diagnostic Server have dependencies on event pipe library
(and reuse part of event pipe runtime shim from its how shim).

This is the first PR getting the code from diagnostic server codebase
over to C library.

3 years agoJSON Escape the strings used in test before comparing for non-English locales (#42982)
Ganbarukamo41 [Sun, 4 Oct 2020 22:25:36 +0000 (07:25 +0900)]
JSON Escape the strings used in test before comparing for non-English locales (#42982)

3 years agomake BrowserHttpMessage.Send throw PNSE (#42990)
Larry Ewing [Sun, 4 Oct 2020 19:44:53 +0000 (14:44 -0500)]
make BrowserHttpMessage.Send throw PNSE (#42990)

* Throw PNSE on sync version of BrowserHttpHandler.Send

* Mark HttpClientHandler.Send as unsupported on browser

* Update reference source

3 years agoR2RDump cleanup (#42996)
Andrew Au [Sat, 3 Oct 2020 16:57:17 +0000 (09:57 -0700)]
R2RDump cleanup (#42996)

3 years agoRyuJIT: Optimize -X and MathF.Abs(X) for floats (#42164)
Egor Bogatov [Fri, 2 Oct 2020 23:30:22 +0000 (02:30 +0300)]
RyuJIT: Optimize -X and MathF.Abs(X) for floats (#42164)

* Optimize -X and MathF.Abs(X) for floats
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
3 years ago[mono] Fix constant folding for Math.Round (#42951)
Egor Bogatov [Fri, 2 Oct 2020 22:19:06 +0000 (01:19 +0300)]
[mono] Fix constant folding for Math.Round (#42951)

3 years agoCrossgen2 cross target testing (#42663)
David Wrighton [Fri, 2 Oct 2020 20:35:46 +0000 (13:35 -0700)]
Crossgen2 cross target testing (#42663)

Add cross compilation testing for crossgen2.

The goal here is to cover cross compilation for the framework libraries, with support for testing cross compilation behavior between across the large swath of possible cross target possibilities.

This testing is added to the crossgen2 outerloop and is based on the work that @echesakovMSFT built for crossgen1 for cross target support for Linux X64 to Linux Arm. (The testing model has been tweaked to allow for general purpose cross target testing.)

Important details.

There is now a cross targeting build job, which builds (on either X64 Windows or X64 Linux) the framework dlls for a given target architecture, and captures their SHA1 hashes.

Then there is a comparison job which will run crossgen2 on an arbitrary set of platforms targetting a specific OS/Architecture pair.

The current state is that is known that the x86 compiler does not quite produce identical output when varied between 64 and 32 bit, there are significant issues compiling arm32 code, and arm64 code is nearly perfect with cross compilation.

3 years agoUpdate THIRD-PARTY-NOTICES file (#41851)
Nikola Milosavljevic [Fri, 2 Oct 2020 19:44:03 +0000 (12:44 -0700)]
Update THIRD-PARTY-NOTICES file (#41851)

* Introduce THIRD-PARTY-NOTICES file for deployment with shared host package

* Update of THIRD-PARTY-NOTICES for .NET 5.0 release

* Update src/installer/pkg/THIRD-PARTY-NOTICES.TXT

Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
* Update libunwind name in root TPN file to prevent regression in future updates

* Update libunwind license

* Updates based on review comments

Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
3 years agoFixes dotnet/runtime issue #12446 ILDASM - constants printed with the wrong endian...
Brian Sullivan [Fri, 2 Oct 2020 19:13:01 +0000 (12:13 -0700)]
Fixes dotnet/runtime issue #12446  ILDASM - constants printed with the wrong endian (#42848)

When the Disassembler prints 4-byte and 8-byte values it should print them in little endian format

3 years agoMoves ConfigurationRootTest to common (#42788)
Maryam Ariyan [Fri, 2 Oct 2020 18:47:28 +0000 (11:47 -0700)]
Moves ConfigurationRootTest to common (#42788)

- used by two test projects

3 years ago[metadata] Getting the element size of array of fnptr types is ok (#42920)
Aleksey Kliger (λgeek) [Fri, 2 Oct 2020 18:42:36 +0000 (14:42 -0400)]
[metadata] Getting the element size of array of fnptr types is ok (#42920)

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

3 years agoCleanly split BinDir to RuntimeBinDir and TestBinDir (#42829)
Tomáš Rylek [Fri, 2 Oct 2020 16:46:04 +0000 (18:46 +0200)]
Cleanly split BinDir to RuntimeBinDir and TestBinDir (#42829)

3 years agoAdd a few useful links, and move doc as requested (#42965)
Jo Shields [Fri, 2 Oct 2020 14:14:12 +0000 (10:14 -0400)]
Add a few useful links, and move doc as requested (#42965)

3 years agoUse constants instead of instance call for http handlers predefined values (#42941)
Marek Safar [Fri, 2 Oct 2020 13:55:02 +0000 (15:55 +0200)]
Use constants instead of instance call for http handlers predefined values (#42941)

3 years agoAdd `Crossgen2JitPath` to R2R test. (#42939)
Sergey Andreenko [Fri, 2 Oct 2020 09:09:28 +0000 (02:09 -0700)]
Add `Crossgen2JitPath` to R2R test. (#42939)

3 years agoAddress JSON test failures on Mono + Windows (#42960)
Layomi Akinrinade [Fri, 2 Oct 2020 03:58:42 +0000 (23:58 -0400)]
Address JSON test failures on Mono + Windows (#42960)

3 years agoAdd single-file app's dir to NATIVE_DLL_SEARCH_DIRECTORIES (#42876)
Mateo Torres-Ruiz [Fri, 2 Oct 2020 00:44:36 +0000 (17:44 -0700)]
Add single-file app's dir to NATIVE_DLL_SEARCH_DIRECTORIES (#42876)

Add two directories to NATIVE_DLL_SEARCH_DIRECTORIES to single-file bundles:

1. The bundle exe directory
2. If the bundle extracts any files, the extraction directory

Fixes #42772

3 years agoDisabled GC.TotalBytesAllocated test. (#42921)
Nathan Ricci [Thu, 1 Oct 2020 21:55:29 +0000 (17:55 -0400)]
Disabled GC.TotalBytesAllocated test. (#42921)

3 years ago[wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomValues (#42728)
Kenneth Pouncey [Thu, 1 Oct 2020 21:44:56 +0000 (23:44 +0200)]
[wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomValues (#42728)

* [wasm][crypto] RandomNumberGenerator mapped to Web Crypto getRandomValues

- Uses Web Crypto API [`getRandomValues`](https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues) if available.
- Falls back to `/dev/urandom` as default if the crypto library is missing.

* Remove the emscripten interface code from the driver.c.

* remove extraneous code comment

* Move emscripten definition around.

* Address review comment

* Add javascript bridge implementation library to Native source tree.

- Javascript checks for crypto interface and uses `crypto.getRandomValues`
- Add api bridge call when building for emscripten browser.
- separate out into browser subdirectory
- If we couldn't find a proper implementation, as Math.random() is not suitable we will abort.

```

ABORT: no cryptographic support found getRandomValues. Consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };

```

* Change tests to set random values of the buffer instead of return a single value.

* Remove old test code

* Remove testing code

* Incorporate the PAL bridge layer into the `--js-library` build process

* Address review comments about directory structure and naming

* Update src/mono/wasm/runtime-test.js

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Add note about insecure code for testing purposes

* Formatting

* Return -1 if crypto does not exist instead of aborting from js.  This allows the managed code exception flow to continue as normal.

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
3 years agoAdd server core testing (#41701)
Santiago Fernandez Madero [Thu, 1 Oct 2020 21:35:25 +0000 (16:35 -0500)]
Add server core testing (#41701)

* Add server core testing to Windows x64

* Add server core testing

* Use 20h1 queue instead

* Remove runtime testing until we get more capacity on 20H1 queue

* Use 2004 image

* Skip tests on Server core

* PR Feedback and fix build

* Disable more server core tests

* Disable more tests on Server Core

* Attempt fixing failing process test in server core

address feedback

* Fix PlatformDetection.IsInContainer for windows and feedback from Eirik's change

* PR Feedback

* Don't run server core on PRs yet until we get more capacity

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
3 years agoSome style clean-up in HttpClient.cs (#42956)
Stephen Toub [Thu, 1 Oct 2020 19:30:32 +0000 (15:30 -0400)]
Some style clean-up in HttpClient.cs (#42956)