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

Assert "Block being garbage collected instead of returned to pool" on Travis/Linux #988

Closed
mikeharder opened this issue Jul 18, 2016 · 6 comments
Assignees

Comments

@mikeharder
Copy link
Contributor

The following assert was raised on Travis/Linux (https://travis-ci.org/aspnet/KestrelHttpServer/jobs/145638862):

Unhandled Exception: System.Diagnostics.Debug+DebugAssertException: Block being garbage collected instead of returned to pool
   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
   at System.Diagnostics.Debug.Assert(Boolean condition, String message)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.MemoryPoolBlock.Finalize() in /home/travis/build/aspnet/KestrelHttpServer/src/Microsoft.AspNetCore.Server.Kestrel/Internal/Infrastructure/MemoryPoolBlock.cs:line 76
   at System.Diagnostics.Debug.UnixDebugLogger.ShowAssertDialog(String stackTrace, String message, String detailMessage)
   at System.Diagnostics.Debug.Assert(Boolean condition, String message, String detailMessage)
   at System.Diagnostics.Debug.Assert(Boolean condition, String message)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.MemoryPoolBlock.Finalize()
@davidfowl
Copy link
Member

On dev?

@mikeharder
Copy link
Contributor Author

mikeharder commented Jul 18, 2016

Yes, on dev. See the link to Travis. Happened once, then didn't repro on the next Travis build of dev.

@davidfowl
Copy link
Member

davidfowl commented Jul 19, 2016

The randomness is killing me. This is too hard to debug.

@benaadams
Copy link
Contributor

benaadams commented Jul 20, 2016

Caught one in Kestrel, allocation stacktrace

Unhandled Exception: System.Diagnostics.Debug+DebugAssertException: Block being garbage collected instead of returned to pool: IncomingStart, I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Http\SocketInput.cs, 65
   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.MemoryPool.Lease(String memberName, String sourceFilePath, Int32 sourceLineNumber) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Infrastructure\MemoryPool.cs:line 85
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.SocketInput.IncomingStart() in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Http\SocketInput.cs:line 65
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Connection.OnAlloc(UvStreamHandle handle, Int32 suggestedSize) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Http\Connection.cs:line 199
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Connection.AllocCallback(UvStreamHandle handle, Int32 suggestedSize, Object state) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Http\Connection.cs:line 194
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Connection.<>c.<.cctor>b__28_1(UvStreamHandle handle, Int32 suggestedsize, Object state) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Http\Connection.cs:line 24
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvStreamHandle.UvAllocCb(IntPtr handle, Int32 suggested_size, uv_buf_t& buf) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Networking\UvStreamHandle.cs:line 149
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvStreamHandle.<>c.<.cctor>b__24_1(IntPtr handle, Int32 suggested_size, uv_buf_t& buf) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Networking\UvStreamHandle.cs:line 16
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.NativeMethods.uv_run(UvLoopHandle handle, Int32 mode)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.NativeMethods.uv_run(UvLoopHandle handle, Int32 mode)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.run(UvLoopHandle handle, Int32 mode) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Networking\Libuv.cs:line 107
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvLoopHandle.Run(Int32 mode) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Networking\UvLoopHandle.cs:line 28
   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelThread.ThreadStart(Object parameter) in I:\Work\GitHub\KestrelHttpServer\src\Microsoft.AspNetCore.Server.Kestrel\Internal\Infrastructure\KestrelThread.cs:line 232
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

@benaadams
Copy link
Contributor

False alarm on the block, that happens after test error - is a symptom not cause.

@benaadams
Copy link
Contributor

Will still suggest its fixed with #998

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants