summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2020-10-07fix dwarf-based unwinding to the end of stacksubmit/tizen_5.5_wearable_hotfix/20201030.060217accepted/tizen/5.5/unified/wearable/hotfix/20201103.003343tizen_5.5accepted/tizen_5.5_unified_wearable_hotfixYaroslav 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
2020-10-07Revert "[Tizen] Fix crash on accessing 0x0 while unwinding (#287)"Yaroslav Yamshchikov1-3/+1
This reverts commit c4a72f57bee753daf09ffbc2a2dfe65ed1582919.
2020-07-03[Tizen] Unify dnetmemoryenumlib terms to match the codebase (#291)submit/tizen_5.5_wearable_hotfix/20201026.184306submit/tizen_5.5/20200729.021615submit/tizen_5.5/20200629.221218submit/tizen/20200703.012556accepted/tizen/unified/20200703.155115accepted/tizen/5.5/unified/wearable/hotfix/20201027.101953accepted/tizen/5.5/unified/20200729.230651accepted/tizen_5.5_unifiedMateusz Moscicki/System (PLT) /SRPOL/Engineer/Samsung Electronics2-20/+40
2020-06-30[Tizen] Fix crash on accessing 0x0 while unwinding (#287)이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자1-1/+3
Change-Id: I663d0fcdcd6fd8fb4c521d9bdbb4d234c96022ae
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-26Fix 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-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-HEON41-2407/+746
* 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-05[x86/Linux] Fix SIGSEGV during evaluation abort routine.submit/tizen_5.5/20200607.233848submit/tizen/20200607.233857accepted/tizen/unified/20200608.144754accepted/tizen/5.5/unified/20200608.142150Mikhail 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-06-04[Tizen] Enable ASan annotation of passing to native code buffersAndrey Kazmin2-3/+47
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-05-14Set vtable offset as containedJUNG DONG-HEON1-0/+1
- Can remove a machine instruction which adds vtable offset
2020-05-13[Tizen] Change the visibility of symbols for dnetmemoryenumlibsubmit/tizen_5.5/20200512.212247submit/tizen/20200528.065414accepted/tizen/unified/20200529.124257accepted/tizen/5.5/unified/20200522.160111Mateusz Moscicki2-6/+6
2020-04-22[Tizen] Add a config knob for importing ibc filesSwift Kim2-2/+15
2020-04-16Fix PIE options (#26323)submit/tizen/20200415.223728accepted/tizen/unified/20200416.080052Jan Vorlicek43-121/+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-25Fix OverflowException from IntPtr casting (#14381)Swift Kim1-1/+1
2020-03-25[Tizen] Reduce arm_phdr_cb call overheadJUNG DONG-HEON3-1/+48
- Too many calls to arm_phdr_cb even though it get the same data. - It caches an ARM_CB_DATA for libcoreclr.so, then reuse.
2020-03-25Change 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-03-25[Tizen] add pie linker option to createdumpWoongsuk Cho1-0/+1
2020-03-25Handle 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-03-25Enable NGEN for methods marked with AggressiveOptimization (#27259)Dong-Heon Jung1-1/+4
- Methods marked with AggressiveOptimization are not NGENed at all. - The methods are compiled during the runtime with high JITC overhead. - It makes launching time slower over 6% in our embedded systems.
2020-03-25Mark Relocation Section as NotNeeded (#25715)Dong-Heon Jung5-0/+110
- 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] Use PTRACE_GETREGSET for any arch when creating dumpSwift Kim1-13/+5
Also ignore ptrace NT_FPREGSET failures for arm processes on aarch64 kernels. Fixes #25707.
2020-03-25[Tizen] Add coreclr_preload_assembly to CoreCLR host APIKonstantin Baladurin14-162/+1064
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-25[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>
2020-03-25Prevent freeing of the profiler on process shutdown.David Mason1-11/+6
2020-03-25[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.
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 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
2020-03-25[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.
2020-03-25Linux/x86: fix build (#26594)Konstantin Baladurin2-0/+3
2020-03-25[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.
2020-03-25add access(2) call before dlopening filesYaroslav Yamshchikov1-0/+9
2020-03-25corbbtprof: set byte alignment for CORBBTPROF structures (#25816)Konstantin Baladurin1-0/+5
Fix patch fixes SIGBUG that occurs due to unaligned read/write
2020-03-25Fail to explicitly tail call on x86 unix. (#25032)Jarret Shook1-2/+6
* 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
2020-03-25[Tizen] Disable jithost arena cacheGleb Balykov1-1/+1
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-25[Tizen] seperate PIC and PIE to fix x86_64 build errorWoongsuk Cho1-3/+5
2020-03-25[Tizen] Add a library to retrieve memory regions for a coredumpMateusz Moscicki8-15/+339
This is needed to save a minicoredump of .NET applications to allows reconstruct managed stack by lldb and SOS plugin.
2020-03-25Fix OOPStackUnwinderX86::Unwind crash when Eip is invalidIgor Kulaychuk1-1/+1
2020-03-25Fix EECodeManager::GetAmbientSP on x86/LinuxIgor Kulaychuk1-1/+2
2020-03-25[Tizen] Add -pie to linker optionHyungju Lee1-0/+1
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
2020-02-18[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-02-18Port 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.