Crash due to INVALID_POINTER_READ NativeRequestContext.GetRequestInfo #50445
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Is there an existing issue for this?
Describe the bug
When using the IHttpSysRequestInfoFeature it's possible to hit invalid pointer read errors which causes a process crash. It's also possible to hit other issue (see below). The error occurs when a GC moves to memory of the request's _backingBuffer before trying to access the RequestInfo property of IHttpSysRequestInfoFeature.
The issue is with this line of code. Indexing into the pointer will try to deference it but the pointer first needs to be adjusted using the baseAddress to account for any GC moves.
Expected Behavior
No exceptions should happen.
Steps To Reproduce
No response
Exceptions (if any)
The bug can surface in a few different ways, depending on exactly how the memory was moved around.
INVALID_POINTER_READ crash
This happens when the memory where pRequestInfo points to in no longer valid for the application to reference.
ArgumentOutOfRangeException
ArgumentException
.NET Version
6.0.21
Anything else?
No response
The text was updated successfully, but these errors were encountered: