summaryrefslogtreecommitdiff
path: root/src/vm
AgeCommit message (Collapse)AuthorFilesLines
2020-07-13[Tizen] Update CreateDictionaryLookupHelper on arm64 to support relative ↵Gleb Balykov1-22/+75
indirection
2020-07-13[Tizen] Support relative indirection for 1st and 2nd levels of vtable on arm64Gleb Balykov2-52/+70
2020-06-26Fix a FNV error on arm64 (#286)정동헌/Common Platform Lab(SR)/Principal Engineer/삼성전자1-0/+2
Simple HelloWorld app can run with NI of System.Private.CoreLib.dll, HelloWorld.dll and System.Console.dll
2020-06-23[Tizen] Force Inline for Generic Methods (#224)submit/tizen/20200622.225420accepted/tizen/unified/20200623.124116정동헌/Common Platform Lab(SR)/Principal Engineer/삼성전자1-0/+11
This patch enables more generic method inlining for methods which are not compiled by NI.
2020-06-18Fix missing TransitionBlock methods (#33134)submit/tizen_5.5/20200623.003918accepted/tizen/5.5/unified/20200623.152349JUNG DONG-HEON1-3/+0
2020-06-18Implement instantiating and unboxing through portable stublinker code… (#106)JUNG DONG-HEON28-2365/+710
* Implement instantiating and unboxing through portable stublinker code - Handle only the cases with register to register moves - Shares abi processing logic with delegate shuffle thunk creation - Architecture specific logic is relatively simple - Do not permit use of HELPERREG in computed instantiating stubs - Fix GetArgLoc such that it works on all architectures and OS combinations Add a JIT stress test case for testing all of the various combinations - Use the same calling convention test architecture that was used as part of tail call work Rename secure delegates to wrapper delegates - Secure delegates are no longer a feature of the runtime - But the wrapper delegate lives on as a workaround for a weird detail of the ARM32 abi
2020-06-18Fix GenerateShuffleArray to support cyclic shuffles (dotnet/coreclr#26169)JUNG DONG-HEON4-20/+182
* Fix GenerateShuffleArray to support cyclic shuffles The GenerateShuffleArray was not handling case when there was a cycle in the register / stack slots shuffle and it resulted in an infinite loop in this function. This issue is Unix Amd64 ABI specific. To fix that, this change reworks the algorithm completely. Besides fixing the issue, it has also better performance in some cases. To fix the cyclic shuffling, I needed an extra helper register. However, there was no available general purpose register available, so I had to use xmm8 for this purpose. * Remove special handling of the hang from ABI stress
2020-06-04[Tizen] Enable ASan annotation of passing to native code buffersAndrey Kazmin1-1/+2
Turn on ASan inteceptors while marshaling managed buffers to native code. We could not properly annotate already allocated on heap buffers, so we have to disable pinning of such objects. Current patch affects only pinning of native arrays.
2020-04-16Fix PIE options (#26323)submit/tizen/20200415.223728accepted/tizen/unified/20200416.080052Jan Vorlicek1-4/+0
* Fix PIE options We were missing passing the -pie linker option. That means that while we were compiling our code as position independent, the executables (not shared libraries) were not marked as position independent and ASLR was not applied to them. They were always loaded to fixed addresses. This change adds the missing -pie option and also replaces all the individual settings of -fPIE / -fPIC on the targets we build by a centralized setting of CMAKE_POSITION_INDEPENDENT_CODE variable that causes cmake to add the appropriate compiler options everywhere. * Fix native parts of coreclr tests build The native parts of the tests are not built using the root CMakeLists.txt so I am moving enabling the position independent code to configurecompiler.cmake Change-Id: Ieafff8984ec23e5fdb00fb0c2fb017e53afbce88
2020-03-25[Tizen] Add FEATURE_LARGEADDRESS_SUPPORTSangwook Kim3-0/+13
Many diagnostic tools are unaware of 32-bit applications which have large address spaces (> 2GB). Such tools include the TraceEvent library (required by PerfView and dotnet-trace), and Visual Studio. They assume the address range 0x80000000 through 0xFFFFFFFF as the system space and thus often fail to read symbols from event traces generated by CoreCLR. This workaround is to support such scenarios by simply discarding MSBs of 32-bit instruction pointer values in the trace output. Only a minimal set of values required for symbol resolution are affected by this change. Beware that you will have to manually restore the original values when you inspect them in lldb or etc.
2020-03-25modify integral tryparse to use memcpy (#2295)John Salem1-1/+1
2020-03-25Mark Relocation Section as NotNeeded (#25715)Dong-Heon Jung1-0/+3
- After relocation, relocation section in zap image is not necessary. - Mark the section as NotNeeded by giving advice(madvise with MADV_DONTNEED) - It reduces 120~150KB PSS in tizen sample apps.
2020-03-25[Tizen] Add coreclr_preload_assembly to CoreCLR host APIKonstantin Baladurin3-46/+99
2020-03-25[Tizen] Implement ASan wrapper for Linux AMD64Vyacheslav Cherkashin3-0/+157
Change-Id: I48446ce7c8771a4c75149512bb7d8a8cb3fae8e5 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
2020-03-25[Tizen] Implement ASan wrapper for Linux ARM32Vyacheslav Cherkashin6-0/+278
This commit implements wrappers that allow interception transitions from managed to external unmanaged code (CIL -> native) and back (native -> CIL). This allows enable/disable ASan during transitions. Due to this, we sanitize only external code, which allows us to achieve acceptable performance. Change-Id: I53ecdc14d28f7210cd9e7f5bd4db0c8ef5ed81fc Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
2020-03-25Prevent freeing of the profiler on process shutdown.David Mason1-11/+6
2020-03-25Build error fix on FEATURE_PREJIT=trueSwift Kim2-2/+2
This fix is to update usages of SetupGcCoverage() under FEATURE_PREJIT aligned to the signature change in #25261.
2020-03-25[Linux/x86] Use ebp from current context during unwinding (#26789)Konstantin Baladurin2-12/+11
pCurrentContextPointers in REGDISPLAY can contain NULLs so we need to use ebp value from pCurrentContext. This patch contains following changes: - GetRegdisplayFP returns ebp from pCurrentContext - GetRegdisplayFP is used instead of *GetEbpLocation() - Set##reg##Location also updates register value in pCurrentContext
2020-03-25[Tizen] Disable IBC Logger as a defaultDongHeon Jung1-1/+1
- 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.
2020-03-25Fix a build error when IBCLOGGER_ENABLED is not defined (#25691)Dong-Heon Jung1-13/+31
- Even if DACCESS_COMPILE or CROSSGEN_COMPILE is defined, coreclr can be built without IBCLOGGER_ENABLED definition.
2020-03-25Fix EECodeManager::GetAmbientSP on x86/LinuxIgor Kulaychuk1-1/+2
2020-02-18[3.1] Fail FuncEval if slot backpatching lock is held by any thread (#28006)Koundinya Veluri3-3/+80
- 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
2020-01-14Port to 3.1 - Fix out of range access in GetRecycleMemoryInfo (#27959)Jan Vorlicek1-1/+3
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
2020-01-14Port to 3.1 - Fix getting affinity set on MUSL on Jetson TX2 (#27957)Jan Vorlicek1-1/+1
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
2019-11-22Non virtual calls to instance methods non-virtual dispatch on instance ↵David Wrighton1-1/+1
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
2019-11-11[release/3.1] Reword comments for policheck (#27670)Jeremy Koritzinsky1-1/+1
* Comment rewordings required by policheck. * Use AppContainer instead of Windows Store.
2019-10-30Fix minidumps not loading in VS issue (#27553)Mike McLaughlin1-2/+2
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
2019-10-30[Release/3.1] Port profiler APIs to set and retrieve environment variables ↵David Mason2-1/+105
to 3.1 (#27512)
2019-10-24[3.1] Protect against a rare invalid lock acquision attempt during etw ↵Koundinya Veluri2-5/+15
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
2019-10-21Fix LTTng build for build environments with older liblttng-ust-dev (#27273) ↵Sung Yoon Whang1-0/+8
(#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
2019-10-21[Release/3.1] Fixes for profiler stack sampling (#27300)David Mason2-3/+17
* 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
2019-10-21[3.1] Backport fixes to ETW/EventPipe events to enable GCDumps (#27297)John Salem1-7/+9
* 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)
2019-10-20Fix Segfault in PerfInfo Image Logging (#26910)Brian Robbins1-2/+15
2019-10-14Do not create diagnostics server thread and pipe if EnableDiagnostics is set ↵Sung Yoon Whang1-0/+6
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
2019-10-14Enable optimized single-proc allocation helpers for single-proc x86/x64 ↵Jan Kotas1-4/+4
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
2019-10-04Handle AV caused by invalid IBC data (#27029) (#27034)Fadi Hanna1-1/+5
Make FindOrCreateAssociatedMethodDesc throw a type load exception instead of an AV, which can't be handled by EX_TRY/EX_CATCH on Unix systems.
2019-10-03Fix read ordering bug between buckets pointer and counter (#26997) (#27009)Fadi Hanna1-1/+4
* Fix read ordering bug between buckets pointer and counter Use VolaiteLoad to read counter
2019-09-27Port to Release/3.1 - enabling MHR support (#26803)Jan Vorlicek8-7/+148
* 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.
2019-09-17[release/3.1] Fix marshalling a pinnable multi-dimensional arr… (#26664)Jeremy Koritzinsky3-3/+5
* Use the exact methodtable of the parameter to calculate the offset into a pinned array.
2019-09-12Fix watson bucketing/broken triage dumps (#26670)Mike McLaughlin1-0/+5
Fix watson bucketing/broken triage dumps The DAC EnumMemoryRegions needs to include some missing code version manager memory.
2019-08-29Emit RVA Instead of File Offset by Default in Native Image PerfMap Files ↵Brian Robbins3-5/+31
(#26423)
2019-08-19Use function-local StackingAllocator for EnC added methods (#26256)Juan Hoyos1-2/+6
As adding EnC methods happens on the Debugger Thread, there's no managed Thread object from which to obtain the cached StackingAllocator. Instead, just use a function-local StackingAllocator.
2019-08-19Account for quoted values in provider filter string (#26159) (#26195)John Salem1-3/+19
* Account for quoted values in provider filter string
2019-08-16Clean up diagnosticserver socket on unexpected shutdown (#25976) (#26190)Sung Yoon Whang2-0/+33
* Clean up diagnosticserver socket/pipe on shutdown * Refactor dbg transport pipe cleanup to be registered as signal handler from the vm side * cleanup dead code * Remove more dead code and fix windows builds * Moving some ifdefs around
2019-07-26fix gc config - need to read from both runtime config and env var (#25890)Maoni Stephens1-5/+9
need to read hardlimit configs from env vars as well as runtimeconfig.json
2019-07-19Fixing Buffer::BlockCopy, JIT_MemCpy, and JIT_MemSet to just call the ↵Tanner Gooding3-300/+90
appropriate CRT functions for x64 Windows, as is already done for all other platforms/targets (#25763) * Fixing Buffer::BlockCopy to just call the CRT memmove for x64 Windows, as is already done for all other platforms/targets * Fixing up the x64 CrtHelpers.asm to just forward to the CRT implementations for JIT_MemSet and JIT_MemCpy * Keep unix using memcpy and clarify that Windows uses memmove for full framework compat.
2019-07-19Fix typo: `_TARGET_X86` -> `_TARGET_X86_` (#25788)Andy Hanson1-1/+1
This typo was in #24989 so would be a new regression in 3.0. In an x86 build, it causes us to not get the cache size correct, leading us to use a smaller default cache size and do more GCs. Tested with GCPerfSim and this PR reduces TotalNumberGCs by 33% using an x86 build.
2019-07-16Merge branch 'release/3.0' into merge/master-to-release/3.0William Godbe2-0/+16
2019-07-16Add missing Arm64 specific diagnostic code (#25695)Steve MacLean1-0/+15
* Arm64 ICorDebugRegisterSet float support * Arm64 ICorDebugRegisterSet2 implementation * Add arm64 VLT_REG_FP case * Arm64 add funceval GetRegister SetRegister support
2019-07-12Frkaya/gccfix07102019 (#25624)Sinan Kaya3-3/+3
* Remove duplicate definition * Fix conversion error * 1ui64 doesn't exist on GCC