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

System.Net.Http.WinHttpHandler.Functional.Tests crash on assert #112700

Open
ericstj opened this issue Feb 19, 2025 · 4 comments
Open

System.Net.Http.WinHttpHandler.Functional.Tests crash on assert #112700

ericstj opened this issue Feb 19, 2025 · 4 comments
Labels
area-System.Net.Http blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug Known Build Error Use this to report build issues in the .NET Helix tab
Milestone

Comments

@ericstj
Copy link
Member

ericstj commented Feb 19, 2025

Observed in release/8.0 branch

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=950188
Build error leg or test failing: System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution
Pull request: #112494

Error Message

Fill the error message using step by step known issues guidance.

{
  "ErrorMessage": "OnRequestSendingRequest: state.RequestHandle is null",
  "ErrorPattern": "",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Log: https://helixr1107v0xd1eu3ibi6ka.blob.core.windows.net/dotnet-runtime-refs-pull-112494-merge-9343a57bae6046a29f/System.Net.Http.WinHttpHandler.Functional.Tests/1/console.cd4eada5.log?helixlogtype=result

Relevant stack:

Process terminated. Assertion failed.
OnRequestSendingRequest: state.RequestHandle is null
   at System.Net.Http.WinHttpRequestCallback.OnRequestSendingRequest(WinHttpRequestState state) in /_/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 /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs:line 91
   at System.Net.Http.WinHttpRequestCallback.WinHttpCallback(IntPtr handle, IntPtr context, UInt32 internetStatus, IntPtr statusInformation, UInt32 statusInformationLength) in /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.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 /_/src/libraries/System.Net.Http.WinHttpHandler/src/Microsoft.Interop.LibraryImportGenerator/Microsoft.Interop.LibraryImportGenerator/LibraryImports.g.cs:line 856
   at System.Net.Http.WinHttpRequestStream.InternalWriteDataAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs:line 233
   at System.Net.Http.WinHttpRequestStream.InternalWriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs:line 202
   at System.Net.Http.WinHttpRequestStream.WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken token) in /_/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs:line 135
   at System.IO.Stream.WriteAsync(ReadOnlyMemory`1 buffer, CancellationToken cancellationToken) in /_/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 /_/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/BidirectionStreamingTest.cs:line 150
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/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/xunit.assert/Asserts/Record.cs:line 104
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncMethodBuilderCore.cs:line 38
   at Xunit.Assert.ThrowsAsync[T](Func`1 testCode) in /_/src/xunit.assert/Asserts/ExceptionAsserts.cs:line 73
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) in /_/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 /_/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/BidirectionStreamingTest.cs:line 146
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread) in /_/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 /_/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 /_/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 /_/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 /_/src/libraries/System.Private.CoreLib/src/System/Threading/ExecutionContext.cs:line 179
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) in /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:line 2345
   at System.Threading.Tasks.Task.ExecuteEntryUnsafe(Thread threadPoolThread) in /_/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 /_/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/ThreadPoolTaskScheduler.cs:line 35
   at System.Threading.Thread.StartCallback() in /_/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 105

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=950188
Error message validated: [OnRequestSendingRequest: state.RequestHandle is null]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 2/19/2025 4:57:47 PM UTC

Report

Build Definition Test Pull Request
961435 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112881
960844 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112520
959137 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112790
958130 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112504
958878 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112780
958068 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112505
956712 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112530
950188 dotnet/runtime System.Net.Http.WinHttpHandler.Functional.Tests.WorkItemExecution #112494

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
2 7 8
@ericstj ericstj added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab labels Feb 19, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 19, 2025
Copy link
Contributor

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

@ManickaP
Copy link
Member

ManickaP commented Feb 20, 2025

This happens on 8.0, 8.0 staging so it doesn't seem to be caused by the recent changes in WinHttpHandler.
I randomly looked into few console logs and it seems it's the very same call stack every time (excluding obviously unrelated other crashes):

It started happening much more since 11.2. So it might be uncovered by some environmental change, but based on the assert itself, this seems like a legit bug.

@ManickaP ManickaP added the bug label Feb 20, 2025
@ManickaP ManickaP added this to the 10.0.0 milestone Feb 20, 2025
@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Feb 20, 2025
@ManickaP
Copy link
Member

Ok, so it's only in 8.0, because it's been fixed by this: #93984
Do we want to backport it? It's a product code change.
@karelz @wfurt

@wfurt
Copy link
Member

wfurt commented Feb 20, 2025

I would be open to it. It looks like simple change and it would help us stabilize release CI.

@ManickaP ManickaP mentioned this issue Feb 21, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Http blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug Known Build Error Use this to report build issues in the .NET Helix tab
Projects
None yet
Development

No branches or pull requests

3 participants