platform/upstream/coreclr.git
4 years agoLinux/x86: fix build (#26594)
Konstantin Baladurin [Mon, 9 Sep 2019 15:40:14 +0000 (00:40 +0900)]
Linux/x86: fix build (#26594)

4 years ago[Tizen] Pack test libs to coreclr-test
Gleb Balykov [Wed, 11 Sep 2019 13:53:14 +0000 (16:53 +0300)]
[Tizen] Pack test libs to coreclr-test

4 years ago[Tizen] Add unsupported tests
Gleb Balykov [Tue, 10 Mar 2020 17:22:57 +0000 (20:22 +0300)]
[Tizen] Add unsupported tests

4 years ago[Tizen] Replace new runtest.sh, which calls dotnet internally, with old runtest.sh
Gleb Balykov [Wed, 21 Aug 2019 16:47:37 +0000 (19:47 +0300)]
[Tizen] Replace new runtest.sh, which calls dotnet internally, with old runtest.sh

4 years ago[Tizen] Partially revert a6292a6.
Mikhail Kurinnoi [Mon, 19 Aug 2019 12:06:58 +0000 (15:06 +0300)]
[Tizen] Partially revert a6292a6.

NetcoreDBG depends from PAL functions.
Instead of SOS plugin, that use PAL static libs, debugger should be able
to operate with any runtime version and can't be statically linked to PAL.

4 years agoadd access(2) call before dlopening files
Yaroslav Yamshchikov [Thu, 18 Jul 2019 10:14:14 +0000 (13:14 +0300)]
add access(2) call before dlopening files

4 years agocorbbtprof: set byte alignment for CORBBTPROF structures (#25816)
Konstantin Baladurin [Tue, 23 Jul 2019 04:01:22 +0000 (07:01 +0300)]
corbbtprof: set byte alignment for CORBBTPROF structures (#25816)

Fix patch fixes SIGBUG that occurs due to unaligned read/write

4 years agoFail to explicitly tail call on x86 unix. (#25032)
Jarret Shook [Fri, 19 Jul 2019 04:07:08 +0000 (21:07 -0700)]
Fail to explicitly tail call on x86 unix. (#25032)

* Fail to explicitly tail call on x86 unix.

* Correctly return 100

* Correct return value

* Add noway assert in morphTailCall to avoid morphing slow tail calls on unix.

* Address feedback

4 years ago[Tizen] Disable jithost arena cache
Gleb Balykov [Fri, 2 Aug 2019 14:28:27 +0000 (17:28 +0300)]
[Tizen] Disable jithost arena cache

4 years ago[Tizen] Disable IBC Logger as a default
DongHeon Jung [Thu, 18 Jul 2019 08:28:55 +0000 (17:28 +0900)]
[Tizen] Disable IBC Logger as a default

- Profile information is collected by ibc logger.
  Hower it is not used and saved into profile file.
- The patch disables IBC logger which is enabled by default.
- It disables IBC logger only with ibclogger.h file.
  IBCLOGGER_ENABLED definition is only used in ibclogger files.

4 years agoFix a build error when IBCLOGGER_ENABLED is not defined (#25691)
Dong-Heon Jung [Wed, 17 Jul 2019 03:09:40 +0000 (12:09 +0900)]
Fix a build error when IBCLOGGER_ENABLED is not defined (#25691)

- Even if DACCESS_COMPILE or CROSSGEN_COMPILE is defined,
  coreclr can be built without IBCLOGGER_ENABLED definition.

4 years ago[Tizen] Enable PGO for Linux/arm
Konstantin Baladurin [Thu, 18 Apr 2019 09:29:56 +0000 (12:29 +0300)]
[Tizen] Enable PGO for Linux/arm

4 years ago[Tizen] seperate PIC and PIE to fix x86_64 build error
Woongsuk Cho [Thu, 9 May 2019 09:02:22 +0000 (18:02 +0900)]
[Tizen] seperate PIC and PIE to fix x86_64 build error

4 years ago[Tizen] Add a library to retrieve memory regions for a coredump
Mateusz Moscicki [Wed, 10 Apr 2019 09:40:33 +0000 (11:40 +0200)]
[Tizen] Add a library to retrieve memory regions for a coredump

This is needed to save a minicoredump of .NET applications to allows
reconstruct managed stack by lldb and SOS plugin.

4 years ago[Tizen] update cscope files to be ignored
Hyungju Lee [Wed, 13 Mar 2019 00:28:54 +0000 (09:28 +0900)]
[Tizen] update cscope files to be ignored

Change-Id: Ia0e1c6aa651c4fd88dc58b901729896a7a27681d

4 years agoFix OOPStackUnwinderX86::Unwind crash when Eip is invalid
Igor Kulaychuk [Wed, 25 Apr 2018 18:31:59 +0000 (21:31 +0300)]
Fix OOPStackUnwinderX86::Unwind crash when Eip is invalid

4 years agoFix EECodeManager::GetAmbientSP on x86/Linux
Igor Kulaychuk [Fri, 20 Apr 2018 20:52:57 +0000 (23:52 +0300)]
Fix EECodeManager::GetAmbientSP on x86/Linux

4 years ago[Tizen] Add -pie to linker option
Hyungju Lee [Mon, 2 Jul 2018 00:28:08 +0000 (09:28 +0900)]
[Tizen] Add -pie to linker option

There have been no -pie linker option.
This patch adds -pie linker option into crossgen(for tizen)

This originates from 0024-Add-pie-to-linker-option.patch

4 years ago[Tizen] Add support for GBS
junghyuk.park [Mon, 25 Jun 2018 09:47:41 +0000 (18:47 +0900)]
[Tizen] Add support for GBS

4 years ago[Tizen] Add prebuilt libicu-57.1 libraries
junghyuk.park [Mon, 25 Jun 2018 07:03:57 +0000 (16:03 +0900)]
[Tizen] Add prebuilt libicu-57.1 libraries

4 years ago[Tizen] Add BuildTools v3.1.3
Gleb Balykov [Tue, 10 Mar 2020 16:22:08 +0000 (19:22 +0300)]
[Tizen] Add BuildTools v3.1.3

4 years ago[3.1] Fail FuncEval if slot backpatching lock is held by any thread (#28006)
Koundinya Veluri [Tue, 18 Feb 2020 21:46:37 +0000 (16:46 -0500)]
[3.1] Fail FuncEval if slot backpatching lock is held by any thread (#28006)

- In many cases cooperative GC mode is entered after acquiring the slot backpatching lock and the thread may block for debugger suspension while holding the lock. A FuncEval may time out on entering the lock if for example it calls a virtual or interface method for the first time. Failing the FuncEval when the lock is held enables the debugger to fall back to other options for expression evaluation.
- Also added polls for debugger suspension before acquiring the slot backpatching lock on background threads that often operate in preemptive GC mode. A common case is when the debugger breaks while the tiering delay timer is active, the timer ticks shortly afterwards (after debugger suspension completes) and if a thread pool thread is already available, the background thread would block while holding the lock. The poll checks for debugger suspension and pulses the GC mode to block before acquiring the lock.

Risks:
- The fix is only a heuristic and lessens the problem when it is detected that the lock is held by some thread. Since the lock is acquired in preemptive GC mode, it is still possible that after the check at the start of a FuncEval, another thread acquires the lock and the FuncEval may time out. The polling makes it less likely for the lock to be taken by background tiering work, for example if a FuncEval starts while rejitting a method.
- The expression evaluation experience may be worse when it is detected that the lock is held, and may still happen from unfortunate timing
- Low risk for the change itself

Port of https://github.com/dotnet/runtime/pull/2380
Fix for https://github.com/dotnet/runtime/issues/1537

4 years agoPort dotnet/runtime#31946 to release/3.1 branch (#28014)
Levi Broderick [Tue, 18 Feb 2020 21:32:57 +0000 (13:32 -0800)]
Port dotnet/runtime#31946 to release/3.1 branch (#28014)

When string.Replace is given a target string with zero collation weight, it would enter an infinite loop. It is now changed so that the call to Replace terminates when such a condition is encountered.

4 years agoFix AppDomain.SetPrincipalPolicy bug for new threads (#32104) (#28019)
Eirik Tsarpalis [Tue, 18 Feb 2020 21:31:53 +0000 (21:31 +0000)]
Fix AppDomain.SetPrincipalPolicy bug for new threads (#32104) (#28019)

* fix principal policy for new threads

Fixes #31717

Co-authored-by: Marco Rossignoli <marco.rossignoli@gmail.com>
4 years agoFix build on systems with glibc >= 2.30 (#28012)
Omair Majid [Tue, 18 Feb 2020 18:27:24 +0000 (13:27 -0500)]
Fix build on systems with glibc >= 2.30 (#28012)

On newer systems with glibc 2.30, the compiler emits a warning:

    In file included from coreclr/src/pal/src/misc/sysinfo.cpp:32:
    /usr/include/sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and will be removed." [-Werror,-W#warnings]
    #warning "The <sys/sysctl.h> header is deprecated and will be removed."
     ^

The glibc 2.30 release notes cover this at
https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html:

* The Linux-specific <sys/sysctl.h> header and the sysctl function have been
  deprecated and will be removed from a future version of glibc.
  Application should directly access /proc instead.  For obtaining random
  bits, the getentropy function can be used.

To keep coreclr release/3.1 building, disable treating the #warning as an
error. Clang and GCC have separate flags to turn this error off.

4 years agoPort dotnet/runtime#31904 to release/3.1 (#28013)
Levi Broderick [Tue, 18 Feb 2020 18:06:38 +0000 (10:06 -0800)]
Port dotnet/runtime#31904 to release/3.1 (#28013)

Remove BMI2 from ASCII and UTF-16 processing hot paths, as not all processors have optimized implementations of pext/pdep

4 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20200213.5 (#28018)
dotnet-maestro[bot] [Fri, 14 Feb 2020 01:45:08 +0000 (01:45 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20200213.5 (#28018)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.20113.5
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.20113.5
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.20113.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.20113.5

4 years agoPort of dotnet/runtime#1059 to 3.1 branch (#27986)
Carol Eidt [Thu, 13 Feb 2020 22:27:49 +0000 (14:27 -0800)]
Port of dotnet/runtime#1059 to 3.1 branch (#27986)

This is the fix for #27924. This is a GC hole bug that was found externally, #27590.
The cause is that the JIT was using the target type of the subtract when it needed
to make a copy of the source, but it needs to use the source type.

## Customer Impact
Corruption of state that is non-deterministic and hard to track down.

## Regression?
Not a recent regression, but exposed by Unsafe.ByteOffset.

## Testing
The fix has been verified in the runtime repo.

## Risk
Low: The fix is straightfoward and only impacts 3 lines of code.

4 years agoPort fix for #1241 to 3.1 (#27983)
Carol Eidt [Thu, 13 Feb 2020 22:27:34 +0000 (14:27 -0800)]
Port fix for #1241 to 3.1 (#27983)

4 years agoPort PR #258 to 3.1 (#27984)
Carol Eidt [Thu, 13 Feb 2020 22:27:22 +0000 (14:27 -0800)]
Port PR #258 to 3.1 (#27984)

* Port PR #258 to 3.1

* Fix test proj file

4 years agoFix GC heap corruption on ARM. (#27985)
Anton Lapounov [Thu, 13 Feb 2020 22:27:12 +0000 (14:27 -0800)]
Fix GC heap corruption on ARM. (#27985)

Port of dotnet/runtime#1389.

4 years agoPort the 5.0 fix for issue #1104 (#28003)
Brian Sullivan [Thu, 13 Feb 2020 22:26:51 +0000 (14:26 -0800)]
Port the 5.0 fix for issue #1104 (#28003)

* Port the 5.0 fix for issue #1104 3.1

- Pull Request Runtime\#1734
- This change corrects a cut-and paste typo with a previous commit.
- Includes test case Runtime_1104.cs

* Updated the csproj to use 3.1 syntax

4 years agoupdate branding for 3.1.3 (#28016)
Anirudh Agnihotry [Thu, 13 Feb 2020 22:24:18 +0000 (14:24 -0800)]
update branding for 3.1.3 (#28016)

4 years ago[automated] Merge branch 'release/3.0' => 'release/3.1' (#28002)
dotnet-maestro-bot [Fri, 17 Jan 2020 02:10:56 +0000 (18:10 -0800)]
[automated] Merge branch 'release/3.0' => 'release/3.1' (#28002)

* Fix Segfault in PerfInfo Image Logging (#26910)

* update branding for 3.0.2 (#27896)

* update branding

* remove stable properties from coreclr as it never stablises

* [release/3.0] Fix use of ilasm during test builds when using a 3.0 SDK (#27820)

* Add fix for restore of ilasm

The restore logic in buildtools tried to use a netcoreapp2.1 TFM for Linux-musl.
This ended up restoring Linux-x64 binaries which then broke the test build.
This change works around this by saving a copy of the depproj that BuildTools used into
the tree and restore it as a 3.0 app manually in init-tools on our side of the build.

* Change to a 3.0 SDK for servicing

* Bump test versions of ilasm and runtime package to match the RC

* Move off of the old arm32 queue (#27905)

* Add alpine3.10 testing to 3.0 (#27214)

* Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27843)

Port #25802 to 3.0.2

* [release/3.0] Update dependencies from dotnet/core-setup (#27910)

* Update dependencies from https://github.com/dotnet/core-setup build 20191016.12

- Microsoft.NETCore.App - 3.0.1-servicing-19516-12

* Update dependencies from https://github.com/dotnet/core-setup build 20191121.02

- Microsoft.NETCore.App - 3.0.2-servicing-19571-02

* update brandint to 3.0.3 (#27993)

* Update branding to 3.0.3 (#27997)

eng/Versions.props doesn't seem to the the source of truth for branding

* Fix infrastructure issues in release 3.0 (#28000)

* Restore Helix SDK using Tools.props to work around MSBuild race condition
* Disable formatting jobs
* Disable ARM windows jobs
* Fix tracing in RHEL6 build

* [release/3.0] Update dependencies from dotnet/arcade (#26889)

* Update dependencies from https://github.com/dotnet/arcade build 20190924.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19474.3
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19474.3
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19474.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19474.3

* Update NuGet.config

* Update runtime versions

* Update dependencies from https://github.com/dotnet/arcade build 20191119.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19569.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19569.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19569.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19569.2

* Update dependencies from https://github.com/dotnet/arcade build 20191122.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19572.3
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19572.3
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19572.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19572.3

* Update dependencies from https://github.com/dotnet/arcade build 20191127.5

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19577.5
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19577.5
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19577.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19577.5

* Add coreclr static feed to NuGet.config

Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Brian Robbins <brianrob@microsoft.com>
Co-authored-by: Anirudh Agnihotry <anirudhagnihotry098@gmail.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Jarret Shook <jashoo@microsoft.com>
Co-authored-by: David Mason <davmason@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Matt Mitchell <mmitche@microsoft.com>
4 years ago[release/3.1] Port fix to revert EncoderNLS and DecoderNLS Convert changes (#27996)
Levi Broderick [Wed, 15 Jan 2020 21:04:09 +0000 (13:04 -0800)]
[release/3.1] Port fix to revert EncoderNLS and DecoderNLS Convert changes (#27996)

4 years agoUpdate branding to 3.1.2 (#27998)
Matt Mitchell [Wed, 15 Jan 2020 19:51:12 +0000 (11:51 -0800)]
Update branding to 3.1.2 (#27998)

eng/Versions.props doesn't seem to be the source of truth for branding

4 years agoRevert CPU clipping in the presence of CPU quota to 3.0, 2.x behavior.
Vladimir Sadov [Wed, 15 Jan 2020 03:31:01 +0000 (19:31 -0800)]
Revert CPU clipping in the presence of CPU quota to 3.0, 2.x behavior.

Basically reverting https://github.com/dotnet/coreclr/pull/26806

4 years ago[release/3.1] Port fix for JIT silent bad code (#27972)
Andy Ayers [Tue, 14 Jan 2020 18:36:18 +0000 (10:36 -0800)]
[release/3.1] Port fix for JIT silent bad code (#27972)

* [release/3.1] Port fix for JIT silent bad code

Release/3.1 port of https://github.com/dotnet/runtime/pull/797.
Fixes https://github.com/dotnet/runtime/issues/764

The jit might incorrectly order a read from a struct field with an operation
that modifies the field, so that the read returns the wrong value.

Silent bad code; program behaves incorrectly.

Yes, introduced in the 3.0 cycle.

Verified the user's test case now passes; no diffs seen in any existing framework
or test code.

**Low**: the jit is now spilling the eval stack entries to temps in cases where it
did not before; this should be conservatively safe.

cc: @brucefo

____

If we're appending an assignment whose LHS is is a location within a local
struct, we need to spill all references to that struct from the eval stack.

Update the existing logic for this to handle the case where the LHS is a field
of a local struct, and the field is updated by unusual means (here, `initobj`).

Fixes dotnet/runtime#764.

* Fix test

4 years agoFix CancellationTokenRegistration.Unregister race condition (#27949)
Stephen Toub [Tue, 14 Jan 2020 18:36:07 +0000 (13:36 -0500)]
Fix CancellationTokenRegistration.Unregister race condition (#27949)

4 years agoRelease/3.1 port of dotnet/runtime#239 (#27973)
Andy Ayers [Tue, 14 Jan 2020 18:35:50 +0000 (10:35 -0800)]
Release/3.1 port of dotnet/runtime#239 (#27973)

Fix for #27923

The jit might fail to locate a class handle for a ref class, leading to an
unexpected crash while jitting.

## Customer Impact
Unexpected and hard to diagnose crash/exception

## Regression?
Yes, introduced during the development 3.0 cycle. 2.x behaves correctly.

## Testing
Verified the user's test case now passes; no diffs seen in any existing
framework or test code.

## Risk
**Low**: the jit will now fall back to using the handle for System.Object if no
better option can be found.

cc @BruceForstall

____

In some cases we may end up in lvaSetClass without a valid ref class handle
from either the IR or the stack. Use the handle for object as a conservative
fallback.

4 years agoFix EventSource to stop ignoring EventCommand.SendManifest (#27979)
Sung Yoon Whang [Tue, 14 Jan 2020 18:35:31 +0000 (10:35 -0800)]
Fix EventSource to stop ignoring EventCommand.SendManifest (#27979)

4 years agoStop throwing exception in TimeZoneInfo POSIX parsing (#27969)
Eric Erhardt [Tue, 14 Jan 2020 18:35:16 +0000 (12:35 -0600)]
Stop throwing exception in TimeZoneInfo POSIX parsing (#27969)

IsDaylightSavingTime_CasablancaMultiYearDaylightSavings fails on rhel.8

When parsing the tzdata POSIX string that contains an 'n' Julian date, we are currently throwing an exception, and then falling back to a TimeZoneInfo without DST enabled. However, this is a mistake because there are other DST transitions that were read from the tzdata file that are valid and usable. We shouldn't be throwing that information away.

So instead, we now skip the POSIX string if we detect an unsupported 'n' Julian date, and just use the last transition as the AdjustmentRule for all the DateTimes in the future. This way we can still make DST determinations correctly for some DateTimes.

Fix https://github.com/dotnet/corefx/issues/42192

4 years agoThis is a point fix for not allowing fast tail calls on windows arm64 for vararg...
Jarret Shook [Tue, 14 Jan 2020 18:35:01 +0000 (10:35 -0800)]
This is a point fix for not allowing fast tail calls on windows arm64 for vararg methods (#27963)

* This is a point fix for not allowing fast tail calls on windows arm64

This only affects windows arm and arm64.

* Fix build break

4 years agoPort to 3.1 - Fix out of range access in GetRecycleMemoryInfo (#27959)
Jan Vorlicek [Tue, 14 Jan 2020 18:34:51 +0000 (19:34 +0100)]
Port to 3.1 - Fix out of range access in GetRecycleMemoryInfo (#27959)

Ports change #26873 to release 3.1 branch.

On OpenVZ virtualized linux, GetCurrentProcessorNumber which uses sched_getcpu()
can return a value greater than the number of processors reported by
sched_getaffinity with CPU_COUNT or sysconf(_SC_NPROCESSORS_ONLN).
For example, taskset -c 2,3 ./MyApp will make CPU_COUNT be 2 but
sched_getcpu() can return 2 or 3, and OpenVZ kernel can make
sysconf(_SC_NPROCESSORS_ONLN) return a limited cpu count but
sched_getcpu() still report the real processor number.

Example of affinity vs current CPU id on OpenVZ:
nproc: 8
nprocOnline: 1
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 2
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 2
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 2
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 2
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 2
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 5
affinity: 1, 0, 0, 0, 0, 0, 0, 0, cpuid: 5

4 years agoPort to 3.1 - Fix VirtualMemoryLogging::logRecords overflow (#27958)
Jan Vorlicek [Tue, 14 Jan 2020 18:34:38 +0000 (19:34 +0100)]
Port to 3.1 - Fix VirtualMemoryLogging::logRecords overflow (#27958)

when VirtualMemoryLogging::recordNumber increments from LONG_MAX,
it became negative number, and the result of i % MaxRecords became
a number from -127 to 0.

When that happens we will ovewrite CRITICAL_SECTION virtual_critsec
which are stored in bss right before logRecords with garbage data.
Then most likely the process will have a GC hang with one or more
GC threads stuck trying to enter or leave critical section.

The fix is to ensure ULONG value are passed to modulo operation.

4 years agoPort to 3.1 - Fix getting affinity set on MUSL on Jetson TX2 (#27957)
Jan Vorlicek [Tue, 14 Jan 2020 18:33:49 +0000 (19:33 +0100)]
Port to 3.1 - Fix getting affinity set on MUSL on Jetson TX2 (#27957)

Ports https://github.com/dotnet/runtime/pull/206 to release/3.1.

The code in PAL_GetCurrentThreadAffinitySet relied on the fact that the
number of processors reported as configured in the system is always
larger than the maximum CPU index. However, it turns out that it is not
true on some devices / distros. The Jetson TX2 reports CPUs 0, 3, 4 and
5 in the affinity mask and the 1 and 2 are never reported. GLIBC reports
6 as the number of configured CPUs, however MUSL reports just 4. The
PAL_GetCurrentThreadAffinitySet was using the number of CPUs reported as
configured as the upper bound for scanning affinity set, so on Jetson
TX2, the affinity mask returned had just two bits set while there were
4 CPUs. That triggered an assert in the GCToOSInterface::Initialize.

This change fixes that by reading the maximum CPU index from the
/proc/cpuinfo. It falls back to using the number of processors
configured when the /proc/cpuinfo is not available (on macOS, FreeBSD, ...)

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

4 years agoupdate branding to 3.1.2 (#27981)
Anirudh Agnihotry [Tue, 14 Jan 2020 18:16:15 +0000 (10:16 -0800)]
update branding to 3.1.2 (#27981)

4 years agoUse 3.1.100 SDK in 3.1 build (#27965)
Matt Mitchell [Thu, 5 Dec 2019 23:18:05 +0000 (15:18 -0800)]
Use 3.1.100 SDK in 3.1 build (#27965)

To ensure that the 3.1 stack uses a consistent SDK.  The upper portions of the stack require the 3.1 SDK because for TFM purposes.

4 years ago[release/3.1] Update dependencies from dotnet/arcade (#27927)
dotnet-maestro[bot] [Thu, 5 Dec 2019 18:47:54 +0000 (10:47 -0800)]
[release/3.1] Update dependencies from dotnet/arcade (#27927)

* Update dependencies from https://github.com/dotnet/arcade build 20191122.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19572.3
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19572.3
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19572.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19572.3

* Update dependencies from https://github.com/dotnet/arcade build 20191127.5

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19577.5
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19577.5
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19577.5
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19577.5

4 years ago[automated] Merge branch 'release/3.0' => 'release/3.1' (#27922)
dotnet-maestro-bot [Mon, 2 Dec 2019 19:25:15 +0000 (11:25 -0800)]
[automated] Merge branch 'release/3.0' => 'release/3.1' (#27922)

* Fix Segfault in PerfInfo Image Logging (#26910)

* update branding for 3.0.2 (#27896)

* update branding

* remove stable properties from coreclr as it never stablises

* [release/3.0] Fix use of ilasm during test builds when using a 3.0 SDK (#27820)

* Add fix for restore of ilasm

The restore logic in buildtools tried to use a netcoreapp2.1 TFM for Linux-musl.
This ended up restoring Linux-x64 binaries which then broke the test build.
This change works around this by saving a copy of the depproj that BuildTools used into
the tree and restore it as a 3.0 app manually in init-tools on our side of the build.

* Change to a 3.0 SDK for servicing

* Bump test versions of ilasm and runtime package to match the RC

* Move off of the old arm32 queue (#27905)

* Add alpine3.10 testing to 3.0 (#27214)

* Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27843)

Port #25802 to 3.0.2

* [release/3.0] Update dependencies from dotnet/core-setup (#27910)

* Update dependencies from https://github.com/dotnet/core-setup build 20191016.12

- Microsoft.NETCore.App - 3.0.1-servicing-19516-12

* Update dependencies from https://github.com/dotnet/core-setup build 20191121.02

- Microsoft.NETCore.App - 3.0.2-servicing-19571-02

4 years agoChange non_virtual_calls_to_instance_methods test to non-il-sdk format (#27952)
Juan Hoyos [Mon, 2 Dec 2019 15:53:14 +0000 (07:53 -0800)]
Change non_virtual_calls_to_instance_methods test to non-il-sdk format (#27952)

* Change non_virtual_calls_to_instance_methods test to non-il-sdk format

* Work around maxpath hit by method name

* Fix compile item to short file name

4 years agoDisable formatting jobs in release/3.1 (#27954)
Jarret Shook [Thu, 28 Nov 2019 15:39:52 +0000 (07:39 -0800)]
Disable formatting jobs in release/3.1 (#27954)

4 years agoupdate branding for 3.1 sevicing (#27921)
Anirudh Agnihotry [Tue, 26 Nov 2019 21:25:03 +0000 (13:25 -0800)]
update branding for 3.1 sevicing (#27921)

* update branding for 3.1 sevicing

* added internal branch

4 years agoNon virtual calls to instance methods non-virtual dispatch on instance interface...
David Wrighton [Fri, 22 Nov 2019 21:26:57 +0000 (13:26 -0800)]
Non virtual calls to instance methods non-virtual dispatch on instance interface methods (#27756) (#27868)

* est for non_virtual_calls_to_instance_methods
* Fix handling of callvirt to instance methods on interface types that are not virtual
- Use call type to indicate if its non-virtual or not, instead of opcode
* Use ilproj to protect against future C# compiler changes
- This test needs to test the use of specific opcodes, and so an IL proj is required

4 years agoMove off of the old arm32 queue (#27906)
Jarret Shook [Thu, 21 Nov 2019 17:31:01 +0000 (09:31 -0800)]
Move off of the old arm32 queue (#27906)

4 years ago[release/3.1] Update dependencies from dotnet/arcade (#26886)
dotnet-maestro[bot] [Thu, 21 Nov 2019 02:56:36 +0000 (18:56 -0800)]
[release/3.1] Update dependencies from dotnet/arcade (#26886)

* Update dependencies from https://github.com/dotnet/arcade build 20190924.3

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19474.3
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19474.3
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19474.3
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19474.3

* Add lots o' sources

* Update dependencies from https://github.com/dotnet/arcade build 20191119.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19569.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19569.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19569.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19569.2

4 years agoUpdate PreReleaseVersionLabel to RTM (#27885)
William Godbe [Fri, 15 Nov 2019 00:21:02 +0000 (16:21 -0800)]
Update PreReleaseVersionLabel to RTM (#27885)

4 years ago[release/3.1] Fix use of ilasm during test builds when using a 3.0 SDK (#27818)
Juan Hoyos [Mon, 11 Nov 2019 23:40:59 +0000 (15:40 -0800)]
[release/3.1] Fix use of ilasm during test builds when using a 3.0 SDK (#27818)

* Add fix for restore of ilasm

The restore logic in buildtools tried to use a netcoreapp2.1 TFM for Linux-musl.
This ended up restoring Linux-x64 binaries which then broke the test build.
This change works around this by saving a copy of the depproj that BuildTools used into
the tree and restore it as a 3.0 app manually in init-tools on our side of the build.

* Change to a 3.0 SDK for servicing

4 years agoRevert "stablixe package (#27740)" (#27816)
William Godbe [Mon, 11 Nov 2019 19:15:16 +0000 (11:15 -0800)]
Revert "stablixe package (#27740)" (#27816)

This reverts commit 2bc3c7c6feede9a40deb7474ecdafa8d0809d8af.

4 years agostablixe package (#27740)
Anirudh Agnihotry [Mon, 11 Nov 2019 17:31:24 +0000 (09:31 -0800)]
stablixe package (#27740)

4 years agoMerge pull request #27742 from dotnet/darc-release/3.1-d5e14434-9c47-489d-80e5-c9ee4d...
William Godbe [Mon, 11 Nov 2019 17:31:07 +0000 (09:31 -0800)]
Merge pull request #27742 from dotnet/darc-release/3.1-d5e14434-9c47-489d-80e5-c9ee4d41b969

[release/3.1] Update dependencies from dotnet/core-setup and dotnet/corefx

4 years ago[release/3.1] Reword comments for policheck (#27670)
Jeremy Koritzinsky [Mon, 11 Nov 2019 17:30:52 +0000 (09:30 -0800)]
[release/3.1] Reword comments for policheck (#27670)

* Comment rewordings required by policheck.

* Use AppContainer instead of Windows Store.

4 years agoFixup PrivateAssets->ExcludeAssets
wtgodbe [Fri, 8 Nov 2019 22:29:02 +0000 (14:29 -0800)]
Fixup PrivateAssets->ExcludeAssets

4 years agoAdd packagereference to System.IO.FileSystem.AccessControl
wtgodbe [Fri, 8 Nov 2019 22:17:32 +0000 (14:17 -0800)]
Add packagereference to System.IO.FileSystem.AccessControl

4 years agoSet RuntimeFrameworkVersion in CoreFx.depproj
wtgodbe [Fri, 8 Nov 2019 21:12:36 +0000 (13:12 -0800)]
Set RuntimeFrameworkVersion in CoreFx.depproj

4 years agoLine up corefx & core-setup versions
wtgodbe [Fri, 8 Nov 2019 19:19:14 +0000 (11:19 -0800)]
Line up corefx & core-setup versions

4 years agoUpdate dependencies from corefx
wtgodbe [Thu, 7 Nov 2019 20:34:43 +0000 (12:34 -0800)]
Update dependencies from corefx

4 years agoUpdate dependencies from https://github.com/dotnet/core-setup build 20191103.2
dotnet-maestro[bot] [Thu, 7 Nov 2019 20:08:27 +0000 (20:08 +0000)]
Update dependencies from https://github.com/dotnet/core-setup build 20191103.2

- Microsoft.NETCore.App - 3.1.0-preview3.19553.2

4 years agoFix StreamReader to pass cancellation token into ReadBufferAsync (#27464) (#27501)
Stephen Toub [Thu, 31 Oct 2019 17:06:30 +0000 (13:06 -0400)]
Fix StreamReader to pass cancellation token into ReadBufferAsync (#27464) (#27501)

ReadAsyncInternal is correctly passing its token into the two call sites where it delegates directly to the underlying stream, but in one place it calls through ReadBufferAsync, which is currently not defined to take a token.  Fix that, and pass the token through.

4 years agoSupport large EventSource filter args (#27522)
Noah Falk [Thu, 31 Oct 2019 00:09:33 +0000 (17:09 -0700)]
Support large EventSource filter args (#27522)

1. Fix NullReferenceException. When the filter args exceeded the
hard-coded size limit GetDataFromController would return data = null.
The code previously asserted that data was not null and triggered NRE
when it was. The fix correctly null checks the value instead of
asserting and uses an empty args dictionary in this case, the same as if
filter args had been empty to begin with.

2. ETW has always limited filter args to 1024 bytes but EventPipe has no
such restriction. When using DiagnosticSourceEventSource it can be
useful to specify a larger filter arg blob. I can't do anything about
ETW's restriction but there is no need for the runtime to force
EventPipe to be equally limited. The larger size also reduces the chance
that we need to hit the fallback path above causing filter args to be
ignored.

4 years agoFix minidumps not loading in VS issue (#27553)
Mike McLaughlin [Wed, 30 Oct 2019 23:12:47 +0000 (16:12 -0700)]
Fix minidumps not loading in VS issue (#27553)

Fix a function that was ifdef'ed needed for the metadata locator callbacks to work.

Fix some not properly DAC'ized code in the type desc and server GC code. Caused an exception during dump generation.

Issue: https://github.com/dotnet/coreclr/issues/26907

4 years ago[Release/3.1] Port profiler APIs to set and retrieve environment variables to 3.1...
David Mason [Wed, 30 Oct 2019 18:26:32 +0000 (11:26 -0700)]
[Release/3.1] Port profiler APIs to set and retrieve environment variables to 3.1 (#27512)

4 years agoRebrand to preview3 (#27552)
William Godbe [Wed, 30 Oct 2019 17:52:38 +0000 (10:52 -0700)]
Rebrand to preview3 (#27552)

4 years ago[3.1] Protect against a rare invalid lock acquision attempt during etw processing...
Koundinya Veluri [Thu, 24 Oct 2019 20:06:58 +0000 (13:06 -0700)]
[3.1] Protect against a rare invalid lock acquision attempt during etw processing during shutdown (#27241)

* Protect against a rare invalid lock acquision attempt during etw processing during abrupt shutdown

Targeted and partial fix for https://github.com/dotnet/coreclr/issues/27129
- This is not a generic fix for the issue above, it is only a very targeted fix for an issue seen (a new issue introduced in 3.x). For a generic fix and more details, see the fix in 5.0: https://github.com/dotnet/coreclr/pull/27238.
- This change avoids taking a lock during process detach - a point in time when all other threads have already been abruptly shut down by the OS and locks may have been orphaned.
- The issue leads to a hang during shutdown when ETW tracing is enabled and the .NET process being traced begins the shutdown sequence at an unfortunate time - this is a probably rare timing issue. It would take the shutdown sequence to begin at just the point when a thread holds a particular lock and is terminated by the OS while holding the lock, then the OS sends the process detach event to the CLR, work during which then tries to acquire the lock and cannot because it is orphaned.
- The generic fix has broader consequences and is unlikely to be a reasonable change to make so late in the cycle, such a change needs some bake time and feedback. Hence this targeted fix for 3.x.

* Report tier as unknown when it cannot be determined

* Return unknown only on process detach

4 years agoFix step with stackalloc (#27246) (#27351)
Steve MacLean [Tue, 22 Oct 2019 20:58:15 +0000 (16:58 -0400)]
Fix step with stackalloc (#27246) (#27351)

* Make ControllerStackInfo::m_returnFrame private

* Make ControllerStackInfo always capture a return frame

In case the active frame has no managed caller, capture
the unmanaged frame

* Fix step over stackalloc

Generalize handling of stack allocations and stepping

* Fix GetFunctionFromToken() argument checking

Check token type is a method before creating a CordbFunction.

Add extra assert to check for invalid tokens

4 years agoFix LTTng build for build environments with older liblttng-ust-dev (#27273) (#27294)
Sung Yoon Whang [Mon, 21 Oct 2019 23:04:28 +0000 (16:04 -0700)]
Fix LTTng build for build environments with older liblttng-ust-dev  (#27273) (#27294)

* Fix macro redefinition to use XplatEventLogger instead of simply writing FALSE

* Fix linker error

* undo newline changes

* Some changes to comment

* Move wrapper export from eventpipe.cpp to eventtrace.cpp

4 years ago[Release/3.1] Fixes for profiler stack sampling (#27300)
David Mason [Mon, 21 Oct 2019 20:57:30 +0000 (13:57 -0700)]
[Release/3.1] Fixes for profiler stack sampling  (#27300)

* only set THREAD_IS_SUSPENDED if we are truly doing an async stack walk (#26985)

* Use a new COR_PRF_SUSPEND_FOR_PROFILER in ICorProfilerCallback::RuntimeThreadSuspended() when requested by profiler (#27041)

Fixes https://github.com/dotnet/coreclr/issues/26576

4 years ago[3.1] Backport fixes to ETW/EventPipe events to enable GCDumps (#27297)
John Salem [Mon, 21 Oct 2019 18:22:50 +0000 (11:22 -0700)]
[3.1] Backport fixes to ETW/EventPipe events to enable GCDumps (#27297)

* Move TypeSystemLog::OnKeywordsChanged from EtwCallback to EtwCallbackCommon to enable this same behavior in ETW and EventPipe.   This unblocks parity for GCHeapDumps between ETW and EventPipe (#26270)

* Fix unique ETW events for GC Type logging, so they are also fired across EventPipe (#27250)

4 years agoFix Segfault in PerfInfo Image Logging (#26910)
Brian Robbins [Tue, 15 Oct 2019 18:23:19 +0000 (11:23 -0700)]
Fix Segfault in PerfInfo Image Logging (#26910)

4 years agoFix DecoderNLS.Convert to out the correct value for 'completed' (#27229)
Levi Broderick [Thu, 17 Oct 2019 18:33:32 +0000 (11:33 -0700)]
Fix DecoderNLS.Convert to out the correct value for 'completed' (#27229)

Port https://github.com/dotnet/coreclr/pull/27210 to release/3.1

4 years agoEnable ETW/EventSource logging of task IDs for boxed state machines (#27115) (#27217)
Stephen Toub [Thu, 17 Oct 2019 15:32:29 +0000 (11:32 -0400)]
Enable ETW/EventSource logging of task IDs for boxed state machines (#27115) (#27217)

* Wrap MoveNext Action for TPL event tracing

Wraps the MoveNext action of the AsyncStateMachineBox in a
continuation wrapper when async causality tracing is on so that the
TPL event source can find the task that is associated with a
continuation. Does not wrap otherwise.

* Clarifying comment

* removing trailing whitespace

* code review feedback.

Makes AsyncMethodBuilderCore.TryFindContinuationTask check to
whether the target of a continuation is itself a task, as a fall-back
to checking to see if the continuation is a ContinuationWrapper

* Got rid of unnecessary null checks

4 years agoFix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap...
David Mason [Wed, 16 Oct 2019 20:13:55 +0000 (13:13 -0700)]
Fix GetSequencePoints when profiler provides mapping via SetILInstrumentedCodeMap (#27075)

Port #25802 to 3.1

4 years agoImprove the performance of Environment.WorkingSet in Windows (#26522) (#27212)
Sung Yoon Whang [Wed, 16 Oct 2019 05:08:30 +0000 (22:08 -0700)]
Improve the performance of Environment.WorkingSet in Windows (#26522) (#27212)

* Use win32 api directly for workingset counter

* Fix build warnings

* Removing useless code

* more cleanup

* remove size annotation

* remove useless comment

* Move all the changes to Environment.WorkingSet and remove it from RuntimeEventSourceHelper

* removing useless usings

* Use kernel32.dll instead of psapi.dll

* Code review feedback

* Remove newline change

* More code review nits

4 years agoDo not create diagnostics server thread and pipe if EnableDiagnostics is set to 0...
Sung Yoon Whang [Tue, 15 Oct 2019 01:29:38 +0000 (18:29 -0700)]
Do not create diagnostics server thread and pipe if EnableDiagnostics is set to 0 (#27137) (#27140)

* Do not create diagnostics server thread and pipe if EnableDiagnostics is set to 0

* Remove unnecessary check for config var in DiagnosticServer::Shutdown

4 years agoCorrectly handle variable argument SIMDScalar (#26421) (#26778)
Carol Eidt [Mon, 14 Oct 2019 20:23:46 +0000 (13:23 -0700)]
Correctly handle variable argument SIMDScalar (#26421) (#26778)

* Correctly handle variable argument SIMDScalar

Fix #26286

4 years agoEnable optimized single-proc allocation helpers for single-proc x86/x64 systems only...
Jan Kotas [Mon, 14 Oct 2019 17:25:34 +0000 (10:25 -0700)]
Enable optimized single-proc allocation helpers for single-proc x86/x64 systems only (#27014) (#27080)

Use maximum number of processors the process may run on to determine whether it is ok to use
single-proc allocation helpers. It is not sufficient to depend on current process affinity since
that can change during the process lifetime.

Also, the single-proc allocation helpers work well on x86/x64 systems only because of they depend
on atomic non-interlocked increment instruction for good performance. Such instruction is available
on x86/x64 only. Disable them everywhere else.

Fixes #26990

4 years agoFix available memory extraction on Linux (#26764) (#26938)
agoretsky [Mon, 14 Oct 2019 17:03:12 +0000 (20:03 +0300)]
Fix available memory extraction on Linux (#26764) (#26938)

* Fix available memory extraction on Linux

The GlobalMemoryStatusEx in PAL is returning number of free physical pages in
the ullAvailPhys member. But there are additional pages that are allocated
as buffers and caches that get released when there is a memory pressure and
thus they are effectively available too.

This change extracts the available memory on Linux from the /proc/meminfo
MemAvailable row, which is reported by the kernel as the most precise
amount of available memory.

4 years agopreview2 (#27127)
Anirudh Agnihotry [Thu, 10 Oct 2019 21:07:17 +0000 (14:07 -0700)]
preview2 (#27127)

4 years agoHandle AV caused by invalid IBC data (#27029) (#27034)
Fadi Hanna [Fri, 4 Oct 2019 18:58:23 +0000 (11:58 -0700)]
Handle AV caused by invalid IBC data (#27029) (#27034)

Make FindOrCreateAssociatedMethodDesc throw a type load exception instead of an AV, which can't be handled by EX_TRY/EX_CATCH on Unix systems.

4 years agoImprove TimeSpan precision (#26992) (#27010)
Jan Kotas [Fri, 4 Oct 2019 18:07:23 +0000 (11:07 -0700)]
Improve TimeSpan precision (#26992) (#27010)

Change multiplying by (x * (1.0 / BigValue)) on (x / BigValue).

Fix #41380

4 years agooom (#26457) (#26983)
Maoni Stephens [Thu, 3 Oct 2019 19:44:36 +0000 (12:44 -0700)]
oom (#26457) (#26983)

+ when hardlimit is specified we should only retry when we didn't fail due to commit failure - if commit failed it means we simply didn't have as much memory as what the hardlimit specified. we should throw OOM in this case.

+ added some diag info around OOM history to help with future diagnostics.

(cherry picked from commit 7dca41fd36721068e610c537654765e8e42275d7)

4 years agoFix read ordering bug between buckets pointer and counter (#26997) (#27009)
Fadi Hanna [Thu, 3 Oct 2019 19:08:01 +0000 (12:08 -0700)]
Fix read ordering bug between buckets pointer and counter (#26997) (#27009)

* Fix read ordering bug between buckets pointer and counter

Use VolaiteLoad to read counter

4 years agoMerge pull request #26893 from dotnet-maestro-bot/merge/release/3.0-to-release/3.1
William Godbe [Tue, 1 Oct 2019 17:35:32 +0000 (10:35 -0700)]
Merge pull request #26893 from dotnet-maestro-bot/merge/release/3.0-to-release/3.1

[automated] Merge branch 'release/3.0' => 'release/3.1'

4 years agoMerge branch 'release/3.1' into merge/release/3.0-to-release/3.1
William Godbe [Tue, 1 Oct 2019 17:35:17 +0000 (10:35 -0700)]
Merge branch 'release/3.1' into merge/release/3.0-to-release/3.1

4 years agoAbort FuncEval on unaligned SP (for 3.1) (#26607)
Steve MacLean [Mon, 30 Sep 2019 18:25:42 +0000 (14:25 -0400)]
Abort FuncEval on unaligned SP (for 3.1) (#26607)

* Abort FuncEval on unaligned SP (#26572)
* Check for nullity of the context in FuncEval setup SP alignment checks (#26911)

4 years agoPort to Release/3.1 - enabling MHR support (#26803)
Jan Vorlicek [Fri, 27 Sep 2019 08:47:27 +0000 (10:47 +0200)]
Port to Release/3.1 - enabling MHR support (#26803)

* Move JIT_WriteBarrier that is modified at runtime to a dynamically
allocated memory instead of making a page in libcoreclr.dylib RWX.
* Fix JIT_Stelem_Ref calls to JIT_WriteBarrier
* Update PAL to add MEM_JIT flag for allocations and reservations of
executable memory.
* Update native runtime in EH and stack unwinding areas so that it can
unwind from the write barrier copy. That code has no unwind info, so
without special handling, runtime would not be able to unwind from
it.

4 years agoupdate branding (#26875)
Anirudh Agnihotry [Wed, 25 Sep 2019 17:05:05 +0000 (10:05 -0700)]
update branding (#26875)

4 years agoDo not clip CPU count when CPU quota is used. (#26153) (#26806)
Jan Kotas [Mon, 23 Sep 2019 01:31:09 +0000 (18:31 -0700)]
Do not clip CPU count when CPU quota is used. (#26153) (#26806)

4 years agoPort The Fix When Enabling Windows Compatibilty Mode (#26805)
Tarek Mahmoud Sayed [Sat, 21 Sep 2019 18:24:14 +0000 (11:24 -0700)]
Port The Fix When Enabling Windows Compatibilty Mode (#26805)

4 years ago[release/3.1] Fix marshalling a pinnable multi-dimensional arr… (#26664)
Jeremy Koritzinsky [Tue, 17 Sep 2019 19:26:35 +0000 (12:26 -0700)]
[release/3.1] Fix marshalling a pinnable multi-dimensional arr… (#26664)

* Use the exact methodtable of the parameter to calculate the offset into a pinned array.