Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs')
-rw-r--r--mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs b/mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs
index c737904c41a..8b886267bc5 100644
--- a/mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs
+++ b/mcs/class/referencesource/mscorlib/system/diagnostics/assert.cs
@@ -15,8 +15,8 @@ namespace System.Diagnostics {
// Class which handles code asserts. Asserts are used to explicitly protect
// assumptions made in the code. In general if an assert fails, it indicates
- // a program
-
+ // a program bug so is immediately called to the attention of the user.
+ // Only static data members, does not need to be marked with the serializable attribute
internal static class Assert
{
internal const int COR_E_FAILFAST = unchecked((int) 0x80131623);
@@ -102,13 +102,13 @@ namespace System.Diagnostics {
#else
// This assert dialog will be common for code contract failures. If a code contract failure
// occurs on an end user machine, we believe the right experience is to do a FailFast, which
- // will report this error via Watson, so someone could theoretically fix the
-
-
-
-
-
-
+ // will report this error via Watson, so someone could theoretically fix the bug.
+ // However, in CLR v4, Environment.FailFast when a debugger is attached gives you an MDA
+ // saying you've hit a bug in the runtime or unsafe managed code, and this is most likely caused
+ // by heap corruption or a stack imbalance from COM Interop or P/Invoke. That extremely
+ // misleading error isn't right, and we can temporarily work around this by using Environment.Exit
+ // if a debugger is attached. The right fix is to plumb FailFast correctly through our native
+ // Watson code, adding in a TypeOfReportedError for fatal managed errors.
if (Debugger.IsAttached)
Environment._Exit(exitCode);
else