summaryrefslogtreecommitdiff
path: root/src/pal
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-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-04[Tizen] Enable ASan annotation of passing to native code buffersAndrey Kazmin1-2/+45
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 Vorlicek3-5/+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] 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-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-25Mark Relocation Section as NotNeeded (#25715)Dong-Heon Jung4-0/+107
- 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 Baladurin6-114/+915
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-25add access(2) call before dlopening filesYaroslav Yamshchikov1-0/+9
2020-01-16[automated] Merge branch 'release/3.0' => 'release/3.1' (#28002)dotnet-maestro-bot1-1/+7
* 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>
2020-01-14Revert CPU clipping in the presence of CPU quota to 3.0, 2.x behavior.Vladimir Sadov1-0/+6
Basically reverting https://github.com/dotnet/coreclr/pull/26806
2020-01-14Port to 3.1 - Fix VirtualMemoryLogging::logRecords overflow (#27958)Jan Vorlicek1-4/+4
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.
2020-01-14Port to 3.1 - Fix getting affinity set on MUSL on Jetson TX2 (#27957)Jan Vorlicek1-2/+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-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-30[Release/3.1] Port profiler APIs to set and retrieve environment variables ↵David Mason2-1872/+2872
to 3.1 (#27512)
2019-10-21[Release/3.1] Fixes for profiler stack sampling (#27300)David Mason1-1871/+1872
* 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-14Fix available memory extraction on Linux (#26764) (#26938)agoretsky1-12/+71
* 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.
2019-09-27Port to Release/3.1 - enabling MHR support (#26803)Jan Vorlicek4-32/+88
* 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-22Do not clip CPU count when CPU quota is used. (#26153) (#26806)Jan Kotas1-6/+0
2019-08-19arm64 out of proc unwind for DAC (#26156)Mike McLaughlin1-10/+69
Removed FEATURE_DATATARGET4 for arm64 Added SP check to createdump's native unwind loop to make it more robust. Issue: https://github.com/dotnet/coreclr/issues/15062
2019-08-07Port to 3.0 - Fix WSL alternate stack check (#25980)Jan Vorlicek2-5/+27
On WSL, the alternate stack check in sigsegv_handler doesn't work. The uc_stack members are always zero no matter whether the handler is executed on an alternate or default stack. So the check to detect whether we are running on an alternate stack or not is always returning false on WSL and it prevents NULL reference exceptions from being handled. The fix is to introduce an env variable COMPlus_EnableAlternateStackCheck that can be used to enable the alternate stack check. By default, the sigsegv_handler is considered to always run on an alternate stack.
2019-07-19Arm32 support VFP registers context to/from native context (#25775)Steve MacLean2-0/+79
2019-07-18Arm32 restore d8-d15 in ThrowExceptionFromContextInternal (#25777)Steve MacLean1-12/+21
2019-07-18Arm64 restore d8-d15 in ThrowExceptionFromContextInternal (#25743)Steve MacLean1-0/+12
2019-07-18Arm64 support SIMD registers context to/from native context (#25757)Steve MacLean2-0/+60
2019-07-18Arm64 Fix Rtl*Context (#25745)Steve MacLean2-5/+5
Fix issues related to save restore of FPCR/FPSR/V0/V31 There were several bugs in the assembly causing FPCR/FPSR to overwrite V0 on RtlCaptureContext. Then restore from V0 on RtlRestoreContext
2019-07-04Fix dotnet-dump/createdump launch failure (#25562)Mike McLaughlin1-1/+2
On CentOS or OpenSUSE dotnet-dump collect fails but a valid coredump is generated. The "prctl()" call is failing that gives the child createdump process permission to ptrace to the runtime process. On CentOS/OpenSUSE the PR_SET_PTRACER option isn't supported and not needed. Issue: https://github.com/dotnet/diagnostics/issues/334
2019-07-03Remove legacy resource value (PrivateBuild) in binaries. (#25560)Aaron Robinson2-12/+6
* Remove legacy resource value (PrivateBuild) in binaries. * Never set the private file flag on the binary
2019-06-29Fix a mutex abandon case with WaitHandle.WaitAll in the PAL (#25452)Koundinya Veluri1-2/+6
Fixes https://github.com/dotnet/coreclr/issues/25108 - Upon a `WaitAll` when all waits are already satisfied, the abandoned flag is overwritten with the abandoned state of the last wait object in the array - So if the first wait object is an abandoned mutex and the second wait object is a signaled event, the `WaitAll` succeeds and does not report that anything was abandoned - Fixed to accumulate into the flag instead of overwriting it
2019-06-26Delegate inspection API in the DBI (#25362)Juan Hoyos4-17/+119
* Add ICorDebugDelegateObjectValue interfaces * Expose appropriate HR (CORDBG_E_UNSUPPORTED_DELEGATE) * Partially DACize DelegateObject * Add DacDbi method for delegate inspection
2019-06-21Fix OSX floating point state extraction (#25295)Jan Vorlicek2-159/+66
There was a bug reported on a very recent Mac with Intel i9 processor. A crash in the RtlRestoreContext was happening at the fxrstor instruction due to the fact that the floating point state data were garbage. The investigation has shown that sometimes, the x86_FLOAT_STATE64 cannot be obtained using the thread_get_state API. And it was also found that at the same time, the x86_AVX_STATE64 can be obtained. The state extracted by the AVX variant contains all the registers that the FLOAT variant would extract. However, in some cases, even the x86_AVX_STATE64 cannot be obtained and there is a third flavor that we can get - x86_AVX512_STATE64. Unfortunately, there are cases where none of those can be obtained. It is not clear what causes these cases, it seems only kernel debugging can give us an answer to that. This change modifies the way we extract the floating point state. We first try to get the AVX state, if we fail, we try the AVX512 and finally we fall back to the FLOAT state. If we fail to get the floating point state with any of these, we return context without the floating point state flag set. Also, if only getting the FLOAT state succeeds, we return context without the XSTATE flag set.
2019-06-20Add custom default base address option to crossgen (#25227)Gleb Balykov4-1/+32
* Add crossgen option to setup default base address for native image This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION. * Mmap native images at default base address if env variable COMPlus_UseDefaultBaseAddr=0x1 is setup. This is enabled only with -DFEATURE_ENABLE_NO_ADDRESS_SPACE_RANDOMIZATION.
2019-06-17Enable running SIGSEGV handler on non-alternate stack (#25196)Jan Vorlicek1-3/+27
When a third party library that someone loads into a coreclr process registers its own SIGSEGV handler and then chain-calls coreclr SIGSEGV handler on a non-alternate stack, coreclr would currently crash. This fix enables it to execute the SIGSEGV handler on the non-alternate stack (original stack of the interrupted thread) in such case. The disadvantage is that stack overflow would lead to silent crash in such a case, but we cannot do anything about it.
2019-06-17Replace 'assert' with '_ASSERTE' (#25177)Andy Hanson1-1/+1
2019-06-11Use pread() to read DOS/NT headers when mapping PE files (#25059)Leandro A. F. Pereira1-14/+2
Shaves off two syscalls per managed assembly load.
2019-06-10Add support for the NetTrace EventPipe file formatnoahfalk5-12/+83
Right now the new format is not on by default, but it can be enabled using COMPlus_EventPipeNetTraceFormat = 1 for testing purposes. The plan to have a follow up PR that will add shipping configuration mechanisms and change the default setting. See the documentation in the PerfView repo for more details about the format. At a glance the goal is to create a format that is more efficient to produce, has a smaller on disk size, and offers enhanced functionality in a few areas: a) 64 bit thread id support b) Detection of dropped events via sequence numbers c) Better support for extracting subsets of the file Together with the change there was also some refactoring of the EventPipeBufferManager and EventPipeThread. This change addresses (at least in part) the following issues: #19688, #23414, #24188, #20751, #20555, #21827, #24852, #25046
2019-06-06Use CMake's C# support to build DacTableGen instead of manually invoking ↵Jeremy Koritzinsky3-23/+23
csc.exe ourselves. (#24342) * Use CMake's C# support to build DacTableGen instead of manually invoking csc.exe ourselves. * Fix x86 failures. * Disable DAC generation when building with NMake Makefiles and issue an error since the CMake C# support is VS-only. We don't actually support building with NMake (only configure) so this is ok. * Clean up rest of the macro=1's PR Feedback. * Fix Visual Studio generator matching. * Explicitly specify anycpu32bitpreferred for DacTableGen so the ARM64 build doesn't accidentally make it 64-bit * Fix bad merge
2019-06-06Fix tmp dir in configure.cmake (#25003)Jan Vorlicek1-3/+4
The ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS check was using a temp path that had some non-existent components. While this works fine on Linux, it fails to create the temp file on OSX. The fix is to use temp dir in the CMake's output dir.
2019-06-05APIs to allow profilers to use DoStackSnapShot on Linux (#24968)David Mason2-0/+17
2019-06-05Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac (#24777)Andy Hanson3-0/+18
* Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac In a previous PR (https://github.com/dotnet/coreclr/commit/ed52a006c01a582d4d34add40c318d6f324b99ba#diff-8447e54277bb962d167a77bb260760d7R1879), GetCacheSizePerLogicalCpu was changed to no longer rely on cpuid on amd64 systems; instead it uses GetLogicalProcessorCacheSizeFromOS(). Unfortunately that function consisted of a number of `#if`s, none of which were active on macs, and we just returned 0. This caused us to default to a gen0size of only 0.25MB, causing many GCs. Fixed by adding a new case that uses `sysctlbyname`. Fix #24658 * Fixes from code review * Check for function sysctlbyname instead of header
2019-06-05Use Modern CMake features instead of CMAKE_CXX_FLAGS (#24861)Jeremy Koritzinsky3-6/+6
* Convert C++ standard settings and warning options from CMAKE_<LANG>_FLAGS to Modern CMake isms. * More $<COMPILE_LANGUAGE> generator expressions instead of CMAKE_CXX_FLAGS. * Use $<COMPILE_LANGUAGE:CXX> for all -fpermissive usage * Fix generator expression that generates multiple flags * Fix invalid use of CMAKE_CXX_FLAGS instead of CMAKE_C_FLAGS. * Treat AppleClang as though it is Clang (match pre-3.0 behavior). * Update our build system to understand that AppleClang is distinct from Clang and remove CMP0025 policy setting. * PR Feedback.
2019-06-02Improve fatal err msg (#24390)Dan Moseley1-1/+1
* Improve fatal err msg * Match SO format * a * Remove dead define * More adjustments to ex msg * And PAL * Remove special case for SOE * Remove excess Debug.Assert newline * Remove excess newline * typo * New format * Remove DebugProvider redundancy * Adjustments * Remove preceding newline * Make other SOE and OOM consistent * Tidy up assertion msg * Fix missing newline after inner exception divider * CR when no inner exception * ToString never CR terminated * disable corefx tests temporarily
2019-05-30Frkaya/gcc fix 052919 (#24845)Sinan Kaya1-1/+1
* fix compilation with gcc7.x In file included from src/inc/sstring.h:1029:0, from src/inc/ex.h:19, from src/inc/stgpool.h:28, from src/inc/../md/inc/metamodel.h:18, from src/inc/../md/inc/metamodelro.h:19, from src/inc/metadata.h:17, from src/inc/corpriv.h:21, from src/md/compiler/stdafx.h:20, from src/md/compiler/mdutil.cpp:12: src/inc/sstring.inl: In member function ‘const WCHAR* SString::GetUnicode() const’: src/inc/sstring.inl:650:5: error: nonnull argument ‘this’ compared to NULL [-Werror=nonnull-compare] if (this == NULL) ^~ add version check * Use the abstracted version of __nodebug__ * cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C
2019-05-29Use /proc/<pid>/mem to read memory in remote DBI data target. It makes the ↵Mike McLaughlin2-1/+16
test case run at (#24844) least 4 to 5 times faster than before. Fallback to old transport ReadMemory if /proc/<pid>/mem can't be opened. This happens on attach because of permissions/access, but works fine on the launch (the most important case).
2019-05-29Add COMPlus_LTTng environment variable (#24733)John Salem1-5/+17
* default value is 1, and when set to 0 will disable loading LTTng. Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
2019-05-29Refactor native build to remove the compiler-override files (#23897)Jeremy Koritzinsky7-95/+12
* On systems that have both cmake 2 and cmake 3, use cmake 3. Move CMAKE_EXPORT_COMPILE_COMMANDS to top level instead of in gen-buildsys-*. Define the CMake install prefix in gen-buildsys-* instead of pulling from an environment variable. Define C++ standard as CMake property instead of as flag. Move CLR_DEFINES_*_INIT out of overrides and into configurecompiler.cmake Move flags that generate debug info into configurecompiler.cmake Remove the CMAKE_USER_RULES_OVERRIDE files. Add cmake version output for determining what cmake versions each CI system has. Fix syntax in gen-buildsys-clang. Change add_compile_definitions back to add_definitions Add -D prefix for adding definitions via add_definitions Remove extraneous double-quote Change default config definition adding to the syntax in master Switch back to old CMAKE_<LANG>_FLAGS way of setting the language standards and try to go back to 2.8.12 minimum Switch back setting compile definitions for non-Windows branch too. Use SET with CMAKE_<LANG>_FLAGS. Convert some usages of appending to CMAKE_<LANG>_FLAGS to add_compile_options where possible. Set CMAKE_<LANG>_FLAGS_INIT instead of CMAKE_<LANG>_FLAGS Make sure configureopimitzation.cmake is included correctly in test build. Try to add brackets to get the Linux ARM compilation working correctly. Define standard language version in configurecompiler.cmake instead of root CMakeLists (so tests get it) Try to move langauge standard check to configure.cmake define language standard in each root CMakeLists.txt Fix off-Windows test build. Set CMAKE_EXPORT_COMPILE_COMMANDS after the project() call * Set CMAKE_USER_MAKE_RULES_OVERRIDE to "" to not break incremental builds after building on a branch that had it set to a path. * Remove CMake version output. * Move comment outside of multiline command. * Retry setting CMAKE_USER_MAKE_RULES_OVERRIDE * Remove unnecessary variable wrappers. * Simplify cmake 3 resolution. * Explicitly use CMAKE_CXX_FLAGS for C++-only flags that GCC complains about on C files. * Set -Wall via CMAKE_<LANG>_FLAGS until we can move all flag settings to add_compile_options * Fix typos * Another temporary precedence issue. * include configureoptimization.cmake in configurecompiler.cmake * Move setting CMAKE_EXPORT_COMPILE_COMMANDS to configurecompiler.cmake. * Rename configure.cmake -> verify_lto.cmake. * Fix path to verify-lto * Try using CMAKE_<LANG>_FLAGS instead of CMAKE_<LANG>_FLAGS_INIT. * Revert name change to configure.camek
2019-05-28Fix initial thread affinity on Linux (#24801)Jan Vorlicek4-9/+51
* Fix initial thread affinity on Linux On Linux, a new thread inherits the affinity mask of the thread that created the new thread. This is a problem for background GC threads that are created by one of the server GC threads that are affinitized to single core. This change adds resetting each new thread affinity to match the current process affinity. In addition to that, I've also fixed the extraction of the CPU count that was using PID 0. While the doc says that 0 represents current process, it in fact means current thread. And as a small bonus, I've added caching of the value returned by the PAL_GetLogicalCpuCountFromOS, since it cannot change during runtime.
2019-05-23Diagnostics IPC (#24582)John Salem1-0/+4
* Initial draft of structs and classes for Diagnostic Server IPC Protocol * Fix some syntax/name issues that weren't getting caught by intellisense in vscode for mac * * Add member checkers for Flatten and GetSize * Split Flatten impl to have a default version for simple, fixed-size structs * * Remove unnecessary abstract class * Add documentation about templates * * Change templating for IpcMessage class to be more limited (only on message creation and payload parsing) * flesh out parse and tryparse * add requirement for non-fixed-size payloads to implement a static TryParse(buffer, bufferlen) * refactor namespace to bottom of file * * moved DiagnosticsIpc namespace into diagnosticprotocol.h to avoid being referenced by debug-pal project * converted diagnostic server to use DiagnosticsIpc code * converted EventPipeProtocolHelper to use DiagnosticsIpc code * made EventPipe end to end use DiagnosticsIpc code * * Add ASSERTs where relevant * Refactor stream ownershpi back to previous way for collect tracing response * * Add contracts where applicable * * Updating GenerateCoreDump code to use new IPC work after rebase * * modify contract in DiagnosticProtocolHelper to be more restrictive * remove comments * Add comment documentation of SFINAE pattern above usage * simplify Has* checks * Fix function resolution for static member check * Add Constructor for rvalue references to IpcMessage * avoid code path that would result in a blocking read on 0 bytes * Fix silly strcmp bug * fix contractin EventPipeProtocolHelper * * Modify header declaration to make static initialization easier * fix type in template code * * Make all messages use Initialize instead of constructor for hydrating themselves, to make error paths easier * * Expand and streamline error model to match spec * Simplify writing error messages to a static function * memory management * *modify function signatures for SFINAE to remove clang warning * * add braces to static initialization to remove clang warnings * * modify IpcMessage::TryParseImpl, to reset the internal data pointer when passing back a reinterpret_cast to prevent double frees on destruction * Add notes on requirement that user free the memory for a payload * * fix bug in TryParse for generateCoreDump * change INT to uint32_t in GenerateCoreDump payloads * Remove unused error code * * rename Miscellaneous command set to Diagnostic * Remove unnecessary command ids in EventPipe * Rename Diagnostic command set to Dump * * Move payload into Holder to simplify cleanup * Add buffer holder to payloads to ensure the buffers are being cleaned up after use * updated Profiler attach to use IPC work after rebase * * Fix typos * Fix placement of ifdefs for profiler helpers * * Fix accidental char hidden in ifdef... * * Add ASSERT to signify we shouldn't be re-using IpcMessages * * fix another typo hidden behind inactive ifdef... * * Change errors to use HRESULTS to increase transparency * fix bug in profiler attach for checking if entire client data is in buffer