Skip to content

Commit 6f1bdff

Browse files
Sergey Andreenkojkotas
authored andcommitted
Disable arm64 contracts. (dotnet#22605)
* Fix ifdef for `g_DbgSuppressAllocationAsserts`. It needs to be defined under `FEATURE_INTEROP_DEBUGGING`. * Unify contracts disabling for UNIX/ARM. It also disables some parts that were disabled for ARM, but not for UNIX. It fixes the difference that we see between ARM32 and ARM64 Unix Checked. * Disable contracts on arm64. FIxes the difference that we see between windows arm32 and arm64 in checked/debug builds. * Revert CoreFX arm64 timeout change. That is no longer necessary. * Reenable arm64 corefx jobs. They should not fail with timeouts anymore. * Don't allow `g_DbgSuppressAllocationAsserts` defnition in release builds. * delete AssertAllocationAllowed
1 parent 342c80a commit 6f1bdff

File tree

6 files changed

+8
-60
lines changed

6 files changed

+8
-60
lines changed

configurecompiler.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ if (CLR_CMAKE_PLATFORM_UNIX)
438438
add_compile_options(-fstack-protector-strong)
439439
endif(CLR_CMAKE_PLATFORM_DARWIN)
440440

441+
# Contracts are disabled on UNIX.
441442
add_definitions(-DDISABLE_CONTRACTS)
442443

443444
if (CLR_CMAKE_WARNINGS_ARE_ERRORS)
@@ -563,6 +564,11 @@ if (WIN32)
563564

564565
set(CMAKE_ASM_MASM_FLAGS "${CMAKE_ASM_MASM_FLAGS} /ZH:SHA_256")
565566

567+
if (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
568+
# Contracts work too slow on ARM/ARM64 DEBUG/CHECKED.
569+
add_definitions(-DDISABLE_CONTRACTS)
570+
endif (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_ARM64)
571+
566572
endif (WIN32)
567573

568574
if(CLR_CMAKE_ENABLE_CODE_COVERAGE)

netci.groovy

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -940,12 +940,6 @@ def static setJobTimeout(newJob, isPR, architecture, configuration, scenario, is
940940
}
941941
else if (isCoreFxScenario(scenario)) {
942942
timeout = 360
943-
if (architecture == 'arm64') {
944-
if (configuration == 'Checked' || configuration == 'Debug') {
945-
// ARM64 checked/debug is slow, see #17414.
946-
timeout *= 3;
947-
}
948-
}
949943
}
950944
else if (isJitStressScenario(scenario)) {
951945
timeout = 300
@@ -1568,15 +1562,6 @@ def static addNonPRTriggers(def job, def branch, def isPR, def architecture, def
15681562
if ((architecture == 'arm64') && isCoreFxScenario(scenario) && !isFlowJob) {
15691563
break
15701564
}
1571-
// Windows arm64 corefx testing all fails due to time out, partially due to no parallelism
1572-
// in the test run harness. So don't create cron jobs for these. We could alternatively
1573-
// just increase the timeout, but we don't have enough Windows arm64 machines to
1574-
// take so much time running these. We also have Linux/arm64 corefx test coverage.
1575-
// It would be best to improve the runtime of the tests.
1576-
// See issue https://github.com/dotnet/coreclr/issues/21236.
1577-
if ((architecture == 'arm64') && isCoreFxScenario(scenario) && (os == 'Windows_NT')) {
1578-
break
1579-
}
15801565
if (jobRequiresLimitedHardware(architecture, os)) {
15811566
if ((architecture == 'arm64') && (os == 'Ubuntu16.04')) {
15821567
// These jobs are very fast on Linux/arm64 hardware, so run them daily.

src/debug/ee/debugger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,8 +906,6 @@ class DebuggerRCThread
906906
// calls operator new, which may occur during shutdown paths.
907907
static EEThreadId s_DbgHelperThreadId;
908908

909-
friend void AssertAllocationAllowed();
910-
911909
public:
912910
// The OS ThreadId of the helper as determined from the CreateThread call.
913911
DWORD m_DbgHelperThreadOSTid;

src/debug/ee/rcthread.cpp

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -797,46 +797,6 @@ static LONG _debugFilter(LPEXCEPTION_POINTERS ep, PVOID pv)
797797
return EXCEPTION_CONTINUE_SEARCH;
798798
}
799799

800-
#ifdef _DEBUG
801-
// Tracking to ensure that we don't call New() for the normal (non interop-safe heap)
802-
// on the helper thread. We also can't do a normal allocation when we have hard
803-
// suspended any other thread (since it could hold the OS heap lock).
804-
805-
// TODO: this probably belongs in the EE itself, not here in the debugger stuff.
806-
807-
void AssertAllocationAllowed()
808-
{
809-
#ifdef USE_INTEROPSAFE_HEAP
810-
// Don't forget to preserve error status!
811-
DWORD err = GetLastError();
812-
813-
// We can mark certain
814-
if (g_DbgSuppressAllocationAsserts == 0)
815-
{
816-
817-
// if we have hard suspended any threads. We want to assert as it could cause deadlock
818-
// since those suspended threads may hold the OS heap lock
819-
if (g_fEEStarted) {
820-
_ASSERTE (!EEAllocationDisallowed());
821-
}
822-
823-
// Can't call IsDbgHelperSpecialThread() here b/c that changes program state.
824-
// So we use our
825-
if (DebuggerRCThread::s_DbgHelperThreadId.IsCurrentThread())
826-
{
827-
// In case assert allocates, bump up the 'OK' counter to avoid an infinite recursion.
828-
SUPPRESS_ALLOCATION_ASSERTS_IN_THIS_SCOPE;
829-
830-
_ASSERTE(false || !"New called on Helper Thread");
831-
832-
}
833-
}
834-
SetLastError(err);
835-
#endif
836-
}
837-
#endif
838-
839-
840800
//---------------------------------------------------------------------------------------
841801
//
842802
// Primary function of the Runtime Controller thread. First, we let

src/inc/contract.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@
239239
#endif
240240

241241
// Also, we won't enable contracts if this is a DAC build.
242-
// @ARMTODO: Disable for ARM for now, contracts slow down the debug build far too much
243-
#if defined(ENABLE_CONTRACTS_DATA) && !defined(DACCESS_COMPILE) && !defined(CROSS_COMPILE) && !defined(_TARGET_ARM_)
242+
#if defined(ENABLE_CONTRACTS_DATA) && !defined(DACCESS_COMPILE) && !defined(CROSS_COMPILE)
244243
#define ENABLE_CONTRACTS
245244
#endif
246245

src/inc/palclr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@
503503
#endif
504504

505505

506-
#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(_TARGET_ARM_) // @ARMTODO: no contracts for speed
506+
#if defined(_DEBUG_IMPL) && !defined(JIT_BUILD) && !defined(JIT64_BUILD) && !defined(CROSS_COMPILE) && !defined(DISABLE_CONTRACTS)
507507
#define PAL_TRY_HANDLER_DBG_BEGIN \
508508
BOOL ___oldOkayToThrowValue = FALSE; \
509509
ClrDebugState *___pState = ::GetClrDebugState(); \

0 commit comments

Comments
 (0)