platform/upstream/dotnet/runtime.git
3 years agofix stream conformance tests for mock provider (#44282)
Geoff Kizer [Thu, 5 Nov 2020 14:16:09 +0000 (06:16 -0800)]
fix stream conformance tests for mock provider (#44282)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoMore consistent cache key validation in Remove (#44286)
Jody Donetti [Thu, 5 Nov 2020 14:05:43 +0000 (15:05 +0100)]
More consistent cache key validation in Remove (#44286)

3 years agoAdd R2RDump support for lazy GC info (#44261)
Tomáš Rylek [Thu, 5 Nov 2020 12:21:20 +0000 (13:21 +0100)]
Add R2RDump support for lazy GC info (#44261)

This change makes it such that GC info is not automatically parsed
for each method, we only store a delegate performing the parsing
that gets called on demand. In practice this also helps us with
working around a bug in GC info previously crashing R2RDump when
emitting PDB in ARM release build mode.

Thanks

Tomas

3 years agoOmit ErrorInformation from ManagementException binary serialization (#44112)
Fagner Nunes Carvalho [Thu, 5 Nov 2020 04:36:05 +0000 (01:36 -0300)]
Omit ErrorInformation from ManagementException binary serialization (#44112)

* Omit ErrorInformation from ManagementException binary serialization
Fixes #2116

* Serialize MgmtException.errorObject as NULL for .NET Framework compat

3 years agoAllow embedded nulls in the result of mono_wasm_invoke_js (). (#44237)
Zoltan Varga [Thu, 5 Nov 2020 02:01:37 +0000 (21:01 -0500)]
Allow embedded nulls in the result of mono_wasm_invoke_js (). (#44237)

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

3 years agoSplit SslStream stream conformance tests for TLS1.2/1.3 (#44245)
Stephen Toub [Thu, 5 Nov 2020 01:33:18 +0000 (20:33 -0500)]
Split SslStream stream conformance tests for TLS1.2/1.3 (#44245)

3 years agoMove dotnet version to hardcoded version to workaround TFM change (#44224)
Drew Scoggins [Thu, 5 Nov 2020 01:32:14 +0000 (17:32 -0800)]
Move dotnet version to hardcoded version to workaround TFM change (#44224)

* Move dotnet version to hardcoded version to workaround TFM change

* Change 'windows' -> 'Windows_NT'

* Move osGroup checks back to 'windows'

* Update scenario yml

* Add crossgen path for SoD tests

3 years agoDisable DOUBLY_LINKED_FL (#44262)
Jan Kotas [Thu, 5 Nov 2020 01:17:28 +0000 (17:17 -0800)]
Disable DOUBLY_LINKED_FL (#44262)

Fixes #44250

3 years ago Use shared lock for files opened without FileAccess.Write on Linux (#44185)
David Cantú [Thu, 5 Nov 2020 00:32:38 +0000 (16:32 -0800)]
 Use shared lock for files opened without FileAccess.Write on Linux (#44185)

* Use shared lock for readonly files on Linux

* Add suggested tests

* Exclude test from OSX

* Add RemoteExecutor.IsSupported condition to tests

3 years agoUpdate IpcStreamFactory state machine to handle being started on a thread that ends...
John Salem [Thu, 5 Nov 2020 00:21:59 +0000 (16:21 -0800)]
Update IpcStreamFactory state machine to handle being started on a thread that ends (#43711)

Handles the case on Windows where Async IO is cancelled due to the thread coreclr started on ending.

3 years agoRemove MNADeprecationWorkaround in host test assets (#44259)
Elinor Fung [Wed, 4 Nov 2020 23:36:35 +0000 (15:36 -0800)]
Remove MNADeprecationWorkaround in host test assets (#44259)

3 years agoJIT: simple redundant compare optimization (#43811)
Andy Ayers [Wed, 4 Nov 2020 22:57:15 +0000 (14:57 -0800)]
JIT: simple redundant compare optimization (#43811)

For a relop, walk up the dominator tree to see if any dominating
block has a similar compare. If so, and there's just one path from
that block to the relop, the relop's value is known.

Closes #11909.

3 years agoUse SetFileInformationByHandle on FileStream.SetLength (#44170)
David Cantú [Wed, 4 Nov 2020 22:27:24 +0000 (14:27 -0800)]
Use SetFileInformationByHandle on FileStream.SetLength (#44170)

* Use SetFileInformationByHandle on FileStream.SetLength

* Remove Interop.SetEndOfFile since is no longer used

* Add manual test

* Address feedback

3 years agoAdd debugging a ci dump documentation template and script to fill info and include...
Santiago Fernandez Madero [Wed, 4 Nov 2020 20:28:33 +0000 (12:28 -0800)]
Add debugging a ci dump documentation template and script to fill info and include it on azdo test tab (#43937)

* Add debugging a ci dump documentation template and script to generate it on helix

* PR Feedback and fix helix workitems

* Fix python script and -buildid argument

* Upload doc only if dumps were found

* Pass down templatedir

* PR feedback

3 years agoUpdate buildtriage.md (#44196)
Viktor Hofer [Wed, 4 Nov 2020 19:22:34 +0000 (20:22 +0100)]
Update buildtriage.md (#44196)

* Update buildtriage.md

3 years agoFix inject_debug_resources target (#44238)
Juan Hoyos [Wed, 4 Nov 2020 17:20:24 +0000 (09:20 -0800)]
Fix inject_debug_resources target (#44238)

3 years agoRespect DOTNET_SHUTDOWNTIMEOUTSECONDS in HostOptions (#44080)
Vadim Galaktionov [Wed, 4 Nov 2020 13:55:35 +0000 (16:55 +0300)]
Respect DOTNET_SHUTDOWNTIMEOUTSECONDS in HostOptions (#44080)

* Respect DOTNET_SHUTDOWNTIMEOUTSECONDS in HostOptions

* Add Initialize to HostOptions, add HostOptions configure

* Add test

3 years agoAdd stream conformance tests for SocketsHttpHandler HTTP/1.1 streams (#44204)
Stephen Toub [Wed, 4 Nov 2020 13:52:08 +0000 (08:52 -0500)]
Add stream conformance tests for SocketsHttpHandler HTTP/1.1 streams (#44204)

* Add stream conformance tests for SocketsHttpHandler HTTP/1.1 streams

* Address PR feedback

3 years agoReenable dllmap for iOS/Android (#44243)
Alexander Köplinger [Wed, 4 Nov 2020 13:26:59 +0000 (14:26 +0100)]
Reenable dllmap for iOS/Android (#44243)

This got lost as part of the CMake conversion but we still need it for these platforms.

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

3 years agoFix: NetworkStream throwing inconsistent exceptions (#40772)
Anton Firszov [Wed, 4 Nov 2020 12:45:51 +0000 (13:45 +0100)]
Fix: NetworkStream throwing inconsistent exceptions (#40772)

Fix a bug: Span<byte> overloads of NetworkStream throwing ObjectDisposedException instead of NetworkException, when not using derived NetworkStream.

3 years agoSocket.Tests: remove TestSettings.UDPRedundancy (#44202)
Anton Firszov [Wed, 4 Nov 2020 12:36:42 +0000 (13:36 +0100)]
Socket.Tests: remove TestSettings.UDPRedundancy  (#44202)

dotnet/corefx#15697 changed this value to 1, and no-one touched it since then.

As the comment in that PR points out, the root cause of the UDP test failures wasn't packet loss, but IPv4 / IPv6 port collision on Unix in dual-mode cases.

The value and the for loops are complicating Socket test code unnecessarily, simplification seems reasonable.

3 years agoAdd 'condition: always()' to Disk Usage after Build (#44209)
Matt Galbraith [Wed, 4 Nov 2020 12:24:21 +0000 (04:24 -0800)]
Add 'condition: always()' to Disk Usage after Build (#44209)

Looking at builds like this: https://dev.azure.com/dnceng/public/_build/results?buildId=873478&view=logs&j=1f8f000c-1adc-5434-677a-95dd9e006aba&t=30ef7da5-6e59-540d-0dbe-fa78537a8165&s=d654deb9-056d-50a2-1717-90c08683d50a, the other legs are failing left and right filling the agents' disks.  We need to know the disk usage after a build to see if this is relevant to build failures.

3 years agoDoubly linked freelist fixes (#43636)
Peter Sollich [Wed, 4 Nov 2020 09:02:04 +0000 (10:02 +0100)]
Doubly linked freelist fixes (#43636)

* Fix bugs in the doubly linked free list logic and enable it.

Details:

 - #define DOUBLY_LINKED_FL to enable

 - Fix issue in adjust_limit with accidentally setting MAKE_FREE_OBJ_IN_COMPACT bit in the plug_and_gap structure that gets put before a pinned plug - this overwrites any object that used to be there (after it has been saved elsewhere), so added logic to detect the situation and set MAKE_FREE_OBJ_IN_COMPACT in the saved object instead. To make this work, added new field "saved_pinned_plug_index" to remember which pinned plug to look at.

- In connection with the previous issue in adjust_limit, fix case of a 3 pointer size plug in from of a pinned plug - for this we need a range test to catch the case, plus add this offset to the beginning of saved_pre_plug_reloc. On the other hand, 3 pointers is the minimum size object, so added an assert to that effect as suggested in code review.

- Changed several comparisons because an object <= min_free_item_no_prev cannot be on the free list.

- Fixed issue in should_set_bgc_mark_bit where an assert fired because current_sweep_seg was null because the background gc thread was about to sweep, but hadn't set current_sweep_seg just yet. Fix is to set current_sweep_seg and current_sweep_pos early.

3 years ago[interp] Simplify GetRawData (#44217)
Vlad Brezae [Wed, 4 Nov 2020 07:09:25 +0000 (09:09 +0200)]
[interp] Simplify GetRawData (#44217)

Generate also better code.

3 years agoWasm async entrypoint (#44045)
Larry Ewing [Wed, 4 Nov 2020 05:59:21 +0000 (23:59 -0600)]
Wasm async entrypoint (#44045)

* [browser][bindings] Add support for calling the async Task entry point.

- When the entry point of an assembly is async we need to execute that method and return the Task object
- The Task object that is return from the execution of the async entry point will be marshaled to a JavaScript Promise.

Co-authored-by: Kenneth Pouncey <kjpou@pt.lu>
3 years agoTolerate missing tests (#44168)
Bruce Forstall [Wed, 4 Nov 2020 01:47:53 +0000 (17:47 -0800)]
Tolerate missing tests (#44168)

* Remove trailing whitespace

* Tolerate missing test file when analyzing results

Before, we'd hit an assert.

3 years agoAdd assert to SharedPerformanceCounter to debug test failures in CI (#44225)
Stephen Toub [Wed, 4 Nov 2020 01:00:59 +0000 (20:00 -0500)]
Add assert to SharedPerformanceCounter to debug test failures in CI (#44225)

3 years agoAdd wiggle room to MonitoringIsEnabled test (#44228)
Stephen Toub [Wed, 4 Nov 2020 01:00:30 +0000 (20:00 -0500)]
Add wiggle room to MonitoringIsEnabled test (#44228)

3 years agoAdd a PNSE configuration for System.Net.Quic (#44223)
Viktor Hofer [Wed, 4 Nov 2020 00:07:00 +0000 (01:07 +0100)]
Add a PNSE configuration for System.Net.Quic (#44223)

Systme.Net.Quic is part of the shared framework but dosn't have a
configuration that applies to Browser. Adding a non-rid configuration so
that this applies for all future configurations that aren't explicitely
listed as well.

Changing some throw null lambdas in the reference source file to work
around a bug in the GenFacades not supported assembly creation logic:
https://github.com/dotnet/arcade/issues/6509.

3 years agoRemove the old mono timezone icall implementation from driver.c (#44171)
Larry Ewing [Tue, 3 Nov 2020 23:37:30 +0000 (17:37 -0600)]
Remove the old mono timezone icall implementation from driver.c (#44171)

* Remove unused on netcore icall and set TZ in the startup js

3 years ago[interp] Reinitialize error in a few places (#44188)
Vlad Brezae [Tue, 3 Nov 2020 23:14:49 +0000 (01:14 +0200)]
[interp] Reinitialize error in a few places (#44188)

Otherwise we can assert when attempting to use the error.

3 years agoCheck that we don't create null checks on an address that is not null. (#44059)
Sergey Andreenko [Tue, 3 Nov 2020 22:42:20 +0000 (12:42 -1000)]
Check that we don't create null checks on an address that is not null. (#44059)

* Check that we don't create null checks on an address that is not null.

* Egor's request

3 years agoTry a different attribute for disabling stream conformance tests on browser (#44218)
Stephen Toub [Tue, 3 Nov 2020 22:09:20 +0000 (17:09 -0500)]
Try a different attribute for disabling stream conformance tests on browser (#44218)

3 years agoRemove several volatiles from Timer (#44199)
Stephen Toub [Tue, 3 Nov 2020 21:33:57 +0000 (16:33 -0500)]
Remove several volatiles from Timer (#44199)

TimerQueueTimer._canceled is only ever used when _associatedTimerQueue is held.

TimerQueueTimer._notifyWhenNoCallbacksRunning only ever transitions from null to non-null, always under a lock, and the only time it's used outside of a lock is just after that same thread validated the field was non-null while holding the lock.

3 years agoDon't expect LIST nodes in CALL args. (#44089)
Sergey Andreenko [Tue, 3 Nov 2020 21:01:34 +0000 (11:01 -1000)]
Don't expect LIST nodes in CALL args. (#44089)

3 years agoCheck catch and throw non-Exception derived types (#43969)
Adeel Mujahid [Tue, 3 Nov 2020 20:28:21 +0000 (22:28 +0200)]
Check catch and throw non-Exception derived types (#43969)

Verifies:

* `X` is derived from `Exception` in `throw X`.
* `throw null` is valid.
* `X` is derived from `Exception` in `catch(X)`.

Contributes to #37390

3 years agoDon't create a wrapper for run-v8.sh (#44172)
Larry Ewing [Tue, 3 Nov 2020 19:58:47 +0000 (13:58 -0600)]
Don't create a wrapper for run-v8.sh (#44172)

3 years agoimprove accuracy of Expect100Continue_WaitsExpectedPeriodOfTimeBeforeSendingContent...
Tomas Weinfurt [Tue, 3 Nov 2020 19:35:01 +0000 (11:35 -0800)]
improve accuracy of Expect100Continue_WaitsExpectedPeriodOfTimeBeforeSendingContent test (#44053)

* improve accuracy of Expect100Continue_WaitsExpectedPeriodOfTimeBeforeSendingContent test

* feedback from review

3 years agoExtend SendAsync/ReceiveAsync cancellation tests (#44161)
Anton Firszov [Tue, 3 Nov 2020 19:10:18 +0000 (20:10 +0100)]
Extend SendAsync/ReceiveAsync cancellation tests (#44161)

- Rename CanceledDuringOperation_Throws to ReceiveAsync_CanceledDuringOperation_Throws and extend it to IPv6 sockets.
- Introduce cancellation test for Socket.SendAsync.

3 years agoTcpClient.ConnectAsync(EndPoint) (#44110)
Martin Vseticka [Tue, 3 Nov 2020 18:33:23 +0000 (19:33 +0100)]
TcpClient.ConnectAsync(EndPoint) (#44110)

Implement TcpClient.ConnectAsync(IPEndPoint)

3 years ago[mono] remove 2 extra members from System.Object (#44081)
Aleksey Kliger (λgeek) [Tue, 3 Nov 2020 17:44:08 +0000 (12:44 -0500)]
[mono] remove 2 extra members from System.Object (#44081)

1. move `GetRawData` to an extension method in RuntimeHelpers and fixup the intrinsics
2. replace `Object.CloneInternal` by `MarshalAsAttribute.CloneInternal` at its one use site
3. re-enable System.Reflection.Tests.TypeInfoTests.FindMembers and fix mono/mono#15029

3 years agoUse different variable in base-job.yml to avoid confusion (#44193)
Alexander Köplinger [Tue, 3 Nov 2020 17:34:26 +0000 (18:34 +0100)]
Use different variable in base-job.yml to avoid confusion (#44193)

`/p:RuntimeOS` and the `-os` args are not the same thing (see https://github.com/dotnet/runtime/issues/33419) so we shouldn't be using the same variable for them.

3 years agoClean up style of Random.cs (#44195)
Stephen Toub [Tue, 3 Nov 2020 17:19:00 +0000 (12:19 -0500)]
Clean up style of Random.cs (#44195)

No functional changes.

3 years agoAdd SYSLIB0013 into obsoletion list (#44203)
Jan Jahoda [Tue, 3 Nov 2020 16:51:46 +0000 (17:51 +0100)]
Add SYSLIB0013 into obsoletion list (#44203)

* Add SYSLIB0013 into obsoletion list

Add obsoletion of Uri.EscapeUriString to the list.

* Remove extra new line

3 years agoFix comment causing formatting leg in CI to fail (#44197)
Stephen Toub [Tue, 3 Nov 2020 15:23:03 +0000 (10:23 -0500)]
Fix comment causing formatting leg in CI to fail (#44197)

3 years agodisable MockQuicStreamConformanceTests.Parallel_ReadWriteMultipleStreamsConcurrently...
Tomas Weinfurt [Tue, 3 Nov 2020 13:25:02 +0000 (05:25 -0800)]
disable MockQuicStreamConformanceTests.Parallel_ReadWriteMultipleStreamsConcurrently (#44184)

* disable MockQuicStreamConformanceTests.Parallel_ReadWriteMultipleStreamsConcurrently

* Update QuicStreamConnectedStreamConformanceTests.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix/remove TODO-NULLABLE in System.Private.Xml (#44149)
Krzysztof Wicher [Tue, 3 Nov 2020 13:18:46 +0000 (14:18 +0100)]
Fix/remove TODO-NULLABLE in System.Private.Xml (#44149)

* Fix/remove TODO-NULLABLE in System.Private.Xml

* update contract for System.Xml.ReaderWriter

* follow up changes

3 years agoFill out hardware intrinsics linker substitutions for unsupported platforms (#44156)
Eric Erhardt [Tue, 3 Nov 2020 11:36:45 +0000 (05:36 -0600)]
Fill out hardware intrinsics linker substitutions for unsupported platforms (#44156)

Fix #44146

3 years agoFix race condition in timeout handling and GetAsync_ContentCanBeCanceled (#44169)
Stephen Toub [Tue, 3 Nov 2020 10:55:04 +0000 (05:55 -0500)]
Fix race condition in timeout handling and GetAsync_ContentCanBeCanceled (#44169)

There are three issues here.

Two tests issues:
1. When the client times out, it could do so while the server is still reading the request or sending the response, in which case the server can fail and cause the test to fail.  The server failure needs to be ignored.
2. when the client times out, it could do so before it even initiates the request, in which case the test would hang while the server waits indefinitely for a request that'll never arrive.  The server waiting needs to factor in the client's completion.

And one product issue:
1. The timeout handling we added in .NET 5 has a race condition that can, in extreme conditions (e.g. a unit test trying to force the interleaving) result in us not throwing the appropriate TimeoutException.  There are two different timer mechanisms used, the one based on Timer inside of CancellationTokenSource, and then the use of Envrionment.TickCount64 to track how much time has progressed.  Their quantums are different, so it's possible for the timer to fire due to the timeout expiring but Environment.TickCount64 not ticking over, at which point we'll read it and determine that the cause of the cancellation wasn't for a timeout.  The fix is to use the pending requests token source to check whether it or the timeout occurred, rather than using the time elapsed to determine which of the two occurred.

3 years agoMove serializable types for xml serialization generator tests to separate assembly...
Santiago Fernandez Madero [Tue, 3 Nov 2020 02:03:21 +0000 (18:03 -0800)]
Move serializable types for xml serialization generator tests to separate assembly (#44164)

* Move serializable types for xml serialization generator tests to separate assembly

* Add comment explaining why we need a separate assembly

3 years agoAdd stream conformance tests for standalone streams (#44069)
Stephen Toub [Tue, 3 Nov 2020 01:53:00 +0000 (20:53 -0500)]
Add stream conformance tests for standalone streams (#44069)

* Nullable-enable stream conformance tests

* Add standalone stream conformance tests

* Address PR feedback

3 years agoUse actual nint/nuint in Latin1Utility (#44162)
Stephen Toub [Tue, 3 Nov 2020 01:28:13 +0000 (20:28 -0500)]
Use actual nint/nuint in Latin1Utility (#44162)

3 years agoFix asserts that were always true due to a missed neg. (#44095)
Sergey Andreenko [Tue, 3 Nov 2020 01:26:04 +0000 (15:26 -1000)]
Fix asserts that were always true due to a missed neg. (#44095)

* Fix asserts that were always true due to missed neg.

* Ensure we don't assert for HWIntrinsics that already had the imm operand marked contained

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
3 years agoFix an assert which is hit when compiling Microsoft.CodeAnalysis.dll with llvmonly...
Zoltan Varga [Tue, 3 Nov 2020 00:47:33 +0000 (19:47 -0500)]
Fix an assert which is hit when compiling Microsoft.CodeAnalysis.dll with llvmonly. (#44092)

3 years agoRemove some unsafe code from System.Xml (#43379)
Levi Broderick [Tue, 3 Nov 2020 00:24:23 +0000 (16:24 -0800)]
Remove some unsafe code from System.Xml (#43379)

* Remove private DoubleToInt64Bits

* Remove unsafe IntToString implementation

* Remove unsafe AdjustLineInfo implementation

* Remove unsafe GetStringAligned implementation

* Remove unsafe code from BinHexDecoder

* Remove unsafe MemoryMarshal usage from CodeIdentifier

* Remove unsafe Base64Decoder implementation

* Remove unsafe code in GetSingle and GetDouble

* Remove unsafe code from CheckText

3 years agoMove the exclusion of unregister01/03 into general CoreCLR group (#44163)
Tomáš Rylek [Mon, 2 Nov 2020 23:30:42 +0000 (00:30 +0100)]
Move the exclusion of unregister01/03 into general CoreCLR group (#44163)

3 years ago[interp] Fix pinvoke passing of valuetype on wasm (#44129)
Vlad Brezae [Mon, 2 Nov 2020 23:10:22 +0000 (01:10 +0200)]
[interp] Fix pinvoke passing of valuetype on wasm (#44129)

For valuetypes, a stackval used to contain a pointer to the valuetype data, while currently the valuetype data is stored directly in the stackval.

3 years agoChanging Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the...
Anirudh Agnihotry [Mon, 2 Nov 2020 22:25:58 +0000 (14:25 -0800)]
Changing Windows_NT -> Windows for enabling TargetPlatformMoniker  feature of the sdk for platform specific tfms. (#43651)

* eng change

* coreclr change

* libraries change

* tests change

* installer & mono change

* py files changed

* .md change

* .yml change

* remove redundant targetos property

* Windows_NT -> windows after ninja change

* fixing runtime build failure

3 years agoJSON continuation tests (#42393)
devsko [Mon, 2 Nov 2020 21:37:52 +0000 (22:37 +0100)]
JSON continuation tests (#42393)

* Repro #42070

* formatting

* namespace

* Fix

* never forget the header

* More tests
- Test continuation at every position inside the tested object
- Many member with primitive and nullable types
- One more level of nested object
- All combinations of class/struct for tested and nested object
- tested and nested object with parametrized ctor for some properties

* Addressed feedback

* refactoring

* Test with original repro data from #42070

* custom converter to ensure the padding is written in front of the tested object

* rename

* test data moved to Strings.resx

* Using test data from SR

* Generalize continuation tests for payloads of any length
Tweak the payload and expect `JsonException`

* merge

* Test deserialize with Utf8JsonReader and ReadOnlySequence

* Again with value typed nested object

* Add tests for splitted whitespaces

* Addressed feedback
Added dictionary test

* Validate line and position of failure in tweaked payloads
more tweaks

* Fixed comment

Co-authored-by: Layomi Akinrinade <laakinri@microsoft.com>
3 years agoRemove stale !s and TODO-NULLABLEs, plus those for indexer nullability tracking ...
Stephen Toub [Mon, 2 Nov 2020 21:13:53 +0000 (16:13 -0500)]
Remove stale !s and TODO-NULLABLEs, plus those for indexer nullability tracking (#44136)

3 years agoAdd property to reuse Android App signing key (#44085)
Mitchell Hwang [Mon, 2 Nov 2020 20:36:05 +0000 (15:36 -0500)]
Add property to reuse Android App signing key (#44085)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoStrip release builds on wasm. Avoid linking against libicudata.a, its not needed...
Zoltan Varga [Mon, 2 Nov 2020 20:25:31 +0000 (15:25 -0500)]
Strip release builds on wasm. Avoid linking against libicudata.a, its not needed. (#43951)

Fix warnings.

3 years agoSlight cleanup in hostpolicy (#44157)
Elinor Fung [Mon, 2 Nov 2020 20:22:46 +0000 (12:22 -0800)]
Slight cleanup in hostpolicy (#44157)

3 years agoUpdate Brotli to v1.0.9 (#44107)
Clinton Ingram [Mon, 2 Nov 2020 20:16:17 +0000 (12:16 -0800)]
Update Brotli to v1.0.9 (#44107)

* sync brotli source

* update runtime project

3 years agoRemove OSX_arm64 from platform group all (#44160)
Steve MacLean [Mon, 2 Nov 2020 19:44:18 +0000 (14:44 -0500)]
Remove OSX_arm64 from platform group all (#44160)

3 years agoSet the MSVC RuntimeLibrary properties for ASM_MASM when we use MASM. (#44155)
Jeremy Koritzinsky [Mon, 2 Nov 2020 17:45:54 +0000 (09:45 -0800)]
Set the MSVC RuntimeLibrary properties for ASM_MASM when we use MASM. (#44155)

3 years agoAdd NativeMainSource alternative to Android Sample App (#44076)
Mitchell Hwang [Mon, 2 Nov 2020 17:44:46 +0000 (12:44 -0500)]
Add NativeMainSource alternative to Android Sample App (#44076)

* Add NativeMainSource alternative to Android Sample

* Move nativeMainSource from parameter to property

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoFix incorrect handling of character range and capitalization in regex (#42282)
Prashanth Govindarajan [Mon, 2 Nov 2020 17:40:15 +0000 (09:40 -0800)]
Fix incorrect handling of character range and capitalization in regex (#42282)

* Bug fix and unit test

* Address comments

* An elegant fix and unit tests

* Remove old code

* Fix the unit tests

* sq

* sq

* Address comments and add test case

* Skip the unit tests on net framework

* Debug commit for CI

* Try to get more error info

* Run validation as a unit test.

Skip it on non-ICU environments

3 years agoDelete duplicate Buffer.Memmove implementations and avoid unnecessary pinning (#44118)
Stephen Toub [Mon, 2 Nov 2020 16:21:49 +0000 (11:21 -0500)]
Delete duplicate Buffer.Memmove implementations and avoid unnecessary pinning (#44118)

* Delete duplicate Buffer.Memmove implementations and avoid unnecessary pinning

We have several versions of Buffer.Memmove, including one implemented around `byte*` and one implemented around `ref byte`.  We can delete the former and just use the latter everywhere.  In doing so, we can also remove a few wrapper helpers, and reduce pinning in places where those wrappers were pinning to get pointers only to eventually end up in the ref-based implementation, anyway.

* Use ThrowHelper in more places

3 years agoAdd issues.targets CG2 entries for issue #44054 (#44142)
Tomáš Rylek [Mon, 2 Nov 2020 16:16:46 +0000 (17:16 +0100)]
Add issues.targets CG2 entries for issue #44054 (#44142)

3 years agoEnable using the Ninja generator instead of Visual Studio on Windows builds. (#41897)
Jeremy Koritzinsky [Mon, 2 Nov 2020 15:50:01 +0000 (07:50 -0800)]
Enable using the Ninja generator instead of Visual Studio on Windows builds. (#41897)

* Move DacTableGen out of the CMake build and into tools-local.

* Attempt: usenmakefiles means ninja.

* Make changes to Windows build to support non-VS generators like ninja.

* Use CMake 3.16 PCHs.

* Remove explicit process count.

* Build and run DacTableGen via the .NET CLI we pull down for the build instead of via CMake.

* Update configurecompiler.cmake to specify language (needed for Ninja).

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Get Ninja build working again.

* Pass configuration to cmake configure step for Ninja build.

* Rename flag

* Fix configure step for cross-arch native build

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Support building via Ninja for coreclr via an MSBuild property

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Implement support for opening the CoreCLR solution in VS via the -vs flag.

* Fix setting generator to Ninja.

* Merge libraries gen-buildsys-win.bat with runtime gen-buildsys.cmd to share windows cmake configure infra.

* Enable building libraries native build with ninja.

* Centralize setting CMAKE_SYSTEM_VERSION for windows builds.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Update host build to use shared gen-buildsys.cmd

* Fix multi-config generator detection.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Exit with success when we build successfully.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Enable and fix up Ninja build for hosts.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Only link delayimp.lib on Windows

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Remove "overriding /W3 with /W1" warning in Ninja build of hosts by turning on /W3 and disabling any new warnings we hit.

* Reduce command line override warnings by adopting the MSVC_RUNTIME_LIBRARY abstraction feature in CMake 3.14+ (below the minimum requirement on Windows).

* Use the delayed expansion syntax to correctly pass in the config to cmake.

* Move all usages of MSVC runtime library selection to the CMake abstraction to reduce console spew about overridden flags.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Condition the rest of the compiler options correctly so they don't show up as invalid parameter warnings for assembly builds.

* Correctly build DIALib and DacTableGen as AnyCPU

* Fix WRITE_BARRIER_CHECK define

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Fix passing arch for MSBuild build.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Configure ASM compiler command line format in configurecompiler.cmake and use CMake's assembly compilation step to build ASM files for ARM/ARM64 instead of manually building them and adding the generated files as additional sources.

* Cleanup after fixing ARM/ARM64 support.

* Rename variable

* Condition PCH's for C++-only as needed to fix using them on non-Windows (where we compile C as C instead of as C++).

* Fix CoreCLR native test build on windows to point to new gen-buildsys location.

* Add missing compilation options in Ninja build that are implicitly defined in the MSBuild build.

* Disable analyzers for DacTableGen. Remove /MAP linker flag (that's for local testing).

* Upgrade to CMake 3.16.4

* Don't warn on unused variables in CMake (these usually vary on platform/config)

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Manually compile ARM and ARM64 asm files when using the VS generator since it doesn't support emitting MARMASM item types in projects (and as a result cannot compile ARM or ARM64 asm without assistance).

* Enable CMake policy in test build to use CMAKE_MSVC_RUNTIME_LIBRARY variable.

* Update initially disabled warnings in host.

* Add -ninja arg to root scripts to enable using Ninja.

* Enable using Ninja in CoreCLR CI.

* Try to fix passing the -ninja arg in yaml.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Add ninja to the Windows invocation

* Fix 2-phase cross targeting to do one phase at a time and initialize the VC++ environment for the correct build tools each time instead of interleaving them and relying on Visual Studio to handle the differing targets.

* Restore old /Ox optimization setting for Release.

* Fix typos, don't pass exception flags to C files.

* Remove unneeded pragma.

* Fix .pgd file installation.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Add mention of the `-ninja` flag in the Building CoreCLR documentation.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Mention installation locations for Ninja and warn while building if CMake is older than 3.16.0.

* Update docs/workflow/requirements/windows-requirements.md

3 years agoSet GC_SUSPEND based on the target os not the host os. (#44093)
Zoltan Varga [Mon, 2 Nov 2020 15:47:15 +0000 (10:47 -0500)]
Set GC_SUSPEND based on the target os not the host os. (#44093)

* Set GC_SUSPEND based on the target os not the host os.

* Add ENABLE_LLVM_RUNTIME cmake option.

3 years agoFix equality check for unset variables (#44099)
Larry Ewing [Mon, 2 Nov 2020 15:44:29 +0000 (09:44 -0600)]
Fix equality check for unset variables (#44099)

3 years agoUse slightly smaller code for String.Concat(object, object, ...) (#44133)
Stephen Toub [Mon, 2 Nov 2020 15:04:55 +0000 (10:04 -0500)]
Use slightly smaller code for String.Concat(object, object, ...) (#44133)

C#, IL, and asm are all a bit smaller.  We don't need to set the arguments to Empty if they're null, as the called function checks for null.

3 years agoDelete dead AppendSpanFormattable method from ValueStringBuilder (#44135)
Stephen Toub [Mon, 2 Nov 2020 15:03:30 +0000 (10:03 -0500)]
Delete dead AppendSpanFormattable method from ValueStringBuilder (#44135)

3 years agoRemove some unused icalls. (#44128)
Zoltan Varga [Mon, 2 Nov 2020 08:46:35 +0000 (03:46 -0500)]
Remove some unused icalls. (#44128)

3 years ago(MQ cleanup) Remove size_t from managed Brotli code (#44043)
Levi Broderick [Mon, 2 Nov 2020 02:57:26 +0000 (18:57 -0800)]
(MQ cleanup) Remove size_t from managed Brotli code (#44043)

* Remove size_t from managed Brotli code

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove unsafe code from String.Join (#44126)
Stephen Toub [Mon, 2 Nov 2020 02:18:01 +0000 (21:18 -0500)]
Remove unsafe code from String.Join (#44126)

* Remove unsafe code from String.Join

- Use a span for the separator to share the same code across a char separator and string separator, rather than using pointers.
- Consolidate argument validation for the value/startIndex/count overloads into one shared helper
- Change indexing to use standard 0 to values.Length for loop to eliminate bounds checking on span accesses

* Update src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs

3 years agoRemove last remnants of IExpando support. (#44122)
Aaron Robinson [Sun, 1 Nov 2020 23:11:16 +0000 (15:11 -0800)]
Remove last remnants of IExpando support. (#44122)

3 years agoFix type generator test failures (#44041)
David Wrighton [Sun, 1 Nov 2020 22:54:35 +0000 (14:54 -0800)]
Fix type generator test failures (#44041)

- Fix issue where method token referred to derived type but method was actually defined on base type
  - Previously the methods did not carry enough state to determine when to emit the owner type of the method, and which exact type was the owning type. The new logic computes it from the token in the presence of a proper instantiation context, which allows for correct operation.

- Fix issue where constrained dispatch on a method of a valuetype would not put in the correct owner type
  - Issue fixed by determining if the token resolves to a method on the same type as the eventual target method, or if it needs to have a specific owning type specified

In general these issues where both caused by confusion around exactly the correct owning type, and it turned out that computation could not be computed within the signature emitter code, but instead needed to be computed in the JIT at point of use. Fortunately, we had a structure `MethodWithToken` that is used in these (and only these situations). Finally, I also made a pass through the emitter and related logic to remove various band-aids that had built up over the last few years to make all the tests and applications pass. I believe that the new logic should be correct in the general case.

Bonus tweak...  Use parallelism when compiling the framework composite images with crossgen2, and fix bug in composite image generation where mangled symbol names might conflict.

Fixes #43466 and fixes #43467

3 years agoAdd optimized String.Join for IList<string> (#44032)
John Call [Sun, 1 Nov 2020 17:37:08 +0000 (09:37 -0800)]
Add optimized String.Join for IList<string> (#44032)

* Support IList<string>

* Revert API change

* Feedback

* Use ReadOnlySpan

* Feedback

* Fix comment

* address feedback

* Add test for List<string> optimization

* Remove StartIndex and Count in core

* Update src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDelete unnecessary seek from SetLengthInternal on Unix (#44097)
Jan Kotas [Sun, 1 Nov 2020 14:08:42 +0000 (06:08 -0800)]
Delete unnecessary seek from SetLengthInternal on Unix (#44097)

Also, improve test coverage for FileStream.SetLength

3 years agoAvoid linking against libicudata.a, its not needed. (#44105)
Zoltan Varga [Sun, 1 Nov 2020 07:01:15 +0000 (02:01 -0500)]
Avoid linking against libicudata.a, its not needed. (#44105)

3 years agoFix the typo (#44075)
SingleAccretion [Sun, 1 Nov 2020 03:00:39 +0000 (06:00 +0300)]
Fix the typo (#44075)

3 years ago[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/xharness...
dotnet-maestro[bot] [Sat, 31 Oct 2020 21:38:38 +0000 (21:38 +0000)]
[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/xharness (#44062)

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

3 years agoRemove WinRT leftovers from mono's CoreLib (#44102)
Adeel Mujahid [Sat, 31 Oct 2020 16:36:26 +0000 (18:36 +0200)]
Remove WinRT leftovers from mono's CoreLib (#44102)

3 years agoMinor update to function signatures for RISCV64 architecture (#43862)
monojenkins [Sat, 31 Oct 2020 16:30:19 +0000 (12:30 -0400)]
Minor update to function signatures for RISCV64 architecture (#43862)

I don't believe this fixes any existing issue in the tracker, but I'm trying to build mono with dotnet-core on riscv from git and ran into this problem when compiling.  There may end up being other changes but I won't know until my VM is done actually building mono.  The changes right now are incredibly minor, just updating some function signatures to match the current rest of the system.

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: simcop2387 <simcop2387@users.noreply.github.com>
3 years agoFix IL interpreter build on GCC. (#44049)
hev [Sat, 31 Oct 2020 12:16:44 +0000 (20:16 +0800)]
Fix IL interpreter build on GCC. (#44049)

3 years agoDisable PollingEventFires test (#44096)
Stephen Toub [Sat, 31 Oct 2020 09:57:50 +0000 (05:57 -0400)]
Disable PollingEventFires test (#44096)

3 years agoOptimize String.Replace(string, string) (#44088)
Stephen Toub [Sat, 31 Oct 2020 02:22:49 +0000 (22:22 -0400)]
Optimize String.Replace(string, string) (#44088)

We can significantly improve its throughput for a few scenarios:
- If both oldValue and newValue are single characters in the form of strings, we can just delegate to the Replace(char, char) overload, which is much faster.
- If oldValue is a single character but newValue isn't, we can use IndexOf to find it, rather than an open-coded loop, making search times much faster for reasonably sized strings.
- If oldValue is multiple characters and the string being searched for isn't super frequent (e.g. doesn't repeat every few characters), we can significantly speed up throughput by using IndexOf to search for the whole string.  For example, replacing "\r\n" with "\n" in the contents of a typical file.

This does come at a measurable cost when the oldValue is really common and tightly packed, e.g. searching for "aa" in "aaaaaaaaaaaaaaaaaa", so we can decide whether the tradeoff is the right one.

3 years ago[Interp] Create an intrinsic for Interlocked.Exchange for int64 (#43893)
Fan Yang [Fri, 30 Oct 2020 21:06:32 +0000 (17:06 -0400)]
[Interp] Create an intrinsic for Interlocked.Exchange for int64 (#43893)

* Add an instrinsic for Interlocked.Exchange

* Hacks to help with development

* Remove one more layer of function call and revert local hacks

* Revert redundant format change

* make interlocked_mutex a global variable

* Update opcode name

* Resolve reviewer feedbacks

* Add a pair of braces.

3 years agoAdd area owners for System.Formats (#44038)
Carlos Sanchez [Fri, 30 Oct 2020 21:04:29 +0000 (14:04 -0700)]
Add area owners for System.Formats (#44038)

* Asn1

* Cbor

* Align last pipe, add missing pipes.

* Quic

* Additional owners for Asn1 and Cbor

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
3 years agoClean up debugger debug logging and wasm trace logging (#43960)
Larry Ewing [Fri, 30 Oct 2020 20:09:07 +0000 (15:09 -0500)]
Clean up debugger debug logging and wasm trace logging (#43960)

* Clean up debugger debug logging and wasm trace logging

* Update src/mono/mono/mini/mini-wasm-debugger.c

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
3 years agoEqualityComparer IndexOf to shared (#44065)
Ben Adams [Fri, 30 Oct 2020 19:42:38 +0000 (19:42 +0000)]
EqualityComparer IndexOf to shared (#44065)

3 years agoDelete area-Tizen
Jan Kotas [Fri, 30 Oct 2020 19:41:11 +0000 (12:41 -0700)]
Delete area-Tizen

3 years agoSet default value for value-type ctor params properly (#43831)
Layomi Akinrinade [Fri, 30 Oct 2020 18:38:27 +0000 (11:38 -0700)]
Set default value for value-type ctor params properly (#43831)

* Set default value for value-type ctor params properly

* Address review feedback

3 years agoSet number handling for properties read after deserializing ctor params (#43829)
Layomi Akinrinade [Fri, 30 Oct 2020 17:39:43 +0000 (10:39 -0700)]
Set number handling for properties read after deserializing ctor params (#43829)

* Set number handling for properties read after deserializing ctor params

* Use DeserializeWrapper pattern for tests

3 years agoEnable unused-result warning for PAL (#43395)
Adeel Mujahid [Fri, 30 Oct 2020 17:36:06 +0000 (19:36 +0200)]
Enable unused-result warning for PAL (#43395)

Delete the remaining dead variables and methods from PAL, that were
highlighted by gcc's dead code analysis, and enable `unused-result`
warning for PAL.

3 years agoFix gsharedvt constrained calls to Object.GetHashCode () which was broken by #43729...
Zoltan Varga [Fri, 30 Oct 2020 16:53:26 +0000 (12:53 -0400)]
Fix gsharedvt constrained calls to Object.GetHashCode () which was broken by #43729. (#44047)

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

3 years agoImplement the reuse of duplicate constant values (#43899)
Brian Sullivan [Fri, 30 Oct 2020 16:21:58 +0000 (09:21 -0700)]
Implement the reuse of duplicate constant values (#43899)

* Implement the reuse of duplicate constant value
- Duplicate values will now be reused in the constants area
- Added MIN_DATA_ALIGN and MAX_DATA_ALIGN constants
- Added dsDataType to record the type of the constant
- Print the floating point values in the constants area
- Changed 'alignment' and 'cnsSize' parameters to be unsigned instead of UNATIVE_OFFSET
- Added method emitDataGenFind to search and return a duplicate constant value

* Correctly place declaration of curOffs

* Code review feedback

* Carol's feedback

* Feedback from Tanner Gooding
Allow binary bit pattern matches of constants

* Fix build warning/error

* Jit Format