platform/upstream/dotnet/runtime.git
3 years agoImprove ConnectCallback tests (#42562)
Geoff Kizer [Tue, 22 Sep 2020 16:11:59 +0000 (09:11 -0700)]
Improve ConnectCallback tests (#42562)

* make existing tests run on HTTP2

* add exception test

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years ago[interp] Track MINT_MONO_LDPTR as constants (#42531)
monojenkins [Tue, 22 Sep 2020 15:34:37 +0000 (11:34 -0400)]
[interp] Track MINT_MONO_LDPTR as constants (#42531)

This allows us to optimize out checks like `typeof(T1) == typeof(T2)`, which is very common in bcl.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
3 years agoMark some APIs throwing PNSE from runtime as unsupported on Browser (#42310)
Maxim Lipnin [Tue, 22 Sep 2020 15:27:27 +0000 (18:27 +0300)]
Mark some APIs throwing PNSE from runtime as unsupported on Browser (#42310)

* Mark some APIs throwing PNSE from runtime as unsupported on Browser

* Annotate APIs in coreclr part

3 years ago[browser] Reenable marshal library tests (#42574)
Maxim Lipnin [Tue, 22 Sep 2020 15:04:45 +0000 (18:04 +0300)]
[browser] Reenable marshal library tests (#42574)

3 years agoFix argument type in a call to SSLSetEnabledCiphers (#42543)
Jan Vorlicek [Tue, 22 Sep 2020 08:44:08 +0000 (10:44 +0200)]
Fix argument type in a call to SSLSetEnabledCiphers (#42543)

The latest version of macOS clang from XCode 12 beta complains about
data type of the 2nd argument passed to SSLSetEnabledCiphers.
This change fixes it by casting it to the actual argument type.

3 years ago[wasm][debugger][tests] Add some async stepping tests (#42461)
Ankit Jain [Tue, 22 Sep 2020 05:36:56 +0000 (01:36 -0400)]
[wasm][debugger][tests] Add some async stepping tests (#42461)

* [wasm][debugger][tests] Move stepping tests to a separate file

* [wasm][debugger][tests] Add more async stepping tests, some of which are

.. failing.

3 years agoAdd support for associating BrowserDebugHost with parent process (#42541)
Safia Abdalla [Mon, 21 Sep 2020 23:31:34 +0000 (23:31 +0000)]
Add support for associating BrowserDebugHost with parent process (#42541)

3 years agoAdd test case for growing beyond buffer size in Utf8JsonWriter (#28409) (#36917)
Josh Schreuder [Mon, 21 Sep 2020 21:45:22 +0000 (07:45 +1000)]
Add test case for growing beyond buffer size in Utf8JsonWriter (#28409) (#36917)

* Add test case for growing beyond buffer size in Utf8JsonWriter (#28409)

* Update with review feedback

Co-authored-by: Josh Schreuder <josh.schreuder@gmail.com>
3 years agoAnnotate handle indirections with GTF_IND_INVARIANT and add validation to fgDebugChec...
Brian Sullivan [Mon, 21 Sep 2020 18:50:03 +0000 (11:50 -0700)]
Annotate handle indirections with GTF_IND_INVARIANT and add validation to fgDebugCheckFlags (#42021)

* Rename GTF_ICON_PTR_HDL to GTF_ICON_PTR_GLOBAL - Use this whenever we are embedding a pointer to mutable data from the VM state

* Rename GTF_ICON_PSTR_HDL to GTF_ICON_CONST_PTR, use this when the constant is a pointer to immutable data, (e.g. IAT_PPVALUE)

* Use GTF_ICON_TOKEN_HDL only for a constant that is a token handle, other than class, method or field.

* In gtDispConst - print H or I when we have a handle, or O for a field offset
In gtNewStringLiteralNode - Added assert for non-CoreRT case of a IAT_VALUE of a TYP_REF

* In optHoistThisLoop - print if the loop has a single exit or multiple exits
as this can currently significantly limit our hoisting optimization.

* Added assert for later lowering of IAT_PPVALUE in Lowering::LowerDirectCall
and comment in Lowering::LowerNonvirtPinvokeCall where we currently allow this late expansion.

* Added function fgDebugCheckDispFlags to support extra flag checking of GTF_IND_INVARIANT
Disable the GTF_IND_INVARIANT for the cases that currentlt do not set it correctly.

* Added additional support for checking of GTF_IND_NONFAULTING in fgDebugCheckFlags (disabled)
Minor changes with GTF_IND_NONFAULTING
Added assert(!"Check this")
Add check for GTF_ICON_PINVKI_HDL // Eventually remove, as this is immutable

* Changed a GTF_ICON_FIELD_HDL to be invariant in fgMorphField
Added  assert(!"Unreached GTF_IND_INVARIANT") in fgMorphField
Fixed IAT_PPVALUe and modified IAT_PVALUE cases in fgMorphLeaf for GT_FTN_ADDR

* Mark indirection of handles created by gtNewIconEmbHndNode as invariant
This was previously #ifdef out
ran jit-format

* Enable checking of GTF_IND_INVARIANT in fgDebugCheckFlags

* Fix Compiler::fgMorphLeaf for extra fgMorpgTree in GT_FTN_ADDR IAT_VALUE case
Removed #if 0 code

* Reverse the if-the-else block for creating a static field address or value
Remove the unreachable block

* Added asserts to gtNewIndOfIconHandleNode if isInvariant is set incorrectly, set GTF_GLOB_REF for all class static indirections
Check that all class static indirections have GTF_GLOB_REF set
Changed two asserts to be noway_asserts
Changed the indirection that points to the array initialization blob to be a GTF_ICON_CONST_PTR instead of a GTF_ICON_STATIC_HDL.
Changed the indirection that fetches the field offset value for ReadyToRun to be a GTF_ICON_CONST_PTR instead of a GTF_ICON_FIELD_HDL.

* ifdef 0 code to touch the codegen of Generic methods via GTF_DONT_CSE

* Rename of GTF_ICON_PTR_GLOBAL to GTF_ICON_GLOBAL_PTR

* Refactor morph of static field and eliminate the dead code

* Add method header for fgDebugCheckDispFlags
Rename of GTF_ICON_GLOBAL_PTR) for emitarm64.ccp

3 years agoEncode the alt-svc header after pseudo-headers ("All pseudo-header fields MUST appear...
Cory Nelson [Mon, 21 Sep 2020 18:29:23 +0000 (11:29 -0700)]
Encode the alt-svc header after pseudo-headers ("All pseudo-header fields MUST appear in the header field section before regular header fields.") (#42545)

3 years agoAdd CSharpCodeGenerator tests (#33886)
Hugh Bellamy [Mon, 21 Sep 2020 17:58:39 +0000 (18:58 +0100)]
Add CSharpCodeGenerator tests (#33886)

* Add CSharpCodeGenerator tests

3 years agoSupport auto-download of JIT baseline for SuperPMI asm diffs (#42511)
Bruce Forstall [Mon, 21 Sep 2020 17:22:54 +0000 (10:22 -0700)]
Support auto-download of JIT baseline for SuperPMI asm diffs (#42511)

Add `-base_git_hash` to allow specifying the exact baseline hash to use.

Depends on JIT rolling build implemented in https://github.com/dotnet/runtime/pull/42507

Allows running asm diffs with just:

    python superpmi.py asmdiffs

3 years agoAdd CLR JIT rolling build (#42507)
Bruce Forstall [Mon, 21 Sep 2020 17:11:08 +0000 (10:11 -0700)]
Add CLR JIT rolling build (#42507)

Build just the JIT, and upload the resulting JIT DLL to
CLR JIT Azure Storage.

This will be used as a baseline JIT for developer use, such
as assembly diffs.

Linux arm and Linux arm64 are disabled for now, until we can
determine how to properly configure Python on the build machines
with the azure-storage-blob package required for upload of the
JIT to Azure blob storage.

3 years agoFix Enumerable.Take/SkipLast on mutable collections (#42506)
Stephen Toub [Mon, 21 Sep 2020 13:48:21 +0000 (09:48 -0400)]
Fix Enumerable.Take/SkipLast on mutable collections (#42506)

* Fix Take/SkipLast on mutable collections

LINQ operators are lazy and can't factor in the current contents of a mutable list when making decisions about how to subsequently process that list.

* Address PR feedback

3 years agoFix mapping of files from bundle to only map the necessary part (#42402)
Vitek Karas [Mon, 21 Sep 2020 13:20:13 +0000 (06:20 -0700)]
Fix mapping of files from bundle to only map the necessary part (#42402)

Mapping the whole bundle every time leads to VM space starvation. Which mostly matters on 32bit.

3 years agoFix typos in comment (#42367)
Martin Costello [Mon, 21 Sep 2020 09:58:31 +0000 (10:58 +0100)]
Fix typos in comment (#42367)

Fix a handful of typos in a comment for AllocateUninitializedArray<T>().

3 years agoCleanup libraries CMakeLists (#42380)
Jan Vorlicek [Mon, 21 Sep 2020 09:10:44 +0000 (11:10 +0200)]
Cleanup libraries CMakeLists (#42380)

* Cleanup libraries CMakeLists

The Windows CMakeLists.txt was unnecessarily using build configuration
information extracted from an environment variable to set
configuration specific options. Generator expressions are a better way
to handle that.

Besides that, I've also added support for Checked build.

Both of these changes are needed for the single exe host work where
libraries will be built during coreclr build.

3 years agoFix artifact source globbing for extract (#42484)
Matt Mitchell [Mon, 21 Sep 2020 08:27:40 +0000 (01:27 -0700)]
Fix artifact source globbing for extract (#42484)

* Fix artifact source globbing for extract
There was a change the extract AzDO task that fixed a bug where it appeared to be matching some subpaths without globbing.

If you specified foo/x* it would apparently match subpaths of foo. Runtime was relying on this behavior, as the artifact target directory would implicitly get a subdirectory which was the artifact name, but not including that artifact name in the globbing pattern.

Fix this by including ** before the archive.

* Update download-artifact-step.yml

3 years agoemit test for bounds checks against a 0 index (#42295)
nathan-moore [Mon, 21 Sep 2020 06:58:52 +0000 (02:58 -0400)]
emit test for bounds checks against a 0 index (#42295)

* emit test for bounds checks against 0

* formatting

* remove dead code

* formatting

3 years agoFix the mechanism getting Constructed Culture (#42480)
Tarek Mahmoud Sayed [Sat, 19 Sep 2020 22:42:35 +0000 (15:42 -0700)]
Fix the mechanism getting Constructed Culture (#42480)

3 years agoFix Getting default parent span Id with root Parent (#42483)
Tarek Mahmoud Sayed [Sat, 19 Sep 2020 20:16:57 +0000 (13:16 -0700)]
Fix Getting default parent span Id with root Parent (#42483)

3 years agoMemory Leak in Microsoft.Extensions.Caching.Memory when handling exceptions (#42355)
Eric Erhardt [Sat, 19 Sep 2020 15:39:50 +0000 (10:39 -0500)]
Memory Leak in Microsoft.Extensions.Caching.Memory when handling exceptions (#42355)

* Memory Leak in Microsoft.Extensions.Caching.Memory when handling exceptions

When an exception is thrown inside MemoryCache.GetOrCreate, we are leaking CacheEntry objects. This is because they are not being Disposed properly, and the async local CacheEntryStack is growing indefinitely.

The fix is to ensure the CacheEntry objects are disposed correctly. In order to do this, I set a flag to indicate whether the CacheEntry.Value has been set. If it hasn't, Disposing the CacheEntry won't add it to the cache.

Fix #42321

* Fix another memory leak when one cache depends on another cache. The inner cache's entries will reference the outer cache entries through the ScopeLease object.

Null'ing out the CacheEntry._scope field when it is disposed fixes this issue.

3 years agoSemaphoreSlim spelling corrections (#42451)
Frank Bolero [Sat, 19 Sep 2020 11:16:34 +0000 (13:16 +0200)]
SemaphoreSlim spelling corrections (#42451)

* Fixes comment spelling errors in SemaphoreSlim.cs

Words "increments" and "exceeded" where incorrectly spelled.

* Text change for clarity

Changed maxi to maximum to align with the rest of the comments
and variables in the file.

3 years agoFix JS<->WASM string marshaling crash (#42486)
Katelyn Gadd [Sat, 19 Sep 2020 11:04:53 +0000 (04:04 -0700)]
Fix JS<->WASM string marshaling crash (#42486)

Fix JS strings being truncated at the first null when passed to mono
Fix crashes when moving large strings across the JS<->WASM boundary

3 years agoAvoid reusing Regex.Replace Match objects with MatchEvaluator (#42452)
Stephen Toub [Sat, 19 Sep 2020 10:52:30 +0000 (06:52 -0400)]
Avoid reusing Regex.Replace Match objects with MatchEvaluator (#42452)

One of the allocation-related optimizations we made for Regex in .NET 5 was for Regex.Replace and Regex.Split to not allocate unnecessary Match objects.  Previously, every match was producing a Match object which was then used to implement the API's semantics.  But in the case of an API like `Replace(string, string)`, those Match objects never make their way out to user code, so we can avoid creating a new Match object each time and instead only create one Match object for the whole operation and just reuse it over and over.

However, one of the overloads of Regex.Replace accepts a MatchEvaluator, a delegate that's handed the Match object.  The intent is that the callback fishes out from the Match whatever it needs and doesn't hold onto the Match object, that ownership isn't transferred... but it turns out some applications are indeed storing these Match objects and assuming ownership... and the reuse behavior breaks that.

This PR tweaks the caching behavior to be parameterized, only reusing the match object from callers where the Match object is never handed out to user code.

3 years agoFix several BeginXx nullable annotations (#42442)
Stephen Toub [Sat, 19 Sep 2020 10:51:20 +0000 (06:51 -0400)]
Fix several BeginXx nullable annotations (#42442)

AsyncCallback and object state parameters in APM BeginXx methods should always be nullable.  Several in annotated libraries were annotated incorrectly.

3 years ago Use ReadOnlySpan<byte> for parsing FileWatcher responses (#42474)
Jan Kotas [Sat, 19 Sep 2020 04:30:43 +0000 (21:30 -0700)]
 Use ReadOnlySpan<byte> for parsing FileWatcher responses (#42474)

3 years agoA small ref PR in preparation for arm64 apple work. (#42270)
Sergey Andreenko [Sat, 19 Sep 2020 01:20:12 +0000 (18:20 -0700)]
A small ref PR in preparation for arm64 apple work. (#42270)

* Mark some getters as const to avoid build errors.

* use `gtGetStructHandle` if `NO_CLASS_HANDLE` means an error.

* Add `GetStructHnd` to `LclVarDsc`.

A small contirubtion to https://github.com/dotnet/runtime/issues/32648.

* additional asserts

3 years agoUpdate to latest StyleCop.Analyzers and Microsoft.CodeAnalysis.NetAnalyzers (#42413)
Stephen Toub [Sat, 19 Sep 2020 01:04:45 +0000 (21:04 -0400)]
Update to latest StyleCop.Analyzers and Microsoft.CodeAnalysis.NetAnalyzers (#42413)

3 years agoRemove implicit anchoring optimization from Regex (#42408)
Stephen Toub [Sat, 19 Sep 2020 00:58:44 +0000 (20:58 -0400)]
Remove implicit anchoring optimization from Regex (#42408)

* Remove implicit anchoring optimization from Regex

In .NET 5 we added a bunch of optimizations to Regex.  One of them was a transform that optimized for the case where the pattern begins with `.*`.  If it does, then we insert an implicit anchor at the beginning in order to avoid unnecessary backtracking.  Imagine the pattern `.*a` and the pattern `bcdefghijklmnopqrstuvwxyz`.  This is going to start matching at `b`, find the next newline, and then backtrack from there looking for the `a`; it won't find it and will backtrack all the way, failing the match at that position.  At that point it'll bump to the next position, starting at `c`, and do it all over.  It'll fail, backtrack all the way, and bump again, starting at `d`, and doing it all over.  Etc.  The optimization recognizes that since `.` will match anything other than newline, after it fails to match at the first position, we can just skip all subsequent positions until the next newline, as they're all going to fail.

However, the optimization failed to take into account that someone can explicitly start a match in the middle of the provided text.  In that case, the implicitly added anchor will fail the match in the actual "Go" matching logic.

There are safe ways to do this optimization, e.g. introducing a variant of these anchors that let FindFirstChar skip ahead but that aren't considered for Go's matching purposes, but we can look at employing those for .NET 6.  For now for .NET 5, this commit just deletes the faulty optimization and adds a few tests that were failing it.

* Address PR feedback

3 years agoConsole.Unix: fix inverted TreatControlCAsInput (#42432)
Tom Deseyn [Sat, 19 Sep 2020 00:50:29 +0000 (02:50 +0200)]
Console.Unix: fix inverted TreatControlCAsInput (#42432)

The logical negation was unintentionally removed while refactoring.

3 years agoFix Windows AccessViolationException in FileSystemWatcher when monitoring network...
Carlos Sanchez [Fri, 18 Sep 2020 23:01:58 +0000 (16:01 -0700)]
Fix Windows AccessViolationException in FileSystemWatcher when monitoring network share for changes (#42419)

* Fix FileSystemWatcher crash due to malformed data coming from Windows.

* Address PR suggestions.

* Bring back assert for numBytes.

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
3 years agoImprove superpmi.py scripting (#42238)
Bruce Forstall [Fri, 18 Sep 2020 22:32:42 +0000 (15:32 -0700)]
Improve superpmi.py scripting (#42238)

* Improve superpmi.py scripting

1. Update Azure storage collections location to a new location
where we have appropriate permissions to manage the data.
2. Update the Azure storage upload/download implementation
to the current version of the Azure Python API.
3. Add JIT-EE interface GUID to path of Azure stored
collections. When downloading collections, use the appropriate
collection for your JIT-EE interface GUID. This is all done
by adding a "-printJITEEVersion" option to the SuperPMI
MCS tool. Thus, to determine the JIT-EE version, we assume
that MCS is built with the same version as the JIT (which
will be true in a normal build), and that MCS is available
and able to be run -- this typically requires a Core_Root
location be available. The user can specify the JIT-EE
version explicitly with the new `-jit_ee_version` argument.
4. Simplify the Azure storage format: there is no longer
a JSON mapping of name to MCH file. Instead, there is just
a directory full of files. By default, all files are downloaded
and used for replay/asmdiffs, by that can be filtered with
the new `-filter` argument.
5. The `-mch_files` (previously `-mch_file`) argument used
by `replay`, `asmdiffs`, and `upload`, now accepts a list
of directories and files, and for each directory all MCH
files included in that directory, recursively, are used.
6. Also upload MCT (TOC) files with the MCH files.
7. A `--force_download` argument is added to allow forcing
re-download of the Azure collections to the local cache.
8. PMI.dll is also looked for on the PATH before downloading
a cached version from Azure storage.
9. Some of the lesser-used arguments were renamed to simplify them.
10. Various bugs were fixed and code simplification/reorganization was done.
E.g., some of the commonality between replay and asmdiffs was
factored out.
11. More code documentation was added.
12. The superpmi.md documentation was re-written and simplified.

* Add support for download and caching of UNC paths on Windows

* Support downloading and caching explicitly specified HTTP addressed files

3 years agoSupport loading assemblies and symbols into debugger via callback (#42255)
Safia Abdalla [Fri, 18 Sep 2020 19:27:30 +0000 (19:27 +0000)]
Support loading assemblies and symbols into debugger via callback (#42255)

* Add test setup for debugging lazy-loaded assemblies
* Add mono_wasm_add_lazy_load_files callback
* Rely on assembly_load callback to register PDBs
* Address feedback on formatting
* Fix spacing on method invocations
* Address second round of feedback
* Transport assembly data as base64 string
* Revert automated whitespace changes
* [wasm][debugger] Fix some issues with lazy loading assemblies
- One of the problems I found was that we were sending lot of duplicate
assemblies.
    - this is a problem because we are converting them to base64, then
    sending them over the wire, unnecessarily.
    - Also, the proxy wasn't correctly dealing with them, and ended up
    processing them, and then sending out duplicate `scriptParsed`
    events!
- So, we try to solve this at the `mono_wasm_asm_loaded` point:
    - issue: the `MONO.mono_wasm_runtime_is_ready` check wasn't enough
    - What we want to do is to send the events only for assemblies that
      were not in the bundle, list of which we can get in
      `MONO.loaded_files`.
    - but that has the filename
    - But we don't seem to be getting the filename from the MonoImage,
      so we use the assembly name as a workaround.
    - So, as a heuristic (and trying not too add too much new stuff this
    close to rc2!), we check if the assembly name begins with `System.`,
    or `Microsoft.`, and if it does then we look for `$assembly_name.dll`
    in the the loaded filenames.
        - If found, then we can skip these!
- The other point in the Proxy:
    - where we avoid adding duplicate assemblies if we already have one
    keyed by the assembly name.
* Fix spacing in function definition
* [wasm][debugger] Handle errors in downloading from symbol servers
* [wasm][debugger] MonoProxy: Don't skip assembly if no pdb is available
- this caused such assemblies not getting added `DebugStore.assemblies`
- which broke download symbols on demand, because it couldn't find the
corresponding assembly in the list
* [wasm][debugger] Use the correct assembly name for the search
* Fixing and changes things related to Embedded Pdb.
* Update check for loaded assemblies and initialize resolver once
* Changing the order of the checks.
* Fix indentation.
* [wasm][debugger][tests] Improve tests a bit
.. which includes setting breakpoint using a url, before loading the
dynamic assembly. This essentially tests that the bp request gets resolved
automatically when the assembly gets loaded.
- And add the embedded pdb test for `DuplicateAssemblyLoadedEvent*`
tests
* Add back types to DebugStore
* Comply with new code style requirements

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Thays <thaystg@gmail.com>
3 years ago[wasm][http] Add support for Blob URLs (#42111)
Kenneth Pouncey [Fri, 18 Sep 2020 17:28:02 +0000 (19:28 +0200)]
[wasm][http] Add support for Blob URLs (#42111)

* [wasm][http] Add support for Blob URLs

* Modify the string to read `Only 'http' 'https' and 'blob' schemes are allowed.` for browser

* Add more tests

* Add blob Uri marshal test

* Address review comments to add comments within code about intentions.

* Multiple review comments.

- Split Fact into theory instead of specific test for blob.
- Split large test into multiple tests as well as mark it Theory where appropriate.

* Rename

* Add message to other validations as well

* Change name

* Update src/libraries/System.Net.Http/src/Resources/Strings.resx

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Create partial classes for HttpUtilities to replace the proliferating use of TARGETS_BROWSER in the sources.

* Define and call `HttpUtilities.InvalidUriMessage` to provide the invalid message to be thrown.

* Fix CI Build

* Rename modules to follow current standards

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix stackalloc loop in hpack test (#42416)
Chris Ross [Fri, 18 Sep 2020 16:25:22 +0000 (09:25 -0700)]
Fix stackalloc loop in hpack test (#42416)

3 years agoAdapt to new behavior of nano server in resource updater (#42444)
Vitek Karas [Fri, 18 Sep 2020 15:24:14 +0000 (08:24 -0700)]
Adapt to new behavior of nano server in resource updater (#42444)

In recent builds of nano server BeginUpdateResource will return ERROR_CALL_NOT_IMPLEMENTED. ResourceUpdater needs to adapt to provide a good error experience.

Without this change the code still fails, but with a much less friendly error.

3 years ago[wasm] [debugger] Adding test for #42227 PR (#42299)
Thays Grazia [Fri, 18 Sep 2020 15:07:15 +0000 (12:07 -0300)]
[wasm] [debugger] Adding test for #42227 PR (#42299)

* Adding the test I realized that I need to move one more function.

* Adding line.

* Adding space.

3 years ago[metadata] Assorted enhancements for some CIL image formats (#42398)
monojenkins [Fri, 18 Sep 2020 13:45:30 +0000 (09:45 -0400)]
[metadata] Assorted enhancements for some CIL image formats (#42398)

Some  cherrypicked changes from a work in progress

* Try to set MonoImage guid from modules table for metadata_only images

   If the image has a modules table, and a guid heap, set MonoImage:guid when loading the image, even if it is metadata_only.  In minimal delta images this is true.

* Minimal delta files have 4 byte indices, always

* Don't populate MonoImage:module_name for minimal deltas

* Always store precise string heap size in MonoImage:heap_strings

   In minimal delta images, the String heap is appended to the heap of the base image.  But in the physical base image, the String heap is zero-padded to a size that's a multiple of 4 bytes.

   Compute the precise String heap size at base image load time.

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years agoUpdate ownership of area-Single-File (#42445)
Vitek Karas [Fri, 18 Sep 2020 13:37:49 +0000 (06:37 -0700)]
Update ownership of area-Single-File (#42445)

3 years agoAdd a minimal .editorconfig for Mono C files (#42286)
Aleksey Kliger (λgeek) [Fri, 18 Sep 2020 13:36:01 +0000 (09:36 -0400)]
Add a minimal .editorconfig for Mono C files (#42286)

3 years ago[jit] Transition some memory allocations to memory managers. (#42351)
monojenkins [Fri, 18 Sep 2020 11:45:27 +0000 (07:45 -0400)]
[jit] Transition some memory allocations to memory managers. (#42351)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoAllow more obj(addr(lcl_var) foldings. (#42343)
Sergey Andreenko [Fri, 18 Sep 2020 05:21:29 +0000 (22:21 -0700)]
Allow more obj(addr(lcl_var) foldings. (#42343)

* Allow `struct<N> with no GCPointers <-> block<N>` replacements.

* Alllow local morph to fold `OBJ(ADDR(LCL_VAR))` when obj and lclVar loayouts are compatible.

3 years agoOngoing cmake build work. (#42182)
Zoltan Varga [Fri, 18 Sep 2020 04:49:10 +0000 (00:49 -0400)]
Ongoing cmake build work. (#42182)

* Ongoing cmake build work.

* Fix indentation.
* Add linux support.
* Add tvos support.
* Use clang only options only with clang.
* Add check for iconv.

* Fix indentation.

3 years agoAnnotate Min and Max WorkingSet setters as supported on macOS and FreeBSD (#42385)
Adam Sitnik [Fri, 18 Sep 2020 03:46:30 +0000 (05:46 +0200)]
Annotate Min and Max WorkingSet setters as supported on macOS and FreeBSD (#42385)

* Annotate MaxWorkingSet setter as supported on macOS and FreeBSD

* annotate MinWorkingSet as well, simplify the comment

* update ref assembly

3 years agoFix build warning/error about converting a constant to a boolean (#42389)
Omair Majid [Fri, 18 Sep 2020 03:22:06 +0000 (23:22 -0400)]
Fix build warning/error about converting a constant to a boolean (#42389)

On Fedora 32 with Clang 10, I get this warning/error when building
coreclr:

    /home/omajid/devel/dotnet/runtime/src/coreclr/src/jit/emitarm.cpp:5553:31: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
            assert(ins == INS_cbz || INS_cbnz);
                                  ^

This looks like a bug that should be fixed: ins should be compared with
the constant on both sides of the boolean operator. Otherwise the
conditional can always evaluate to true.

3 years agoRemove unnecessary logic to determine E format when parsing floating point values...
David Cantú [Thu, 17 Sep 2020 22:45:20 +0000 (15:45 -0700)]
Remove unnecessary logic to determine E format when parsing floating point values on Utf8JsonReader and JsonDocument (#42298)

3 years agoFix handling of repo analyzers and warnings-as-errors (#42272)
Stephen Toub [Thu, 17 Sep 2020 21:40:01 +0000 (17:40 -0400)]
Fix handling of repo analyzers and warnings-as-errors  (#42272)

* Fix handling of repo analyzers and warnings-as-errors

When we brought in the new SDK, it enabled analyzers by default (which then used our custom ruleset), but a bunch of projects (in particular tests) weren't expecting that, such that we now have thousands of warnings in the repo. This opts-out those projects.

It also enables warnings-as-errors at the root level of the repo, to hopefully avoid such warning storms in the future, and to also clean up the remaining that exist.  This includes a bunch of new obsoletion and platform compat warnings that are firing in the runtime tests.

We may choose to run analyzers on additional projects in the future where it's currently disabled, but this gets us back to a state at least as good if not better than we were previously.

* Fix analyzer warnings on Microsoft.NET.HostModel

Fixes the warnings that were triggered by our rule set applying to this project.  All fixes were automated.

* Fix analyzer warnings in additional projects

* Remove several `<RunAnalyzers>false</RunAnalyzers>`

* Try to opt-out remaining coreclr tests

Co-authored-by: David Mason <davmason@microsoft.com>
3 years ago[wasm][filesystem] add arg to testharness for setting working dir (#42020)
Tammy Qiu [Thu, 17 Sep 2020 20:44:33 +0000 (16:44 -0400)]
[wasm][filesystem] add arg to testharness for setting working dir (#42020)

* [wasm][tests] Fix failing System.IO.Tests.DirectoryInfo_Name.CurrentDirectory

Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoV3 publishing for Runtime (#42262)
Epsitha Ananth [Thu, 17 Sep 2020 18:15:17 +0000 (11:15 -0700)]
V3 publishing for Runtime (#42262)

* V3 publishing  (#41899)

3 years agoFix MacOS createdump testing failures (#42357)
Mike McLaughlin [Thu, 17 Sep 2020 16:53:07 +0000 (09:53 -0700)]
Fix MacOS createdump testing failures (#42357)

Fix MacOS createdump testing failures

There are a few things that are causing MacOS dumps not to be complete and causing the diagnostics SOS tests to fail:

1) The threads were completely stopped with the per thread suspend. Switch from thread_suspend to task_suspend.
2) .Stopping filtering out SM_EMPTY share_mode type memory regions. There are read/write sections that are needed in the dump by the tools

3 years agoAvoid race condition in WebClient.IsBusy. (#42076)
Theodore Tsirpanis [Thu, 17 Sep 2020 15:58:21 +0000 (18:58 +0300)]
Avoid race condition in WebClient.IsBusy. (#42076)

3 years agoAdd a pointer to Android build doc and a pointer to Hello World sample (#42345)
Fan Yang [Thu, 17 Sep 2020 15:13:14 +0000 (11:13 -0400)]
Add a pointer to Android build doc and a pointer to Hello World sample (#42345)

* Update README.md

* Update docs/workflow/building/mono/README.md

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update README.md

Resolve Egor's feedback

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoFix default handling for value types when converter based on interface (#42319)
Steve Harter [Thu, 17 Sep 2020 14:58:11 +0000 (09:58 -0500)]
Fix default handling for value types when converter based on interface (#42319)

3 years agoFix order of singlefilehost libarires passed to the linker (#42094)
Omair Majid [Thu, 17 Sep 2020 14:26:52 +0000 (10:26 -0400)]
Fix order of singlefilehost libarires passed to the linker (#42094)

We give a list of arguments to the linker which includes a list of
static objects we want to be linked together and a set of system-wide
native libraries they should be dynamically linked against.

Some build environments, such as Fedora, use the `--as-needed` linker
flag. This makes the linker pay attention to the order in which
libraries appear and remove uneeded libararies.

When the linker sees this:

    ld --as-needed -lz staticobject.a

It works from left to right and sess that nothing so far depends on
libz. The linker removes libz from the set of objects being linked. Then
it links staticobject.a, which needs symbols from libz. The linker then
complains that it contains an undefined reference.

We can fix that by changing the order so that dependencies appear last
in the linker command line:

    ld --as-needed staticobject.a -lz

This makes the linker link staticobject.a against libz correctly.

3 years agoConsole.Unix: fix terminal settings during Console.KeyAvailable (#42371)
Tom Deseyn [Thu, 17 Sep 2020 14:20:22 +0000 (16:20 +0200)]
Console.Unix: fix terminal settings during Console.KeyAvailable (#42371)

* Console.Unix: fix terminal settings during Console.KeyAvailable

Arguments passed to configure the terminal are in the wrong order.
This causes Enter keys to be returned as ConsoleKey.J instead of
ConsoleKey.Enter.

* Add test

3 years agoHarden AssemblyDependencyResolver assemblyPaths (#42055)
Lakshan Fernando [Thu, 17 Sep 2020 12:58:36 +0000 (05:58 -0700)]
Harden AssemblyDependencyResolver assemblyPaths (#42055)

* Harden AssemblyDependencyResolver assemblyPaths  AssemblyDependencyResolver is made resilience to the case where  hostpolicy.dll returns the same assembly paths by ignoring multiple  entries. This is done by using OrdinalIgnoreCase comparison on Windows and Ordinal comparison elsewhere  Fix #37162

* Pick the first simple assembly for multiples

AssemblyDependencyResolver is made resilience to the case when
hostpolicy.dll returns multiple assembly paths for the same assembly
by picking the first one.

Fix #37162

* missed an extra line

* Test case for casing change with the same assembly

* typo

* Disabled the tests for non-windows

Filed #42334 to track the linux-mac differences

Co-authored-by: Lakshan Fernando <lakshanf@microsoft.com>
3 years agoRemove unused locals and methods in System.Private.Xml (#39592)
Matt Kotsenas [Thu, 17 Sep 2020 12:28:25 +0000 (05:28 -0700)]
Remove unused locals and methods in System.Private.Xml (#39592)

* Remove unused locals and methods in System.Private.Xml

* Remove unneeded discards and simplify expressions

* Restore #if DEBUG code

3 years agoMake EventPipeProviderCallbackData own the filter data (#42307)
David Mason [Thu, 17 Sep 2020 06:50:23 +0000 (23:50 -0700)]
Make EventPipeProviderCallbackData own the filter data (#42307)

Fixes a use after free issue in EventPipe, where the EventPipeProviderCallbackData would cache a pointer to the filter data string on EventPipeSessionProvider, but disabling the session would free all of the EventPipeSessionProviders.

3 years agoHTTP/3 interop fixes (#42315)
Cory Nelson [Thu, 17 Sep 2020 03:41:43 +0000 (20:41 -0700)]
HTTP/3 interop fixes (#42315)

* Fix SETTINGS frame creation.
* Only call tracing when it is enabled.
* Add descriptions for stream read states.
* Fix: SETTINGS frame parsing not discarding bytes from ArrayBuffer.
* Fix: ownership of ArrayBuffer could have resulted in double-free of arrays.

3 years ago[wasm][debugger] Improving logging control for tests (#42175)
Ankit Jain [Thu, 17 Sep 2020 00:58:16 +0000 (20:58 -0400)]
[wasm][debugger] Improving logging control for tests (#42175)

- replace CWLs with log messages
- Fix use of loggerFactory, and logger to correctly configure them, and
allow being controlled via appsettings.json

- Also, add default settings for proxy also, just an example:

```
     "LogLevel": {
       "Default": "Error",
       "Microsoft": "Warning",
       "Microsoft.WebAssembly.Diagnostics.TestHarnessProxy": "Information",
       "Microsoft.WebAssembly.Diagnostics.DevToolsProxy": "Information",
       "DebuggerTests.Inspector": "Information"
    }
```

Eg. to see trace messages (eg. protocol chat) for the test proxy:
    `"Microsoft.WebAssembly.Diagnostics.TestHarnessProxy": "Trace"`

3 years agocorrect perf-send-to-helix on windows (#42235)
Olivia Chen [Thu, 17 Sep 2020 00:32:22 +0000 (17:32 -0700)]
correct perf-send-to-helix on windows (#42235)

* correct perf helix workitems on windows

* Will Revert: turn on PR validation

* change Agent.Os to runtime var

* remove sendparams condition

* test if macro syntax var case sensitive

* try expression for Agent.Os

* try $(Agent.Os)

* pass osGroup param

* revert pr trigger:

3 years agoFix continuation of JSON deserialization (#42158)
devsko [Wed, 16 Sep 2020 23:44:41 +0000 (01:44 +0200)]
Fix continuation of JSON deserialization (#42158)

* Repro #42070

* formatting

* namespace

* Fix

* never forget the header

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

* Addressed feedback

* Test with original repro data from #42070

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

* rename

* test data moved to Strings.resx

3 years agoRemove unused locals and fix tests in System.ServiceModel.Syndication (#39639)
Matt Kotsenas [Wed, 16 Sep 2020 23:41:45 +0000 (16:41 -0700)]
Remove unused locals and fix tests in System.ServiceModel.Syndication (#39639)

* Remove unused locals and fix tests in System.ServiceModel.Syndication

Remove unused locals in System.ServiceModel.Syndication.

While refactoring I found two places where unit tests appear to have a
copy/paste error and were asserting the wrong value.

* Add back `thirdDocument` and correct tests

* Add back `sixthDocument` and correct tests

* Add back item and correct tests

* Add back `genericFormatter` and correct test

* Add back `elementExtensions` and add assert

3 years agoUse portable PDBs even on .NETFramework (#42331)
Eric StJohn [Wed, 16 Sep 2020 23:23:31 +0000 (16:23 -0700)]
Use portable PDBs even on .NETFramework (#42331)

Previously we were building full / windows PDBs for .NETFramework
because at the time .NETFramework couldn't read portable PDBs
so things like StackTrace wouldn't include file/line info.

That has been fixed as of 4.7.2 and we can switch to portable PDB
everywhere.

Symbol archiving will still convert to windows PDBs where necessary so
that we don't break any consumption scenarios for folks on older
frameworks.

This is important to get the latest symbols features only available in
the portable PDB format.

3 years agosmall imp for `fgMorphMultiregStructArg`. (#42320)
Sergey Andreenko [Wed, 16 Sep 2020 20:48:49 +0000 (13:48 -0700)]
small imp for `fgMorphMultiregStructArg`. (#42320)

3 years agoRun PAL tests in CI (#42049)
David Wrighton [Wed, 16 Sep 2020 19:55:59 +0000 (12:55 -0700)]
Run PAL tests in CI (#42049)

Refactor the PAL test framework to be useable in our CI system, and enable it for testing

The existing PAL tests are problematic in a few ways for our CI.
1. They are large in terms of disk space used per test, this interferes with building them properly, especially as they are part of the product build, and not of the test build
2. While part of the product build, the option to build them was well hidden.
3. The tests are not related to our existing tests, and in particular are not driven from managed xunit wrappers.

The change here has 4 components
1. Reduce the volume of the binaries such that they can be passed from a product build to a test job effectively. This is done by merging all tests which are not strictly dependent on secondary libraries.
  - This was done via a tool which parsed and replaced all of the CMakeFiles.txt
  - And then manual editing to remove all duplicate global symbols
2. The build flag for building the tests has been exposed as a first class option to build-runtime, as well as through the subset mechanism. As of this change, developers who wish to build the tests should use the clr.paltests subset to build the tests.
3. As the tests do not have normal xunit wrappers, but they *do* have a script which will generate xunit output, they cannot quite be run in the existing helix pathway. Add a separate path for launch the appropriate helix workitem as part of outerloop test runs.
4. A new issue exclusion mechanism has been built. Add exclusions by modifying src/coreclr/src/pal/tests/palsuite/issues.targets
  - There are a number of failures in the current test suite that should probably be investigated, but making meaningful changes to the tests should not be part of this change.

3 years agoAdjust console error logging for msbuild (#42285)
David Wrighton [Wed, 16 Sep 2020 18:20:40 +0000 (11:20 -0700)]
Adjust console error logging for msbuild (#42285)

- Show a summary of error on completion
- And don't attempt to force alignment to screen width (which will allow for better copy/paste from the console)

3 years agoJIT: make profile data available to inlinees (#42277)
Andy Ayers [Wed, 16 Sep 2020 18:14:37 +0000 (11:14 -0700)]
JIT: make profile data available to inlinees (#42277)

Update the jit to try and read profile data for inlinees, and if successful,
scale it appropriately for the inline call site. This kicks in for crossgen
BBOPT and TieredPGO Tier1.

Update VM and Crossgen hosts to handle requests for inlinee profile counts.
Crossgen2 does not seem to support profile data retrieval yet.

Note crossgen experience may not be as good as one might expect, because
crossgen BBINSTR loses counts for inlinees. But enabling this for crossgen
even with this limitation is probably a win overall.

Fix small issue in the jit where we were overly aggressive about merging the
callee block's flags into the callsite block's flags.

3 years agoSupport CFB8 for 3DES and AES on Windows 7
Kevin Jones [Wed, 16 Sep 2020 16:52:57 +0000 (12:52 -0400)]
Support CFB8 for 3DES and AES on Windows 7

This also throws a better exception on platforms that do not support
setting the feedback size (such as Win7).

3 years ago[mono] Add proper check for clock_gettime (#42206)
Ryan Lucia [Wed, 16 Sep 2020 15:24:14 +0000 (11:24 -0400)]
[mono] Add proper check for clock_gettime (#42206)

Fixes mono/mono wasm build

3 years ago[utils] Don't use __builtin_available on x86 and amd64 macos (#42251)
monojenkins [Wed, 16 Sep 2020 14:24:20 +0000 (10:24 -0400)]
[utils] Don't use __builtin_available on x86 and amd64 macos (#42251)

Fixes package building.  We build packages with Xcode 8.3.3 for x86 and amd64
build, and it is too old for __builtin_available

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years agoFix createdump Windows triage dumps (#42159)
Mike McLaughlin [Wed, 16 Sep 2020 02:54:38 +0000 (19:54 -0700)]
Fix createdump Windows triage dumps (#42159)

Fix createdump Windows triage dumps

Add ld (i.e. ld_2_23.so) interpreter program headers to Linux coredumps. This is important to the windbg linux support.

3 years agoa naive fix for Jit Time log with the new style phases. (#42199)
Sergey Andreenko [Tue, 15 Sep 2020 23:41:59 +0000 (16:41 -0700)]
a naive fix for Jit Time log with the new style phases. (#42199)

* a naive check for time log.

* format fix.

3 years agoAdd comment to ThreadSuspend::RestartEE (#42281)
Jan Kotas [Tue, 15 Sep 2020 23:16:10 +0000 (16:16 -0700)]
Add comment to ThreadSuspend::RestartEE (#42281)

3 years agoAdd running of the release/5.0 branch for the runtime repo (#42279)
Drew Scoggins [Tue, 15 Sep 2020 22:27:39 +0000 (15:27 -0700)]
Add running of the release/5.0 branch for the runtime repo (#42279)

3 years agoRe-enable tests for Directory.GetFileSystemEntries (#42242)
David Cantú [Tue, 15 Sep 2020 21:33:05 +0000 (14:33 -0700)]
Re-enable tests for Directory.GetFileSystemEntries (#42242)

3 years ago[wasm][debugger] Log messages in the proxy with the correct debug level (#42170)
Ankit Jain [Tue, 15 Sep 2020 21:03:44 +0000 (17:03 -0400)]
[wasm][debugger] Log messages in the proxy with the correct debug level (#42170)

- Eg. exceptions thrown in the proxy get logged as debug, instead of an
error, so you might get strange test failures with no details!

Also, updated the current messages logged as `info` to `debug`, since
that is what they were being logged as anyway.

3 years agoTransition to GC Unsafe in mono_runtime_invoke_array (#41174)
monojenkins [Tue, 15 Sep 2020 20:22:52 +0000 (16:22 -0400)]
Transition to GC Unsafe in mono_runtime_invoke_array (#41174)

`mono_runtime_invoke_array` is marked as `MONO_API MONO_RT_EXTERNAL_ONLY`, but it does not transition to GC Unsafe in contrast to similar methods like `mono_runtime_invoke`. This led to crashes when calling it from unmanaged code.

The original PR that added the transitions in the other methods is https://github.com/mono/mono/pull/8613, maybe there was a particular reason for not updating  `mono_runtime_invoke_array` also?

<!--
Thank you for your Pull Request!

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

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

Co-authored-by: Boulougou <Boulougou@users.noreply.github.com>
3 years agorestart fix for weak memory model processors (#42243)
Maoni Stephens [Tue, 15 Sep 2020 19:46:25 +0000 (12:46 -0700)]
restart fix for weak memory model processors (#42243)

3 years agoUpdate bug report template for Blazor (#42271)
Katelyn Gadd [Tue, 15 Sep 2020 19:25:46 +0000 (12:25 -0700)]
Update bug report template for Blazor (#42271)

Bug reports about Blazor should include info on the user's web browser(s)

3 years agoSet targetplatform only if necessary in runsetting (#42256)
Viktor Hofer [Tue, 15 Sep 2020 18:15:57 +0000 (20:15 +0200)]
Set targetplatform only if necessary in runsetting (#42256)

* Set targetplatform only if necessary in runsetting

3 years ago[wasm][debugger] Add support for raising events in the app, intended to (#42171)
Ankit Jain [Tue, 15 Sep 2020 18:04:33 +0000 (14:04 -0400)]
[wasm][debugger] Add support for raising events in the app, intended to (#42171)

* [wasm][debugger] Add support for raising events in the app, intended to

.. be received by the debug proxy.

* [wasm][debugger] `mono_wasm_raise_event` -> `mono_wasm_raise_debug_event`

Based on @lewing's suggestion

3 years agoDelete obsolete folder src/coreclr/tests/debugger_tests (#42218)
Tomáš Rylek [Tue, 15 Sep 2020 17:46:41 +0000 (19:46 +0200)]
Delete obsolete folder src/coreclr/tests/debugger_tests (#42218)

3 years ago[wasm][debugger] Fix stepping out from an async method (#42227)
Thays Grazia [Tue, 15 Sep 2020 17:24:38 +0000 (14:24 -0300)]
[wasm][debugger] Fix stepping out from an async method (#42227)

* Fix assert when calling set_set_notification_for_wait_completion_flag

* Fix compilation error.

3 years ago[wasm] Download Symbols from microsoft symbol server (#40690)
Thays Grazia [Tue, 15 Sep 2020 16:46:29 +0000 (13:46 -0300)]
[wasm] Download Symbols from microsoft symbol server (#40690)

* Creating a draft to download symbols from microsoft symbol server when there is an exception and exceptions are turned on on debugger.
This is a workaround while VS doesn't work on it, which should be the final solution.

* Fix what lewing suggested.

* Changing what @radical suggested.

* Changed what @radical suggested.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* If it's not available on a URL try in the next one in the list.

* Logging error and adding comment about SDSR

* Returning if we find the method even if we have an exception sending files to browser.

* Logging when we don't find the pdb.

* Changing what @radical suggested.

* Avoiding that we try to load symbols from the same assembly more than once.

* Simplifying and adding more log.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Adding support for receive the urlSymbolServer as a parameter in the request as discussed with Diego:

Diego: The response from vs code is that this shouldn't live in js-debug, so I think that passing it around in inspectUri would be the best approach for us

* Fix @radical suggestion.

* Removing default symbol server URL, like this we can land this on rc 5.0 without any risk of side effect.

* Fix compilation.

* Update src/mono/wasm/debugger/DebuggerTestSuite/TestHarnessStartup.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Update src/mono/wasm/debugger/BrowserDebugHost/Startup.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Accepting @radical suggestion.

* Adding workaround on dotnet/runtime while PR 686 is not merged on Cecil. When it's merged we will not get any side effect with this workaroud.

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoUpdating HttpCLientFactory ownership (#42245)
Karel Zikmund [Tue, 15 Sep 2020 14:00:00 +0000 (16:00 +0200)]
Updating HttpCLientFactory ownership (#42245)

Networking team owns it

3 years agoAdd test to make sure we release the ICorProfilerCallback interfaces (#41855)
David Mason [Tue, 15 Sep 2020 09:16:25 +0000 (02:16 -0700)]
Add test to make sure we release the ICorProfilerCallback interfaces (#41855)

3 years agoDon't set TargetPlatform to arm64 in runsettings (#42210)
Viktor Hofer [Tue, 15 Sep 2020 09:01:03 +0000 (11:01 +0200)]
Don't set TargetPlatform to arm64 in runsettings (#42210)

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

3 years agoMark Thread.ResetAbort as obsolete (#42228)
Luke Parker [Tue, 15 Sep 2020 05:52:58 +0000 (15:52 +1000)]
Mark Thread.ResetAbort as obsolete (#42228)

3 years agoHTTP2 Perf: Optimize decoding of HPack static table (#40745)
Geoff Kizer [Tue, 15 Sep 2020 05:34:02 +0000 (22:34 -0700)]
HTTP2 Perf: Optimize decoding of HPack static table (#40745)

* optimize decoding of HPack static table

* use byte[] instead of ReadOnlyMemory<byte> in table

* address feedback

* add error string for multiple status codes

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoclean up Span/Memory usage (#42236)
Geoff Kizer [Tue, 15 Sep 2020 05:32:45 +0000 (22:32 -0700)]
clean up Span/Memory usage (#42236)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoUnpin C# compiler version (#42174)
Jan Kotas [Tue, 15 Sep 2020 03:21:20 +0000 (20:21 -0700)]
Unpin C# compiler version (#42174)

3 years agoRenable build of several tests on wasm. (#42134)
Nathan Ricci [Tue, 15 Sep 2020 03:09:18 +0000 (23:09 -0400)]
Renable build of several tests on wasm. (#42134)

3 years agoImprove codegen for `Marshal.ThrowExceptionForHr` (#40211)
John Kelly [Tue, 15 Sep 2020 02:55:14 +0000 (03:55 +0100)]
Improve codegen for `Marshal.ThrowExceptionForHr` (#40211)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years ago[mono] Introduce MonoMemoryManager to hold memory previously owned by the domain...
Ryan Lucia [Tue, 15 Sep 2020 01:55:45 +0000 (21:55 -0400)]
[mono] Introduce MonoMemoryManager to hold memory previously owned by the domain (#41754)

* Introduce MonoMemoryManager

* Move things out of the domain

* Update callers

This does *not* handle cases where we call mono_domain_alloc and friends, just direct access to domain->mp etc. As of this, everything is allocated from the default ALC on netcore and the domain on legacy.

* Update locks in domain_alloc functions

* Take correct lock around mp

* Introduce memory manager allocation helpers

* Shorten mono_domain_default_memory_manager

* Add memory_manager alloc nolock variants

* Fix locking

* More use of nolock functions

* Add trailing newline to monovm.h

This is obviously unrelated, but it was causing issues with my sed commands

* mono_memory_manager -> mono_mem_manager

Bit shorter at least, but I can cut it down further if deemed necessary

* Add to msvc build

* Fix mono/mono build

* Fix test failure

Oops

* Remove erroneous returns

* Store domain in memory manager, take domain lock

* Build fixes

* Remove comment

* Free memory manager during domain unload

* C++ fix

* Don't double free

* Remove designated initializer

MSVC C++ fails it seems :(

3 years agoSPMI: fix performance of `repRecordCallSite`. (#42192)
Sergey Andreenko [Tue, 15 Sep 2020 01:21:26 +0000 (18:21 -0700)]
SPMI: fix performance of `repRecordCallSite`. (#42192)

* Fix a long replaying test.

* add a comment.

3 years agoFix the globalization test. (#42212)
Tarek Mahmoud Sayed [Mon, 14 Sep 2020 22:14:20 +0000 (15:14 -0700)]
Fix the globalization test. (#42212)

3 years agoRedo annotation of Enumerable.Cast and friends to use oblivious TResult (#42215)
Stephen Toub [Mon, 14 Sep 2020 22:08:03 +0000 (18:08 -0400)]
Redo annotation of Enumerable.Cast and friends to use oblivious TResult (#42215)

* Revert "Make Enumerable.Cast<T> and friends return IEnumerable<T?> (#40929)"

This reverts commit e75670889321611505115e4561a98e80732b58a0.

* Redo annotation of Enumerable.Cast and friends to use oblivious T

Some folks aren't happy with the fallout of Cast being annotated to return a `TResult?`, and others aren't happy with having it be `TResult`.  Consensus is to make the TResult oblivious, such that we don't declare one way or another what it is, since there's no good way to annotate it appropriately.

3 years ago[utils] Fix MONO_SOLIB_EXT in mono-dl.h on Apple ARM64 (now .dylib) (#42181)
monojenkins [Mon, 14 Sep 2020 20:48:16 +0000 (16:48 -0400)]
[utils] Fix MONO_SOLIB_EXT in mono-dl.h on Apple ARM64 (now .dylib) (#42181)

Co-authored-by: k15tfu <k15tfu@users.noreply.github.com>