-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[QUIC] Support for OpenSSL build of MsQuic on Windows (Attempt 2) #72609
[QUIC] Support for OpenSSL build of MsQuic on Windows (Attempt 2) #72609
Conversation
…uicApi.cs Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
…for-OpenSSL-build-of-MsQuic-on-Windows
…for-OpenSSL-build-of-MsQuic-on-Windows
Tagging subscribers to this area: @dotnet/ncl Issue DetailsCloses #69978. The problem with the original PR (#72262) was that in case that an incompatible MsQuic version was loaded, we didn't close the API Table handle before unloading the library. This led to us unloading the library while some code was still executing on a background MsQuic thread which crashed the process (this was way more probable on Release configurations than on Debug). This PR reintroduces the feature with appropriate changes.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for looking into this!
src/libraries/System.Net.Quic/src/System/Net/Quic/Internal/MsQuicApi.cs
Outdated
Show resolved
Hide resolved
} | ||
finally | ||
{ | ||
if (!IsQuicSupported) | ||
if (!IsQuicSupported && NativeLibrary.TryGetExport(msQuicHandle, "MsQuicClose", out IntPtr msQuicClose)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we had the same issue before your change as well, we just never hit the right set of conditions for it to manifest and with your original change it happened on every Windows non-TLS1.3 machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we did not hit it before because the OS version check was before we opened the MsQuic library. I had to move the OS check later once we knew which TLS backend MsQuic is using.
We could have still hit the issue when opening an older MsQuic version on sufficiently new Windows OS
…uicApi.cs Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Closes #69978.
The problem with the original PR (#72262) was that in case that an incompatible MsQuic version was loaded, we didn't close the API Table handle before unloading the library. This led to us unloading the library while some code was still executing on a background MsQuic thread which crashed the process (this was way more probable on Release configurations than on Debug). This PR reintroduces the feature with appropriate changes.