summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-10-30Port dotnet/runtime#31904 to release/3.1 (#28013)Levi Broderick3-156/+92
Remove BMI2 from ASCII and UTF-16 processing hot paths, as not all processors have optimized implementations of pext/pdep
2020-10-30Fix build on systems with glibc >= 2.30 (#28012)Omair Majid1-0/+4
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.
2020-10-30Fix AppDomain.SetPrincipalPolicy bug for new threads (#32104) (#28019)Eirik Tsarpalis1-3/+4
* fix principal policy for new threads Fixes #31717 Co-authored-by: Marco Rossignoli <marco.rossignoli@gmail.com>
2020-10-30Port dotnet/runtime#31946 to release/3.1 branch (#28014)Levi Broderick1-1/+5
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.
2020-10-30[3.1] Fail FuncEval if slot backpatching lock is held by any thread (#28006)Koundinya Veluri4-3/+89
- 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-10-30Handle glibc sys/sysctl.h deprecation (#27048)Omair Majid1-2/+5
glibc has deprecated sys/sysctl.h: 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." ^ 1 error generated. Fix that by preferring sysconf and only including sys/sysctl.h if HAVE_SYSCONF is not true. This mirrors the order of the implementation code in this file (sysinfo.cpp) which checks for HAVE_SYSCONF before HAVE_SYSCTL. Fixes #27008
2020-10-30Fix OverflowException from IntPtr casting (#14381)Swift Kim1-1/+1
2020-10-30Fix PIE options (#26323)Jan Vorlicek45-128/+10
* 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-10-30Set vtable offset as containedJUNG DONG-HEON1-0/+1
- Can remove a machine instruction which adds vtable offset
2020-10-30Change bIsFree check in DacValidateMethodTable (#1086)Dong-Heon Jung1-8/+1
Some commands of SOS validate a method table in DacValidateMethodTable. In the function, it checks whether a method table is FreeObjectMethodTable or not with GetClass() value. However, GetClass() should not be NULL. (There is an assert in GetClass()) In this patch, it compares pMT address with g_pFreeObjectMethodTable address only.
2020-10-30modify integral tryparse to use memcpy (#2295)John Salem1-1/+1
2020-10-30Abort FuncEval on unaligned SP (for 3.1) (#26607)Steve MacLean1-0/+14
* Abort FuncEval on unaligned SP (#26572) * Check for nullity of the context in FuncEval setup SP alignment checks (#26911)
2020-10-07[x86/Linux] Fix SIGSEGV during evaluation abort routine.Mikhail Kurinnoi1-1/+16
In case of evaluation with implicit function call aborted by ```ICorDebugEval::Abort()```, CoreCLR crash with SIGSEGV at line https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/vm/jitinterface.cpp#L14293 since ```m_pJM``` is ```NULL```. This happens because during ```EECodeInfo::Init()``` call, ```codeAddress``` parameter provide address inside native code region (this address belong to CallDescrWorkerInternal(), libcoreclr.so), but not address inside managed code, so, ```ExecutionManager::FindCodeRange()``` can't find appropriate ```RangeSection```. During investigation I found, that at line https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/vm/stackwalk.cpp#L2584 current context was not changed properly (we have wrong ```Eip``` register value). I found, that ```FuncEvalFrame::UpdateRegDisplay()``` code https://github.com/dotnet/runtime/blob/e25517ea27311297c1e3946acb3b4382d5fa7fef/src/coreclr/src/debug/ee/debugger.inl#L238-L247 don't have x86/Linux support implemented. I propose changes, that were already made for other ```UpdateRegDisplay()``` implementations in order to provide proper context for x86/Linux.
2020-10-07Fix TPA map hash calculation. (#288)Mikhail Kurinnoi/AI Compiler Lab /SRR/Staff Engineer/Samsung Electronics3-2/+57
* Fix TPA map hash calculation. The point of issue is "the Turkish-I Problem". After locale changed, towupper() provide another result for "i" and different hash are calculated in case if file name have "i" letter. * Regression test for #37910
2020-10-07fix dwarf-based unwinding to the end of stackYaroslav Yamshchikov1-1/+1
We experience CLR crash on some architectures (at least on x86) in case of unhandled managed exception. libunwind steps to the very end of a stack, and if .eh_frame info is correct, it returns with retcode 0 and ip=0 from unw_step, then PAL calls unw_is_signal_frame with c->validate==0 which in turn dereferences zeroed ip in access_mem. libunwind spec says that retcode 0 from unw_step means very end of a stack, so PAL should not expect any frames, signal or not. It should convert cursor back to SEH representation and return with TRUE. corresponding PR to dotnet/runtime on upstream: https://github.com/dotnet/runtime/pull/42620
2019-10-15[Tizen] Add coreclr_preload_assembly to CoreCLR host APItizen_5.5.m2_releasesubmit/tizen_5.5_mobile_hotfix/20201026.185106submit/tizen_5.5/20191031.000006submit/tizen/20191014.221258accepted/tizen/unified/20191015.012049accepted/tizen/5.5/unified/mobile/hotfix/20201027.061818accepted/tizen/5.5/unified/20191031.004944Konstantin Baladurin14-162/+1064
2019-10-11[Tizen] mscorlib postscript to remove System.Private.CoreLib.dll.Backupsubmit/tizen/20191010.235421accepted/tizen/unified/20191011.080124Hyungju Lee1-0/+4
Change-Id: Ia495a61aa6495c3cf52cac167b34823ec90d3d9b
2019-10-11[Tizen] Enable Tizen ASan runtime supportVyacheslav Cherkashin2-1/+14
Enable libasansi.so support (libasan.so with switchable interceptors). Change-Id: I9ee9b47b7beab55f036ffc0697ffab2583e9701c Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
2019-10-11[Tizen] Implement ASan wrapper for Linux AMD64Vyacheslav Cherkashin3-0/+157
Change-Id: I48446ce7c8771a4c75149512bb7d8a8cb3fae8e5 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
2019-10-11[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>
2019-10-11[Tizen] Implement detecting of sanitized librariesAndrey Drobyshev5-0/+182
Parse ".dynamic" section (ELF dynamic array tags) of the module being added, find ".rel(a).plt" section and search it for presence of '__asan_init' symbol. Change-Id: Ie7cc4c818b791b5f00713b42ba15131325b8152c Signed-off-by: Andrey Drobyshev <a.drobyshev@samsung.com>
2019-10-07Remove VolatileLoad from code already under lockFadi Hanna1-1/+1
2019-10-07Use VolaiteLoad to read counterFadi Hanna1-2/+2
2019-10-07Fix read ordering bug between buckets pointer and counterFadi Hanna1-1/+4
2019-10-07Prevent freeing of the profiler on process shutdown.David Mason1-11/+6
2019-10-07Revert "bail if profiler is terminated"David Mason1-24/+15
This reverts commit a5339ba00e94b8cd0c85b67fa66944eabc4ec7ad.
2019-10-07bail if profiler is terminatedDavid Mason1-15/+24
2019-10-07[Tizen] skip dotnet specific arguments in corerunKonstantin Baladurin1-0/+13
Now we use corerun to run corefx tests instead of dotnet, because last one isn't available for Tizen/armel. So we need to skip dotnet specific arguments, we patch corerun for it because Microsoft.DotNet.RemoteExecutor tries to execute binary that it gets from /proc/self/maps, so we need a binary that will behave like dotnet.
2019-10-07Build 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.
2019-10-04[Linux/x86] Use ebp from current context during unwinding (#26789)Konstantin Baladurin4-15/+21
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
2019-10-04[Tizen] Add unsupported tests for armKonstantin Baladurin1-0/+1
tracing/tracevalidation/tracelogging/tracelogging/tracelogging.sh see tests/issues.targets
2019-09-26[JIT/x86] Fix LinearScan::allocateRegisters (#26649)Konstantin Baladurin1-1/+1
Check for `lvLRACandidate` instead of `!lvDoNotEnregister` when checking whether `this` may be enregistered and has an Interval.
2019-09-26Linux/x86: fix build (#26594)Konstantin Baladurin2-0/+3
2019-09-26[Tizen] Pack test libs to coreclr-testGleb Balykov1-0/+1
2019-09-26[Tizen] PrecompileCommonGenerics to falseHyungju Lee1-1/+1
Change-Id: I74b3686bf0caad35c2c7519f8e4ee4d8ad0412f3
2019-09-26[Tizen] Disable missing test, which requires libhostpolicy.so to be missingGleb Balykov1-0/+1
2019-09-26[Tizen] Add unsupported tests: see tests/issues.targetsGleb Balykov1-0/+6
2019-09-26[Tizen] Replace new runtest.sh, which calls dotnet internally, with old ↵Gleb Balykov1-256/+1071
runtest.sh
2019-09-26[Tizen] Partially revert a6292a6.Mikhail Kurinnoi1-0/+39
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.
2019-09-26[Tizen] Update openssl-64bit version to 1.1Hyungju Lee1-1/+1
Change-Id: Icc69aa049a77c3adb961b00571765905d3494c70
2019-09-26[Tizen] Enable IBCLoggerHyungju Lee1-1/+1
Change-Id: I39f7a8c07d7760493d2aae08750abce6139103c4
2019-09-26add access(2) call before dlopening filesYaroslav Yamshchikov1-0/+9
2019-09-26[Tizen] Precompile frequently used generic methods.Kirill Frolov3-0/+48
2019-09-26corbbtprof: set byte alignment for CORBBTPROF structures (#25816)Konstantin Baladurin1-0/+5
Fix patch fixes SIGBUG that occurs due to unaligned read/write
2019-09-26Fail to explicitly tail call on x86 unix. (#25032)Jarret Shook3-2/+55
* 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
2019-09-26[Tizen] Disable jithost arena cacheGleb Balykov1-1/+1
2019-09-26[Tizen] Disable IBC Logger as a defaultDongHeon Jung2-1/+5
- 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.
2019-09-26Fix 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.
2019-09-26[Tizen] Define -DHAS_ADDRESS_SANITIZER for ASan buildSlava Barinov1-3/+6
This define turns on new and delete operators compatibility mode for build with Address Sanitizer. It allows Tizen libasan to intercept operators and prevents alloc-dealloc-mismatch errors. Change-Id: If72b1d42dd99eaaf11d3cb1232006ee0e2e411c3 Signed-off-by: Slava Barinov <v.barinov@samsung.com>
2019-09-26[Tizen] Remove -DFEATURE_GDBJIT=TRUE from spec fileHyungju Lee1-2/+2
Change-Id: Ic0b8bfc8ab45284ecda5ab99e683224368e607f5