platform/upstream/dotnet/runtime.git
4 years agofree existingTrust when verifying certificate name on macOS (#41657)
Tomas Weinfurt [Wed, 2 Sep 2020 00:35:25 +0000 (17:35 -0700)]
free existingTrust when verifying certificate name on macOS (#41657)

* free existingTrust when verifying certificate name

* add back NL

* free existingTrust on error path as well

4 years agoUse dynamic port for BrowserDebugHost process (#41688)
Safia Abdalla [Tue, 1 Sep 2020 23:09:51 +0000 (23:09 +0000)]
Use dynamic port for BrowserDebugHost process (#41688)

4 years agoRemove unused USE_REFEMIT define in System.Private.DataContractSerialization (#41664)
Seonyoung Park [Tue, 1 Sep 2020 22:39:37 +0000 (07:39 +0900)]
Remove unused USE_REFEMIT define in System.Private.DataContractSerialization (#41664)

4 years ago[interp] Optimize out conditional branches (#41628)
monojenkins [Tue, 1 Sep 2020 21:01:53 +0000 (17:01 -0400)]
[interp] Optimize out conditional branches (#41628)

If we know the values of the arguments of a conditional branch, replace it with an unconditional branch. Once we have support for basic blocks, we can remove dead basic blocks and merge any adjacent ones.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years agoBlock casting to an interface marked ComInterfaceType.InterfaceIsIInspectable (#41633)
Jeremy Koritzinsky [Tue, 1 Sep 2020 20:35:56 +0000 (13:35 -0700)]
Block casting to an interface marked ComInterfaceType.InterfaceIsIInspectable (#41633)

4 years agoAdd methods to manipulate Half in binary (#40882)
Huo Yaoyuan [Tue, 1 Sep 2020 20:17:28 +0000 (04:17 +0800)]
Add methods to manipulate Half in binary (#40882)

* Expose HalfToInt16Bits and Int16BitsToHalf.

* Use HalfToInt16Bits and Int16BitsToHalf in tests.

* Add and expose BinaryPrimitive Half overloads.

* Test BinaryPrimitive Half overloads.

* Add and expose BinaryReader/Writer Half overloads.

* Test BinaryReader/Writer Half overloads.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years agoInclude CrossOs diagnostic assets for signing (#41655)
Juan Hoyos [Tue, 1 Sep 2020 18:56:58 +0000 (11:56 -0700)]
Include CrossOs diagnostic assets for signing (#41655)

* Include CrossOs diagnostic assets for signing

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoAdd SafeBuffer Span<T> methods (#40842)
Huo Yaoyuan [Tue, 1 Sep 2020 16:48:13 +0000 (00:48 +0800)]
Add SafeBuffer Span<T> methods (#40842)

* Implement SafeBuffer.ReadSpan and WriteSpan.

* Add reference source for SafeBuffer.

* Add empty span test for SafeBuffer.

* Add roundtrip tests for SafeBuffer.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years agoAdd Support to ActivitySource events in DiagnosticSourceEventSource (#41641)
Tarek Mahmoud Sayed [Tue, 1 Sep 2020 16:38:28 +0000 (09:38 -0700)]
Add Support to ActivitySource events in DiagnosticSourceEventSource (#41641)

4 years agoSafeSocketHandle: avoid potential blocking of finalizer thread (#41508)
Tom Deseyn [Tue, 1 Sep 2020 12:42:47 +0000 (14:42 +0200)]
SafeSocketHandle: avoid potential blocking of finalizer thread (#41508)

* SafeSocketHandle: avoid potential blocking of finalizer thread

When the Socket is Disposed, it attempts to make all on-going operations
abort. It does this in a loop, and decides there are no on-going operations
when the reference count becomes zero and the handle gets released.

SafePipeHandle holds a reference to SafeSocketHandle. This prevents the
reference count to drop to zero, and causes the dispose to loop infinitly.

When the Socket is disposed from the finalizer thread, it is no longer used
for operations and we can skip the loop. This avoids blocking the finalizer
thread when the reference count can't drop to zero.

* When disposing from finalizer, fall back to ReleaseHandle

* Add test

* PR feedback

* Fix test

* PR feedback

* Refactor

* Refactor

* Log call to _handle.Dispose

* Handle null handle

4 years agoFix issue 41413 (#41445)
Peter Sollich [Tue, 1 Sep 2020 10:23:21 +0000 (12:23 +0200)]
Fix issue 41413 (#41445)

Fix the AV issue in GCHeap::ApproxTotalBytesInUse:

- The AV is fixed by stopping the iteration when seg1 becomes null
- don't count segments that have been decommited
- stop iterating when seg1 becomes freeable_soh_segment - this takes care of the case where we have put a segment on the list, but the OS call to decommit hasn't come back.

These fixes will still leave a window where the result will be inaccurate. To reduce the chances of an inaccurate result, we try this 3 times.

4 years agoRemove dead files from System.Private.DataContractSerialization (#41646)
Eric Erhardt [Tue, 1 Sep 2020 04:59:44 +0000 (23:59 -0500)]
Remove dead files from System.Private.DataContractSerialization (#41646)

These files have been moved to System.Runtime.Serialization.Primitives and were left over here. They aren't part of any .csproj, so they are not being compiled.

4 years agoAdd assert to verify the correctness of the GCRefMap pulled from an R2R image (#41544)
David Wrighton [Tue, 1 Sep 2020 03:02:37 +0000 (20:02 -0700)]
Add assert to verify the correctness of the GCRefMap pulled from an R2R image (#41544)

4 years agoSearch libgdiplus in /usr/local/lib on macOS (#41503)
Adeel Mujahid [Tue, 1 Sep 2020 02:58:52 +0000 (05:58 +0300)]
Search libgdiplus in /usr/local/lib on macOS (#41503)

With Apple's Hardened Runtime, `/usr/local/lib` is not searched for
`dlopen(3)` calls.

Today, some brew packages, such as `mono-libgdiplus` (used by
System.Drawing) are installed in `/usr/local/lib`. This causes
`DllNotFoundException` and user is supposed to either:

1. manually create a symlink to `/usr/local/lib/libgdiplus.dylib`.
2. export `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH` or
  `DYLD_FALLBACK_LIBRARY_PATH` to `/usr/local/lib`.
3. remove signature from dotnet binary:
  `sudo codesign --remove-signature $(command -v dotnet)`

This patch adds a fallback lookup for libgdiplus.dylib, to avoid
workaround on macOS (as it is done for Linux: `libgdiplus.so` falls
back to `libgdiplus.so.0`).

Also removed `LIBSEARCHPATH` which is unused since 8d5e610.

4 years agoObsolete Uri.EscapeUriString (#41501)
Jan Jahoda [Tue, 1 Sep 2020 02:56:29 +0000 (04:56 +0200)]
Obsolete Uri.EscapeUriString (#41501)

* Obsolete Uri.EscapeUriString

* Fix tests

Co-authored-by: Adeel Mujahid <adeelbm@outlook.com>
4 years agoFix infinite recursion in configuration manager (#41638)
Santiago Fernandez Madero [Tue, 1 Sep 2020 02:45:04 +0000 (19:45 -0700)]
Fix infinite recursion in configuration manager (#41638)

* Revert "Remove unused local in System.Configuration.ConfigurationManager (#40583)"

This reverts commit a4eba0a0e1ecb31b7cb3482509bd461c8e9f5ccf.

* Rename unused variable and add regression test

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
4 years ago[RyuJIT] Avoid emitting cdq/coq for a positive constant in rax for idiv (#41551)
Egor Bogatov [Tue, 1 Sep 2020 02:43:25 +0000 (05:43 +0300)]
[RyuJIT] Avoid emitting cdq/coq for a positive constant in rax for idiv (#41551)

* avoid emitting cdq/coq for dividend if it's a positive constant

4 years agoFix palsuite build (#41622)
Adeel Mujahid [Tue, 1 Sep 2020 01:30:31 +0000 (04:30 +0300)]
Fix palsuite build (#41622)

Error 1
```sh
   CMake Error at src/pal/tests/palsuite/exception_handling/pal_sxs/test1/CMakeLists.txt:22 (set_exports_linker_option):
    set_exports_linker_option Function invoked with incorrect arguments for
    function named: set_exports_linker_option
```
Error 2
```sh
  [ 23%] Building CXX object src/vm/wks/CMakeFiles/cee_wks_core.dir/__/debugdebugger.cpp.o
  In file included from /Users/am11/projects/runtime_base/src/coreclr/src/pal/tests/palsuite/c_runtime/acosf/test1/test1.c:17:
  In file included from /Users/am11/projects/runtime_base/src/coreclr/src/pal/tests/palsuite/common/palsuite.h:24:
  /Users/am11/projects/runtime_base/src/coreclr/src/pal/inc/pal.h:379:28: error: unknown type name 'bool'
      const char *szExePath, bool runningInExe);
                             ^
  1 error generated.
```

4 years agoOptimize out gc polls in basic blocks with regular PInvokes (#41581)
Jan Kotas [Tue, 1 Sep 2020 01:18:23 +0000 (18:18 -0700)]
Optimize out gc polls in basic blocks with regular PInvokes (#41581)

Regular PInvokes poll for GC. It means that the explicit gc polls can be skipped in basic blocks that contain regular PInvoke.

4 years agoAdd nullable annotations for XmlDataDocument (#41541)
Immo Landwerth [Tue, 1 Sep 2020 01:09:41 +0000 (18:09 -0700)]
Add nullable annotations for XmlDataDocument (#41541)

* Add nullable annotations for XmlDataDocument

* Address code review feedback

* More code review feedback

* Address Eric's feedback

* Annotate _dataSet as not null when AttachDataSet is called

* Fix GetElementById return type annotation

In order to match with src

Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
Co-authored-by: David Cantú <dacantu@microsoft.com>
4 years agoUpdating ref source documentation for full facades (#41629)
Eric Erhardt [Tue, 1 Sep 2020 00:56:28 +0000 (19:56 -0500)]
Updating ref source documentation for full facades (#41629)

4 years agoAdd TypeConverterAttribute to IListSource (#41634)
Eric StJohn [Mon, 31 Aug 2020 23:46:39 +0000 (16:46 -0700)]
Add TypeConverterAttribute to IListSource (#41634)

4 years agoAdd docs link to editing-and-debugging (#41636)
Andy Gocke [Mon, 31 Aug 2020 22:42:51 +0000 (15:42 -0700)]
Add docs link to editing-and-debugging (#41636)

We were missing a link to the Editing and Debugging doc from the main workflow doc.

4 years agoRenable AddMethodBody tests (#41613)
Eric StJohn [Mon, 31 Aug 2020 20:58:16 +0000 (13:58 -0700)]
Renable AddMethodBody tests (#41613)

4 years agomake cns_str indirect loads invariant (#40898)
Egor Bogatov [Mon, 31 Aug 2020 20:47:11 +0000 (23:47 +0300)]
make cns_str indirect loads invariant (#40898)

4 years agoMade char.IsAscii public (#41396)
Günther Foidl [Mon, 31 Aug 2020 20:21:36 +0000 (22:21 +0200)]
Made char.IsAscii public (#41396)

4 years ago[mono] Add mono_image_open_from_data_alc to unstable embedding API (#41334)
Ryan Lucia [Mon, 31 Aug 2020 18:53:38 +0000 (14:53 -0400)]
[mono] Add mono_image_open_from_data_alc to unstable embedding API (#41334)

4 years ago[wasm][debugger] Breakpoint stopping after it's removed (#41479)
Thays Grazia [Mon, 31 Aug 2020 17:30:50 +0000 (14:30 -0300)]
[wasm][debugger] Breakpoint stopping after it's removed (#41479)

* Remove unnecessary WriteLine.
Fix #41447.

* Creating unit test about remove breakpoint.

* Implementing @radical suggestions!

4 years agoAdd Request/Response Headers/Content Start/Stop events (#41590)
Miha Zupan [Mon, 31 Aug 2020 16:45:15 +0000 (18:45 +0200)]
Add Request/Response Headers/Content Start/Stop events (#41590)

4 years agoHTTP 1.1 stress test steps (#41592)
Alexander Nikolaev [Mon, 31 Aug 2020 16:31:08 +0000 (18:31 +0200)]
HTTP 1.1 stress test steps (#41592)

Adds HTTP 1.1 steps to http-stress pipeline.

4 years ago[wasm] Disable an extraneous debug message (#41468)
Ankit Jain [Mon, 31 Aug 2020 14:26:34 +0000 (10:26 -0400)]
[wasm] Disable an extraneous debug message (#41468)

Recent debugger test runs were showing lot of
`CWL: Failed to lookup sequence point` messages.

These are being shown for cases like:

`CWL: list_frames: Failed to lookup sequence point. method: runtime_invoke_direct_void, native_offset: 56`

This is a warning, and doesn't need to be emitted by default.

4 years ago[wasm][debugger] Correctly handle empty, and whitespace-only strings (#41424)
Ankit Jain [Mon, 31 Aug 2020 14:21:04 +0000 (10:21 -0400)]
[wasm][debugger] Correctly handle empty, and whitespace-only strings (#41424)

There are two cases being fixed here:

1. str=='', or str=' '
- We check `str_value == 0`, and for the above cases JS returns
true, due to type coercion.
- So, we show the result as a null string.

2. str==null
- debugger.c adds the value for this with `mono_wasm_add_typed_value ("string", NULL, 0)`
- the second argument is converted to a string with
  `Module.UTF8ToString(..)`, but when it's `0`/NULL, we get an
  empty string. And that becomes a null string, because of (1).

Fixing this by using `===` operator to avoid type coercion.

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

4 years agoFix issue 41311 - Assert failure ephemeral_heap_segment->saved_committed == heap_segm...
Peter Sollich [Mon, 31 Aug 2020 13:17:56 +0000 (15:17 +0200)]
Fix issue 41311 - Assert failure ephemeral_heap_segment->saved_committed == heap_segment_committed (#41441)

This is an interaction problem between gradual decommit and entering a no GC region.

Details:
 - When we enter a no GC region, we are manipulating our commit goals outside of GC, we usually are planning to commit more, so it makes sense to stop any gradual decommit in progress.
- Even if we need to do a GC in preparation for a no GC region, any decommit target established by decommit_ephemeral_segment_pages is likely to be invalid, so we do an early out.
- add an assert to grow_heap_segment so we can catch future issues in this area better.

We may want to trigger the gradual decommit logic in set_allocations_for_no_gc if we discover that after accounting for the planned allocation, we still have substantial decommits. I'm leaving this for a later PR though.

4 years agomono: result of regmask should be stored in regmask_t, not int (#41543)
monojenkins [Mon, 31 Aug 2020 13:12:59 +0000 (09:12 -0400)]
mono: result of regmask should be stored in regmask_t, not int (#41543)

While unlikely in practice, architectures with more than 32 registers would be affected by this as `sizeof(regmask_t) ==8` && `sizeof(int) == 4`.

Run into this while debugging something unrelated.

Co-authored-by: skmp <skmp@users.noreply.github.com>
4 years agoMoved HTTP request telemetry to HttpClient.SendAsync (#41022)
Marie Píchová [Mon, 31 Aug 2020 09:28:27 +0000 (11:28 +0200)]
Moved HTTP request telemetry to HttpClient.SendAsync (#41022)

* Moved HTTP request telemetry to HttpClient.SendAsync

* Added ResponseContent and helper methods events.

* Rework helper method activity nesting

* Expand Telemetry tests

* Also log RequestStart/Stop in HttpMessageInvoker

* Update RequestStart signature

* RequestAborted => RequestFailed rename

* ResponseContent Begin => Start/Stop

* Fix HttpMessageInvoker implementation

* Add Synchronous request Telemetry tests

* Check telemetryStarted before ResponseContentStart

Co-authored-by: MihaZupan <mihazupan.zupan1@gmail.com>
4 years agoAdd 32/8 bit values of exit codes (#41566)
eli-fin [Mon, 31 Aug 2020 09:02:16 +0000 (12:02 +0300)]
Add 32/8 bit values of exit codes (#41566)

This will make searching for the exit code a little easier

Co-authored-by: Eli Finkel <Eli.Finkel@checkmarx.com>
4 years agoUpdate perf docs (#41583)
Adam Sitnik [Mon, 31 Aug 2020 08:32:51 +0000 (10:32 +0200)]
Update perf docs (#41583)

* mention benchmarking and profiling in the workflow description

* remove a very general doc about PerfView which was not refferenced by other docs

* update the performance-guidelines.md doc

4 years agoOptimize Half.Equals (#41554)
Huo Yaoyuan [Mon, 31 Aug 2020 07:08:21 +0000 (15:08 +0800)]
Optimize Half.Equals (#41554)

4 years ago[MIPS32] Fix mono_arch_get_cie_program and ELF_MACHINE undefined issue (#41546)
monojenkins [Sun, 30 Aug 2020 16:17:18 +0000 (12:17 -0400)]
[MIPS32] Fix mono_arch_get_cie_program and ELF_MACHINE undefined issue (#41546)

Hi,

Cross compile for MIPS32:

```
CC=mips-linux-gnu-gcc CFLAGS="-I./libatomic_ops/src" ./autogen.sh --host=mips-linux-gnu --prefix=/home/zhaixiang/mono-mips32-git
make
make install
```

And HelloWorld testcase PASSED:

```
$ ./mono-mips32-git/bin/mono HelloWorld/bin/Debug/netcoreapp3.0/HelloWorld.dll
Hello World!
```

Thanks,
Leslie Zhai

Co-authored-by: xiangzhai <xiangzhai@users.noreply.github.com>
4 years agoPass Configuration to cmake. Use -Os on wasm. (#41550)
Zoltan Varga [Sun, 30 Aug 2020 10:25:55 +0000 (06:25 -0400)]
Pass Configuration to cmake. Use -Os on wasm. (#41550)

4 years ago[master] Update dependencies from dotnet/arcade Microsoft/vstest dotnet/runtime-asset...
dotnet-maestro[bot] [Sun, 30 Aug 2020 09:54:11 +0000 (09:54 +0000)]
[master] Update dependencies from dotnet/arcade Microsoft/vstest dotnet/runtime-assets dotnet/xharness dotnet/icu (#41322)

[master] Update dependencies from dotnet/arcade Microsoft/vstest dotnet/runtime-assets dotnet/xharness dotnet/icu
- Updates:
  - System.ComponentModel.TypeConverter.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.Drawing.Common.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.IO.Compression.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.IO.Packaging.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.Net.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.Private.Runtime.UnicodeData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.Security.Cryptography.X509Certificates.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1
  - System.Windows.Extensions.TestData: from 5.0.0-beta.20420.1 to 5.0.0-beta.20426.1

- Updates:
  - Microsoft.DotNet.XHarness.CLI: from 1.0.0-prerelease.20424.1 to 1.0.0-prerelease.20424.2
  - Microsoft.DotNet.XHarness.TestRunners.Xunit: from 1.0.0-prerelease.20424.1 to 1.0.0-prerelease.20424.2

- Updates:
  - Microsoft.NETCore.Runtime.ICU.Transport: from 5.0.0-preview.8.20421.1 to 6.0.0-alpha.1.20428.1

- Updates:
  - Microsoft.DotNet.GenFacades: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.Build.Tasks.Feed: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.Build.Tasks.Packaging: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.CodeAnalysis: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.GenAPI: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.XUnitExtensions: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.Helix.Sdk: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.RemoteExecutor: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.VersionTools.Tasks: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.XUnitConsoleRunner: from 2.5.1-beta.20419.21 to 2.5.1-beta.20427.5
  - Microsoft.DotNet.Arcade.Sdk: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5
  - Microsoft.DotNet.ApiCompat: from 5.0.0-beta.20419.21 to 5.0.0-beta.20427.5

- Updates:
  - Microsoft.NET.Test.Sdk: from 16.8.0-release-20200821-04 to 16.8.0-release-20200828-02

 - fix TestFirstYearOfJapaneseEra test on Browser platform

4 years ago[mono] Squelch Mach exception handlers (#41536)
monojenkins [Sat, 29 Aug 2020 18:23:12 +0000 (14:23 -0400)]
[mono] Squelch Mach exception handlers (#41536)

Work around LLDB's unconditionally-installed and inflexible Mach
exception handler by installing a no-op task-wide Mach exception
handler.

See also:
- https://github.com/openjdk/jdk/blob/50cc54c730bb0f130991648d1547d42483edddc1/src/hotspot/os/bsd/os_bsd.cpp#L2810-L2817
- https://github.com/mono/mono/issues/10180#issuecomment-683119507

Co-authored-by: imhameed <imhameed@users.noreply.github.com>
4 years agoFix comments calling surrogate halves low surrogates (#41545)
Serentty [Sat, 29 Aug 2020 18:14:43 +0000 (14:14 -0400)]
Fix comments calling surrogate halves low surrogates (#41545)

I think these comments were copied and pasted and someone forgot to modify them.

4 years agoFix a race condition in GCStress (#41540)
Bruce Forstall [Sat, 29 Aug 2020 17:22:20 +0000 (10:22 -0700)]
Fix a race condition in GCStress (#41540)

Consider the case of a partially interruptible function where we've replaced
each call site with INTERRUPT_INSTR_CALL or INTERRUPT_INSTR_CALL_32. Even
though the call site itself isn't a safe point, we put a GCStress instruction
there so we can capture the call target at GC stress time, then set a specific
GCStress instruction for the next instruction that will indicate how to GC
protect any GC refs that are returned from the call.

Multiple threads can enter `DoGcStress` at the same time. They all get just
past the race check `if (!IsGcCoverageInterruptInstruction(instrPtr)) return;`.
One goes ahead, and reads the instruction code for the address at which we're
doing a GCStress. We set `atCall` to `true` if this matches one of our known
GCStress instructions for partially-interruptible call sites. Later, if
`atCall` is `true`, we write the original call instruction back to the code
stream, write the distinguished next instruction GCStress instruction, and
continue. If the other threads then read at the instruction address, they
might read the actual call opcode, not the distinguished GCStress breakpoint
instruction code. Then, they will set `atCall` to `false`. This will indicate
that we are in a fully-interruptible location, or that no special call-site
behavior is required. We go on, force a GC, and eventually get to the assert
in `EECodeManager::EnumGcRefs` that we are at a GC safe point.

The solution is to simply move the `if (!IsGcCoverageInterruptInstruction(instrPtr))`
check below the read of `*instrPtr` to set `atCall`.

Re-enable the GitHub_27924 test.

Fixes #36681

4 years agoarea-owners.md: Add @radical for debugger-mono (#41425)
Ankit Jain [Sat, 29 Aug 2020 09:59:41 +0000 (05:59 -0400)]
area-owners.md: Add @radical for debugger-mono (#41425)

4 years ago[runtime] Fix signature of mini_cleanup (). (#41510)
Zoltan Varga [Sat, 29 Aug 2020 08:04:54 +0000 (04:04 -0400)]
[runtime] Fix signature of mini_cleanup (). (#41510)

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

4 years agoFix reading cpu cache size for Alpine(musl) (#41532)
Manish Godse [Sat, 29 Aug 2020 05:17:01 +0000 (22:17 -0700)]
Fix reading cpu cache size for Alpine(musl) (#41532)

* Fix reading cpu cache size for Alpine(musl)

* limiting the fallback to Linux only

* exclude ARM

* fixing copy-paste error

4 years agoSystem.Net Telemetry style changes (#41527)
Miha Zupan [Sat, 29 Aug 2020 00:46:03 +0000 (02:46 +0200)]
System.Net Telemetry style changes (#41527)

* Change HandshakeStop SslProtocols parameter to enum

* Parameterize Http11/Http20 events

* Add dummy request to ensure Http2 settings are received

4 years agoNullable annotations for System.Runtime.Serialization.Xml and System.Runtime.Serializ...
Eric Erhardt [Fri, 28 Aug 2020 21:55:24 +0000 (16:55 -0500)]
Nullable annotations for System.Runtime.Serialization.Xml and System.Runtime.Serialization.Json (#41476)

* Initial nullable annotations of System.Private.DataContractSerialization

Contributes to #2339

* Mark DataMember.Name as non-nullable.

* Fix a few simple nullable compile errors.

* Assert attributes is non-null in XmlObjectSerializerReadContext

* Ensure XmlObjectSerializerContext.serializer is never null

* Fix a few simple nullable errors

* Remove any checks that DataMember.MemberInfo can be null.

* Mark EnumDataContract.Members as non-nullable.

Fix nullable errors in SchemaExporter.

* Correctly annotate CollectionDataContract.IsCollectionOrTryCreate.

* Assert DataContractResolver is non-null.

* Suppress https://github.com/dotnet/runtime/issues/41465

* Update System.Runtime.Serialization.Json ref source for nullable annotations.

* Update System.Runtime.Serializaiton.Xml ref source for nullable annotations.

* Update for Xml.ReaderWriter nullable annotations

* Work around compiler issue.

* Fix test failure.

Reference compiler issue in TODO comment.

* Revert nullable suppression now that XmlSchemaAppInfo.Markup is annotated correctly.

* Fix build for latest annotations in master.

* PR feedback round 1

* Address PR feedback round 2

4 years agoModfiy ErrorHandlingTests for Browser (#40659)
Mitchell Hwang [Fri, 28 Aug 2020 21:29:35 +0000 (17:29 -0400)]
Modfiy ErrorHandlingTests for Browser (#40659)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years agoDo not add bundle deps file to APP_CONTEXT_DEPS_FILES on single-file apps (#41430)
Mateo Torres-Ruiz [Fri, 28 Aug 2020 20:57:39 +0000 (13:57 -0700)]
Do not add bundle deps file to APP_CONTEXT_DEPS_FILES on single-file apps (#41430)

* App Context deps file should be empty for single file apps

4 years agoUpdate IgnoreNullValues obsoletion message (#41141)
Layomi Akinrinade [Fri, 28 Aug 2020 20:39:17 +0000 (13:39 -0700)]
Update IgnoreNullValues obsoletion message (#41141)

* Update IgnoreNullValues obsoletion message

* Add attributes to ref file

4 years agoUpdate excluded tests list for WASM (#41415)
Fan Yang [Fri, 28 Aug 2020 18:40:43 +0000 (14:40 -0400)]
Update excluded tests list for WASM (#41415)

* Check runtime test failures on WASM

* Modify ExcludeList for wasm to exclude only failed tests

* Revert the change to runtime.yml

* Update runtime.yml

4 years agofixed issue 36752 mail address display name (#37874)
jaymin93 [Fri, 28 Aug 2020 18:21:27 +0000 (23:51 +0530)]
fixed issue 36752 mail address display name (#37874)

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Co-authored-by: Karel Zikmund <karelz@microsoft.com>
4 years agoObsolete WebRequest, ServicePoint and WebClient (#41400)
Jan Jahoda [Fri, 28 Aug 2020 17:49:52 +0000 (19:49 +0200)]
Obsolete WebRequest, ServicePoint and WebClient (#41400)

* Obsolete WebRequest, ServicePoint and WebClient

* Update src/libraries/Common/src/System/Obsoletions.cs

Co-authored-by: Cory Nelson <phrosty@gmail.com>
* Remove obsoletion from FileWebRequest

* Add refs assemblies obsoletion

* Add missing attribute

* Add missing attribute

* Suppress warning for System.Media.SoundPlayer

* Change message id

Co-authored-by: Jan Jahoda <jajahoda@.microsoft.com>
Co-authored-by: Cory Nelson <phrosty@gmail.com>
4 years agoMake gc/vxsort/isa_detection.cpp portable (#41517)
Jan Kotas [Fri, 28 Aug 2020 17:13:47 +0000 (10:13 -0700)]
Make gc/vxsort/isa_detection.cpp portable (#41517)

Fixes #41515

4 years agoBump emscripten version to 2.0.1 (#41509)
Alexander Köplinger [Fri, 28 Aug 2020 15:19:12 +0000 (17:19 +0200)]
Bump emscripten version to 2.0.1 (#41509)

Updates the emscripten Docker container we use to build in CI. We no longer need to explicitly set `EMSDK_PATH` since the container already does it.
Also remove `--embedded` flag from `./emsdk activate` since it was deprecated and is now the default.

4 years agoClient side logging for HTTP stress. (#41444)
Marie Píchová [Fri, 28 Aug 2020 13:31:29 +0000 (15:31 +0200)]
Client side logging for HTTP stress. (#41444)

4 years agoFixes Windows docker debug prints. (#41443)
Marie Píchová [Fri, 28 Aug 2020 11:56:31 +0000 (13:56 +0200)]
Fixes Windows docker debug prints. (#41443)

4 years agoBump the local emscripten version to 2.0.1. (#41504)
Zoltan Varga [Fri, 28 Aug 2020 11:53:08 +0000 (07:53 -0400)]
Bump the local emscripten version to 2.0.1. (#41504)

4 years agomono.proj: properly pass -mmacosx-version-min to CFLAGS for OSX (#41433)
Alexander Köplinger [Fri, 28 Aug 2020 11:51:20 +0000 (13:51 +0200)]
mono.proj: properly pass -mmacosx-version-min to CFLAGS for OSX (#41433)

Noticed we were missing this while looking at another PR.

4 years agoPort nullability annotations from System.Private.Xml.Linq to contracts (#41086)
David Cantú [Fri, 28 Aug 2020 10:15:15 +0000 (03:15 -0700)]
Port nullability annotations from System.Private.Xml.Linq to contracts (#41086)

* Enable nullability on System.Xml.XPath.XDocument src

* Port nullability annotations to System.Xml.XPath.XDocument

* Port nullability annotations to System.Xml.XDocument

* Add ? to XmlAttribute argument in int? explicit operator

4 years agoPort nullability annotations to refs XmlDocument and XmlSerializer (#41474)
David Cantú [Fri, 28 Aug 2020 09:58:46 +0000 (02:58 -0700)]
Port nullability annotations to refs XmlDocument and XmlSerializer (#41474)

* Port nullability annotations to refs XmlDocument and XmlSerializer

* Fix new System.Data.Common nullability related errors

* Switch nullability of parameter in SoapElementAttribute ctor

4 years ago[wasm][debugger] Make sure `System.Private.CoreLib.dll` is in sync with (#41469)
Ankit Jain [Fri, 28 Aug 2020 08:08:00 +0000 (04:08 -0400)]
[wasm][debugger] Make sure `System.Private.CoreLib.dll` is in sync with (#41469)

.. it's pdb. Running debugger-tests, I saw lot of messages like:

`CWL: : /Users/radical/dev/runtime/src/mono/mono/metadata/debug-mono-ppdb.c:230 <disabled>`

.. which is trying to print:
`CWL: Symbol file data-0x1c38008 doesn't match image System.Private.CoreLib.dll`

And indeed the dll is out of sync with it's pdb. We need to copy the pdb
too.

4 years agoSwitch Markup property to XmlNode?[]? to reflect it can contain null elements (#41488)
David Cantú [Fri, 28 Aug 2020 06:47:24 +0000 (23:47 -0700)]
Switch Markup property to XmlNode?[]? to reflect it can contain null elements (#41488)

* Switch Markup property to XmlNode?[]? to reflect it can contain null elements

* Update ref

4 years agoRemove if-def from JSON ref file previously used to support linker attributes (#41484)
Layomi Akinrinade [Fri, 28 Aug 2020 01:14:55 +0000 (18:14 -0700)]
Remove if-def from JSON ref file previously used to support linker attributes (#41484)

* Remove if-def from JSON ref file previously used to support linker attributes

* Run GenerateReferenceSource target on ref project

4 years agoimprove InitializeCurrentThread (#41440)
Egor Bogatov [Fri, 28 Aug 2020 00:26:06 +0000 (03:26 +0300)]
improve InitializeCurrentThread (#41440)

4 years agoFix perf token (#41345)
Olivia Chen [Fri, 28 Aug 2020 00:22:43 +0000 (17:22 -0700)]
Fix perf token (#41345)

* remove semicolon from upload token

* will revert - test private commands

* remove condition

* add debug code

* add dump task

* comment out internal param

* rename helixprecommands to sharedhelixprecommands

* update and revert for check-in

4 years agoSwitch text param to nullable in WriteProcessingInstructionAsync (#41481)
David Cantú [Thu, 27 Aug 2020 23:54:03 +0000 (16:54 -0700)]
Switch text param to nullable in WriteProcessingInstructionAsync (#41481)

4 years agoClean up changes in #40914 (#41427)
Layomi Akinrinade [Thu, 27 Aug 2020 22:55:23 +0000 (15:55 -0700)]
Clean up changes in #40914 (#41427)

* Fixup JSON equality checks in polymorphic converter tests

* Limit deserialization value validation to custom _polymorphic_ converters

4 years agoUpdate SYSLIB0012 obsoletion messages to be clear and consistent (#41467)
Jeff Handley [Thu, 27 Aug 2020 22:25:49 +0000 (15:25 -0700)]
Update SYSLIB0012 obsoletion messages to be clear and consistent (#41467)

4 years agoadd tracing to Decryp to complement tracing in Encrypt (#40998)
Tomas Weinfurt [Thu, 27 Aug 2020 20:17:14 +0000 (13:17 -0700)]
add tracing to Decryp to complement tracing in Encrypt (#40998)

* add tracing to Decryp to complement tracing in Encrypt

* feedback from review

* revert encrypt

4 years agoPort nullability annotations to System.Xml.ReaderWriter contract (#41083)
David Cantú [Thu, 27 Aug 2020 20:03:46 +0000 (13:03 -0700)]
Port nullability annotations to System.Xml.ReaderWriter contract (#41083)

* Port nullability annotations to System.Xml.ReaderWriter contract assembly

* Port annotations of recently updated members in Xml/Serialization

* Fix anontations on XmlElement discovered while updating System.Data.Common Xml related annotations

* Fix Xml related annotations on System.Data.Common

* address feedback

Co-authored-by: Krzysztof Wicher <kwicher@microsoft.com>
4 years agoFix SPMI to handle replays of BBINSTR jit method contexts (#41386)
Andy Ayers [Thu, 27 Aug 2020 19:26:33 +0000 (12:26 -0700)]
Fix SPMI to handle replays of BBINSTR jit method contexts (#41386)

Move the handling of allocMethodBlockCounts to the method context.
While this data is both an input and an output, we're more interested
in the input side.

We could also treat it as an output, if we say wanted to verify that
the replay jit wrote the same sequence of IL offsets into the BlockCount
records, but that doesn't seem crucial as changes here would also lead
to code diffs.

Fix the code that checks the AddressMap for reloc hints so it doesn't
fail if the exact lookup fails, but instead falls back to a search.
This is needed because the base of the replay count buffer is recorded
as the map key, but the instrumentation probes in jitted code refer
to offsets from this value.

Fixes #37270.

4 years agoMake minimal OSX version consistent between build-native.sh and configurecompiler...
Alexander Köplinger [Thu, 27 Aug 2020 18:38:25 +0000 (20:38 +0200)]
Make minimal OSX version consistent between build-native.sh and configurecompiler.cmake (#41435)

The latter still specified 10.12 but .NET Core 3+ actually only supports macOS 10.13 or later.

4 years agoFix null check in S.Diagnostics.Contract regressed by nullability annotations (#41382)
Krzysztof Wicher [Thu, 27 Aug 2020 18:00:42 +0000 (20:00 +0200)]
Fix null check in S.Diagnostics.Contract regressed by nullability annotations (#41382)

* Fix null check in S.Diagnostics.Contract regressed by nullability annotations

* fix product per Jan's recommendation

4 years agoConsole.Unix: fix window size not always being invalidated (#41317)
Tom Deseyn [Thu, 27 Aug 2020 17:53:49 +0000 (19:53 +0200)]
Console.Unix: fix window size not always being invalidated (#41317)

Ensure signal handlers are setup to invalidate cached values
for window size.

4 years agoFix ArgumentNullException when using minimum json file (#41428)
Maryam Ariyan [Thu, 27 Aug 2020 17:33:18 +0000 (10:33 -0700)]
Fix ArgumentNullException when using minimum json file (#41428)

4 years agoAllow return null from ConnectionListener.AcceptAsync (#41442)
Natalia Kondratyeva [Thu, 27 Aug 2020 16:20:54 +0000 (19:20 +0300)]
Allow return null from ConnectionListener.AcceptAsync (#41442)

Changed API as it was proposed and approved in #41304

Closes #41304

4 years agoIssue18826 fix (#35137)
monojenkins [Thu, 27 Aug 2020 15:38:44 +0000 (11:38 -0400)]
Issue18826 fix (#35137)

<!--
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
-->

Fixes mono/mono#18826

Co-authored-by: HinTak <HinTak@users.noreply.github.com>
4 years ago[mono] ALC function restructuring for unloadability (#41344)
Ryan Lucia [Thu, 27 Aug 2020 14:56:30 +0000 (10:56 -0400)]
[mono] ALC function restructuring for unloadability (#41344)

We previously had a weird split between the domain and loader headers/files. This makes fewer things public, moves the useful ALC functions to loader-internals.h with the implementation in assembly-load-context.c, and cleans up the flow for some unloading behavior.

4 years agoAdd support for using cmake in the mono runtime build. (#41316)
Zoltan Varga [Thu, 27 Aug 2020 14:13:41 +0000 (10:13 -0400)]
Add support for using cmake in the mono runtime build. (#41316)

* Add support for using cmake in the mono runtime build.

Not enabled by default. Ninja is used for building if available, else we fall
back to make.

* Build and install libmonosgen-2.0.dylib.

* Address review comments.

* Add a few more MONO_EMPTY_SOURCE_FILE defines to silence ranlib warnings on osx.

* Pass -mmacosx-version-min=10.12 on osx.

* Add eventpipe support.

* Quiet the OSX build a bit.

* Address review comments.

4 years agoGlobally enable nullability in XML (#41438)
Krzysztof Wicher [Thu, 27 Aug 2020 12:57:29 +0000 (14:57 +0200)]
Globally enable nullability in XML (#41438)

* Globally enable nullability in XML

* remove double #nullable enable in the file

4 years agoBrowserDebugProxy: bump package versions to latest stable (#41436)
Alexander Köplinger [Thu, 27 Aug 2020 12:51:19 +0000 (14:51 +0200)]
BrowserDebugProxy: bump package versions to latest stable (#41436)

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

4 years agoNullable: System.Xml, part 7 (Serialization) (#41261)
Krzysztof Wicher [Thu, 27 Aug 2020 06:29:11 +0000 (08:29 +0200)]
Nullable: System.Xml, part 7 (Serialization) (#41261)

* Nullable: System.Xml, part 7 (Serialization)

* Fix build errors on Release (ifdef-ed code)

* fix incidental product bug

* address PR feedback

* Make XmlSerializer._rootType nullable

4 years agoThree fixes for R2RDump bugs I discovered while investigating #38290 (#41303)
Tomáš Rylek [Wed, 26 Aug 2020 23:33:45 +0000 (01:33 +0200)]
Three fixes for R2RDump bugs I discovered while investigating #38290 (#41303)

1) As ReadyToRunMethod newly looks at method bodies, in the
composite case we need to pass around per-module IL info, not only
the metadata reader. I have replaced such usages of MetadataReader
with the new interface IAssemblyMetadata and I implemented the
standalone variant StandaloneAssemblyMetadata.

2) I hit an UnwindInfo decoding issue and I found out that the
UnwindCode decoder is weirdly split between the UnwindCode ctor
and a separate method ParseUnwindCode that weren't completely
consistent in whether the UnwindInfoArray refers to the raw 16-bit
entries in the UnwindInfo or to the parsed UnwindCode instances.
I have basically migrated ParseUnwindCode into the UnwindCode ctor
and I simplified the related logic.

3) We shouldn't block method dump on header dump, otherwise there's
no way to dump both headers and methods in one R2RDump execution.

Thanks

Tomas

4 years ago[VisualBasic] Fix tests for Android (#41378)
Edison Henrique Andreassy [Wed, 26 Aug 2020 21:57:05 +0000 (22:57 +0100)]
[VisualBasic] Fix tests for Android (#41378)

Remove some empty tests and add data for others. Resolves #37066

4 years agoAdded VersionConverter (#41384)
devsko [Wed, 26 Aug 2020 21:04:52 +0000 (23:04 +0200)]
Added VersionConverter (#41384)

* Added VersionConverter

* Nullable annotation

4 years agoselect Debian10 over Debian9 for PR validation (#41015)
Tomas Weinfurt [Wed, 26 Aug 2020 20:34:20 +0000 (13:34 -0700)]
select Debian10 over Debian9 for PR validation (#41015)

4 years agoExclude Fannkuch_9 test on ARM (#41380)
Drew Scoggins [Wed, 26 Aug 2020 18:08:16 +0000 (11:08 -0700)]
Exclude Fannkuch_9 test on ARM (#41380)

4 years agoNullability annotations for HttpListener (#41189)
Prashanth Govindarajan [Wed, 26 Aug 2020 17:29:19 +0000 (10:29 -0700)]
Nullability annotations for HttpListener (#41189)

* src files annotated

* ref file

* Address feedback

4 years agoHTTP stress docker fix (#41397)
Marie Píchová [Wed, 26 Aug 2020 16:41:38 +0000 (18:41 +0200)]
HTTP stress docker fix (#41397)

Fixed docker files not using currently built runtime for http stress test.

4 years agoRetry up to three times for X509Chain timeout tests
Kevin Jones [Wed, 26 Aug 2020 16:30:07 +0000 (12:30 -0400)]
Retry up to three times for X509Chain timeout tests

4 years agoAdd netcoreapp build of System.Formats.Asn1
Jeremy Barton [Wed, 26 Aug 2020 16:27:01 +0000 (09:27 -0700)]
Add netcoreapp build of System.Formats.Asn1

This avoids the library causing a cyclic dependency in generating netstandard.dll.
The netcoreapp version is not included in the NuGet package,
following the pattern of
  * System.Text.Json
  * System.Collections.Immutable
  * System.Reflection.Metadata

4 years ago[wasm][browser] Fix System.IO.FileSystem failing tests requiring nanosecond/milliseco...
Tammy Qiu [Wed, 26 Aug 2020 16:06:14 +0000 (12:06 -0400)]
[wasm][browser] Fix System.IO.FileSystem failing tests requiring nanosecond/millisecond granularity (#41288)

* Emscripten lacks ns/ms granularity which I included a switch for and added a browser platform check
* Emscripten takes maximum of utime and atime so I set utime and atime together for Browser

4 years ago[mono] Add mono_assembly_decref, return value on both decref and addref (#41342)
Ryan Lucia [Wed, 26 Aug 2020 13:59:58 +0000 (09:59 -0400)]
[mono] Add mono_assembly_decref, return value on both decref and addref (#41342)

4 years agoReset all Uri fields when reusing an instance (#41324)
Miha Zupan [Wed, 26 Aug 2020 13:08:29 +0000 (15:08 +0200)]
Reset all Uri fields when reusing an instance (#41324)

* Reset all Uri fields when reusing an instance

* Test combined Uri's AbsoluteUri

4 years agoChange Environment.CurrentManagedThreadId back to FCall (#41360)
Jan Kotas [Wed, 26 Aug 2020 12:00:20 +0000 (05:00 -0700)]
Change Environment.CurrentManagedThreadId back to FCall (#41360)

4 years ago[HeapVerify=2] Fix Assert failure "Pointer updated without using write barrier" ...
Leslie Zhai [Wed, 26 Aug 2020 09:53:17 +0000 (17:53 +0800)]
[HeapVerify=2] Fix Assert failure "Pointer updated without using write barrier" (#41375)

* [HeapVerify=2] Fix Assert failure "Pointer updated without using write barrier"

4 years agoupdate macOS 11 rid (#41044)
Tomas Weinfurt [Wed, 26 Aug 2020 09:30:26 +0000 (02:30 -0700)]
update macOS 11 rid (#41044)

* update macOS 11 rid

* add compat 10.16 as well