Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit f42316a

Browse files
committed
Remove Environment.StackTrace as crashing tests
1 parent aa385a1 commit f42316a

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPool.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public MemoryPoolBlock Lease()
8282
#if DEBUG
8383
block.Leaser = memberName + ", " + sourceFilePath + ", " + sourceLineNumber;
8484
block.IsLeased = true;
85-
block.StackTrace = Environment.StackTrace;
8685
#endif
8786
return block;
8887
}
@@ -91,7 +90,6 @@ public MemoryPoolBlock Lease()
9190
#if DEBUG
9291
block.Leaser = memberName + ", " + sourceFilePath + ", " + sourceLineNumber;
9392
block.IsLeased = true;
94-
block.StackTrace = Environment.StackTrace;
9593
#endif
9694
return block;
9795
}
@@ -148,7 +146,7 @@ public void Return(MemoryPoolBlock block)
148146
{
149147
#if DEBUG
150148
Debug.Assert(block.Pool == this, "Returned block was not leased from this pool");
151-
Debug.Assert(block.IsLeased, $"Block being returned to pool twice: {block.Leaser}{Environment.NewLine}{block.StackTrace}");
149+
Debug.Assert(block.IsLeased, $"Block being returned to pool twice: {block.Leaser}{Environment.NewLine}");
152150
block.IsLeased = false;
153151
#endif
154152

src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ unsafe protected MemoryPoolBlock(IntPtr dataArrayPtr)
7474
#if DEBUG
7575
public bool IsLeased { get; set; }
7676
public string Leaser { get; set; }
77-
public string StackTrace { get; set; }
7877
#endif
7978

8079
~MemoryPoolBlock()
8180
{
8281
#if DEBUG
83-
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}");
82+
Debug.Assert(Slab == null || !Slab.IsActive, $"{Environment.NewLine}{Environment.NewLine}*** Block being garbage collected instead of returned to pool: {Leaser} ***{Environment.NewLine}");
8483
#endif
8584
if (Slab != null && Slab.IsActive)
8685
{

0 commit comments

Comments
 (0)