From: Jan Kotas Date: Wed, 25 Nov 2015 22:47:47 +0000 (-0800) Subject: Integrate bug fixes from desktop X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa9267bc4d8b9416311a88820f93dfec931bae68;p=platform%2Fupstream%2Fcoreclr.git Integrate bug fixes from desktop [tfs-changeset: 1552157] --- diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs b/src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs index 5d90253673..54f7b47d28 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/ActivityTracker.cs @@ -41,7 +41,7 @@ namespace System.Diagnostics.Tracing /// On any normal event log the event with activityTracker.CurrentActivityId /// internal class ActivityTracker - { + { /// /// Called on work item begins. The activity name = providerName + activityName without 'Start' suffix. @@ -77,9 +77,9 @@ namespace System.Diagnostics.Tracing var currentActivity = m_current.Value; var fullActivityName = NormalizeActivityName(providerName, activityName, task); - + var etwLog = TplEtwProvider.Log; - if (etwLog.Debug) + if (etwLog.Debug) { etwLog.DebugFacilityMessage("OnStartEnter", fullActivityName); etwLog.DebugFacilityMessage("OnStartEnterActivityState", ActivityInfo.LiveActivities(currentActivity)); @@ -125,7 +125,7 @@ namespace System.Diagnostics.Tracing // Remember the current ID so we can log it activityId = newActivity.ActivityId; - if (etwLog.Debug) + if (etwLog.Debug) { etwLog.DebugFacilityMessage("OnStartRetActivityState", ActivityInfo.LiveActivities(newActivity)); etwLog.DebugFacilityMessage1("OnStartRet", activityId.ToString(), relatedActivityId.ToString()); @@ -146,13 +146,13 @@ namespace System.Diagnostics.Tracing var fullActivityName = NormalizeActivityName(providerName, activityName, task); var etwLog = TplEtwProvider.Log; - if (etwLog.Debug) + if (etwLog.Debug) { etwLog.DebugFacilityMessage("OnStopEnter", fullActivityName); etwLog.DebugFacilityMessage("OnStopEnterActivityState", ActivityInfo.LiveActivities(m_current.Value)); } - for (; ;) // This is a retry loop. + for (; ; ) // This is a retry loop. { ActivityInfo currentActivity = m_current.Value; ActivityInfo newCurrentActivity = null; // if we have seen any live activities (orphans), at he first one we have seen. @@ -225,12 +225,12 @@ namespace System.Diagnostics.Tracing [System.Security.SecuritySafeCritical] public void Enable() { - if (m_current == null) + if (m_current == null) { m_current = new AsyncLocal(ActivityChanging); } } - + /// /// An activity tracker is a singleton, this is how you get the one and only instance. /// @@ -310,19 +310,19 @@ namespace System.Diagnostics.Tracing } } - public static string Path(ActivityInfo activityInfo) + public static string Path(ActivityInfo activityInfo) { if (activityInfo == null) return (""); return Path(activityInfo.m_creator) + "/" + activityInfo.m_uniqueId; } - public override string ToString() + public override string ToString() { string dead = ""; if (m_stopped != 0) - dead = ",DEAD"; - return m_name + "(" + Path(this) + dead + ")"; + dead = ",DEAD"; + return m_name + "(" + Path(this) + dead + ")"; } public static string LiveActivities(ActivityInfo list) @@ -363,7 +363,7 @@ namespace System.Diagnostics.Tracing [System.Security.SecuritySafeCritical] private unsafe void CreateActivityPathGuid(out Guid idRet, out int activityPathGuidOffset) { - fixed (Guid* outPtr = &idRet) + fixed (Guid* outPtr = &idRet) { int activityPathGuidOffsetStart = 0; if (m_creator != null) @@ -371,7 +371,7 @@ namespace System.Diagnostics.Tracing activityPathGuidOffsetStart = m_creator.m_activityPathGuidOffset; idRet = m_creator.m_guid; } - else + else { // TODO FIXME - differentiate between AD inside PCL int appDomainID = 0; @@ -471,9 +471,9 @@ namespace System.Diagnostics.Tracing { if (endPtr <= ptr + 2) // I need at least 2 bytes return 13; - + // Write out the prefix code nibble and the length nibble - WriteNibble(ref ptr, endPtr, (uint) NumberListCodes.PrefixCode); + WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.PrefixCode); } // The rest is the same for overflow and non-overflow case WriteNibble(ref ptr, endPtr, (uint)NumberListCodes.MultiByte1 + (len - 1)); @@ -535,7 +535,7 @@ namespace System.Diagnostics.Tracing #endregion // CreateGuidForActivityPath readonly internal string m_name; // The name used in the 'start' and 'stop' APIs to help match up - readonly long m_uniqueId; // a small number that makes this activity unique among its siblings + readonly long m_uniqueId; // a small number that makes this activity unique among its siblings internal readonly Guid m_guid; // Activity Guid, it is basically an encoding of the Path() (see CreateActivityPathGuid) internal readonly int m_activityPathGuidOffset; // Keeps track of where in m_guid the causality path stops (used to generated child GUIDs) internal readonly int m_level; // current depth of the Path() of the activity (used to keep recursion under control) @@ -565,7 +565,7 @@ namespace System.Diagnostics.Tracing if (cur == null || prev.m_activityIdToRestore != cur.ActivityId) { EventSource.SetCurrentThreadActivityId(prev.m_activityIdToRestore); - return; + return; } } @@ -577,7 +577,7 @@ namespace System.Diagnostics.Tracing { // We found a live activity (typically the first time), set it to that. if (cur.m_stopped == 0) - { + { EventSource.SetCurrentThreadActivityId(cur.ActivityId); return; } diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs index 2eb7c38e3c..6799a09cd5 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs @@ -4478,6 +4478,9 @@ namespace System.Diagnostics.Tracing /// private static void RemoveReferencesToListenerInEventSources(EventListener listenerToRemove) { +#if !ES_BUILD_STANDALONE + Contract.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); +#endif // Foreach existing EventSource in the appdomain foreach (WeakReference eventSourceRef in s_EventSources) { diff --git a/src/mscorlib/src/mscorlib.txt b/src/mscorlib/src/mscorlib.txt index de472423eb..cdc233fd52 100644 --- a/src/mscorlib/src/mscorlib.txt +++ b/src/mscorlib/src/mscorlib.txt @@ -1010,7 +1010,7 @@ EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}). EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000). EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}). -EventSource_EventChannelOutOfRange = Channel {0} has a value of [1} which is outside the legal range (16-254). +EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254). EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}. EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider. EventSource_DuplicateStringKey = Multiple definitions for string "{0}". @@ -1036,6 +1036,8 @@ EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not su EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix. +EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId. +EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly. ; ExecutionEngineException ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions. diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index de60e95259..261ca4dc00 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -1221,12 +1221,6 @@ public: } #endif - //**************************************************************************************** - // - - virtual IApplicationSecurityDescriptor* GetSecurityDescriptor() { LIMITED_METHOD_CONTRACT; return NULL; } - - //**************************************************************************************** // Get the class init lock. The method is limited to friends because inappropriate use // will cause deadlocks in the system @@ -4603,13 +4597,6 @@ public: static HRESULT NotifyProfilerShutdown(); #endif // PROFILING_SUPPORTED - IApplicationSecurityDescriptor* GetSecurityDescriptor() - { - LIMITED_METHOD_CONTRACT; - - return NULL; - } - //**************************************************************************************** // return the dev path #ifdef FEATURE_FUSION diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp index a1ba4beee5..4ad2956efe 100644 --- a/src/vm/jithelpers.cpp +++ b/src/vm/jithelpers.cpp @@ -5739,7 +5739,7 @@ HCIMPLEND; // //======================================================================== -HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd) +NOINLINE HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd) { FCALL_CONTRACT; @@ -5754,6 +5754,7 @@ HCIMPL2(void, JIT_DelegateSecurityCheck_Internal, CORINFO_CLASS_HANDLE delegateH } HCIMPLEND +#include /*************************************************************/ HCIMPL2(void, JIT_DelegateSecurityCheck, CORINFO_CLASS_HANDLE delegateHnd, CORINFO_METHOD_HANDLE calleeMethodHnd) { @@ -5772,11 +5773,12 @@ HCIMPL2(void, JIT_DelegateSecurityCheck, CORINFO_CLASS_HANDLE delegateHnd, CORIN HCCALL2(JIT_DelegateSecurityCheck_Internal, delegateHnd, calleeMethodHnd); } HCIMPLEND +#include /*************************************************************/ //Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout -HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check) +NOINLINE HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check) { FCALL_CONTRACT; @@ -5819,6 +5821,7 @@ HCIMPL4(void, JIT_MethodAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethod HCIMPLEND +#include /*************************************************************/ //Make sure to allow check of 0 for COMPlus_Security_AlwaysInsertCallout HCIMPL4(void, JIT_MethodAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_METHOD_HANDLE calleeMethodHnd, CORINFO_CLASS_HANDLE calleeTypeHnd, CorInfoSecurityRuntimeChecks check) @@ -5841,10 +5844,11 @@ HCIMPL4(void, JIT_MethodAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORI HCCALL4(JIT_MethodAccessCheck_Internal, callerMethodHnd, calleeMethodHnd, calleeTypeHnd, check); } HCIMPLEND +#include // Slower checks (including failure paths) for determining if a method has runtime access to a field -HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check) +NOINLINE HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check) { FCALL_CONTRACT; @@ -5875,6 +5879,7 @@ HCIMPL3(void, JIT_FieldAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodH } HCIMPLEND +#include // Check to see if a method has runtime access to a field HCIMPL3(void, JIT_FieldAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_FIELD_HANDLE calleeFieldHnd, CorInfoSecurityRuntimeChecks check) { @@ -5903,9 +5908,10 @@ HCIMPL3(void, JIT_FieldAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORIN HCCALL3(JIT_FieldAccessCheck_Internal, callerMethodHnd, calleeFieldHnd, check); } HCIMPLEND +#include // Slower checks (including failure paths) for determining if a method has runtime access to a type -HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check) +NOINLINE HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check) { FCALL_CONTRACT; @@ -5920,6 +5926,7 @@ HCIMPL3(void, JIT_ClassAccessCheck_Internal, CORINFO_METHOD_HANDLE callerMethodH } HCIMPLEND +#include // Check to see if a method has runtime access to a type HCIMPL3(void, JIT_ClassAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORINFO_CLASS_HANDLE calleeClassHnd, CorInfoSecurityRuntimeChecks check) { @@ -5948,6 +5955,7 @@ HCIMPL3(void, JIT_ClassAccessCheck, CORINFO_METHOD_HANDLE callerMethodHnd, CORIN HCCALL3(JIT_ClassAccessCheck_Internal, callerMethodHnd, calleeClassHnd, check); } HCIMPLEND +#include NOINLINE HCIMPL2(void, JIT_Security_Prolog_Framed, CORINFO_METHOD_HANDLE methHnd_, OBJECTREF* ppFrameSecDesc) { @@ -6022,7 +6030,7 @@ HCIMPLEND #include /*************************************************************/ -HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_) +NOINLINE HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methHnd_) { FCALL_CONTRACT; @@ -6061,6 +6069,7 @@ HCIMPL1(void, JIT_VerificationRuntimeCheck_Internal, CORINFO_METHOD_HANDLE methH } HCIMPLEND +#include /*************************************************************/ HCIMPL1(void, JIT_VerificationRuntimeCheck, CORINFO_METHOD_HANDLE methHnd_) { @@ -6079,6 +6088,7 @@ HCIMPL1(void, JIT_VerificationRuntimeCheck, CORINFO_METHOD_HANDLE methHnd_) } HCIMPLEND +#include