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
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
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
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>
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>
Jan Kotas [Fri, 28 Aug 2020 17:13:47 +0000 (10:13 -0700)]
Make gc/vxsort/isa_detection.cpp portable (#41517)
Fixes #41515
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.
Marie Píchová [Fri, 28 Aug 2020 13:31:29 +0000 (15:31 +0200)]
Client side logging for HTTP stress. (#41444)
Marie Píchová [Fri, 28 Aug 2020 11:56:31 +0000 (13:56 +0200)]
Fixes Windows docker debug prints. (#41443)
Zoltan Varga [Fri, 28 Aug 2020 11:53:08 +0000 (07:53 -0400)]
Bump the local emscripten version to 2.0.1. (#41504)
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.
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
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
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.
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
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
Egor Bogatov [Fri, 28 Aug 2020 00:26:06 +0000 (03:26 +0300)]
improve InitializeCurrentThread (#41440)
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
David Cantú [Thu, 27 Aug 2020 23:54:03 +0000 (16:54 -0700)]
Switch text param to nullable in WriteProcessingInstructionAsync (#41481)
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
Jeff Handley [Thu, 27 Aug 2020 22:25:49 +0000 (15:25 -0700)]
Update SYSLIB0012 obsoletion messages to be clear and consistent (#41467)
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
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>
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.
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.
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
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.
Maryam Ariyan [Thu, 27 Aug 2020 17:33:18 +0000 (10:33 -0700)]
Fix ArgumentNullException when using minimum json file (#41428)
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
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>
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.
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.
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
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
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
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
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
devsko [Wed, 26 Aug 2020 21:04:52 +0000 (23:04 +0200)]
Added VersionConverter (#41384)
* Added VersionConverter
* Nullable annotation
Tomas Weinfurt [Wed, 26 Aug 2020 20:34:20 +0000 (13:34 -0700)]
select Debian10 over Debian9 for PR validation (#41015)
Drew Scoggins [Wed, 26 Aug 2020 18:08:16 +0000 (11:08 -0700)]
Exclude Fannkuch_9 test on ARM (#41380)
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
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.
Kevin Jones [Wed, 26 Aug 2020 16:30:07 +0000 (12:30 -0400)]
Retry up to three times for X509Chain timeout tests
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
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
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)
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
Jan Kotas [Wed, 26 Aug 2020 12:00:20 +0000 (05:00 -0700)]
Change Environment.CurrentManagedThreadId back to FCall (#41360)
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"
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
Jeff Handley [Wed, 26 Aug 2020 04:14:29 +0000 (21:14 -0700)]
Disable the Platform Compat Analyzer until #41354 is fixed (#41367)
Andrew Au [Wed, 26 Aug 2020 03:02:28 +0000 (20:02 -0700)]
Restrict generational aware analysis to processes that matches the command line configuration (#41052)
Tomas Weinfurt [Wed, 26 Aug 2020 02:58:17 +0000 (19:58 -0700)]
add extra padding for icmp6stat to support macOS 11 (#41179)
* add extra padding for icmp6stat to support macOS 11
* update SystemNative_GetIcmpv6GlobalStatistics to use variable size
* add cast
* avoid realloc
Tomas Weinfurt [Wed, 26 Aug 2020 01:31:30 +0000 (18:31 -0700)]
set TLS versions explicitly to prevent SNI test failure on Deb10 (#41014)
Nathan Ricci [Wed, 26 Aug 2020 00:58:02 +0000 (20:58 -0400)]
Webassembly Runtime Tests (#38556)
Enable runtime tests for the Wasm Architecture on Mono runtime.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Fan Yang <yangfan@microsoft.com>
Co-authored-by: jashook <jashoo@microsoft.com>
Co-authored-by: Tomas Rylek <trylek@microsoft.com>
devsko [Tue, 25 Aug 2020 23:39:57 +0000 (01:39 +0200)]
Support polymorphic value-type converters and add validation on values returned by custom converters (#40914)
* IL emit Box/Unbox in member access
* Test case for object converter
* Test case for class with primitive members and object converter
* Address feedback
* Fixed issues with JsonConverter<object>and nullable value-types
* Address feedback
* Fix test for .NETStandard version
* Fix #41146
* Accidentally commited the local test hack
* Throw JsonException when a deserialized value cannot be assigned to the property/field
* Fix merge
* Fix merge again
* Undo Fix #41146
* Consolidate nullable annotations
* Addressed feedback
* Addressed feedback
Andy Gocke [Tue, 25 Aug 2020 22:51:06 +0000 (15:51 -0700)]
Throw from CodeBase if assembly is in the bundle (#40974)
Also adds test for Module.FullyQualifiedName
Jakob Botsch Nielsen [Tue, 25 Aug 2020 22:34:19 +0000 (00:34 +0200)]
Add sleep in hijacking test (#41340)
Calling GC.Collect in a tight loop is unnecessary for the test and
causing timeouts in CI.
Fixes #40916
Tarek Mahmoud Sayed [Tue, 25 Aug 2020 22:26:41 +0000 (15:26 -0700)]
Fix \u00A7 char Unicode category (#41343)
Ryan Lucia [Tue, 25 Aug 2020 21:55:00 +0000 (17:55 -0400)]
[mono] Pass -Wc++-compat on all platforms, -Werror on OSX, fix errors (#41233)
This PR:
* Enables `-Wc++-compat` on all platforms: we support building the runtime as C++, so this helps catch errors before they're found in CI and will help keep the netcore build C++-compatible
* Sets `-Werror` on netcore CI for OSX
It also fixes various warnings currently present in the build.
`-Werror` should probably be extended to cover all CI platforms eventually. Adding a new platform is as simple as adding to the line in mono.proj whitelisting platforms and fixing the warnings.
Not sure if there's a better way to handle the cpuidex function, but if we're using that from mini it should definitely be in a header somewhere.
Layomi Akinrinade [Tue, 25 Aug 2020 20:22:21 +0000 (13:22 -0700)]
Add tests mapping invalid JSON to objects with parameterized ctors (#41121)
* Move invalid JSON tests to dedicated file
* Add tests mapping invalid JSON to objects with parameterized ctors
Santiago Fernandez Madero [Tue, 25 Aug 2020 20:04:25 +0000 (13:04 -0700)]
Fix signing in official build with 3rd party libraries (#41346)
* Fix signing in official build with 3rd party libraries
* Update eng/Signing.props
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
monojenkins [Tue, 25 Aug 2020 18:17:25 +0000 (14:17 -0400)]
[runtime] Catch attempts to create enum types with an underlying type that is itself an incomplete enum type. (#41165)
* Catch attempts to create enum types with an underlying type that is itself an incomplete enum type.
Previously, only non-enum types containing fields with incomplete enum
types were forbidden.
* Permit static constant fields with incomplete types if the incomplete type is the type currently being defined
Co-authored-by: Alexis Christoforides <alexis@thenull.net>
Co-authored-by: imhameed <imhameed@users.noreply.github.com>
Krzysztof Wicher [Tue, 25 Aug 2020 17:35:31 +0000 (19:35 +0200)]
Fix NRE introduced in FileSystemWatcher during nullability annotations (#41315)
* Fix NRE introduced during nullability annotations
* Apply Jeff's suggestions from code review
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Cory Nelson [Tue, 25 Aug 2020 17:00:47 +0000 (10:00 -0700)]
HTTP/3 interop fixes (#41298)
Support DNS-based quic connections for SNI.
Support multiple ALPN values.
Update H3 ALPN from "h3" to "h3-29".
Charles Stoner [Tue, 25 Aug 2020 16:45:25 +0000 (09:45 -0700)]
Prevent invoking property 'init' method (#41293)
Jan Kotas [Tue, 25 Aug 2020 14:17:41 +0000 (07:17 -0700)]
Fix tailcall regression with compiled F# (#41206)
* Fix tailcall regression with compiled F#
This change skips instantiating stubs for direct tailcalls and instead passes the inst argument directly to the target method.
Fixes #40864
* Add regression test
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Alexander Köplinger [Tue, 25 Aug 2020 13:53:28 +0000 (15:53 +0200)]
Exclude Mono.Cecil assemblies from signing (#41325)
We're just shipping them in the Microsoft.NETCore.BrowserDebugHost.Transport package.
Mitchell Hwang [Tue, 25 Aug 2020 13:40:13 +0000 (09:40 -0400)]
Mark System.Diagnostics.FileVersionInfo as unsupported on Browser (#41271)
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
dotnet-maestro[bot] [Tue, 25 Aug 2020 11:23:50 +0000 (11:23 +0000)]
[master] Update dependencies from dotnet/xharness mono/linker (#41257)
[master] Update dependencies from dotnet/xharness mono/linker
- Updates:
- Microsoft.DotNet.XHarness.CLI: from 1.0.0-prerelease.20420.1 to 1.0.0-prerelease.20424.1
- Microsoft.DotNet.XHarness.TestRunners.Xunit: from 1.0.0-prerelease.20420.1 to 1.0.0-prerelease.20424.1
- Updates:
- Microsoft.NET.ILLink.Tasks: from 6.0.0-alpha.1.20422.1 to 6.0.0-alpha.1.20424.3
Jan Jahoda [Tue, 25 Aug 2020 09:13:41 +0000 (11:13 +0200)]
Missed cases not discovered during first phase (#40382)
Co-authored-by: Jan Jahoda <jajahoda@.microsoft.com>
Johan Lorensson [Tue, 25 Aug 2020 06:42:48 +0000 (08:42 +0200)]
Port EventPipe CoreCLR changes to Mono. (#41152)
* [MonoVM] Enable startup events over EventPipe.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/36720.
* [MonoVM] Add the ability for profilers to listen to EventPipe events.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/37002.
* [MonoVM] Add ProcessInfo command to Diagnostics Server.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/38967.
* [MonoVM] Unregister callback when setting a provider for deferred delete.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/40191.
* [MonoVM] Generational aware analysis based on environment variable.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/40332.
NOTE, the ability to pause a session was not ported since it
currently have no use in Mono and looks like a temporary
solution in CoreCLR.
* [MonoVM] Rebrand Diagnostics Server to DiagnosticPort.
Mono port of CoreCLR PR: https://github.com/dotnet/runtime/pull/40499.
John Salem [Tue, 25 Aug 2020 02:32:35 +0000 (19:32 -0700)]
Modified #41008 without GetOverlappedResultEx (#41236)
* Revert "Revert "Improve Windows error handling in Diagnostics IPC (#41008)" (#41220)"
This reverts commit
15839c0294b51d8bb9b7f689669da86ebe64546d.
* don't use win8+ API
Olivia Chen [Tue, 25 Aug 2020 01:32:43 +0000 (18:32 -0700)]
Enable Crossgen2 and Blazor Perf Tests on Linux (#41270)
* copy changes from blazor PR
* add crossgen2 job on linux
* fix helixprecommands issue
* fix internal param
* will revert: add back PR trigger
* fix category exclusion
* reset PR trigger
Dongbo Wang [Mon, 24 Aug 2020 23:33:04 +0000 (16:33 -0700)]
Correct a few mistakes in the ComInterop code (#40234)
monojenkins [Mon, 24 Aug 2020 23:06:26 +0000 (19:06 -0400)]
Avoid following invalid pointers in mono_w32process_get_modules on Darwin. (#41115)
`_dyld_get_image_name` and `_dyld_get_image_header` can return pointers
to data that will be freed or unmapped by concurrent calls to `dlclose`.
Avoid this by using `_dyld_register_func_for_add_image` and
`_dyld_register_func_for_remove_image` to install callbacks that
maintain a runtime-internal set of loaded dynamic libraries.
Some notes:
- dyld doesn't provide a public "app store friendly" API (like
`dl_iterate_phdr`) to traverse a snapshot of all loaded dynamic
libraries in a process. There are two alternative private APIs that do
this: one uses `_dyld_process_info_create` and friends and is present in
macOS 10.12 and above, and the other depends on
`_dyld_get_all_image_infos`, which is documented by Apple (... in a WWDC
video) to "go away" at some point in dyld3.
- `dladdr` linearly scans the dyld loaded image array (and each image's
segment set) for a matching address, so `image_added` will get slower as
more dynamic libraries are loaded in the process. But dyld3's
implementation of dlopen already scales linearly in time with the number
of loaded libraries. The use of `dladdr` can be avoided by using
`_dyld_register_for_image_loads` or
`_dyld_register_for_bulk_image_loads`, but those are both private APIs.
- The callbacks registered with `_dyld_register_func_for_add_image` and
`_dyld_register_func_for_remove_image` can never be unregistered, so
this is yet another thing that makes it impossible to safely unload an
embedded mono.
- `MonoW32ProcessModule::inode` only seems to be used to avoid dupicates
in other implementations of w32process; sorting the returned module list
in `mono_w32process_get_modules` wouldn't be necessary if the
`mono_dyld_image_info`s were also kept in an intrusive circular doubly
linked list.
- It looks like `mono_w32process_get_modules` in `w32process-unix-bsd.c`
has a similar race condition.
Also see: https://github.com/mono/mono/issues/20107
Co-authored-by: imhameed <imhameed@users.noreply.github.com>
Eugene Rozenfeld [Mon, 24 Aug 2020 22:06:06 +0000 (15:06 -0700)]
Improve tailcallstress testing (#41059)
1. Dispatch all tail calls under TailCallStress via helpers. That
increases our coverage since valid non-tail-prefixed calls are
dispatched as fast calls in normal non-stress mode.
2. Don't attempt to tail call from methods that have a localloc
unless there is an explicit tail prefix. Note that we already disallowed
fast tail calls from such methods so this change only affects
tailcallstress mode.
3. Fix a bug in TestInvokeDOPAndCancel. As the test was written
this assert was firing under tailcallstress:
https://github.com/dotnet/runtime/blob/
480c49b2419ab4a0b34bfd86754abc2f17079c77/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs#L1074
When this call to `cts.Cancel`:
https://github.com/dotnet/runtime/blob/
480c49b2419ab4a0b34bfd86754abc2f17079c77/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs#L1065
is dispatched via helpers, it takes much longer than when it's
dispatched via a fast tail call (we have to jit a couple of IL stubs).
Because of that, it's possible that all other actions complete on the
other thread before cancellation is completed.
David Mason [Mon, 24 Aug 2020 21:53:07 +0000 (14:53 -0700)]
Fix GetAppdomainStaticAddress for non-collectible assemblies (#41076)
Huo Yaoyuan [Mon, 24 Aug 2020 21:49:34 +0000 (05:49 +0800)]
Fix half equality method (#41259)
* Align Half.Equals implementation with Double.Equals.
* Add tests for new Half.Equals behaviour.
Alexander Köplinger [Mon, 24 Aug 2020 21:25:35 +0000 (23:25 +0200)]
Correctly enumerate files in Microsoft.NETCore.BrowserDebugHost.Transport.pkgproj (#41290)
On CI when the repo is built from a clean checkout in one go we were evaluating the wildcard in the ItemGroup
before the files were actually built which meant they weren't put into the nuget package.
We need to list each file explicitly to fix that.
Tomas Weinfurt [Mon, 24 Aug 2020 21:07:59 +0000 (14:07 -0700)]
fix GetAsync_SupportedSSLVersion_Succeeds test (#41056)
Tomas Weinfurt [Mon, 24 Aug 2020 20:52:18 +0000 (13:52 -0700)]
map macOS compat 10.16 version to 11.0 (#41176)
* map macOS compat 10.16 version to 11.0
* feedback from review
Vlad Brezae [Mon, 24 Aug 2020 20:03:25 +0000 (23:03 +0300)]
[coop] Add debug option to disable stack scan (#40985)
When this is enabled, the GC doesn't scan stack or registers. This mode is meant to disable scanning of native frames. This implementation only makes sense in full interpreter mode, where the interp stack is scanned separately from the thread stack. Longer term we could use this mode to scan only the managed stack, also in jit mode.
The point of this mode is to be able to stress test the GC in a wasm like environment, where stack can't be scanned. We can more easily reproduce and investigate GC crashes in this configuration, that would also happen on wasm.
Thays Grazia [Mon, 24 Aug 2020 20:00:27 +0000 (17:00 -0300)]
Fix wasm sample after that was broken after this PR: https://github.com/dotnet/runtime/pull/40478 (#41277)
Jan Kotas [Mon, 24 Aug 2020 18:27:21 +0000 (11:27 -0700)]
Delete dead code and obsolete comments (#41211)
Tarek Mahmoud Sayed [Mon, 24 Aug 2020 17:45:19 +0000 (10:45 -0700)]
Fix Char.GetUnicodeCategory to returns correct results (#41200)
* Fix Char.GetUnicodeCategory to returns correct results
Jo Shields [Mon, 24 Aug 2020 16:24:50 +0000 (12:24 -0400)]
Re-enable testing on OSX 10.15 (#40524)
* Re-enable testing on OSX 10.15
* ActiveIssue for failing font issue
Olivia Chen [Mon, 24 Aug 2020 16:12:54 +0000 (09:12 -0700)]
update helixprecommands (#41205)
Wei Zheng [Mon, 24 Aug 2020 15:25:17 +0000 (23:25 +0800)]
Fix MethodInfo Emit for generic interfaces (#40587)
Steve Pfister [Mon, 24 Aug 2020 15:21:29 +0000 (11:21 -0400)]
[Wasm] Reduce max length on browser for ToArrayShouldWorkWithSpecialLengthLazyEnumerables Linq test (#41241)
Addresses the occasional timeouts in System.Linq tests. The last 3-4 iterations of ToArrayShouldWorkWithSpecialLengthLazyEnumerables take
between 20 - 56 seconds each and likely trigger longer GC runs.
Fixes https://github.com/dotnet/runtime/issues/41114
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Ryan Lucia [Mon, 24 Aug 2020 14:40:44 +0000 (10:40 -0400)]
[mono] Thread DllImportSearchPath flags down to LoadLibraryEx (#41229)
This mostly completes support for the attribute. Our algorithm differs a bit from CoreCLR right now, so we don't support the legacy behavior flag since it makes less since in the context of our algorithm, but this should be good enough for most cases.
Katelyn Gadd [Mon, 24 Aug 2020 09:45:53 +0000 (02:45 -0700)]
more managed pointer rooting (#40934)
Update more bindings and library code to store managed pointers in roots so that objects can't be collected or moved.
Fixes some bugs in the wasm root APIs.
Jan Kotas [Mon, 24 Aug 2020 08:51:48 +0000 (01:51 -0700)]
Fix perf regression in IntPtr operators on 32-bit platforms (#41198)
Switching to C# built-in uint/nuint types caused these operators to use long/ulong IntPtr/UIntPtr constructors instead of int/uint IntPtr constructors that it were used before.
The fix is to avoid going through the IntPtr/UIntPtr constructors and just depend on the built-in uint/nuint implicit conversions.
Fixes #41167
Seonyoung Park [Mon, 24 Aug 2020 05:22:43 +0000 (14:22 +0900)]
remove unused local (#41226)
* remove unused local
issue dotnet#30457
remove unused local variable fullPath at line 415
* Update src/libraries/System.Security.Cryptography.X509Certificates/src/System/Security/Cryptography/X509Certificates/X509Certificate2.cs
Co-authored-by: Kevin Gosse <krix33@gmail.com>
Co-authored-by: Kevin Gosse <krix33@gmail.com>
Ryan Lucia [Mon, 24 Aug 2020 04:24:53 +0000 (00:24 -0400)]
[mono] Add more detailed logs for the PInvoke resolution process (#41228)
Similar logging was added to the managed loading algorithm when it proved extremely useful for debugging a Blazor crash, so the equivalent is probably useful for the unmanaged library algorithm as well
Sergey Andreenko [Mon, 24 Aug 2020 02:29:50 +0000 (19:29 -0700)]
Fix wrong copy prop after `ASG(promoted LCL_VAR with 1 field, call)`. (#41197)
* Add Andy's repro test.
* Andy's fix.
* fix other places
* Improve dump.
Petr Onderka [Sun, 23 Aug 2020 22:39:02 +0000 (00:39 +0200)]
Fix Array.Sort in the presence of nulls (#41234)
* Add failing test case
* Fix Array.Sort in the presence of nulls
Seonyoung Park [Sun, 23 Aug 2020 17:51:01 +0000 (02:51 +0900)]
Remove unused local (#40967)
issue dotnet#30457
remove unused local variable dwErrorCode at line 248
dotnet-maestro[bot] [Sun, 23 Aug 2020 16:07:37 +0000 (09:07 -0700)]
[master] Update dependencies from dotnet/runtime-assets dotnet/llvm-project dotnet/icu mono/linker dotnet/arcade Microsoft/vstest dotnet/xharness (#41025)
* Update dependencies from https://github.com/dotnet/arcade build
20200817.6
Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.ApiCompat
From Version 5.0.0-beta.20407.3 -> To Version 5.0.0-beta.20417.6
* Update dependencies from https://github.com/mono/linker build
20200818.3
Microsoft.NET.ILLink.Tasks
From Version 5.0.0-preview.3.20413.1 -> To Version 5.0.0-preview.3.20418.3
* Update dependencies from https://github.com/dotnet/llvm-project build
20200818.1
runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk
From Version 9.0.1-alpha.1.20410.1 -> To Version 9.0.1-alpha.1.20418.1
* Update dependencies from https://github.com/dotnet/xharness build
20200819.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.20411.1 -> To Version 1.0.0-prerelease.20419.1
* Update dependencies from https://github.com/dotnet/icu build
20200818.2
Microsoft.NETCore.Runtime.ICU.Transport
From Version 5.0.0-preview.8.20410.1 -> To Version 5.0.0-preview.8.20418.2
* Update dependencies from https://github.com/dotnet/xharness build
20200819.2
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.20411.1 -> To Version 1.0.0-prerelease.20419.2
* Update dependencies from https://github.com/dotnet/runtime-assets build
20200820.1
System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Security.Cryptography.X509Certificates.TestData , System.Windows.Extensions.TestData
From Version 5.0.0-beta.20377.1 -> To Version 5.0.0-beta.20420.1
* Update dependencies from https://github.com/mono/linker build
20200820.2
Microsoft.NET.ILLink.Tasks
From Version 5.0.0-preview.3.20413.1 -> To Version 6.0.0-alpha.1.20420.2
* Update dependencies from https://github.com/dotnet/arcade build
20200819.21
Microsoft.DotNet.GenFacades , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
From Version 5.0.0-beta.20417.5 -> To Version 5.0.0-beta.20419.21
* Update dependencies from https://github.com/microsoft/vstest build
20200821-01
Microsoft.NET.Test.Sdk
From Version 16.8.0-preview-
20200730-03 -> To Version 16.8.0-preview-
20200821-01
* Update dependencies from https://github.com/dotnet/xharness build
20200820.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.20411.1 -> To Version 1.0.0-prerelease.20420.1
* Pin compilers version
* Add dotnet6 feed to NuGet.config
* Update dependencies from https://github.com/mono/linker build
20200822.1
Microsoft.NET.ILLink.Tasks
From Version 5.0.0-preview.3.20413.1 -> To Version 6.0.0-alpha.1.20422.1
* Update dependencies from https://github.com/dotnet/arcade build
20200819.21
Microsoft.DotNet.GenFacades , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat
From Version 5.0.0-beta.20417.5 -> To Version 5.0.0-beta.20419.21
* Update dependencies from https://github.com/microsoft/vstest build
20200821-04
Microsoft.NET.Test.Sdk
From Version 16.8.0-preview-
20200730-03 -> To Version 16.8.0-release-
20200821-04
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
Jan Kotas [Sun, 23 Aug 2020 16:01:51 +0000 (09:01 -0700)]
Use nint instead of IntPtr in generic SpanHelpers (#41199)