From f42316af7f0bf048b4ad032bf7bd6c60b5f6aea8 Mon Sep 17 00:00:00 2001 From: Ben Adams Date: Thu, 21 Jul 2016 01:44:23 +0100 Subject: [PATCH] Remove Environment.StackTrace as crashing tests --- .../Internal/Infrastructure/MemoryPool.cs | 4 +--- .../Internal/Infrastructure/MemoryPoolBlock.cs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPool.cs b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPool.cs index b361be5477..814d7c2c47 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPool.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPool.cs @@ -82,7 +82,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure #if DEBUG block.Leaser = memberName + ", " + sourceFilePath + ", " + sourceLineNumber; block.IsLeased = true; - block.StackTrace = Environment.StackTrace; #endif return block; } @@ -91,7 +90,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure #if DEBUG block.Leaser = memberName + ", " + sourceFilePath + ", " + sourceLineNumber; block.IsLeased = true; - block.StackTrace = Environment.StackTrace; #endif return block; } @@ -148,7 +146,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure { #if DEBUG Debug.Assert(block.Pool == this, "Returned block was not leased from this pool"); - Debug.Assert(block.IsLeased, $"Block being returned to pool twice: {block.Leaser}{Environment.NewLine}{block.StackTrace}"); + Debug.Assert(block.IsLeased, $"Block being returned to pool twice: {block.Leaser}{Environment.NewLine}"); block.IsLeased = false; #endif diff --git a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs index 5ce1ce4122..c23030ac38 100644 --- a/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs +++ b/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs @@ -74,13 +74,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure #if DEBUG public bool IsLeased { get; set; } public string Leaser { get; set; } - public string StackTrace { get; set; } #endif ~MemoryPoolBlock() { #if DEBUG - Debug.Assert(Slab == null || !Slab.IsActive, $"{Environment.NewLine}{Environment.NewLine}*** Block being garbage collected instead of returned to pool: {Leaser} ***{Environment.NewLine}Allocation StackTrace:{Environment.NewLine}{StackTrace}"); + Debug.Assert(Slab == null || !Slab.IsActive, $"{Environment.NewLine}{Environment.NewLine}*** Block being garbage collected instead of returned to pool: {Leaser} ***{Environment.NewLine}"); #endif if (Slab != null && Slab.IsActive) {