Uh oh!
There was an error while loading. Please reload this page.
Fix HTTP3 header decoder buffer allocation - #78862
Conversation
ghost
commented
Nov 26, 2022
Tagging subscribers to this area: @dotnet/ncl |
Although this should fix the issue, I believe I've identified at least one other point of failure in the original code, so I am willing to run some more tests. |
I added a few more tests and they all pass fine, so I did not find any other bug, however they run with a fixed sized header name and value, which in turn doesn't test how I'm aware of another test file of the same name located under the |
Uh oh!
There was an error while loading. Please reload this page.
MihaZupan
commented
Dec 7, 2022
Thank you for the investigation work here and for even providing a fix. |
MihaZupan
left a comment
There was a problem hiding this comment.
While looking more closely at this change, I realized that the same issue is present with the HPackDecoder (HTTP/2), it's just unlikely to be hit in practice as the initial size of the name buffer is 4 KB. As these files are quite similar, would you be willing to match the changes you made in QPackDecoder to HPackDecoder as well?
I'm aware of another test file of the same name located under the Common.Tests solution, however I wasn't able to get that running and also don't think these tests I've written are worth adding into the code base since they only cover a niche case, I've added them here mostly to shed a light into the investigation that's been done.
I think these tests are very valuable - they would have caught the bug if we had the before.
We shouldn't introduce a new QPackDecoderTest.cs file as the shared one already exists though. The HPackDecoder and QPackDecoder logic and their tests are shared between the runtime (HttpClient) and ASP.NET Core (Kestrel).
If you look at the System.Net.Http.Unit.Tests.csproj file, you can see how the product code and test code are linked into the project
<CompileInclude="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs"Link="Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs" /><CompileInclude="$(CommonPath)..\tests\Tests\System\Net\aspnetcore\Http2\HPackDecoderTest.cs"Link="HPack\HPackDecoderTest.cs" />We should be able to do the same for the QPackDecoder and its tests. Let me know if I can help with that.
Uh oh!
There was an error while loading. Please reload this page.
BrunoBlanes
commented
Dec 14, 2022
Yes, I'd love to help with that.
I'll see if I can manage that, else I'll let you know to help me out. |
BrunoBlanes
commented
Dec 15, 2022
I've been trying to do some debugging but am unable to attach: Is there a known solution to this? I am running VS 17.5 Preview 2, I have updated my code base and rebuilt it but still cannot debug. |
MihaZupan
commented
Dec 16, 2022
How did you go about starting the debug session? |
I was just right clicking and selecting "Debug" in VS, but your method also gave me the same error: The tests do indeed run, I just can't debug them. :/ Am I supposed to be using a specific version of .NET or VS? PSC:\Users\bruno\runtime\src\libraries\System.Net.Http\tests\UnitTests> dotnetbuild/t:test/p:XunitMethodName=System.Net.Http.Unit.Tests.QPack.QPackDecoderTests.LiteralFieldWithoutNameReferece_ValueBrokenIntoSeparateBuffersMSBuildversion17.4.0+18d5aef85for.NETDeterminingprojectstorestore...Allprojectsareup-to-dateforrestore.Microsoft.Interop.SourceGeneration-> C:\Users\bruno\runtime\artifacts\bin\Microsoft.Interop.SourceGeneration\Debug\netstandard2.0\Microsoft.Interop.SourceGeneration.dllLibraryImportGenerator-> C:\Users\bruno\runtime\artifacts\bin\LibraryImportGenerator\Debug\netstandard2.0\Microsoft.Interop.LibraryImportGenerator.dllTestUtilities-> C:\Users\bruno\runtime\artifacts\bin\TestUtilities\Debug\net6.0\TestUtilities.dllSystem.Net.Http.Unit.Tests-> C:\Users\bruno\runtime\artifacts\bin\System.Net.Http.Unit.Tests\Debug\net8.0-windows\System.Net.Http.Unit.Tests.dll-----startFri12/16/202219:49:45.42===============Toreprodirectly:=====================================================pushdC:\Users\bruno\runtime\artifacts\bin\System.Net.Http.Unit.Tests\Debug\net8.0-windows\"C:\Users\bruno\runtime\artifacts\bin\testhost\net8.0-windows-Debug-x64\dotnet.exe"exec--runtimeconfigSystem.Net.Http.Unit.Tests.runtimeconfig.json--depsfileSystem.Net.Http.Unit.Tests.deps.jsonxunit.console.dllSystem.Net.Http.Unit.Tests.dll-xmltestResults.xml-nologo-methodSystem.Net.Http.Unit.Tests.QPack.QPackDecoderTests.LiteralFieldWithoutNameReferece_ValueBrokenIntoSeparateBuffers-notraitcategory=OuterLoop-notraitcategory=failingpopd===========================================================================================================Discovering:System.Net.Http.Unit.Tests(method display = ClassAndMethod, method display options = None)Discovered:System.Net.Http.Unit.Tests(found 1 of 915 test case)Starting:System.Net.Http.Unit.Tests(parallel test collections = on, max threads = 4)Finished:System.Net.Http.Unit.Tests===TESTEXECUTIONSUMMARY===System.Net.Http.Unit.TestsTotal:1,Errors:0,Failed:0,Skipped:0,Time:29.397s-----endFri12/16/202219:50:25.45-----exitcode0----------------------------------------------------------Buildsucceeded.0Warning(s)0Error(s)TimeElapsed00:01:35.99 |
@MihaZupan@BrunoBlanes I have the same issue (using VS 17.5.0 Preview 2.0). I tried also Debugger.Launch and got the same error. Rollbacking to VS 17.5.0 Preview 1.0 made debugging works again. |
MihaZupan
commented
Dec 27, 2022
You shouldn't need a preview version of VS. It seems to be working with 17.4.3 for example, but I too am running into issues with the current preview version. Can you try using VS 17.5.0 Preview 1.0 as pedrobsaila suggested? @dotnet/dnceng who would be the right contact to help here (the current preview of VS is failing to attach the debugger to a local build of dotnet/runtime)? |
dkurepa
commented
Dec 27, 2022
Hello, I'm not sure who'd be the best person to contact about this. @ilyas1974, could you recommend somebody? |
ilyas1974
commented
Dec 27, 2022
Larry Bynum would be the person to ask about issues with VS. |
danmoseley
commented
Dec 27, 2022
@dotnet/dotnet-diag for that. |
tommcdon
commented
Dec 27, 2022
Please try the workaround noted here. Although the error message does not match it may be that signature validation is the root cause: Starting with Visual Studio 2022 version 17.5, Visual Studio will validate that the debugging libraries that shipped with the .NET Runtime are correctly signed before loading them. If they are unsigned, Visual Studio will show an error like:
If the target process is using a .NET Runtime that is either from a daily build, or one that you built on your own computer, this error will show up. NOTE: This error should never happen for official builds of the .NET Runtime from Microsoft. So don’t disable the validation if you expect to be using a .NET Runtime supported by Microsoft. There are three ways to configure Visual Studio to disable signature validation:
|
karelz
commented
Mar 7, 2023
We plan to look at it next week - @ManickaP |
ghost
commented
Apr 6, 2023
Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it. |
ManickaP
commented
Apr 13, 2023
@MihaZupan I think this is ready for re-review. |
MihaZupan
left a comment
There was a problem hiding this comment.
Looks good. I admit I forgot some of the details around the decoder implementation, but your change in HPack looks similar enough to Qpack.
Uh oh!
There was an error while loading. Please reload this page.
ManickaP
commented
Apr 17, 2023
@BrunoBlanes could you please resolve the CLA from #78862 (comment)? I cannot merge this without it. |
BrunoBlanes
commented
Apr 18, 2023
@dotnet-policy-service agree |
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: ManickaP <mapichov@microsoft.com>
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: ManickaP <mapichov@microsoft.com>
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: ManickaP <mapichov@microsoft.com>
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: ManickaP <mapichov@microsoft.com>
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: Bruno Blanes <bruno.blanes@outlook.com>
* Add test for literal field without name reference * Fix header name buffer allocation * Add more tests * Unified QPackDecoderTest test files * Fix variable name * Fixed HPackDecoder and ported QPack tests * Feedback --------- Co-authored-by: Bruno Blanes <bruno.blanes@outlook.com>

Fixes#78516