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

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

* match up the GUID

* why is this returning nothing

* Make ThreadPool emit events via NativeRuntimeEventSource

* found error...

* hack around having duplicate events generated

* make portable threadpool fire events through nativeruntimeeventsource

* make the initializer live in correct namespace

* EventListener tests are passing now

* make native QCall endpoints that sink into LTTng

* send events through XplatEventLogger sink

* Fix merge error

* double registration

* fix callback not getting handled when lttng is enabled

* cleanup 1

* rename file

* remove stale comments

* remove stale comment

* undo useless change

* fix broken EventListener

* apply code review feedback

* fix windows build

* fix incorrect qcall

* fix up ifdefs for Windows builds

* fix ifdef

* put back removed code

* tests pass now

* Fix NativeRuntimeEventSource not getting enabled for lttng

* Add some more comments

* Add comment in generated code

* fix mono build

* PR feedback

* fix typo

* code review feedback

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

[master] Update dependencies from mono/linker

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

Accidentally deleted formatting in runtime.yml

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

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

Get rid of explicit protection change to RW

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

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

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

* Add source index build step

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

* Add missing parameter

* another fix

* roll forward

* Change common yaml template back to main version

* Remove PR run of source index build for now

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

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

* eh fix

* Removing 2 rooted types related to EventSource Feature Switch

* typo

* NativeRuntimeEventSource needs to remain for now

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

* Add System.Linq Chunk extension method

Fix #27449

* Use explicit types instead of type inference

* Seperate inner and outer loop

* Rename parameter maxSize to size

* Add missing license header

* Remove Chunk.SpeedOpt.cs

* Add tests to verify Chunk works after mutations

* Add/remove before getting enumerator in tests

* Test content of chunk method for IQueryable<T>

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

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

And enable nullable annotations in test projects

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

* Make superpmi collection with command more convenient

Allow a command to be searched for on the PATH.

* Allow searching core_root for tool

Fix help string

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

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

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

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

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

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

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

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

* Update apicompat ref pack compare verison to 5.0.0

* Baseline attribute changes

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

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

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

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

* Remove bound checks for unsigned <= with constant integers

* formatting

* update comment and add next edge tests

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

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

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

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

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

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

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

* Return failure code when SafeHandle tests fail.

* Disable SafeHandle tests on mono.

* Handle platform specific exception type.

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

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

* Project move from extensions

* addding ref and some analyzer changes

* header changes and ref file for system.md

* add ref projects

* minor formating

* packaging

* adding sln files

* address feedbacl

* correct case of Directory.build.props

* add net461 dll to package

* Remove usage of startsWith

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

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

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

* remove EventPipe type

* remove outdated tests

* remove GitHub_22247

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

* Support marshalling of null SafeHandle.

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

* Match SafeHandle behavior on Mono.

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

* Make corelib crossgen incremental

* Fix typo

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

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

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

Contributes to #45623

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

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

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

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

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

* FileSystem.AccessControl tests not cleaning files properly

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

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

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

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

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

* Restore try catch before merging.

* Address suggestions.

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

* NotFound test

* FileShare.None

* InlineData FileMode

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

* Address suggestions

* Address suggestions

* Address suggestions

* Reverting Verify_FileSecurity_CreateFile to the original arguments

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

* update the pi

* add the missing entry

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

This reverts commit 464010d9d0241bbdcbfbda25b32e78991ddf6093.

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

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

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

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

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

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

* Add the Math benchmarks as tests

* Fixing impMathIntrinsic to not insert unnecessary casts

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

3 years agoDuplicate productVersion.txt with repo-specific name (#48018)
Michelle McDaniel [Tue, 9 Feb 2021 16:07:08 +0000 (08:07 -0800)]
Duplicate productVersion.txt with repo-specific name (#48018)

In our efforts to unify the build access story using aka.ms links, we have found that there are certain files that share the same name in multiple different repositories, most importantly, productVersion.txt. As part of the work to move to aka.ms links, we will be flattening the short link paths, so rather than having a runtime-specific, aspnetcore-specific, etc. full path to the files generated by each of the repos, they will all go to the same short link location. This means that the path to productVersion.txt will collide in the aka.ms links (the backing locations are not changing and will be unaffected). To combat this, we will add a duplicate of each of the product repos productVersion.txt, renamed to indicate which product repo it came from, in this case runtime-productVersion.txt. The original will remane so that we do not break existing scenarios that do not use the aka.ms links.

3 years agoReimplement APM UDP Socket methods on top of task variants and consolidate related...
Anton Firszov [Tue, 9 Feb 2021 16:02:13 +0000 (17:02 +0100)]
Reimplement APM UDP Socket methods on top of task variants and consolidate related tests (#47781)

Contributes to #43845. Reimplements (Begin|End)(SendTo|ReceiveFrom|ReceiveMessageFrom) on top of the new Task-based variants, and deletes unused code. Moves all related argument validation tests from ArgumentValidationTests.cs to SendTo.cs, ReceiveFrom.cs and ReceiveMessageFrom.cs, and extends coverage.

3 years agoOptimize Matrix.Elements (#47932)
Jeremy Kuhne [Tue, 9 Feb 2021 15:56:14 +0000 (07:56 -0800)]
Optimize Matrix.Elements (#47932)

* Optimize Matrix.Elements

Just pin the array. There is no need to allocate native memory and copy.

* Move more element usage to the stack.

* Remove DeleteObject call

3 years agoMention tiering support in the tutorial (#48047)
SingleAccretion [Tue, 9 Feb 2021 14:31:26 +0000 (17:31 +0300)]
Mention tiering support in the tutorial (#48047)

3 years agoEnable size-optimized LINQ build for Browser (#47918)
Stephen Toub [Tue, 9 Feb 2021 14:30:41 +0000 (09:30 -0500)]
Enable size-optimized LINQ build for Browser (#47918)

* Enable size-optimized LINQ build for Browser

Re-enable the size-optimized variant of LINQ and use it for the Browser build of the library.

* Opt more targets into size optimizations, per PR feedback

3 years agoFix AOT on ios/amd64. (#48004)
Zoltan Varga [Tue, 9 Feb 2021 14:02:25 +0000 (09:02 -0500)]
Fix AOT on ios/amd64. (#48004)

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

3 years agoDelete dotnet-deb-tool. (#48025)
Jeremy Koritzinsky [Tue, 9 Feb 2021 11:53:08 +0000 (03:53 -0800)]
Delete dotnet-deb-tool. (#48025)

Once dotnet/installer#9631 is merged, no one will be using dotnet-deb-tool. So, we can delete it from dotnet/runtime.

3 years agoRemove CF_QueryForIdentity flag (#48040)
Elinor Fung [Tue, 9 Feb 2021 10:03:05 +0000 (02:03 -0800)]
Remove CF_QueryForIdentity flag (#48040)

3 years agoMake sure optdatapath.txt only gets touched when different (#48044)
Juan Hoyos [Tue, 9 Feb 2021 09:43:12 +0000 (01:43 -0800)]
Make sure optdatapath.txt only gets touched when different (#48044)

3 years agoAnnotate DispatchProxy interface type with DynamicallyAccessedMembers.All (#48011)
Eric Erhardt [Tue, 9 Feb 2021 08:36:42 +0000 (02:36 -0600)]
Annotate DispatchProxy interface type with DynamicallyAccessedMembers.All (#48011)

This ensures the trimmer will warn correctly if the interface type has trimming annotations itself.

3 years agoFix errors when DispatchProxy is not public type (#47903)
Krzysztof Wicher [Tue, 9 Feb 2021 07:22:36 +0000 (08:22 +0100)]
Fix errors when DispatchProxy is not public type (#47903)

* Fix non-public DispatchProxy + tests

* Disable mono tests affected by #47989

3 years agoFix build break in markdown lint (#48041)
Dan Moseley [Tue, 9 Feb 2021 06:11:22 +0000 (22:11 -0800)]
Fix build break in markdown lint (#48041)

3 years agoFix timeout in ThreadLocalTests (#48020)
Dan Moseley [Tue, 9 Feb 2021 05:38:28 +0000 (21:38 -0800)]
Fix timeout in ThreadLocalTests (#48020)

3 years agoDelete mov_i2xmm and mov_xmm2i. (#47843)
Sergey Andreenko [Tue, 9 Feb 2021 05:27:08 +0000 (21:27 -0800)]
Delete mov_i2xmm and mov_xmm2i. (#47843)

* Delete mov_i2xmm and mov_xmm2i.

* Delete `ins_CopyFloatToInt`.

* Delete 'ins_CopyIntToFloat'.

* review feedback

3 years agoAllow larger than 0x1000 bytes allocation in genStackPointerConstantAdjustment()...
Egor Chesakov [Tue, 9 Feb 2021 03:03:56 +0000 (19:03 -0800)]
Allow larger than 0x1000 bytes allocation in genStackPointerConstantAdjustment() (#47862)

* In AOT scenarios the VM reports to the JIT the minimal supported page size in src/coreclr/vm/jitinterface.cpp

* Have genStackPointerConstantAdjustment accept regTmp argument on Arm32 and Arm64

The temporary register is going to be used when sub sp,sp,#spDelta can not be encoded.
For example, this happens when spDelta corresponds to OsPageSize and the
OsPageSize is larger than 0x1000 bytes.

The following code needs to be generated in such cases

mov regTmp,#spDelta
sub sp,sp,regTmp

* Use genInstrWithConstant(INS_sub) and rsGetRsvdReg() as temporary register to encode amount of sp adjustment in src/coreclr/jit/codegenarm64.cpp

* Update comment to reflect that REG_NA can be passed for regTmp in genStackPointerConstantAdjustment in src/coreclr/jit/codegenarmarch.cpp

3 years agoShared properties for COM tests (#48019)
Elinor Fung [Tue, 9 Feb 2021 03:02:50 +0000 (19:02 -0800)]
Shared properties for COM tests (#48019)

* Shared properties for COM tests

* Fix comment

3 years agoRemove exclusion of the UnitTest_GVM (#48003)
Jan Vorlicek [Tue, 9 Feb 2021 02:15:01 +0000 (03:15 +0100)]
Remove exclusion of the UnitTest_GVM (#48003)

The test was disabled because it was failign with crossgen2. I am
removing the exclusion because the test is passing now.

3 years agoSpanning tree instrumentation (#47959)
Andy Ayers [Tue, 9 Feb 2021 01:59:12 +0000 (17:59 -0800)]
Spanning tree instrumentation (#47959)

Add a new instrumentation mode that only instruments a subset of the edges in
the control flow graph. This reduces the total number of counters and so has
less compile time and runtime overhead than instrumenting every block.

Add a matching count reconstruction algorithm that recovers the missing edge
counts and all block counts.

See #46882 for more details on this approach.

Also in runtime pgo support, add the header offset to the copy source.
This fixes #47930.

3 years agoDelete dead IFileFormatReader code in System.IO.Compression (#47408)
Stephen Toub [Tue, 9 Feb 2021 01:57:21 +0000 (20:57 -0500)]
Delete dead IFileFormatReader code in System.IO.Compression (#47408)

3 years agoRemove mono config file support. (#48007)
Zoltan Varga [Tue, 9 Feb 2021 01:43:54 +0000 (20:43 -0500)]
Remove mono config file support. (#48007)

* Remove mono config file support.

* Remove unused mono_runtime_unhandled_exception_policy_set ().

* Fix the build.

3 years agoAllow GlobalizationMode.Invariant = false to be substituted by the trimmer. (#47999)
Eric Erhardt [Tue, 9 Feb 2021 01:30:48 +0000 (19:30 -0600)]
Allow GlobalizationMode.Invariant = false to be substituted by the trimmer. (#47999)

This allows a Blazor WASM app to trim unused Invariant code when Invariant mode isn't enabled.

3 years ago[master] Update dependencies from mono/linker (#47995)
dotnet-maestro[bot] [Tue, 9 Feb 2021 01:18:53 +0000 (01:18 +0000)]
[master] Update dependencies from mono/linker (#47995)

[master] Update dependencies from mono/linker

3 years agoIntroducing support for callchain profile-driven optimizations (#47664)
Tomáš Rylek [Tue, 9 Feb 2021 00:27:58 +0000 (01:27 +0100)]
Introducing support for callchain profile-driven optimizations (#47664)

After adding support for calculating callchain profile statistics
as an initial attempt at compile-time measure for code layout
quality, I have implemented an initial algorithm for method
placement based on the statistics. The algorithm is trivial, it
just sorts all caller-callee pairs resolved from the profile
by descending call counts and then goes through the list and
just places methods in the order in which they are found,
putting non-profiled methods last. In the System.Private.CoreLib
compilation using the profile file

simple_new_model_two_apps_1_7.json

(not yet the latest one from Siva with signatures), I'm seeing
the following difference in the statistics:

--callchain-method:none

CHARACTERISTIC            | PAIR COUNT | CALL COUNT | PERCENTAGE
----------------------------------------------------------------
ENTRIES TOTAL             |        291 |     266229 |     100.00
RESOLVED ENTRIES          |        267 |     260172 |      97.72
UNRESOLVED ENTRIES        |         24 |       6057 |       2.28
NEAR (INTRA-PAGE) CALLS   |        145 |     109055 |      40.96
FAR (CROSS-PAGE) CALLS    |        122 |     151117 |      56.76

--callchain-method:sort

CHARACTERISTIC            | PAIR COUNT | CALL COUNT | PERCENTAGE
----------------------------------------------------------------
ENTRIES TOTAL             |        291 |     266229 |     100.00
RESOLVED ENTRIES          |        267 |     260172 |      97.72
UNRESOLVED ENTRIES        |         24 |       6057 |       2.28
NEAR (INTRA-PAGE) CALLS   |        237 |     260110 |      97.70
FAR (CROSS-PAGE) CALLS    |         30 |         62 |       0.02

While the initial results seem encouraging, I guess that's mostly
because the profile used is very small, I guess that with more
complex profiles and / or with composite compilation of the entire
framework things may become substantially more complex.

Thanks

Tomas

3 years agomake sure TcpClient is properly initialized when using name in ctor (#47058)
Tomas Weinfurt [Tue, 9 Feb 2021 00:27:43 +0000 (16:27 -0800)]
make sure TcpClient is properly initialized when using name in ctor (#47058)

* make sure TcpClient is properly initialized when using name in ctor

* add client.Dispose

* feedback from review

* feedback from review

* feedback from review

3 years ago[master] Update dependencies from dotnet/runtime dotnet/xharness (#47993)
dotnet-maestro[bot] [Tue, 9 Feb 2021 00:08:23 +0000 (00:08 +0000)]
[master] Update dependencies from dotnet/runtime dotnet/xharness (#47993)

[master] Update dependencies from dotnet/runtime dotnet/xharness

3 years agoAdd SystemNative_LowLevelMonitor_TimedWait to System.Native (#47325)
Ryan Lucia [Mon, 8 Feb 2021 23:08:46 +0000 (18:08 -0500)]
Add SystemNative_LowLevelMonitor_TimedWait to System.Native (#47325)

* Add SystemNative_LowLevelMonitor_TimedWait to System.Native

* Undefine _XOPEN_SOURCE before pthread.h to fix CoreCLR MacOS build

* Rework pthread_condattr_setclock/CLOCK_MONOTONIC logic to support iOS

* Try redefining _XOPEN_SOURCE

* Fix header for pthread_condattr_setclock check

* Copy check from CoreCLR GC

3 years agoMove common corelib code to shared partition (#47956)
Adeel Mujahid [Mon, 8 Feb 2021 22:50:53 +0000 (00:50 +0200)]
Move common corelib code to shared partition (#47956)

* Move common corelib code to shared partition

* Inline SetCustomAttributeNoLock method

3 years agorebuild certificate context if we use client cert from credential cache (#47729)
Tomas Weinfurt [Mon, 8 Feb 2021 21:09:11 +0000 (13:09 -0800)]
rebuild certificate context if we use client cert from credential cache (#47729)

* rebuild context if we use client cert from cache

* adjust expectation for windows

* add ITestOutputHelper

* use fixture to set up certificates

* add chain verification to the test

* adjust test

* fix assert

* disable test on macOS

3 years agoFix GDI handle leak in Icon.DrawImage (#47836)
Santiago Fernandez Madero [Mon, 8 Feb 2021 20:44:58 +0000 (12:44 -0800)]
Fix GDI handle leak in Icon.DrawImage (#47836)

* Fix GDI handle leak in Icon.DrawImage

* Fix build

* Add test

* Fix test in Mono

* Add missing Usings

3 years agoResolve ILLink warnings for System.Resources.ResourceManager (#47778)
Jose Perez Rodriguez [Mon, 8 Feb 2021 20:44:48 +0000 (12:44 -0800)]
Resolve ILLink warnings for System.Resources.ResourceManager (#47778)

* Making System.Resources.ResourceManager trim safe

* Addressing PR Feedback

* Rename objects => types

* Also rename the strings.resx

* More PR Feedback

* Add UnconditionalSuppressMessage to Extensions

* Rename feature switch and reword error messages

* Removing new warning that is already addressed

* Rename AppContext switch and add feature switch to docs

* Addressing Feedback

* Revert changes to findtype plus some other feedback

* Revert FindType back

* move feature check up

3 years agoRefactor TranscodeUtf8 to allow trimming of Vector128<T> (#47928)
Tanner Gooding [Mon, 8 Feb 2021 20:22:12 +0000 (12:22 -0800)]
Refactor TranscodeUtf8 to allow trimming of Vector128<T> (#47928)

3 years agoName some more threads (#47084)
Dan Moseley [Mon, 8 Feb 2021 20:17:10 +0000 (12:17 -0800)]
Name some more threads (#47084)

* name threads

* typo:

* typo

* Truncate

* Name long running TP thread

* Allow resetting thread names

* Fix thread set test

* Remove unnecessary reset of FSW thread name

* prettier names

* consistent syntax

* Fix threadpool test

* Fix code typo

* typo

* adjust names

3 years agoBitOperations.IsPow2 for all supported integral types (#36163)
John Kelly [Mon, 8 Feb 2021 20:08:00 +0000 (20:08 +0000)]
BitOperations.IsPow2 for all supported integral types (#36163)

* Add IsPow2

* Update BitOperationsTests.cs

* Refactor to static locals

* Add profiled software fallback

* Remove popcnt paths

* Remove popcnt usage as discussed

cc @tannergooding

* Invert branch

Discussed with tanner in DMs

* Update BitOperations.cs

3 years agoAdd Mac Catalyst (iOS API, Mac ABI) runtime (#47823)
Jo Shields [Mon, 8 Feb 2021 19:26:14 +0000 (14:26 -0500)]
Add Mac Catalyst (iOS API, Mac ABI) runtime (#47823)

Initial support for Mac Catalyst for mono subset. This enables building runtime packs and working jobs, but right now the `tests` subset needs some work to allow library test runs in CI

3 years agoEnable markdownlint rule (MD009) (#40887)
Youssef Victor [Mon, 8 Feb 2021 18:43:40 +0000 (20:43 +0200)]
Enable markdownlint rule (MD009) (#40887)

* Create markdownlint.yml

* Create markdownlint-problem-matcher.json

* Create .markdownlint.json

* Update .markdownlint.json

* fix violations

* fixes

* Remove "push" section

As advised by @viktorhofer so it's quite clear it only runs in CI.

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoConvert calls of instance HashAlgorithm.ComputeHash to static HashData
Wei Zheng [Mon, 8 Feb 2021 18:04:44 +0000 (02:04 +0800)]
Convert calls of instance HashAlgorithm.ComputeHash to static HashData

This only affects target sites which are not cross-compiled for a TFM where the static HashData methods don't exist.

3 years agoFix Numeric Test when Number Grouping is Empty (#47983)
Tarek Mahmoud Sayed [Mon, 8 Feb 2021 17:31:03 +0000 (09:31 -0800)]
Fix Numeric Test when Number Grouping is Empty (#47983)

3 years ago[interp] Add handling for conv.i from r4 (#47991)
Vlad Brezae [Mon, 8 Feb 2021 15:45:55 +0000 (17:45 +0200)]
[interp] Add handling for conv.i from r4 (#47991)

3 years ago[master] Update dependencies from mono/linker (#47857)
dotnet-maestro[bot] [Mon, 8 Feb 2021 13:40:06 +0000 (14:40 +0100)]
[master] Update dependencies from mono/linker (#47857)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoSplit lock to prevent deadlock in Http2Stream. (#47769)
Marie Píchová [Mon, 8 Feb 2021 13:25:35 +0000 (14:25 +0100)]
Split lock to prevent deadlock in Http2Stream. (#47769)

Http2Connection.ChangeInitialWindowSize locks connection's SyncObject and calls Http2Stream.OnWindowUpdate which locks stream's SyncObject.
Http2Stream.Complete is called only while stream's SyncObject lock is take and then it calls Http2Connection.RemoveStream that locks connection SyncObject.

3 years agoAdd ios pinvoke functional test (#47988)
Maxim Lipnin [Mon, 8 Feb 2021 13:24:45 +0000 (16:24 +0300)]
Add ios pinvoke functional test (#47988)

Contributes to https://github.com/dotnet/runtime/issues/43865.

3 years agomark FileStream.Lock and Unlock as unsupported on macOS (#47040)
Adam Sitnik [Mon, 8 Feb 2021 12:54:03 +0000 (13:54 +0100)]
mark FileStream.Lock and Unlock as unsupported on macOS (#47040)

* mark FileStream.Lock and Unlock as unsupported on macOS

* update ref assembly

* annotate types derived from FileStream

* annotate VisualBasic parts as well

3 years agoConsolidate ComWrappers implementation across platforms (#47982)
Andrii Kurdiumov [Mon, 8 Feb 2021 11:33:41 +0000 (17:33 +0600)]
Consolidate ComWrappers implementation across platforms (#47982)

* Consolidate ComWrappers implementation across platforms
This should help in implementing https://github.com/dotnet/runtimelab/issues/306

* Fix incorrect and missing partial declarations

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoSingle Transport Package for aspnetcore (#47684)
Anirudh Agnihotry [Mon, 8 Feb 2021 08:03:31 +0000 (00:03 -0800)]
Single Transport Package for aspnetcore (#47684)

* Adding non ectensions library to transport package and moving transport package to all config leg

* update servicing policy doc

* change name from Microsoft.Extensions.Internal.Transport -> Microsoft.AspNetCore.Internal.Transport

* make isAspnetCore property explicit

* csproj to proj change

* remove non used extensions assemblies from transport package

* Update Directory.Build.props

3 years agoCompletely get rid of "refonly" from Mono (#47973)
Aleksey Kliger (λgeek) [Mon, 8 Feb 2021 06:54:56 +0000 (01:54 -0500)]
Completely get rid of "refonly" from Mono (#47973)

* InternalGetAssemblyName can open the image !refonly

Initially this was opening in refonly mode in order to be able to get
the name of problematic assemblies.  See
d64b25aabeb8581a27be4968ca3517217290dd8b

However that concept doesn't exist anymore in netcore mono.  So open
the image normally.

* Get rid of MonoImage ref_only field

* no refonly mono_domain_get_assemblies

* no refonly arg to assembly search hooks

* No refonly preload hook

* No refonly assembly_loaded_internal

* No refonly mono_error_set_simple_file_not_found

* There's no GAC or shadow copying

* Remove MonoAssembly in_gac field

* remove unused var

3 years agoRemove MONO_ASMCTX_REFONLY (#47966)
Aleksey Kliger (λgeek) [Sun, 7 Feb 2021 17:08:01 +0000 (12:08 -0500)]
Remove MONO_ASMCTX_REFONLY (#47966)

* remove MONO_ASMCTX_REFONLY

* Also remove mono_image_open_from_data_internal refonly arg

3 years agoError out if an unknown option is given in ENABLE_MINIMAL. (#47974)
Zoltan Varga [Sun, 7 Feb 2021 16:30:37 +0000 (11:30 -0500)]
Error out if an unknown option is given in ENABLE_MINIMAL. (#47974)

3 years ago[mono] Remove some dead code (#47975)
Aleksey Kliger (λgeek) [Sun, 7 Feb 2021 13:34:46 +0000 (08:34 -0500)]
[mono] Remove some dead code (#47975)

* Remove console-null console-win32 dead icalls

* Remove shadow copying remains

No more MonoDomain shadow_serial field

* No MonoDomain socket assembly fields

* remove MonoRuntimeInfo arg from mono_assembly_load_corlib

* delete useless allocations

3 years agoremove most of w32process (#47962)
Aleksey Kliger (λgeek) [Sun, 7 Feb 2021 04:11:36 +0000 (23:11 -0500)]
remove most of w32process (#47962)

3 years ago[master] Update dependencies from dotnet/arcade (#47952)
dotnet-maestro[bot] [Sun, 7 Feb 2021 02:36:12 +0000 (21:36 -0500)]
[master] Update dependencies from dotnet/arcade (#47952)

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

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21101.7 -> To Version 6.0.0-beta.21105.5

* Fix xunit analyzer warning in SharedArrayBufferTests.cs

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix flaky EventLog test (#47888)
Dan Moseley [Sun, 7 Feb 2021 01:43:33 +0000 (17:43 -0800)]
Fix flaky EventLog test (#47888)

3 years agoCleanup assembly loading code. (#47958)
Zoltan Varga [Sun, 7 Feb 2021 00:32:50 +0000 (19:32 -0500)]
Cleanup assembly loading code. (#47958)

* Cleanup the assembly loading code.

* Remove the 'problematic' assembly code.

Co-authored-by: Aleksey Kliger (λgeek) <alklig@microsoft.com>
3 years agoRemove the remainder of the appdomain unload code. (#47955)
Zoltan Varga [Sun, 7 Feb 2021 00:02:48 +0000 (19:02 -0500)]
Remove the remainder of the appdomain unload code. (#47955)

* Remove the remainder of the appdomain unload code.

* Restore public API functions.

3 years agoAdd crossgen2 automated SuperPMI collection of Core_Root libraries (#47818)
Bruce Forstall [Sat, 6 Feb 2021 20:45:46 +0000 (10:45 -1000)]
Add crossgen2 automated SuperPMI collection of Core_Root libraries (#47818)

* Add crossgen2 automated SuperPMI collection of Core_Root libraries

Linux is excluded; there are uninvestigated crashes doing crossgen2 Linux collections.

I added logic to copy the runtime ".dotnet" directory to Helix machines to use as the
driver for crossgen2, but that doesn't work for cross-platform scenarios (e.g., Windows
x64 .dotnet, x86 Core_Root), so it's commented out for now and the same-Core_Root corerun.exe
is used as the crossgen2 driver.

Add `-collection_type` argument to superpmi-setup.py

Allow copying of .json files to Helix; needed by crossgen2.

Changed superpmi pipeline to run with DEBUG level logging from superpmi.py so it's
easier to see what happened when looking at Helix logs (without having to find and separately
download the superpmi.log file).

Changed superpmi.py to write stdout/stderr files to log on failure, so we can see why
crossgen2 failed.

Fix creation of log file directories when `-log_file` argument specified

Excluded many more native files from superpmi collection setup.

Fixes #47541

Extra:
1. If `-temp_dir` is specified to superpmi.py, normalize it to
an absolute path.
2. Add a superpmi.py collect `-exclude` option to avoid collecting
assemblies known to fail (and cause pop-up failures: see #47552).
(This isn't used by the automated collection, but is generally useful.)
3. Stop logging too-verbose message about CORINFO_SIG_INST handle
array illegal values, since it's "by design" for crossgen2
4. Force lower-casing of JIT-EE version string, for consistency.