monojenkins [Mon, 20 Apr 2020 16:55:49 +0000 (12:55 -0400)]
[wasm][debugger] Implement `Runtime.callFunctionOn`, and support array expansion (#35156)
- This was prompted by vscode/vs requiring this for array expansion.
- It runs a given js function string, on a given object id.
- We handle the case for dotnet object ids.
Implementation:
- We build a proxy object that reflects the details of the real dotnet object/array
- And run the js function on that proxy object
- Then if `returnByValue` was requested, the result is returned as-is
- Else we cache that object, with a new special object id (`dotnet:cfo_res:..`),
and return that id in the response.
- Subsequently, we would get `Runtime.getProperties` request on this new object id
- And a `Runtime.releaseObject` request, to free that function result.
- All this is handled currently
Tests:
- A few tests were added which invoke `callFunctionOn`, on JS objects, and checks the result
- And the same checks are performed on equivalent dotnet objects, with the same js function
- This should help stay in sync with what we think `callFunctionOn` should work as
- These tests have an additional parameter - `roundtrip`, which calls a simple function
`function () { return this; }`
.. on a dotnet object, and gets the result object id. If `roundtrip == true`, then it
runs that same function on the result object, and gets a new result object id. And the
tests run their checks on that.
- this helps to check that outside of the proxy, the result object behaves same as any
other dotnet object.
- Also, most of the tests were modified to support an additional mode (`use_cfo`).
- With this, whenever a test wants to run `Runtime.getProperties on an object, we pass that
object through the earlier "identity" function, and then run `getProperties` on that
resultant object.
- This helps to take advantage most of the existing tests, and use them for `callFunctionOn`
testing too, by ensuring that the results of CFO returns results same as any other object.
Fixes mono/mono#19229, mono/mono#19531
Co-authored-by: radical <radical@users.noreply.github.com>
John Salem [Mon, 20 Apr 2020 16:12:21 +0000 (09:12 -0700)]
Add Reverse Diagnostics Server (#33307)
* Add Advertise IPC Command
* Update diagnostics server to use both reverse and traditional modes
* Change DOTNET_DiagnosticsServerAddress to DOTNET_DiagnosticsMonitorAddress and only use for reverse connection
* Add IpcStreamFactory abstraction
* IpcStreamFactory::Poll is now more similar to the poll API from Linux
* IpcPollHandle struct is used to abstract listening for client and server connections
* use overlapped io for all io on windows
* Add ConnectionState abstraction
* Implement timeout read/write
Swaroop Sridhar [Mon, 20 Apr 2020 15:29:38 +0000 (08:29 -0700)]
Single-File Bundler: Add a FileSize test (#35149)
Add a bundler consistency tests that verifies that the size of each embedded file
(recorded in the bundle manifest) matches its original size of the file on disk.
monojenkins [Mon, 20 Apr 2020 14:39:32 +0000 (10:39 -0400)]
Add ability to turn on just the portable executable verifier. (#35102)
Helps fix issue: https://issuetracker.unity3d.com/issues/unity-crashes-when-opening-the-project
We were hitting a crash were a corrupted dll would get loaded and then hit an assert later on when something tried to use it. The verifier suite would correctly identify the dll as corrupt but it was impossible to turn on just the PE verification. I've added a new PE only mode above "off" to allow for just the PE verifier to be used instead of the larger verification suite.
Co-authored-by: UnityAlex <UnityAlex@users.noreply.github.com>
Alexander Nikolaev [Mon, 20 Apr 2020 13:32:54 +0000 (15:32 +0200)]
Http2LoopbackConnection properly handles stream termination (#35100)
PR adds an optional stream termination handling to `Http2LoopbackConnection.ReadBodyAsync` and fixes `HttpClient` construction missing the `SocketHttpHandler` created in the test.
Fixes #31220
Ryan Lucia [Mon, 20 Apr 2020 11:55:53 +0000 (07:55 -0400)]
Add Mono-specific check for uninitialized default ALC on Resolving event (#35192)
Unlike the other resolvers, this one *can* exist on the default ALC, so we have to add the null check like in GetAssemblyLoadContext.
Move the now-unused ResolveUsingResolvingEvent method back to the CoreCLR-specific file.
Vladimir Sadov [Mon, 20 Apr 2020 02:49:14 +0000 (19:49 -0700)]
CastTable perf tweaks. (#34427)
* No null check in Get.
* bypass AuxData
monojenkins [Sun, 19 Apr 2020 23:34:08 +0000 (19:34 -0400)]
[mono] Fix multidimensional array construction when using programmer-specified lower bounds. (#35091)
* [mono] Fix multidimensional array construction when using programmer-specified lower bounds.
mono_array_full_new_checked and mono_array_full_new (which is marked as
a MONO_API function) both take two pointers to buffers containing
lengths and lower bounds. mono_array_new_n_icall can split the incoming
parameter list in two before forwarding the results to
mono_array_full_new_checked, so mono_array_full_new_checked was
receiving two buffers containing interleaved lower bounds and lengths.
ECMA-335 states that array constructors that specify both lower bounds
and lengths interleave these values. Deinterleave these
in method_to_ir.
Add some tests to iltests.il that verify that multidimensional arrays
with custom lower bounds work.
Fixes https://github.com/dotnet/runtime/issues/34377.
Fixes https://github.com/dotnet/runtime/issues/34378.
Fixes https://github.com/dotnet/runtime/issues/34381.
* Deinterleave lower bounds and array lengths in the interpreter.
Also make the condition in which the deinterleaving code path is taken
more precise. Perhaps this branch should be marked as unlikely.
* Fix a typo.
Co-authored-by: imhameed <imhameed@users.noreply.github.com>
nietras [Sun, 19 Apr 2020 21:23:26 +0000 (23:23 +0200)]
Update shared-generics.md to use `Method<>` instead of `Func<>` (#35181)
To avoid confusion with `Func<>` delegate and object. At least to me it create a bit of unnecessary confusion. Whether this should be `Method` or just `F` can be discussed. However, `Method` makes it clear the discussion is about a generic **method** instantiation.
Anirudh Agnihotry [Sun, 19 Apr 2020 17:09:42 +0000 (10:09 -0700)]
fixing building of projects in VS (#35146)
Andrew Au [Sun, 19 Apr 2020 17:03:57 +0000 (10:03 -0700)]
Make MappingType more usable (#35168)
Ryan Lucia [Sun, 19 Apr 2020 08:13:57 +0000 (04:13 -0400)]
[meta] Mono ALC embedding primer (#34601)
* [meta] Expose managed ALC fields to the runtime
* [meta] Add mono_assembly_load_full_alc to unstable
* [loader] Add preload hook V3 for netcore embedding API
* [loader] Add append parameter to preload hook V3 installation
* [meta] Fix ALC usage to be netcore-only
* Move Sequential attribute to Mono ALC declaration
* Feedback
Tomas Weinfurt [Sat, 18 Apr 2020 19:42:54 +0000 (12:42 -0700)]
fix ping on OSX when running as root (#35070)
* fix ping on OSX when running as root
* feedback from review
* limit disabling DualMode to OSX
* fix osx
Co-authored-by: Tomas Weinfurt <furt@Shining.local>
Tomas Weinfurt [Sat, 18 Apr 2020 18:50:00 +0000 (11:50 -0700)]
add FreeBSD build (#34521)
* try to add FreeBSD to the build
* s/FreeBSD/FReeBSD_x64
* more fixes to pass -os FreeBSD
* add missing :
* more fixes and feedback from review
* pull in new container
* fix corelib-nativecorelib-tools-packages as well
* add crossrootfsDir
* pass crossrootfsDir
* fix installr
* fix compilation on freebsd
* fix test build on freebsd
* update to match new layout
* fix native tests
* CrossBuild?
* rootfsDir debug
* merge with linux to get container support
* fix proc_maps
* fix up buildCommandSourcesDirectory
* remove debug
* more fixup for buildCommandSourcesDirectory
* use TargetOS instead of os
* remove old section
* rever changes to get_loaded_library_from_proc_maps
* fix compilation with missing getline
* add official build
* use arch
* remove special pool for freebsd
* roll-back runtime-official.yml
Co-authored-by: Tomas Weinfurt <furt@Shining.local>
Co-authored-by: Tomas Weinfurt <furt@tocherni-t490s.middleeast.corp.microsoft.com>
imhameed [Sat, 18 Apr 2020 18:08:20 +0000 (11:08 -0700)]
Enable JIT/Regression/JitBlue/DevDiv_578214/DevDiv_578214 for mono. (#35120)
dotnet-maestro[bot] [Sat, 18 Apr 2020 17:45:12 +0000 (19:45 +0200)]
Update dependencies from https://github.com/microsoft/vstest build
20200416-02 (#35155)
- Microsoft.NET.Test.Sdk: 16.7.0-preview-
20200408-06 -> 16.7.0-preview-
20200416-02
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Andrew Au [Sat, 18 Apr 2020 17:21:27 +0000 (10:21 -0700)]
Make GCToEEInterface::Get*ConfigValue check the runtimeconfig.json (#34797)
Carlos Sanchez Lopez [Sat, 18 Apr 2020 08:03:10 +0000 (01:03 -0700)]
Enclose paths with quotes in testPackages.proj (#34791)
* Enclose paths with quotes in testPackages.proj
Viktor Hofer [Sat, 18 Apr 2020 08:01:50 +0000 (10:01 +0200)]
Remove verbose test output logging (#35104)
Fixes https://github.com/dotnet/runtime/issues/33926.
As we ContinueOnError and error by reading from the ExitCode property we can set IgnoreExitCode in the msbuild Exec invocation to avoid the following verbose output: `error MSB4132: The "Exec" task returned false but did not log an error.`
Steve Pfister [Sat, 18 Apr 2020 07:48:30 +0000 (03:48 -0400)]
Fixes nits identified in https://github.com/dotnet/runtime/pull/34980 (#35121)
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Tanner Gooding [Sat, 18 Apr 2020 04:39:17 +0000 (21:39 -0700)]
Fixing several of the Sse/Sse2.Compare* intrinsics to account for NaN inputs (#34204)
* Adding a regression test to validate the Sse.CompareGreaterThan and related behaviors
* Fixing several of the Sse/Sse2.Compare* intrinsics to account for NaN inputs
* Applying format patch
* Switch to using compOpportunisticallyDependsOn
* Use the named intrinsic comparison macros rather than magic numbers
* Applying formatting patch
* Define the _CMP hwintrinsic macros since they aren't available by default on Unix
* Simplifying the special importation logic for Sse/Sse2 compare GreaterThan functions
* Applying formatting patch
* Add a comment explaining the naming of the _CMP_* macros used by the x86 HWIntrinsics
* Switch to mirroring the FloatComparisonMode enum rather than using the _CMP_* macros
* Apply formatting patch
* Don't use XML style doc comments for the FloatComparisonMode mirror on the C++ side
* Ensure the base type is set before it is checked
* Applying formatting patch
mrj001 [Sat, 18 Apr 2020 03:55:36 +0000 (21:55 -0600)]
Remove erroneous curlies in Xml resource (#33890)
* Added test for Issue 30218, use of resource Sch_MinLengthGtBaseMinLength
* Reworded error message to remove the invalid formatters.
Issue #30218
* Updated check of message from the exception to be more amenable to potential internationalization.
* Reworded resource Sch_MaxLengthGtBaseMaxLength and added unit test for same.
* Simplified test code per feedback from Dan Moseley, PR#33890.
* Tests to increase code coverage. The ones that are failing trigger resource string Sch_MaxMinLengthBaseLength to be used as the Exception message.
* Removed invalid formatters from the resource string Sch_MaxMinLengthBaseLength. Failing tests from the previous commit now pass.
* Added test for the Exception using string resource Sch_LengthGtBaseLength as its message. This covers a source line and branch not previously covered. This test fails due to the invalid formatters.
* Reworded string resource Sch_LengthGtBaseLength to remove the invalid formatters.
* Added unit tests for uses of string resource Sch_FacetBaseFixed.
* Made test for the message containing "fixed" more specific.
* Reworded string resource Sch_FacetBaseFixed to remove the invalid formatter.
* Added unit test to cover usage of string resource Sch_InvalidAllMax. A second usage of this string resource is not covered as it is in a class marked Obsolete.
* Reworded string resource Sch_InvalidAllMax to remove the invalid formatter.
* Added unit test for String Resource Sch_InvalidAllElementMax - invalid formatter.
* Reworded string resource Sch_InvalidAllElementMax to remove the invalid formatter.
* Added unit test which causes an XmlSchemaException using string resource Sch_InvalidExemplar as its message.
* Reworded Sch_InvalidExemplar to remove the invalid formatter. Also, added the name of the element which cannot be used as the substitution group affiliation.
* Added unit test that causes an XmlSchemaException to be thrown using string resource Sch_GroupBaseRestNotEmptiable as its message.
* Removed the curly braces so there are no longer any invalid formatters.
* Added unit tests that cause an XmlSchemaException to be thrown using string resource Sch_AllRefMinMax as its message.
* Changed string resource Sch_AllRefMinMax to remove the invalid formatters.
* reworded Sch_MinLengthGtBaseMinLength and Sch_MaxLengthGtBaseMaxLength similarly to Sch_LengthGtBaseLength
* Corrected error "greater than" to "less than".
* Changed name of test to more accurately reflect its purpose.
* Changed casing of MinLength and MaxLength to match their XML facets. Removed redundant ToLower call and comment.
* Removed all Regex used to find invalid formatters.
* renamed MaxMinLengthBaseLength_TestData to indicate that this is testing the successful case.
* Removed suppression of exception so that we will see the exception if one is thrown.
* Removed comments as there are issues tracking these.
* Fixed comment larger -> lower.
* Removed XML comments on test methods.
* Removal of XML comment that was missed.
Aaron Robinson [Sat, 18 Apr 2020 03:50:39 +0000 (20:50 -0700)]
Fix all runtime IL generation paths from passing GC types to unmanaged function calls. (#35026)
* Native COM clients have not been running since we switched over to SDK projects.
* Stop IL generators from passing GC types to unmanaged function calls.
Update crossgen2 IL stub generators.
Update Dynamic runtime stub generator.
Add assert for GC types in unmanaged function calls.
Tomáš Rylek [Sat, 18 Apr 2020 03:37:54 +0000 (05:37 +0200)]
Rename ReadyToRun.SuperIlc to just R2RTest to save typing (#35110)
* Rename ReadyToRun.SuperIlc to just R2RTest to save typing
* Apply the SuperIlc -> R2RTest rename to crossgen determinism test
Jan Vorlicek [Sat, 18 Apr 2020 03:34:37 +0000 (05:34 +0200)]
Fix collectible AssemblyLoadContext shutdown race (#35131)
When the last reference to a collectible AssemblyLoadContext goes away,
its finalizer is called on the finalizer thread. It ends up calling the
native CLRPrivBinderAssemblyLoadContext::PrepareForLoadContextRelease
method which replaces a long weak GC handle to the managed
AssemblyLoadContext stored in the CLRPrivBinderAssemblyLoadContext by a
strong GC handle to the same AssemblyLoadContext and closes the original
weak handle.
The problem is that another thread may have read the weak handle pointer
and then try to use it to call into the resolving methods on the managed
AssemblyLoadContext. If that thread tries to resolve the related handle
after the finalizer thread has closed it, it fails as the handle doesn't
exist anymore. It could even get a completely different object if the
handle got reused in between. Or even worse, if the handle got reused by
another AssemblyLoadContext, the handle would resolve, but to the
different AssemblyLoadContext.
This change fixes the problem by keeping the weak handle open and
closing it after the AssemblyLoadContext shutdown completes (there are
no more assemblies that were loaded into that context and no instances
of types from those assemblies). The strong handle now serves only to
keep the managed AssemblyLoadContext alive.
Jan Kotas [Sat, 18 Apr 2020 01:21:57 +0000 (18:21 -0700)]
Spanize interop in System.Net.NetworkInformation (#35098)
Faster and safer
Kevin Jones [Fri, 17 Apr 2020 23:44:45 +0000 (19:44 -0400)]
Use ReadOnlySpan<byte> instead of byte arrays in CAPI helpers (#35125)
monojenkins [Fri, 17 Apr 2020 20:16:08 +0000 (16:16 -0400)]
[wasm][debugger] Show pointer type+address (#34934)
Co-authored-by: radical <radical@users.noreply.github.com>
David Mason [Fri, 17 Apr 2020 20:00:39 +0000 (13:00 -0700)]
profiler tests depend on jit events (#34919)
* profiler tests depend on jit events so disable R2R images via profiler eventmask
* fix RequestReJITWithInliners for R2R modules
* Update tests to work correctly when crossgenned
* fix issue where test was treating an HRESULT as a FunctionID
* fix alpine failures. you can dlopen a relative path in glib, but apparently with musl you have to have the full path. So look at /proc/self/maps to find the full path to the loaded coreclr
* re-enable profiler tests now that they are passing
* Code review feedback
* Update rejit.cpp
Steve MacLean [Fri, 17 Apr 2020 19:58:26 +0000 (15:58 -0400)]
Enable cross OS DBI build (#35021)
* Enable cross OS DBI build
* Fix .gitignore
* Fix Cross OS DBI compilation issues
* Review feedback
* Cleanup dummy/twowaypipe.cpp
Marek Safar [Fri, 17 Apr 2020 19:33:49 +0000 (21:33 +0200)]
Add wasm for browser RID (#34940)
Jan Kotas [Fri, 17 Apr 2020 18:37:32 +0000 (11:37 -0700)]
Disable IPGlobalProperties_TcpActiveConnections_Succeed test on Mono/Windows (#35113)
Fixes #35111
Viktor Hofer [Fri, 17 Apr 2020 18:00:49 +0000 (20:00 +0200)]
Update VS minimum dependency (#35114)
With the net5.0 TFM change and the nuget static graph restore, we require VS >= 16.6 Preview2.
Steve Pfister [Fri, 17 Apr 2020 17:46:30 +0000 (13:46 -0400)]
Adds support for generating Mono named NETCore.App Runtime Packs (#34980)
Starting with osx, we will produce a uniquely named runtime pack with Mono. The intent is to give the sdk an easier way to identify the mono runtime.
We will now publish Microsoft.NETCore.App.Mono.Runtime.<rid>.nupg
Brooke Philpott [Fri, 17 Apr 2020 17:00:58 +0000 (13:00 -0400)]
Throw DirectoryNotFoundException on Image.Save with bad directory (#34998)
* Provide better exception when saving to non-existent directory
When saving an image to a non-existent directory, throw a DirectoryNotFoundException
vs a System.Runtime.InteropServices.ExternalException.
Fix #31367
* Change exception message to be more intuitive
Use: The directory {0} of the filename {1} does not exist.
instead of: The target directory {0} of the targetPath {1} does not exist.
Fix #31367
* Fix test on unix by using built path.
We were using a hardcoded path with backslashes. That didn't match the built path for the Assert.
* Make Test conditional as it requires GDI+
* Put directory check closer to where it's used to ensure that we
capture it from all Save variations.
* Remove trailing whitespace
* Update test to ensure it doesn't run on the .NET Framework
* Change CheckIfDirectoryExists to ThrowIfDirectoryDoesntExist
to match naming conventions for throw-style methods.
Fix #31367
* Fixes typo in test name
Fix #31367
Manish Godse [Fri, 17 Apr 2020 16:11:41 +0000 (09:11 -0700)]
Fix assert while logging typeload failures (#34985)
* Fix assert while logging typeload failures
* Update src/coreclr/src/vm/clsload.cpp
keeping getTypeToken for `ELEMENT_TYPE_CLASS`
Co-Authored-By: Simon Nattress <nattress@gmail.com>
Co-authored-by: Simon Nattress <nattress@gmail.com>
Alexander Nikolaev [Fri, 17 Apr 2020 15:30:15 +0000 (17:30 +0200)]
Set fetch depth to 5 for stress tests on NanoServer (#35109)
Increases git fetch depth for Windows NanoServer to avoid checkout failures
Fixes #33428
Joseph Musser [Fri, 17 Apr 2020 15:26:55 +0000 (11:26 -0400)]
Move and lint ECMA-335 Augments spec (#35095)
* Move specs and rename Ecma-335-Issues.md
* Fix typos
* MD009/no-trailing-spaces
* MD012/no-multiple-blanks
* MD007/ul-indent
* MD031/blanks-around-fences
* MD032/blanks-around-lists
* MD040/fenced-code-language
* MD030/list-marker-space
* Simplify markdown code span syntax
* Update title and intro
* Fix broken markdown code span
* Link addendum doc from dotnet-standards.md
Simon Nattress [Fri, 17 Apr 2020 15:24:11 +0000 (08:24 -0700)]
Remove IReadyToRunMethodCodeNode interface (#35085)
`IReadyToRunMethodCodeNode` was useful in the CoreRT repo where we had multiple kinds of method code nodes and needed a common way of setting related method data from the JIT. It's not useful in crossgen2 since we only have `MethodWithGCInfo` representing code nodes.
Sam Patel [Fri, 17 Apr 2020 15:21:47 +0000 (11:21 -0400)]
Minor changes - Update specific words in mono code base to be PoliCheck/TSA compliant (#35053)
* Updating some comments to align with PoliCheck rules
* one additional change
* Update src/mono/mono/mini/mini-wasm-debugger.c based on pr suggestion
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Update w32process-unix.c based on PR suggestion
Co-authored-by: Stephen Toub <stoub@microsoft.com>
mrj001 [Fri, 17 Apr 2020 14:45:54 +0000 (08:45 -0600)]
updated output folder from 'aforementioned' to the folder where the single library output is found. (#34340)
Anirudh Agnihotry [Fri, 17 Apr 2020 14:23:03 +0000 (07:23 -0700)]
fix runntinf tests with targetFramework property and -f flag (#35016)
Carol Eidt [Fri, 17 Apr 2020 13:55:53 +0000 (06:55 -0700)]
Add IR support for multireg lclVars & intrinsics (#34822)
* Add IR support for multireg lclVars & intrinsics
* PR Feedback
Egor Bogatov [Fri, 17 Apr 2020 12:55:41 +0000 (15:55 +0300)]
[mono] iOS Test runner (#34976)
Eric Erhardt [Fri, 17 Apr 2020 12:23:26 +0000 (07:23 -0500)]
Update Microsoft.NET.HostModel to reference System.Text.Json 5.0 (#35024)
Microsoft.Extensions.DependencyModel and Microsoft.NET.HostModel are both used on .NET Framework's MSBuild by dotnet/sdk's Microsoft.NET.Build.Tasks assembly. However, they are referencing differnet versions of System.Text.Json, which is causing file load errors on .NET Framework.
Fixing this by updating Microsoft.NET.HostModel to use a 5.0 version.
Fix #35006
Alexander Nikolaev [Fri, 17 Apr 2020 11:52:09 +0000 (13:52 +0200)]
Resetting _waitForCompletion to null was removed from DuplexContent (#35010)
`_waitForCompletion` gets reset to null in `DuplexContent.Complete` and `Fail` which leads to race condition with `SerializeToStreamAsync`. This reset seems redundant since `_waitForCompletion` is always unconditionally initialized on each call to `SerializeToStreamAsync`. This PR removes that reset logic.
Fixes #33141
Jan Vorlicek [Fri, 17 Apr 2020 10:53:16 +0000 (12:53 +0200)]
Merge pull request #35058 from janvorli/fix-vsd-stub-nullref-handling
Fix VSD stub null reference handling on amd64
monojenkins [Fri, 17 Apr 2020 09:41:02 +0000 (05:41 -0400)]
[aot] Fix the support for separate aot data files. Reorder the MONO_AOT_TABLE constants so they match the ordering in MonoAotFileInfo. (#35064)
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
Sergey Andreenko [Fri, 17 Apr 2020 08:37:52 +0000 (01:37 -0700)]
Fix an incorrect CSE case with struct retyping. (#34676)
* Fix old printing issues.
* add a repro test that doesn't require crossgen2.
* Check that all `ADDR` sources are marked as DONT_CSE.
* Fix text(no size) diffs found by SPMI.
* Add a question/comment.
* Update src/coreclr/src/jit/compiler.hpp
Co-Authored-By: Eugene Rozenfeld <erozen@microsoft.com>
* Delete an optimization that was not proved to be correct.
* Delete useless code.
* Revert "Fix text(no size) diffs found by SPMI."
This reverts commit
cd24383210b9ed22f7ea3640005217021f9fbd63.
Tomáš Rylek [Fri, 17 Apr 2020 06:50:40 +0000 (08:50 +0200)]
Fix for PInvoke behavior in composite mode (#35027)
Thanks to Fadi's help I finally identified the root problem with
Crossgen2 PInvokes in composite mode: we weren't setting the
READYTORUN_FLAG_NONSHARED_PINVOKE_STUBS flag on the component
assembly R2R headers and that's what the runtime is looking at.
I believe it's both easier and more general to fix this in the compiler
as it comes for free whereas redirecting the runtime to always look
at the composite header would requite at least an additional
indirection. Also we could theoretically use different settings for
different component assemblies even though my impression from Fadi's
detailed explanation was that we basically always want to use
non-shared PInvokes in Crossgen2.
Thanks
Tomas
David Mason [Fri, 17 Apr 2020 06:47:40 +0000 (23:47 -0700)]
Update rejit.cpp
David Mason [Thu, 16 Apr 2020 07:07:24 +0000 (00:07 -0700)]
Code review feedback
David Mason [Wed, 15 Apr 2020 23:04:40 +0000 (16:04 -0700)]
re-enable profiler tests now that they are passing
David Mason [Wed, 15 Apr 2020 22:52:14 +0000 (15:52 -0700)]
fix alpine failures. you can dlopen a relative path in glib, but apparently with musl you have to have the full path. So look at /proc/self/maps to find the full path to the loaded coreclr
David Mason [Wed, 15 Apr 2020 09:30:04 +0000 (02:30 -0700)]
fix issue where test was treating an HRESULT as a FunctionID
David Mason [Wed, 15 Apr 2020 03:03:17 +0000 (20:03 -0700)]
Update tests to work correctly when crossgenned
David Mason [Wed, 15 Apr 2020 00:30:28 +0000 (17:30 -0700)]
fix RequestReJITWithInliners for R2R modules
David Mason [Sat, 11 Apr 2020 07:32:47 +0000 (00:32 -0700)]
profiler tests depend on jit events so disable R2R images via profiler eventmask
Tomas Weinfurt [Fri, 17 Apr 2020 04:50:14 +0000 (21:50 -0700)]
fix endless loop in GetActiveUdpListeners (#35078)
Larry Ewing [Fri, 17 Apr 2020 03:39:10 +0000 (22:39 -0500)]
Merge pull request #34933 from monojenkins/sync-pr-19535-from-mono
[wasm][debugger] Show signature for delegate, or target, if available…
David Cantu [Fri, 17 Apr 2020 02:59:13 +0000 (19:59 -0700)]
Fix Http.Json serialization performance by using static options (#35040)
Elinor Fung [Fri, 17 Apr 2020 02:20:27 +0000 (19:20 -0700)]
Get the IUnknown identity of COM instance for global ComWrappers (#35032)
Andy Ayers [Thu, 16 Apr 2020 22:39:20 +0000 (15:39 -0700)]
JIT: fix recursive inline checking (#35020)
We were not setting `m_Code` in the root inline context, and so were
sometimes allowing one level of recursive inlining.
Vlad Brezae [Thu, 16 Apr 2020 22:38:34 +0000 (01:38 +0300)]
[jit] Add support for fconv.ovf.*.un opcodes (#34949)
* [jit] Handle fconv_ovf_un opcodes
We handle them the same way as non _un versions, by doing a float to int64 conversion followed by a simple integer conversion to the final size.
* [jit] Remove no longer needed emulation
We no longer need to emulate fconv_ovf_u8_un and rconv_ovf_u8_un since we reuse the mechanism for non _un versions (which uses just the emulation for fconv_ovf_u8 and rconv_ovf_u8)
Partly reverts https://github.com/mono/mono/commit/
de5dca22649ae581085863b0935f94eff4483e55.
* Enable some mono tests
* [jit] Properly handle conv.r.un applied to r4
Fixes src/coreclr/tests/src/JIT/Regression/VS-ia64-JIT/V2.0-Beta2/b309576/bug2.il which was silently failing before
Carol Eidt [Thu, 16 Apr 2020 21:54:37 +0000 (14:54 -0700)]
PR Feedback
Stephen Toub [Thu, 16 Apr 2020 21:42:44 +0000 (17:42 -0400)]
Allow known values for HttpHeaderType.Custom in KnownHeaders (#35003)
Larry Ewing [Thu, 16 Apr 2020 20:55:45 +0000 (15:55 -0500)]
Add OSPlatform.Browser and Architecture.Wasm (#34781)
radical [Thu, 16 Apr 2020 19:37:50 +0000 (19:37 +0000)]
[wasm][debugger] Show signature for delegate, or target, if available…
… (#19505)
* [wasm][debugger] Show signature for delegate, or target, if available
- As object properties, we return a `Target` which has the signature of
the delegate target.
Fixes https://github.com/mono/mono/issues/19382
* [wasm][debugger] Some tidying up
* [wasm][debugger] Remove unused `sig_desc`
* [wasm][debugger] Simplify code, avoid extra allocations
.. as suggested by @lewing
(cherry picked from commit
4eca12e794764da1a0646e77af5b8c60a2e2767a)
Jan Vorlicek [Thu, 16 Apr 2020 19:26:30 +0000 (21:26 +0200)]
Remove explicit null check for VSD from JIT for 64 bit targets
Jan Vorlicek [Thu, 16 Apr 2020 19:16:56 +0000 (21:16 +0200)]
Fix missing semicolon
Zoltan Varga [Thu, 16 Apr 2020 16:32:32 +0000 (12:32 -0400)]
Make the -Wsometimes-uninitialized into an error. (#34965)
Jan Vorlicek [Thu, 16 Apr 2020 15:56:05 +0000 (17:56 +0200)]
Fix swapped Unix and Windows instruction codes
monojenkins [Thu, 16 Apr 2020 15:53:08 +0000 (11:53 -0400)]
[wasm][debugger] Fix typo and silence output (#35041)
Co-authored-by: lewing <lewing@users.noreply.github.com>
monojenkins [Thu, 16 Apr 2020 13:17:12 +0000 (09:17 -0400)]
[debugger] Remove assert when the DebuggerTypeProxy cannot be instantiated (#34966)
Remove the assert because we don't need to stop the debug if we cannot create the object when calling the constructor using invoke_method, if it's a DebuggerTypeProxy, we are not able to show the value of the DebuggerTypeProxy, but we still can show the Raw View, if it's not the case of DebuggerTypeProxy, we just cannot evaluate this expression, but we can continue the debug session.
Fix mono/mono#19492
Co-authored-by: thaystg <thaystg@users.noreply.github.com>
Mitchell Hwang [Thu, 16 Apr 2020 12:49:20 +0000 (08:49 -0400)]
Creating a runtime pack artifacts directory in the libraries build (#34662)
This change populates a runtime pack directory structure in artifcats/bin. This is so that we can support running libraries tests for iOS and Android.
Jan Vorlicek [Thu, 16 Apr 2020 09:39:44 +0000 (11:39 +0200)]
Add regression test
Jan Vorlicek [Thu, 16 Apr 2020 09:09:37 +0000 (11:09 +0200)]
Remove double lookups for virtual stubs
Jan Vorlicek [Thu, 16 Apr 2020 09:03:42 +0000 (11:03 +0200)]
Make the ajdustment unconditional for all architectures
Jan Vorlicek [Thu, 16 Apr 2020 08:53:48 +0000 (10:53 +0200)]
Fix null reference handling in VSD stubs on amd64
When null "this" pointer is passed to the VSD dispatch and resolve
stubs on amd64, it is not converted to NullReferenceException and it
generates AccessViolationException instead, tearing down the process.
This happens due to the fact that AdjustContextForVirtualStub always
returns FALSE on amd64. It behaves correctly on ARM, x86 and ARM64.
This issue has been present at least since .NET Framework 4.5.
This change fixes it by implementing the AdjustContextForVirtualStub for
amd64 too. I've also found that we were doing this adjustment for ARM
and x86 only at some places while ARM64 needs it too. So I've made it
unconditional for all architectures at all places.
Tomas Weinfurt [Thu, 16 Apr 2020 04:54:01 +0000 (21:54 -0700)]
improve TLS perf on macOS (#32338)
* improve TLS perf on macOS
* feedback from review
* feedback from review
* remove unnecesary locking
Co-authored-by: Tomas Weinfurt <furt@Shining.local>
Juan Hoyos [Thu, 16 Apr 2020 03:03:45 +0000 (20:03 -0700)]
Prevent 'in' folder from being created in output directory (#34979)
Kevin Jones [Thu, 16 Apr 2020 02:43:53 +0000 (22:43 -0400)]
Additional nullable annotation on IPAddress (#34698)
* Additional nullable annotation on IPAddress.
* TryParse for System.Net.Http
* TryParse for System.Runtime.Numerics
* CoreLib TryParse nullable annotations
* Update Runtime reference source.
* NotNullWhen for Guid format.
* NotNullWhen for DateTime{Offset} format parameters
* Correct format parameter nullability for TimeSpan.
* Update reference source.
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Jo Shields [Wed, 15 Apr 2020 22:29:31 +0000 (18:29 -0400)]
Pass $(officialBuildIdArg) during build phase of Mono (Closes: #34993) (#35002)
Alexander Köplinger [Wed, 15 Apr 2020 22:02:09 +0000 (00:02 +0200)]
mono.proj: use --build-id=sha1 (#34939)
To mirror what the coreclr/libraries builds are using
Stephen Toub [Wed, 15 Apr 2020 20:52:22 +0000 (16:52 -0400)]
Remove unnecessary MemoryStream allocation from ByteArrayContent (#35005)
Constructing a ByteArrayContent (or anything that derives from it, like StringContent) or a ReadOnlyMemoryContent proactively allocates a MemoryStream that it stores as the _bufferedContent on the base HttpContent. But the 99.99% use case for ByteArrayContent is as a request payload, and this _bufferedContent isn't used for that. The only time this would be used is if a developer created a ByteArrayContent and then explicitly got the stream from it, e.g. via GetStreamAsync, in which case we're no worse off by doing the creation lazily. This PR just deletes the unnecessary code / allocation.
Carol Eidt [Fri, 10 Apr 2020 01:22:29 +0000 (18:22 -0700)]
Add IR support for multireg lclVars & intrinsics
Carol Eidt [Wed, 15 Apr 2020 20:02:20 +0000 (13:02 -0700)]
Fix some flag uses (#34969)
* Fix some flag uses
Tomáš Rylek [Wed, 15 Apr 2020 19:39:33 +0000 (21:39 +0200)]
Script changes enabling composite R2R build with shared framework (#34661)
Jason Pugsley [Wed, 15 Apr 2020 17:27:14 +0000 (03:27 +1000)]
Add FreeBSD-specific SONAME versions to portable OpenSSL probing.
The version of OpenSSL installed will depend on the version of FreeBSD and
whether OpenSSL has been updated from the FreeBSD Ports collection.
The order of attempted loading is:
libssl.so.11 (ports)
libssl.so.111 (base FreeBSD using OpenSSL 1.1.1)
libssl.so.8 (base FreeBSD using OpenSSL 1.0.2)
Alexander Nikolaev [Wed, 15 Apr 2020 17:16:45 +0000 (19:16 +0200)]
Close timeout increased to 20 seconds (#34999)
CloseOutputAsync_Cancel_Success tests are failing due to 2 reasons:
1. `Assert` expecting the state to be `Aborted`, finds it's `Open` - most frequent
2. Connection gets forcibly terminated on a connect attempt
However, the second failure type is not specific to this test because it affects many tests in different types during the same time. Thus, it seems to be an infra issue.
This PR fixes only the first failure type by increasing Close operation timeout.
Fixes #1725
Stephen Toub [Wed, 15 Apr 2020 17:13:37 +0000 (13:13 -0400)]
Simplify KnownHeaders lookup in SocketsHttpHandler (#34974)
* Simplify KnownHeaders lookup
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/KnownHeaders.cs
Co-Authored-By: David Shulman <david.shulman@microsoft.com>
Co-authored-by: David Shulman <david.shulman@microsoft.com>
monojenkins [Wed, 15 Apr 2020 16:09:03 +0000 (12:09 -0400)]
[metadata] Identify when a field is overlapped by a non-object field (#34745)
- Fix class loader to identify when the class has a field overlapped by a non-object field.
- Fix method-to-ir to forward the TypeLoad error.
- Fix transform to forward the TypeLoad error.
- Fix unit test that has a class with a field that is overlapped by a non-object field.
Fixes https://github.com/dotnet/runtime/issues/34388
Co-authored-by: thaystg <thaystg@users.noreply.github.com>
Andrew Au [Wed, 15 Apr 2020 16:00:28 +0000 (09:00 -0700)]
Fix Span length in TryFormatUInt64Slow (#34840)
* Make the Span length right
* Adding a regression test for the span problem
* Avoid dependency on machine locale
* Using customFormat
Marcus Turewicz [Wed, 15 Apr 2020 13:41:07 +0000 (23:41 +1000)]
Adds AssertContentsAgainstJsonNet to avoid unnecessary calls (#34931)
* Adds AssertContentsAgainstJsonNet to avoid unnecessary calls
Fixes #32351
* Remove temporary hack comments
Omair Majid [Wed, 15 Apr 2020 12:23:20 +0000 (08:23 -0400)]
Fix pal_io.c code based on code review suggestions (#34970)
These suggestions were provided by @lpereira on
https://github.com/dotnet/corefx/pull/42900
Marek Safar [Wed, 15 Apr 2020 12:20:46 +0000 (14:20 +0200)]
Fix section reference (#34992)
Zoltan Varga [Wed, 15 Apr 2020 09:34:16 +0000 (05:34 -0400)]
Add wasm cross compiler to the mono build. (#34935) (#34972)
Marie Píchová [Wed, 15 Apr 2020 08:57:27 +0000 (10:57 +0200)]
System.Net.Http ref sources regenerated. (#34961)
monojenkins [Wed, 15 Apr 2020 08:44:56 +0000 (04:44 -0400)]
Fix missing array ctor(int32,int32) test failures. (#34764)
According to ECMA, VES should add the following methods to arrays:
* A constructor that takes a sequence of int32 arguments, one for each dimension of the array, that specify the number of elements in each dimension beginning with the first dimension. A lower bound of zero is assumed.
* A constructor that takes twice as many int32 arguments as there are dimensions of the array. These arguments occur in pairs—one pair per dimension—with the first argument of each pair specifying the lower bound for that dimension, and the second argument specifying the total number of elements in that dimension.
* Get.
* Set.
* Address.
In Mono's case we only added the `ctor (int32, int32)` for rank 1 arrays if they were "jagged" array. Array with rank 1-4 executed an optimized code path always using the one int32 per rank constructor.
This doesn't work in cases where the array is constructed using both a length and a lower bound pattern, like:
`newobj instance void int32[10000...10005]::.ctor(int32, int32)`
this would trigger a method not found exception, since its not a jagged array, Mono wouldn't add the `ctor(int32, int32)` constructor for this type.
Fix will make sure we follow ECMA's definition of this and fix code to use right instance methods of arrays. Code also adds an assert to trap if a jagged array is created through this code path
(shouldn't happen) since current implementation would have handled it as
a 2 ranked array.
Fix also adds several tests into iltests.il allocating different variations of arrays using lower/upper bounds and validating length, rank, upper/lower bounds of allocated arrays.
Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
Levi Broderick [Wed, 15 Apr 2020 07:05:18 +0000 (00:05 -0700)]
Remove outdated CoreFx.Private.TestUtilities.Unicode references (#34981)
* Remove outdated CoreFx.Private.TestUtilities.Unicode references
* Update System.Globalization.Extensions.Nls.Tests dependencies
* Add System.Runtime.Nls.Tests to System.Runtime.sln
* Add missing .sln entry