platform/upstream/dotnet/runtime.git
3 years agoruntime-linker-tests: revert earlier change which added browser offse… (#49774)
Ankit Jain [Thu, 18 Mar 2021 03:25:50 +0000 (23:25 -0400)]
runtime-linker-tests: revert earlier change which added browser offse… (#49774)

3 years agoRemove top-level range check nodes (#49271)
SingleAccretion [Thu, 18 Mar 2021 01:38:37 +0000 (04:38 +0300)]
Remove top-level range check nodes (#49271)

Refactored optRemoveRangeCheck to handle top-level standalone range check nodes.

3 years agoUpdate Microsoft.DiaSymReader.Native package (#49739)
Anton Lapounov [Thu, 18 Mar 2021 01:25:54 +0000 (18:25 -0700)]
Update Microsoft.DiaSymReader.Native package (#49739)

3 years agoAnnotate System.Diagnostics.Process APIs throwing PNSE on iOS/tvOS (#49354)
Maxim Lipnin [Wed, 17 Mar 2021 22:48:13 +0000 (01:48 +0300)]
Annotate System.Diagnostics.Process APIs throwing PNSE on iOS/tvOS (#49354)

* Process.Start

* Remove redundant annotations

* Remove iOS since it's in the default list of supported platforms

* Process.Kill

* Make Process.Kill throw PNSE on iOS/tvOS

* Annotate windows-related implementation of Kill method

3 years ago[main] Update dependencies from mono/linker (#49577)
dotnet-maestro[bot] [Wed, 17 Mar 2021 19:56:33 +0000 (20:56 +0100)]
[main] Update dependencies from mono/linker (#49577)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoAdd runtime MVID checks for composite images (#49668)
Tomáš Rylek [Wed, 17 Mar 2021 19:55:49 +0000 (12:55 -0700)]
Add runtime MVID checks for composite images (#49668)

* Crossgen2 implementation of new MVID R2R section
* Runtime checks for assembly MVIDs against native images
* Basic R2RDump support for dumping the manifest assembly MVID table.
* R2R minor version increment; format spec update

Thanks

Tomas

3 years agoFix incorrect merge suppressing my change to publish CG2 framework (#49666)
Tomáš Rylek [Wed, 17 Mar 2021 19:54:02 +0000 (12:54 -0700)]
Fix incorrect merge suppressing my change to publish CG2 framework (#49666)

As David discovered, I apparently made a merge bug in rebasing my
CG2 framework switch-over change prior to checking in that actually
suppressed CG2 publishing due to losing the property
PublishReadyToRunUseCrossgen2. This change fixes that deficiency.

Thanks

Tomas

3 years agofix typo (#49763)
Eirik Tsarpalis [Wed, 17 Mar 2021 18:55:50 +0000 (18:55 +0000)]
fix typo (#49763)

3 years agoMore tests for FileStream edge cases (#49754)
Adam Sitnik [Wed, 17 Mar 2021 18:53:43 +0000 (19:53 +0100)]
More tests for FileStream edge cases (#49754)

* add StreamConformanceTests to the solution file so we can read source code from VS

* add FileOffsetIsPreservedWhenFileStreamIsCreatedFromSafeFileHandle tests

* add WriteAsyncStartsWherePreviousReadAsyncHasFinished test

3 years ago[wasm] Add a mono_wasm_print_stack_trace () helper function usable during runtime...
Zoltan Varga [Wed, 17 Mar 2021 18:46:37 +0000 (14:46 -0400)]
[wasm] Add a mono_wasm_print_stack_trace () helper function usable during runtime debugging. (#49759)

3 years agoInclude "simple" UTF-8 validation and transcoding logic for interpreted and low-footp...
Pavel Savara [Wed, 17 Mar 2021 18:38:39 +0000 (19:38 +0100)]
Include "simple" UTF-8 validation and transcoding logic for interpreted and low-footprint scenarios (#49372)

3 years agoAddress issue where stress mode testing may not work for this more exhaustive than...
David Wrighton [Wed, 17 Mar 2021 18:28:09 +0000 (11:28 -0700)]
Address issue where stress mode testing may not work for this more exhaustive than usual test (#49736)

3 years agoUpdate area-owners.md (#49769)
Vladimir Sadov [Wed, 17 Mar 2021 18:08:18 +0000 (11:08 -0700)]
Update area-owners.md (#49769)

Added myself to hosting areas.

3 years agoAllow jit to disregard PGO; PGO changes for SPMI and MCS (#49551)
Andy Ayers [Wed, 17 Mar 2021 17:58:08 +0000 (10:58 -0700)]
Allow jit to disregard PGO; PGO changes for SPMI and MCS (#49551)

* COMPlus_JitDisablePGO will now block the jit from using profile data. Useful
for investigations and (someday) bug triage. Also disable GDV if we're disabling PGO

* `-base_jit_option` and `-diff_jit_option` can be used to pass options to
superpmy.py asmdiffs.

* Fix SPMI file name computation to better handle cases where the directory is
a relative path.

* Enhance `mcs -jitflags` output to describe how many method contexts have
PGO data, and which kinds of data they hold. Useful for validating that an
SPMI collection done via dynamic PGO has actually collected an interesting
set of jit requests.

3 years ago[wasm] Enable wasm relinking by default for Release config (#49251)
Ankit Jain [Wed, 17 Mar 2021 17:12:16 +0000 (13:12 -0400)]
[wasm] Enable wasm relinking by default for Release config (#49251)

* [wasm] Set default value for $(WasmBuildNative) based on:

- If $(WasmBuildNative) is already set (eg. by user project) to true, then error if EMSDK_PATH is unset
- if unset, and$(PublishTrimmed) == false, then set to false
- if unset, and $(Configuration) == "Release", then set to true
- If it is $(WasmBuildNative) == true after above steps, and emsdk is missing
    => then emit a warning, and set it to false

commits:

* [wasm] Set WasmBuildNative=true for Release config

- But set to `false` if `$(PublishTrimmed)` is not true

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

* dotnet-linker-tests need mono-aot-cross

* [wasm] Cleanup setting emcc flags

* Address review feedback from @lewing

.. and update tests to track the changes.

* Correctly address review feedback:

3 years agoReorganize span parse tests (#47678)
Cyl18 [Wed, 17 Mar 2021 17:09:11 +0000 (01:09 +0800)]
Reorganize span parse tests (#47678)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years ago[wasm] Avoid error-ing out in AOT only mode if an AOT image is not found since apps...
Zoltan Varga [Wed, 17 Mar 2021 16:26:33 +0000 (12:26 -0400)]
[wasm] Avoid error-ing out in AOT only mode if an AOT image is not found since apps (#49318)

can load assemblies which were not AOT-ed, if they don't attempt to execute code from them.

3 years agoAdds support for building Wasm on Windows (#45545)
Steve Pfister [Wed, 17 Mar 2021 16:23:33 +0000 (12:23 -0400)]
Adds support for building Wasm on Windows (#45545)

* First pass at building wasm on windows

* Adds support for building wasm on Windows

Emscripten and EMSDK_PATH must be set up externally.  This differs from linux and macos
where we optionally can do it for you.

* Cleanup

* Feedback

* Rename conflicting target

* Made sure current master still works

* auto provision when EMSDK_PATH is not set and try to see if a browser build works on windows

* Add call in front of batch scripts. All of a sudden it's necessary

* Use RunWithEmSdkEnv task

* Override arch for Browser OS

Similar to what we do in build.sh

* Update machine certificates

To avoid this error:

    Installing tool 'node-12.18.1-64bit'..
      Installation failed!
      Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/deps/node-v12.18.1-win-x64.zip': <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1045)>
      Warning: Possibly SSL/TLS issue. Update or install Python SSL root certificates (2048-bit or greater) supplied in Python folder or https://pypi.org/project/certifi/ and try again.
      Warning: The SDK/tool 'node-12.18.1-64bit' cannot be activated since it is not installed! Skipping this tool...

The script comes from runtimelabs repo https://github.com/dotnet/runtimelab/blob/d0cda961aeda26faae17c474e26d822cd1e45438/eng/pipelines/runtimelab/update-machine-certs.ps1

* Use msbuild to write the emcc version file

* Put emscripten version in text file

And use it in Makefile and mono.proj

* Try to fix Browser_wasm_Windows detection

* Install native dependencies

I think we are missing cmake and failing with:

      configure: cmake -DENABLE_WERROR=1 -DCMAKE_INSTALL_PREFIX=D:\workspace\_work\1\s\artifacts\obj\mono\Browser.wasm.Debug\out -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Debug -DGC_SUSPEND=preemptive -DENABLE_MINIMAL=jit,portability,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,shared_perfcounters,interpreter,threads,eventpipe,qcalls -DENABLE_INTERP_LIB=1 -DDISABLE_ICALL_TABLES=1 -DDISABLE_CRASH_REPORTING=1 -DENABLE_ICALL_EXPORT=1 -DENABLE_LAZY_GC_THREAD_CREATION=1 -DENABLE_LLVM_RUNTIME=1 -DENABLE_METADATA_UPDATE=1 "-DCMAKE_C_FLAGS= -fexceptions -ID:\workspace\_work\1\s\.packages\microsoft.netcore.runtime.icu.transport\6.0.0-preview.3.21151.1/runtimes/browser-wasm/native/include" "-DCMAKE_CXX_FLAGS= -fexceptions" D:\workspace\_work\1\s\src\mono\ -DCMAKE_TOOLCHAIN_FILE=D:\workspace\_work\1\s\src\mono\wasm\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="D:/workspace/_work/1/s/src/mono/wasm/emsdk/node/12.18.1_64bit/bin/node.exe" -G Ninja
      Traceback (most recent call last):
        File "D:\workspace\_work\1\s\src\mono\wasm\emsdk\upstream\emscripten\\emcmake.py", line 33, in <module>
          sys.exit(run())
        File "D:\workspace\_work\1\s\src\mono\wasm\emsdk\upstream\emscripten\\emcmake.py", line 26, in run
          building.configure(sys.argv[1:])
        File "D:\workspace\_work\1\s\src\mono\wasm\emsdk\upstream\emscripten\tools\building.py", line 339, in configure
          run_process(args, stdout=stdout, stderr=stderr, env=env, **kwargs)
        File "D:\workspace\_work\1\s\src\mono\wasm\emsdk\upstream\emscripten\tools\shared.py", line 94, in run_process
          ret = subprocess.run(cmd, check=check, input=input, *args, **kw)
        File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 472, in run
        File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 775, in __init__
        File "D:\obj\windows-release\37amd64_Release\msi_python\zip_amd64\subprocess.py", line 1178, in _execute_child
      FileNotFoundError: [WinError 2] The system cannot find the file specified
    D:\workspace\_work\1\s\src\mono\mono.proj(410,5): error MSB3073: The command "call D:\workspace\_work\1\s\src\mono\wasm\emsdk\emsdk_env.bat && emcmake cmake -DENABLE_WERROR=1 -DCMAKE_INSTALL_PREFIX=D:\workspace\_work\1\s\artifacts\obj\mono\Browser.wasm.Debug\out -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Debug -DGC_SUSPEND=preemptive -DENABLE_MINIMAL=jit,portability,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,shared_perfcounters,interpreter,threads,eventpipe,qcalls -DENABLE_INTERP_LIB=1 -DDISABLE_ICALL_TABLES=1 -DDISABLE_CRASH_REPORTING=1 -DENABLE_ICALL_EXPORT=1 -DENABLE_LAZY_GC_THREAD_CREATION=1 -DENABLE_LLVM_RUNTIME=1 -DENABLE_METADATA_UPDATE=1 -DCMAKE_C_FLAGS=" -fexceptions -ID:\workspace\_work\1\s\.packages\microsoft.netcore.runtime.icu.transport\6.0.0-preview.3.21151.1/runtimes/browser-wasm/native/include" -DCMAKE_CXX_FLAGS=" -fexceptions"  D:\workspace\_work\1\s\src\mono\" exited with code 1.
    ##[error]src\mono\mono.proj(410,5): error MSB3073: (NETCORE_ENGINEERING_TELEMETRY=Build) The command "call D:\workspace\_work\1\s\src\mono\wasm\emsdk\emsdk_env.bat && emcmake cmake -DENABLE_WERROR=1 -DCMAKE_INSTALL_PREFIX=D:\workspace\_work\1\s\artifacts\obj\mono\Browser.wasm.Debug\out -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Debug -DGC_SUSPEND=preemptive -DENABLE_MINIMAL=jit,portability,sgen_major_marksweep_conc,sgen_split_nursery,sgen_gc_bridge,sgen_toggleref,sgen_debug_helpers,sgen_binary_protocol,logging,shared_perfcounters,interpreter,threads,eventpipe,qcalls -DENABLE_INTERP_LIB=1 -DDISABLE_ICALL_TABLES=1 -DDISABLE_CRASH_REPORTING=1 -DENABLE_ICALL_EXPORT=1 -DENABLE_LAZY_GC_THREAD_CREATION=1 -DENABLE_LLVM_RUNTIME=1 -DENABLE_METADATA_UPDATE=1 -DCMAKE_C_FLAGS=" -fexceptions -ID:\workspace\_work\1\s\.packages\microsoft.netcore.runtime.icu.transport\6.0.0-preview.3.21151.1/runtimes/browser-wasm/native/include" -DCMAKE_CXX_FLAGS=" -fexceptions"  D:\workspace\_work\1\s\src\mono\" exited with code 1.

* Try use newer cmake

* Revert "Try use newer cmake"

This reverts commit bd95f346f9a3c5828924201c79df3b356043c11c.

* Normalize path

* Remove excessive space char

* Try newer emscripten version

To try if it helps with the cmake issue

* Try trim end '\' from directory passed to cmake

Also revert emscripten version back

* Provision emscripten only when targeting wasm

* Do not set $os, it is already set above

* Revert "Remove excessive space char"

This reverts commit b1c4da12a0c39e78b0cf02d1da1332a55cedf772.

* Provision emscripten only on windows

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Radek Doulik <radekdoulik@gmail.com>
3 years agoFix nested Multipart when generating MailMessage (#47403)
Ely [Wed, 17 Mar 2021 15:57:49 +0000 (16:57 +0100)]
Fix nested Multipart when generating MailMessage (#47403)

* Fix nested Multipart when generating MailMessage

When sending a mail with alternate views and attachments, attachments were nested a second time. Doing so made the generated mail unintelligible for some clients (Like Outlook).

Fix dotnet#47379

* Add test for MailMessage serialization

Co-authored-by: MihaZupan <mihazupan.zupan1@gmail.com>
3 years agoFix card marking stealing for regions (#49704)
Peter Sollich [Wed, 17 Mar 2021 15:46:33 +0000 (16:46 +0100)]
Fix card marking stealing for regions (#49704)

Essentially the problem was that for regions, we have several lists of segments, one for each generation. Thus, the card_marking_enumerator logic needs provisions to restart enumerating with another segment list.

The changes fall into 3 categories:

- new method switch_to_segment to start enumerating a new segment list - called for a new generation
- changes to make the enumerator state consistent across one segment list ending and another starting
- added dprintf instrumentation so we can later reconstruct how different threads enumerated chunks.

3 years agoRemove kTLSProtocol13_ForwardDef (#48762)
Kevin Jones [Wed, 17 Mar 2021 15:04:43 +0000 (11:04 -0400)]
Remove kTLSProtocol13_ForwardDef (#48762)

3 years agoUse a single approach to detect presence of pseudo handle support. (#48623)
Kevin Jones [Wed, 17 Mar 2021 14:02:59 +0000 (10:02 -0400)]
Use a single approach to detect presence of pseudo handle support. (#48623)

3 years agoUpdate Microsoft.DotNet.Helix.Sdk to 6.0.0-beta.21166.5 (#49747)
Alexander Köplinger [Wed, 17 Mar 2021 14:02:12 +0000 (15:02 +0100)]
Update Microsoft.DotNet.Helix.Sdk to 6.0.0-beta.21166.5 (#49747)

Includes https://github.com/dotnet/arcade/pull/7103

3 years agoAdd obsolete attribute to DisablePrivateReflectionAttribute (#49550)
Annchous [Wed, 17 Mar 2021 13:42:19 +0000 (16:42 +0300)]
Add obsolete attribute to DisablePrivateReflectionAttribute (#49550)

* Add obsolete attribute to DisablePrivateReflectionAttribute

* Attribute added to ref file

* fix ref file and attribute

* Add new diagnostic ID

* Fix obsolete attribute

* Fix obsolete attribute in ref file

* Add new obsoletion ID to documentation

* Removed all references of DisablePrivateReflection in src/coreclr

* Fixed error message of obsoletion

* Fixed documentation

* Removed reference of DisablePrivateReflection

* Add NoWarn for new obsoletion ID

* Add pragma to tests

* Fix error message of new obsoletion

* Fix new obsoletion description in documentation

3 years agoBig-endian fixes for ilasm/ildasm (#49685)
Ulrich Weigand [Wed, 17 Mar 2021 13:35:31 +0000 (14:35 +0100)]
Big-endian fixes for ilasm/ildasm (#49685)

* Add byte swap when accessing PublicKeyBlob in AsmMan::EndAssembly

* Fix access beyond end of pszString in DumpUnicodeString

* Remove unneccessary assert in _FillMDDefaultValue

3 years agoAdd msbuild task to generate binary runtimeconfig format (#49544)
Fan Yang [Wed, 17 Mar 2021 11:39:54 +0000 (07:39 -0400)]
Add msbuild task to generate binary runtimeconfig format (#49544)

* Add msbuild task to generate binary runtimeconfig format

* Update property name due to naming conversion.

* Fixed more formatting issue

* Fixed one more naming convention

* Update src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Update src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Update src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
* Fixed comments

* Update src/tasks/RuntimeConfigParser/RuntimeConfigParser.cs

Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Fix error handling

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years ago[QUIC] Fix TestConnect (#49660)
Natalia Kondratyeva [Wed, 17 Mar 2021 11:21:40 +0000 (12:21 +0100)]
[QUIC] Fix TestConnect (#49660)

* Mark all failing tests with ActiveIssue

* Fix TestConnect

3 years agoBetter windows only guard which can be removed by linker (#48594)
Marek Safar [Wed, 17 Mar 2021 11:20:52 +0000 (12:20 +0100)]
Better windows only guard which can be removed by linker (#48594)

Also, remove superfluous test poking into an internal state to mimic
non-Windows test environment

3 years agoSimplify ASCIIUtility test utility class (#49720)
Michal Strehovský [Wed, 17 Mar 2021 11:17:34 +0000 (12:17 +0100)]
Simplify ASCIIUtility test utility class (#49720)

* Simplify ASCIIUtility test utility class

The existing code seems to be just an elaborate way to do the same thing.

* Update ASCIIUtilityTests.cs

3 years agoHandle RsaVerificationPrimitive failure (non-internal error) (#49741)
Elinor Fung [Wed, 17 Mar 2021 11:16:08 +0000 (04:16 -0700)]
Handle RsaVerificationPrimitive failure (non-internal error) (#49741)

3 years agoUpdate dependencies from https://github.com/dotnet/xharness build 20210315.2 (#49745)
dotnet-maestro[bot] [Wed, 17 Mar 2021 11:13:51 +0000 (11:13 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20210315.2 (#49745)

[main] Update dependencies from dotnet/xharness

3 years agoFileStream rewrite part II (#48813)
Adam Sitnik [Wed, 17 Mar 2021 10:55:35 +0000 (11:55 +0100)]
FileStream rewrite part II (#48813)

* introduce WindowsFileStreamStrategy

* introduce SyncWindowsFileStreamStrategy

* introduce AsyncWindowsFileStreamStrategy

* only DerivedFileStreamStrategy needs to have a reference to FileStream

remove finalizer from FileStream, keep it only in DerivedFileStreamStrategy and LegacyFileStreamStrategy

* use the new strategies when buffering is not enabled

* introduce BufferedFileStreamStrategy

* use the Legacy strategy by default for now, add tests for the other implementation

* Apply suggestions from code review

Co-authored-by: David Cantú <dacantu@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix stress-http and stress-ssl builds on Linux (#49706)
Anton Firszov [Wed, 17 Mar 2021 10:49:39 +0000 (11:49 +0100)]
Fix stress-http and stress-ssl builds on Linux (#49706)

3 years agoCollectionsMarshal.GetValueRef(Dictionary) (#49388)
Ben Adams [Wed, 17 Mar 2021 10:43:48 +0000 (10:43 +0000)]
CollectionsMarshal.GetValueRef(Dictionary) (#49388)

3 years agoBig-endian fix for JsonClassInfo.GetKey (#49708)
Ulrich Weigand [Wed, 17 Mar 2021 10:42:35 +0000 (11:42 +0100)]
Big-endian fix for JsonClassInfo.GetKey (#49708)

* Big-endian fix for JsonClassInfo.GetKey

* Skip assertion in JsonClassInfo.GetKey on big-endian
  (code will not ensure the properties tested here)

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonClassInfo.Cache.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix build on platforms without gsharedvt (#49710)
Alexander Köplinger [Wed, 17 Mar 2021 10:34:25 +0000 (11:34 +0100)]
Fix build on platforms without gsharedvt (#49710)

A `MonoMemoryManager*` parameter was added to `mono_arch_get_gsharedvt_call_info()` in https://github.com/dotnet/runtime/commit/34c68c7edf6d61c8ff3d2631003ed86353415479 that was missed in arch-stubs.c

3 years agoReadOnlySequence: Don't leak the flags that are on _startInteger and _endInteger...
Kuinox [Wed, 17 Mar 2021 09:16:30 +0000 (10:16 +0100)]
ReadOnlySequence: Don't leak the flags that are on _startInteger and _endInteger. (#47969)

* ReadOnlySequence: Don't leak the flags that are on _startInteger and _endInteger.

* Typo fix.

* Added more tests + review fixes.

3 years agoSystem.IO.Pipelines.PipeReader: Fix TryRead summary (#49603)
Michael Croes [Wed, 17 Mar 2021 06:18:30 +0000 (07:18 +0100)]
System.IO.Pipelines.PipeReader: Fix TryRead summary (#49603)

Add missing 'from' to the summary for TryRead.

3 years agoUnify corerun test runner (#49529)
Aaron Robinson [Wed, 17 Mar 2021 05:55:58 +0000 (22:55 -0700)]
Unify corerun test runner (#49529)

* Remove unused files.

* Rewrite corerun so that it runs on all platforms.
Remove the unixcorerun implementation but fold in
those its features.

Attach debugger is supported on Windows and macOS.
CORE_ROOT can now be set the same way on all platforms:
  --clr-path, CORE_ROOT, corerun dir.

* Dump the computed configuration for runtime if a failure to
  initialize or execute the entry assembly occurs.
Remove -v flag.

* Add debugger attach support for systems with procfs.

* Remove the corerun option for setting System.Globalization.Invariant.

3 years agorework ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed test (#49348)
Tomas Weinfurt [Wed, 17 Mar 2021 04:28:45 +0000 (21:28 -0700)]
rework ProxySetViaEnvironmentVariable_DefaultProxyCredentialsUsed test (#49348)

3 years agoPort hosting tests from extensions to runtime (#49716)
Anirudh Agnihotry [Wed, 17 Mar 2021 04:09:59 +0000 (21:09 -0700)]
Port hosting tests from extensions to runtime  (#49716)

* port hosting tests

* add nrt461 to test matrix and net6.0 -> netcoreappcurrent

* update the license header

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoAnonymousPipeStreams.Linux, Process.Unix Streams: perform async I/O by using Socket...
Tom Deseyn [Wed, 17 Mar 2021 02:03:36 +0000 (03:03 +0100)]
AnonymousPipeStreams.Linux, Process.Unix Streams: perform async I/O by using Socket implementation  (#44647)

* experiment: use read/write for socket operations instead of recvmsg/sendmsg

* AnonymousPipeStreams: perform async I/O by using Socket implementation

* PipeStream.Unix: use sync/async functions on Socket

* Refactor Socket creation

* Cleanup

* Fix broken comment

* Allow passing pipe fd to Socket/SafeSocketHandle public ctor

* macOS: Handle EPIPE on registration

* Refactor IsPipe to IsSocket

* Move registration error handling in to single method

* Process: use AnonymousPipeClientStream for redirected streams.

* Remove unneeded BufferedStream

* PR feedback

* PipeStream.Unix: enable cancelation tests

* Add back Ctor_SafeHandle_Invalid_ThrowsException test

* SysRead/SysWrite: Assert not used for socket-type handle

3 years agoUse new VS detection script in DacTableGen (#49729)
Anton Lapounov [Wed, 17 Mar 2021 01:35:25 +0000 (18:35 -0700)]
Use new VS detection script in DacTableGen (#49729)

3 years agoBig-endian test case fixes: System.Reflection (#49693)
Ulrich Weigand [Wed, 17 Mar 2021 00:33:19 +0000 (01:33 +0100)]
Big-endian test case fixes: System.Reflection (#49693)

* Fix endian assumptions in tests operating on PE headers / IL metadata
  (this is always encoded in little-endian byte order)

* Fix expected result for BlobReader test (always little-endian)

* Fix expected results for GUID tests

3 years agoBig-endian fix: Marvin hash (#49707)
Ulrich Weigand [Wed, 17 Mar 2021 00:31:16 +0000 (01:31 +0100)]
Big-endian fix: Marvin hash (#49707)

* Fix endian assumptions in Marvin.ComputeHash32OrdinalIgnoreCase
  (use the same logic that already exists in Marvin.ComputeHash32)

3 years agoPut tests that depend on non-zero lower bounds arrays behind condition (#49721)
Michal Strehovský [Wed, 17 Mar 2021 00:30:54 +0000 (01:30 +0100)]
Put tests that depend on non-zero lower bounds arrays behind condition (#49721)

I assume these are new.

3 years agoArmel support in crossgen2 (#43706)
David Wrighton [Wed, 17 Mar 2021 00:28:48 +0000 (17:28 -0700)]
Armel support in crossgen2 (#43706)

This change adds support for armel target compilation in crossgen2

To use the feature compile an application using the --targetos Linux and --targetarch armel flags.

Summary of changes
- To avoid bloating the compilation matrix, the #ifdefs used in the JIT that were conditional on ARM_SOFTFP behavior have been changed in to variable checks. To avoid perf penalties, this dynamic behavior is only enabled for the jit intended for compiling using crossgen2.
- Armel abi processing was integrated into the various parts of the managed crossgen2 codebase that correspond to components with special handling in the coreclr codebase
  - HFA support is disabled for Armel targets
  - Floating point registers are not used when passing arguments

With this change it becomes possible to run crossgen2 on a Windows or Linux machine and target a Linux Armel target.

3 years agoFix AppHost Save From MemoryMappedFile. (#49730)
Brian Robbins [Wed, 17 Mar 2021 00:24:08 +0000 (17:24 -0700)]
Fix AppHost Save From MemoryMappedFile. (#49730)

3 years agoCondition new tests depending on Ref.Emit on Ref.Emit support (#49722)
Michal Strehovský [Tue, 16 Mar 2021 23:48:42 +0000 (00:48 +0100)]
Condition new tests depending on Ref.Emit on Ref.Emit support (#49722)

3 years ago[mono] Prefix bundle loads with culture if applicable (#49534)
Ryan Lucia [Tue, 16 Mar 2021 23:10:57 +0000 (19:10 -0400)]
[mono] Prefix bundle loads with culture if applicable (#49534)

3 years ago[AndroidCrypto] Fix remaining Algorithms test failures. (#49501)
Jeremy Koritzinsky [Tue, 16 Mar 2021 21:47:03 +0000 (14:47 -0700)]
[AndroidCrypto] Fix remaining Algorithms test failures. (#49501)

3 years agoBig-endian test case fixes: System.Runtime (#49691)
Ulrich Weigand [Tue, 16 Mar 2021 21:39:35 +0000 (22:39 +0100)]
Big-endian test case fixes: System.Runtime (#49691)

* Byte-swap input/output for BitConverter tests

* Update byte index for GetByte/SetByte tests on big-endian systems

3 years agoadd STRESS_PROMOTE_LESS_STRUCTS mode. (#49084)
Sergey Andreenko [Tue, 16 Mar 2021 21:33:38 +0000 (14:33 -0700)]
add STRESS_PROMOTE_LESS_STRUCTS mode. (#49084)

* add STRESS_PROMOTE_LESS_STRUCTS mode.

* add comment

* Disable failing tests.

* review

* fix build break

3 years agoDo not pin free object for STRESS_REGIONS (#49547)
Andrew Au [Tue, 16 Mar 2021 19:34:56 +0000 (12:34 -0700)]
Do not pin free object for STRESS_REGIONS (#49547)

3 years agoMove dotnet-sdk snaps into the installer repo (#49697)
Viktor Hofer [Tue, 16 Mar 2021 18:59:44 +0000 (19:59 +0100)]
Move dotnet-sdk snaps into the installer repo (#49697)

3 years agoPrevent unbounded lock holds in BufferManager of EventPipe (#48435)
John Salem [Tue, 16 Mar 2021 17:36:07 +0000 (10:36 -0700)]
Prevent unbounded lock holds in BufferManager of EventPipe (#48435)

3 years ago[mono][debugger] Disable by default the generation of mscordbi (#49596)
Thays Grazia [Tue, 16 Mar 2021 17:17:59 +0000 (14:17 -0300)]
[mono][debugger] Disable by default the generation of mscordbi (#49596)

* Disable by default compilation of mscordbi, it will be generated by default only on CI.
To generate it use /p:MonoMsCorDbi=true
Fixes #49590

* Changing what was suggested by @jkotas and @akoeplinger.
Thanks @directhex for your help.

* Update eng/Subsets.props

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years ago[wasm] current dedup breaks blazor template apps (#49678)
Larry Ewing [Tue, 16 Mar 2021 17:05:00 +0000 (12:05 -0500)]
[wasm] current dedup breaks blazor template apps (#49678)

3 years agoPermit ST as a friendly name alias for stateOrProvinceName OID.
Kevin Jones [Tue, 16 Mar 2021 16:28:23 +0000 (12:28 -0400)]
Permit ST as a friendly name alias for stateOrProvinceName OID.

3 years agoDisable Interop test which is killing our pass rate on Mac ARM64 (#49703)
Jo Shields [Tue, 16 Mar 2021 15:42:02 +0000 (11:42 -0400)]
Disable Interop test which is killing our pass rate on Mac ARM64 (#49703)

3 years agoActiveIssue for failing Windows threading test (#49701)
Jo Shields [Tue, 16 Mar 2021 15:40:41 +0000 (11:40 -0400)]
ActiveIssue for failing Windows threading test (#49701)

3 years agoMove StartupHookerProvider from shared descriptor file (#49669)
Mateo Torres-Ruiz [Tue, 16 Mar 2021 15:28:19 +0000 (08:28 -0700)]
Move StartupHookerProvider from shared descriptor file (#49669)

* Move StartupHook substitution from shared descriptor

* Put things in proper descriptor

* Subs

* Add subs xml in SPCL

* Fix assembly name

3 years agoBig-endian test case fixes: PKCS crypto (#49695)
Ulrich Weigand [Tue, 16 Mar 2021 14:55:10 +0000 (15:55 +0100)]
Big-endian test case fixes: PKCS crypto (#49695)

* Fix endian assumption in Rfc3161 test case
  (serial number must always be in big-endian byte order)

3 years agoBig-endian test case fixes: BinaryWriter (#49688)
Ulrich Weigand [Tue, 16 Mar 2021 14:52:20 +0000 (15:52 +0100)]
Big-endian test case fixes: BinaryWriter (#49688)

* Fix endian assumption in BinaryWriter_WriteSpan
  (BinaryWriter always uses little-endian byte order)

3 years agoBig-endian test case fixes: unsafe compiler services (#49692)
Ulrich Weigand [Tue, 16 Mar 2021 14:51:57 +0000 (15:51 +0100)]
Big-endian test case fixes: unsafe compiler services (#49692)

* Update expected values for endian-dependent test cases

3 years agoBig-endian test case fixes: Visual Basic (#49696)
Ulrich Weigand [Tue, 16 Mar 2021 14:43:34 +0000 (15:43 +0100)]
Big-endian test case fixes: Visual Basic (#49696)

* Enable Randomize_SetsExpectedState test case on big-endian systems
  (VBMath.Randomize already handles big-endian systems)

3 years agoMove Windows Mono to Staging (Closes: #49569) (#49641)
Jo Shields [Tue, 16 Mar 2021 14:14:07 +0000 (10:14 -0400)]
Move Windows Mono to Staging (Closes: #49569) (#49641)

* Move Windows Mono to Staging (Closes: #49569)

3 years agoBig-endian test case fixes: XML (#49689)
Ulrich Weigand [Tue, 16 Mar 2021 13:45:48 +0000 (14:45 +0100)]
Big-endian test case fixes: XML (#49689)

* Update expected results for endian-dependent tests BinHex_9/BinHex_10

* Input strings for XML encode/decode tests are hard-coded little-endian

3 years agoBig-endian test case fixes: System.Memory tests (#49690)
Ulrich Weigand [Tue, 16 Mar 2021 13:45:24 +0000 (14:45 +0100)]
Big-endian test case fixes: System.Memory tests (#49690)

* Fix endian assumptions in preparing input byte patterns

* Enable tests that were disabled on big-endian systems

3 years agoBig-endian test case fixes: big-integer numerics (#49694)
Ulrich Weigand [Tue, 16 Mar 2021 13:44:24 +0000 (14:44 +0100)]
Big-endian test case fixes: big-integer numerics (#49694)

* Fix endian assumptions in CtorByteArray tests
  (the byte array must always be in little-endian byte order)

* Fix endian assumptions in left-/right-shift tests
  (byte array representing shift count must be in little-endian)

3 years agoReduce startup allocation from event pipe metadata (#49303)
Stephen Toub [Tue, 16 Mar 2021 13:36:14 +0000 (09:36 -0400)]
Reduce startup allocation from event pipe metadata (#49303)

* Reduce startup allocation from event pipe metadata

A "hello world" console app results in EventPipeMetadataGenerate.GenerateEventMetadata making almost 500 calls to factory methods on ScalarTypeInfo, each of which allocates a new ScalarTypeInfo object and a Func delegate, but they're all immutable objects that could be cached on first use and reused for all subsequent use.  Eliminating the need for the funcs entirely and caching the ScalarTypeInfo objects saves almost 1000 object allocations and 66K of allocation at startup.  It does mean we'll end up holding on to a few objects (9 objects == ~575 bytes) for the duration of the app that we would otherwise have dropped (plus the static fields).

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs

3 years agoDev Innerloop pipeline timeout was passed in wrong (#49702)
Viktor Hofer [Tue, 16 Mar 2021 13:35:30 +0000 (14:35 +0100)]
Dev Innerloop pipeline timeout was passed in wrong (#49702)

3 years agoAvoid forcing parsing of DefaultRequestHeaders and from message.ToString() (#49673)
Stephen Toub [Tue, 16 Mar 2021 13:35:19 +0000 (09:35 -0400)]
Avoid forcing parsing of DefaultRequestHeaders and from message.ToString() (#49673)

* Avoid forcing parsing of DefaultRequestHeaders

In the past, this was done because every request would parse all headers as part of sending them, so it was better to parse once then on every request.  But we changed the behavior for sending in SocketsHttpHandler to actually respect TryAddWithoutValidation, such that we wouldn't forcefully validate unless the developer asked us to.  This makes DefaultRequestHeaders consistent with that.

* Avoid forcing parsing when ToString()'ing request and response messages

This not only can change behavior in the debugger just by hovering over a message, it can change behavior at runtime due to the request/response messages getting logged.

* Add another test

3 years agoWasm build improvements (#49658)
Zoltan Varga [Tue, 16 Mar 2021 04:17:30 +0000 (00:17 -0400)]
Wasm build improvements (#49658)

* Avoid passing mono libs twice when linking dotnet.wasm.

* Build aot-instances.dll in deterministic mode.

* Add a helper target for building the mono runtime + cross compiler without building dotnet.wasm.

Useful when working with AOT, since AOT will rebuild dotnet.wasm anyway.

* Avoid emitting a double -Oz into emcc-flags.txt

* Quiet emsdk_env.sh.

* Add a _WasmDevel internal property which can be used to pass -O0 to the wasm linker, speeding up builds.

* Disable native stripping for wasm tests.

* Revert unrelated changes.

* Don't overwrite EmccFlags.

3 years ago[wasm] Remove extraneous emission of MONO_PATH value (#49672)
Ankit Jain [Tue, 16 Mar 2021 03:25:58 +0000 (23:25 -0400)]
[wasm] Remove extraneous emission of MONO_PATH value (#49672)

3 years agoClear the buffers fields (#49575)
David Fowler [Mon, 15 Mar 2021 22:27:16 +0000 (15:27 -0700)]
Clear the buffers fields (#49575)

- This makes it easier to reason about gcroots in dumps

3 years agoAdd Andy's stress mode for byrefs. (#49636)
Sergey Andreenko [Mon, 15 Mar 2021 22:00:41 +0000 (15:00 -0700)]
Add Andy's stress mode for byrefs. (#49636)

3 years agoRemove reference to non-existing parameter (#49630)
Andrii Kurdiumov [Mon, 15 Mar 2021 21:11:16 +0000 (03:11 +0600)]
Remove reference to non-existing parameter (#49630)

3 years agoResolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2) (#49467)
Eric Erhardt [Mon, 15 Mar 2021 20:45:26 +0000 (15:45 -0500)]
Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2) (#49467)

* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2)

Contributes to #45623

* Change ComNativeDescriptorProxy so the linker can see the Type (when it is available) by using Type.GetType.

3 years agoUpdate buildtriage.md (#49651)
Viktor Hofer [Mon, 15 Mar 2021 18:12:06 +0000 (19:12 +0100)]
Update buildtriage.md (#49651)

* Update buildtriage.md

3 years agoSuppress the exception thrown when DiagnosticSourceEventSource access object properti...
Tarek Mahmoud Sayed [Mon, 15 Mar 2021 18:05:00 +0000 (11:05 -0700)]
Suppress the exception thrown when DiagnosticSourceEventSource access object properties (#49567)

3 years agoAdd non-RC2 content encryption test data for Pkcs test suite (#49564)
Elinor Fung [Mon, 15 Mar 2021 17:26:54 +0000 (10:26 -0700)]
Add non-RC2 content encryption test data for Pkcs test suite (#49564)

3 years ago[wasm] Add "Installation of JavaScript engines" to README (#49650)
Radek Doulik [Mon, 15 Mar 2021 16:49:26 +0000 (17:49 +0100)]
[wasm] Add "Installation of JavaScript engines" to README (#49650)

Add information about `jsvu` and how to install it on mac.

3 years agoPush Evidence down to System.Security.AccessControl (#49411)
Eric StJohn [Mon, 15 Mar 2021 16:41:38 +0000 (09:41 -0700)]
Push Evidence down to System.Security.AccessControl (#49411)

* Push Evidence down to System.Security.AccessControl

This can avoid the dependency
  System.Security.Cryptography.Xml > System.Security.Permissions

* Fix nullable annotations and ObsoleteAttributes

3 years agoImprove docs for StringValues.IsNullOrEmpty for empty strings (#49629)
scharnyw [Mon, 15 Mar 2021 14:53:02 +0000 (22:53 +0800)]
Improve docs for StringValues.IsNullOrEmpty for empty strings (#49629)

Fix #49626

Co-authored-by: Guanbo Wang <GWang26@slb.com>
3 years agoReplace LINQ's custom Set with HashSet (#49591)
Stephen Toub [Mon, 15 Mar 2021 13:02:57 +0000 (09:02 -0400)]
Replace LINQ's custom Set with HashSet (#49591)

3 years ago[RyuJIT] Fix rel32 for calls/data (#49549)
Egor Bogatov [Mon, 15 Mar 2021 12:24:57 +0000 (15:24 +0300)]
[RyuJIT] Fix rel32 for calls/data (#49549)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoDisable /OPT:ICF on windows, it merges identical functions breaking icall symbol...
Zoltan Varga [Mon, 15 Mar 2021 12:09:48 +0000 (08:09 -0400)]
Disable /OPT:ICF on windows, it merges identical functions breaking icall symbol lookup. (#49622)

3 years agoAdd null check for WaitInfo (#49628)
Ryan Lucia [Mon, 15 Mar 2021 11:49:50 +0000 (07:49 -0400)]
Add null check for WaitInfo (#49628)

* Add null check for WaitInfo

* Remove OnThreadExiting static from WaitSubsystem

3 years agoImplement struct enumerator for Tensor<T> (#46497)
Newell Clark [Mon, 15 Mar 2021 10:29:00 +0000 (06:29 -0400)]
Implement struct enumerator for Tensor<T> (#46497)

* Added struct enumerator to Tensor<T>

Fix issue #28391

* Added struct enumerator to Tensor<T>

Added unit test for element enumeration.

Fix issue #28391

* Added xml doc comments

* Apply suggested edit to System.Numerics.Tensor.Enumerator

Co-authored-by: Günther Foidl <gue@korporal.at>
* Fixed naming

* Forgot to change back Current to auto-prop

* Apply suggested changes

-Make Reset and Dispose public
-Fix null ref bug with Reset
-Added tests for Reset and Dispose

Co-authored-by: Günther Foidl <gue@korporal.at>
3 years agoNon-generic StringComparer conversion for dict and hashset (#49608)
Ben Adams [Mon, 15 Mar 2021 03:42:26 +0000 (03:42 +0000)]
Non-generic StringComparer conversion for dict and hashset (#49608)

3 years agoProfile guided compilation fixes (#49516)
David Wrighton [Sun, 14 Mar 2021 22:46:35 +0000 (15:46 -0700)]
Profile guided compilation fixes (#49516)

- Fix issue where if we can't load a token during profile data resolution, we crash with a NullReferenceException
- Fix issue where when profile specified methods are added to the compilation, they cause methods not specified to be compiled as well. This caused about a 3X bloat in method compilation when working off of profile specified data
  - Fixed by adding a dependency phase model to dependency analyzer
  - Then using that to tie into method compilation and dependencies so that some extra dependencies are trimmed by our dependency analysis flow

3 years agoConsolidate VS detection logic (#49593)
Anton Lapounov [Sun, 14 Mar 2021 21:48:27 +0000 (14:48 -0700)]
Consolidate VS detection logic (#49593)

3 years agoFix DateTime Tests (#49560)
Tarek Mahmoud Sayed [Sun, 14 Mar 2021 18:07:56 +0000 (11:07 -0700)]
Fix DateTime Tests (#49560)

* Fix DateTime Tests

3 years agoPass the cancellation token to FlushAsync (#49594)
David Fowler [Sun, 14 Mar 2021 14:45:34 +0000 (07:45 -0700)]
Pass the cancellation token to FlushAsync (#49594)

3 years agoHandle cleanup (#49578)
Zoltan Varga [Sun, 14 Mar 2021 05:36:41 +0000 (00:36 -0500)]
Handle cleanup (#49578)

* Remove unused named handle support.

* Remove more unused code.

3 years agoDelete a few more unused files (#49584)
Jan Kotas [Sun, 14 Mar 2021 02:57:18 +0000 (18:57 -0800)]
Delete a few more unused files (#49584)

3 years agoUse same brick size for both x64 and ARM64 (#49581)
Jan Kotas [Sun, 14 Mar 2021 01:08:06 +0000 (17:08 -0800)]
Use same brick size for both x64 and ARM64 (#49581)

3 years agoDelete Utf8Extensions.* (#49582)
Jan Kotas [Sat, 13 Mar 2021 21:22:05 +0000 (13:22 -0800)]
Delete Utf8Extensions.* (#49582)

Unused left over from the Utf8String prototype

3 years ago[mono][mbr] Implement DOTNET_MODIFIABLE_ASSEMBLIES support (#49507)
Aleksey Kliger (λgeek) [Sat, 13 Mar 2021 18:22:31 +0000 (13:22 -0500)]
[mono][mbr] Implement DOTNET_MODIFIABLE_ASSEMBLIES support (#49507)

Implements https://github.com/dotnet/runtime/issues/47274 for Mono.

1. `DOTNET_MODIFIABLE_ASSEMBLIES` environment variable must be set to `debug` for hot reload to be enabled (in addition to the interpreter being enabled)
2. Assemblies must be compiled in Debug mode - we check `DebuggableAttribute` for the `DisableOptimizations` bit.  If an assembly doesn't have the bit set, it can't be reloaded.
3. In the interpreter - don't try to inline when hot reload is enabled and the caller or callee has the DisableOptimizations bit set.

* [mbr] Check DOTNET_MODIFIABLE_ASSEMBLIES for hot reload support

   If it's set to "debug" (case insensitive) then hot reload is enabled for assemblies compiled in debug mode.  Otherwise hot reload is disabled

* [mbr] Disable inlining for DebuggerAttribue assemblies

   with the optimizer disabled flag

* [mbr] Update samples

* [mbr] Throw InvalidOperationException is hot reload is not supported

   On a per-assembly basis

* [mbr] Stub implementations if !ENABLE_METADATA_UPDATE