Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WinHttpHandler] Assertion in AfterReadResponseServerError_ClientWrite #93099

Closed
ManickaP opened this issue Oct 6, 2023 · 1 comment · Fixed by #93984
Closed

[WinHttpHandler] Assertion in AfterReadResponseServerError_ClientWrite #93099

ManickaP opened this issue Oct 6, 2023 · 1 comment · Fixed by #93984

Comments

@ManickaP
Copy link
Member

ManickaP commented Oct 6, 2023

When running WinHttpHandler tests locally on my Win 11 22H2 22621.2134 machine, I'm getting this assert on each run:

Process terminated. Assertion failed.
  OnRequestSendingRequest: state.RequestHandle is null
     at System.Net.Http.WinHttpRequestCallback.OnRequestSendingRequest(WinHttpRequestState state) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 234
     at System.Net.Http.WinHttpRequestCallback.RequestCallback(WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpReque
  stCallback.cs:line 91
     at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpR
  equestCallback.cs:line 46
     at Interop.WinHttp.<WinHttpWriteData>g____PInvoke|201_0(IntPtr __requestHandle_native, IntPtr __buffer_native, UInt32 __bufferSize_native, IntPtr __parameterIgnoredAndShouldBeNullForAsync_native)
     at Interop.WinHttp.<WinHttpWriteData>g____PInvoke|201_0(IntPtr __requestHandle_native, IntPtr __buffer_native, UInt32 __bufferSize_native, IntPtr __parameterIgnoredAndShouldBeNullForAsync_native)
     at Interop.WinHttp.WinHttpWriteData(SafeWinHttpHandle requestHandle, IntPtr buffer, UInt32 bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\Microsoft.Interop.LibraryImportGenerator\Mi
  crosoft.Interop.LibraryImportGenerator\LibraryImports.g.cs:line 856
     at System.Net.Http.WinHttpRequestStream.InternalWriteDataAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 252
     at System.Net.Http.WinHttpRequestStream.InternalWriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 212
     at System.Net.Http.WinHttpRequestStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 137
     at System.IO.Stream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs:line 744
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.<>c__DisplayClass12_1.<<AfterReadResponseServerError_ClientWrite>b__1>d.MoveNext() in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\tests\FunctionalTests\BidirectionStreami
  ngTest.cs:line 150
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 38
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.<>c__DisplayClass12_1.<AfterReadResponseServerError_ClientWrite>b__1()
     at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in /_/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 113
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 38
     at Xunit.Assert.ThrowsAsync[T](Func`1 testCode) in /_/src/Microsoft.DotNet.XUnitAssert/src/ExceptionAsserts.cs:line 76
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 23
     at Xunit.Assert.ThrowsAsync[T](Func`1 testCode)
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.AfterReadResponseServerError_ClientWrite() in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\tests\FunctionalTests\BidirectionStreamingTest.cs:line 146
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs:line 352
     at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) in /_/src/xunit.execution/Sdk/MaxConcurrencySyncContext.cs:line 106
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() in /_/src/xunit.execution/Sdk/MaxConcurrencySyncContext.cs:line 96
     at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) in /_/src/common/XunitWorkerThread.cs:line 37
     at System.Threading.Tasks.Task.InnerInvoke() in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2405
     at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2387
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2345
     at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2283
     at System.Threading.Tasks.ThreadPoolTaskScheduler.<>c.<.cctor>b__10_0(Object s) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs:line 35
     at System.Threading.Thread.StartCallback() in C:\Users\mapichov\runtime\src\coreclr\System.Private.CoreLib\src\System\Threading\Thread.CoreCLR.cs:line 104
  ----- end 06.10.2023 10:22:48,81 ----- exit code -2146232797 ----------------------------------------------------------
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 6, 2023
@ghost
Copy link

ghost commented Oct 6, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

When running WinHttpHandler tests locally on my Win 11 22H2 22621.2134 machine, I'm getting this assert on each run:

Process terminated. Assertion failed.
  OnRequestSendingRequest: state.RequestHandle is null
     at System.Net.Http.WinHttpRequestCallback.OnRequestSendingRequest(WinHttpRequestState state) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestCallback.cs:line 234
     at System.Net.Http.WinHttpRequestCallback.RequestCallback(WinHttpRequestState state, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpReque
  stCallback.cs:line 91
     at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpR
  equestCallback.cs:line 46
     at Interop.WinHttp.<WinHttpWriteData>g____PInvoke|201_0(IntPtr __requestHandle_native, IntPtr __buffer_native, UInt32 __bufferSize_native, IntPtr __parameterIgnoredAndShouldBeNullForAsync_native)
     at Interop.WinHttp.<WinHttpWriteData>g____PInvoke|201_0(IntPtr __requestHandle_native, IntPtr __buffer_native, UInt32 __bufferSize_native, IntPtr __parameterIgnoredAndShouldBeNullForAsync_native)
     at Interop.WinHttp.WinHttpWriteData(SafeWinHttpHandle requestHandle, IntPtr buffer, UInt32 bufferSize, IntPtr parameterIgnoredAndShouldBeNullForAsync) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\Microsoft.Interop.LibraryImportGenerator\Mi
  crosoft.Interop.LibraryImportGenerator\LibraryImports.g.cs:line 856
     at System.Net.Http.WinHttpRequestStream.InternalWriteDataAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 252
     at System.Net.Http.WinHttpRequestStream.InternalWriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 212
     at System.Net.Http.WinHttpRequestStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\src\System\Net\Http\WinHttpRequestStream.cs:line 137
     at System.IO.Stream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs:line 744
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.<>c__DisplayClass12_1.<<AfterReadResponseServerError_ClientWrite>b__1>d.MoveNext() in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\tests\FunctionalTests\BidirectionStreami
  ngTest.cs:line 150
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 38
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.<>c__DisplayClass12_1.<AfterReadResponseServerError_ClientWrite>b__1()
     at Xunit.Assert.RecordExceptionAsync(Func`1 testCode) in /_/src/Microsoft.DotNet.XUnitAssert/src/Record.cs:line 113
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 38
     at Xunit.Assert.ThrowsAsync[T](Func`1 testCode) in /_/src/Microsoft.DotNet.XUnitAssert/src/ExceptionAsserts.cs:line 76
     at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs:line 23
     at Xunit.Assert.ThrowsAsync[T](Func`1 testCode)
     at System.Net.Http.WinHttpHandlerFunctional.Tests.BidirectionStreamingTest.AfterReadResponseServerError_ClientWrite() in C:\Users\mapichov\runtime\src\libraries\System.Net.Http.WinHttpHandler\tests\FunctionalTests\BidirectionStreamingTest.cs:line 146
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs:line 352
     at Xunit.Sdk.MaxConcurrencySyncContext.RunOnSyncContext(SendOrPostCallback callback, Object state) in /_/src/xunit.execution/Sdk/MaxConcurrencySyncContext.cs:line 106
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at Xunit.Sdk.MaxConcurrencySyncContext.WorkerThreadProc() in /_/src/xunit.execution/Sdk/MaxConcurrencySyncContext.cs:line 96
     at Xunit.Sdk.XunitWorkerThread.<>c.<QueueUserWorkItem>b__5_0(Object _) in /_/src/common/XunitWorkerThread.cs:line 37
     at System.Threading.Tasks.Task.InnerInvoke() in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2405
     at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2387
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs:line 179
     at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2345
     at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs:line 2283
     at System.Threading.Tasks.ThreadPoolTaskScheduler.<>c.<.cctor>b__10_0(Object s) in C:\Users\mapichov\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs:line 35
     at System.Threading.Thread.StartCallback() in C:\Users\mapichov\runtime\src\coreclr\System.Private.CoreLib\src\System\Threading\Thread.CoreCLR.cs:line 104
  ----- end 06.10.2023 10:22:48,81 ----- exit code -2146232797 ----------------------------------------------------------
Author: ManickaP
Assignees: -
Labels:

area-System.Net.Http

Milestone: -

@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Oct 6, 2023
@ManickaP ManickaP added this to the 9.0.0 milestone Oct 6, 2023
@wfurt wfurt self-assigned this Oct 25, 2023
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Oct 25, 2023
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Oct 27, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants