platform/upstream/dotnet/runtime.git
3 years ago[tests] Re-enable tests fixed by #44081 (#44212)
Aleksey Kliger (λgeek) [Fri, 6 Nov 2020 04:19:11 +0000 (23:19 -0500)]
[tests] Re-enable tests fixed by #44081 (#44212)

Fixes
https://github.com/mono/mono/issues/15030 and
fixes https://github.com/mono/mono/issues/15031 and
fixes https://github.com/mono/mono/issues/15032

3 years ago[sgen] Add Ward annotations to sgen_get_total_allocated_bytes (#43833)
monojenkins [Fri, 6 Nov 2020 04:18:21 +0000 (23:18 -0500)]
[sgen] Add Ward annotations to sgen_get_total_allocated_bytes (#43833)

Attempt to fix https://jenkins.mono-project.com/job/test-mono-mainline-staticanalysis/

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years agoUse targetPlatformMoniker for net5.0 and newer tfms (#43965)
Anirudh Agnihotry [Fri, 6 Nov 2020 03:54:19 +0000 (19:54 -0800)]
Use targetPlatformMoniker for net5.0 and newer tfms (#43965)

* Use targetPlatformMoniker for net5.0 and newer tfms

* disabling analyzer, update version to 0.0, and use new format.

* update the targetFramework.sdk

* removing supportedOS assembly level attribute

* fix linker errors and addressing feedback

* making _TargetFrameworkWithoutPlatform as private

3 years agoRemove silly ToString in GetCLRInstanceString (#44335)
Stephen Toub [Fri, 6 Nov 2020 01:18:06 +0000 (20:18 -0500)]
Remove silly ToString in GetCLRInstanceString (#44335)

3 years agoUpdate SharedPerformanceCounter assert (#44333)
Stephen Toub [Fri, 6 Nov 2020 01:07:37 +0000 (20:07 -0500)]
Update SharedPerformanceCounter assert (#44333)

3 years agoPick libmonosgen-2.0.so from cmake install directory instead of .libs (#44291)
Alexander Köplinger [Fri, 6 Nov 2020 00:34:26 +0000 (01:34 +0100)]
Pick libmonosgen-2.0.so from cmake install directory instead of .libs (#44291)

This aligns Linux with what we already do for all the other platforms.

3 years agoForbid `- byref cnst` -> `+ (byref -cnst)` transformation. (#44266)
Sergey Andreenko [Fri, 6 Nov 2020 00:17:58 +0000 (14:17 -1000)]
Forbid `- byref cnst` -> `+ (byref -cnst)` transformation. (#44266)

* Add a repro test.

* Forbid the transformation for byrefs.

* Update src/coreclr/src/jit/morph.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
* Update src/coreclr/src/jit/morph.cpp

* Fix the test return value.

WriteLine is just to make sure we don't delete the value.

* improve the test.

avoid a possible overflow and don't waste time on printing.

Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoUse the new async Run method from xharness and implement a test (#44046)
Larry Ewing [Thu, 5 Nov 2020 23:22:07 +0000 (17:22 -0600)]
Use the new async Run method from xharness and implement a test (#44046)

* Use the new async Run method from xharness and implement a test

* Remove PumpThreadPool as it is no longer used

* Update xharness for async support

3 years agoSet fgOptimizedFinally flag correctly (#44268)
David Wrighton [Thu, 5 Nov 2020 22:55:36 +0000 (14:55 -0800)]
Set fgOptimizedFinally flag correctly (#44268)

- Initialize to 0 at compiler startup
- Set flag when finally cloning optimization kicks in

Fixes non-deterministic generation of nop opcodes into ARM32 code

3 years agoImplementing support to Debugger::Break. (#44305)
Thays Grazia [Thu, 5 Nov 2020 22:06:58 +0000 (19:06 -0300)]
Implementing support to Debugger::Break. (#44305)

3 years ago[master][watchOS] Add simwatch64 support (#44303)
monojenkins [Thu, 5 Nov 2020 20:59:07 +0000 (15:59 -0500)]
[master][watchOS] Add simwatch64 support (#44303)

Xcode 12.2 removed 32 bits support for watchOS simulators, this PR helps to fix https://github.com/xamarin/xamarin-macios/issues/9949, we have tested the new binaries and they are working as expected

![unknown](https://user-images.githubusercontent.com/204671/98253709-64413200-1f49-11eb-9774-8c5aa416fc57.png)

Co-authored-by: dalexsoto <dalexsoto@users.noreply.github.com>
3 years agoFile.Exists() is not null when true (#44310)
Ilya [Thu, 5 Nov 2020 20:57:46 +0000 (01:57 +0500)]
File.Exists() is not null when true (#44310)

* File.Exists() is not null when true

* Fix compile

* Fix compile 2

3 years agoConcurrentQueueSegment allows spinning threads to sleep. (#44265)
Alex Covington [Thu, 5 Nov 2020 20:50:35 +0000 (12:50 -0800)]
ConcurrentQueueSegment allows spinning threads to sleep. (#44265)

* Allow threads to sleep when ConcurrentQueue has many enqueuers/dequeuers.

* Update src/libraries/System.Private.CoreLib/src/System/Collections/Concurrent/ConcurrentQueueSegment.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: AMD DAYTONA EPYC <amd@amd-DAYTONA-X0.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove unused QCall for WinRTSupported (#44278)
Elinor Fung [Thu, 5 Nov 2020 19:41:29 +0000 (11:41 -0800)]
Remove unused QCall for WinRTSupported (#44278)

3 years agoJIT: minor inliner refactoring (#44215)
Andy Ayers [Thu, 5 Nov 2020 18:37:09 +0000 (10:37 -0800)]
JIT: minor inliner refactoring (#44215)

Extract out the budget check logic so it can vary by inlining policy.
Use this to exempt the FullPolicy from budget checking.

Fix inline xml to dump the proper (full name) hash for inlinees.

Update range dumper to dump ranges in hex.

3 years agoAdd stream conformance tests for TranscodingStream (#44248)
Stephen Toub [Thu, 5 Nov 2020 18:32:44 +0000 (13:32 -0500)]
Add stream conformance tests for TranscodingStream (#44248)

* Add stream conformance tests for TranscodingStream

* Special-case 0-length input buffers to TranscodingStream.Write{Async}

The base implementation of Encoder.Convert doesn't like empty inputs.  Regardless, if the input is empty, we can avoid a whole bunch of unnecessary work.

3 years agoBump xharness workitem timeout for Android as well (#44301)
Alexander Köplinger [Thu, 5 Nov 2020 17:12:50 +0000 (18:12 +0100)]
Bump xharness workitem timeout for Android as well (#44301)

Previously we only did it for iOS/tvOS

3 years agoFix illumos native build (#44251)
Adeel Mujahid [Thu, 5 Nov 2020 16:33:32 +0000 (18:33 +0200)]
Fix illumos native build (#44251)

* Fix illumos native build

* Address PR feedback

3 years agoHttp version test cleanup (#44283)
Geoff Kizer [Thu, 5 Nov 2020 16:22:57 +0000 (08:22 -0800)]
Http version test cleanup (#44283)

* remove dead code

* simplification

* more

* fix to still use stream wrapper

* combine tests

* more

* get rid of ClientDisconnectOk overload

* fix

* simplify DribbleStream

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoCtor_SafeHandle_BasicPropertiesPropagate_Success: improve raw packet case. (#44294)
Tom Deseyn [Thu, 5 Nov 2020 16:21:53 +0000 (17:21 +0100)]
Ctor_SafeHandle_BasicPropertiesPropagate_Success: improve raw packet case. (#44294)

Fix expected value for ProtocolType when a new Socket is created from
an existing raw packet socket Handle. This assert isn't checked unless
the test runs as root.

And use a proper value for the ProtocolType when the Socket is created.

3 years agoWorkaround xunit bug for disabling FileStreamStandaloneConformanceTests (#44295)
Stephen Toub [Thu, 5 Nov 2020 16:20:50 +0000 (11:20 -0500)]
Workaround xunit bug for disabling FileStreamStandaloneConformanceTests (#44295)

3 years agoUncomment `pr: none` in perf.yml (#44302)
Stephen Toub [Thu, 5 Nov 2020 15:28:41 +0000 (10:28 -0500)]
Uncomment `pr: none` in perf.yml (#44302)

3 years agoCorrectly set dylib version for libmonosgen-2.0.dylib (#44290)
Alexander Köplinger [Thu, 5 Nov 2020 15:27:45 +0000 (16:27 +0100)]
Correctly set dylib version for libmonosgen-2.0.dylib (#44290)

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

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>