Repository navigation
Fix CoreFoundation number interop ABI in Apple proxy handling - #135089
Merged
vitek-karas merged 1 commit intoOct 5, 2026
Merged
Conversation
Match CFNumberType to the 64-bit CFIndex used by supported Apple targets and CFNumberGetValue to the native one-byte Boolean return. Add network-independent PAC proxy-port regression coverage using the shared production interop. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @karelz, @dotnet/ncl |
vitek-karas
marked this pull request as ready for review
October 2, 2026 09:54
wfurt
approved these changes
Oct 3, 2026
Member
Author
|
/backport to release/11.0 |
Contributor
|
Started backporting to |
2 of 4 tasks
JulieLeeMSFT
pushed a commit
that referenced
this pull request
Oct 5, 2026
…andling (#135198) Backport of #135089 to release/11.0 /cc @vitek-karas ## Customer Impact - [x] Customer reported - [ ] Found internally #134617 Crash using SocketsHttpHandler on a network with proxy configured. Seems to only repro on iOS with CoreCLR runtime. ## Regression - [x] Yes - [ ] No Compared to .NET 10 this is a regression. .NET 10 uses mono runtime. The bug exists there as well, but the different runtime seems to not cause the crash here (tested locally that the same code works on .NET 10 while it crashes on .NET 11) - the crash can be masked if the runtime uses zero-initialized memory for the interop calls, which is likely with mono's interpreter. ## Testing New test which closely mimics customer reported behavior. Validated that the new test fails on unfixed runtime with the same failure as customer reporter. After the fix the test passes. ## Risk Low - the change only affects the code which crashes - before the change the code would always crash, so fixing it doesn't introduce a behavior change. **IMPORTANT**: If this backport is for a servicing release, please verify that: - For .NET 8 and .NET 9: The PR target branch is `release/X.0-staging`, not `release/X.0`. - For .NET 10+: The PR target branch is `release/X.0` (no `-staging` suffix). ## Package authoring no longer needed in .NET 9 **IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version. Keep in mind that we still need package authoring in .NET 8 and older versions. Co-authored-by: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apple proxy handling can crash in
CFNumberGetValuewhen running under the CoreCLR interpreter.CFNumberTypewas declared as a 32-bit enum, but native CoreFoundation usesCFIndex, which is 64-bit on all supported .NET Apple targets. The simulator repro received0x100000009instead of the requested type value9.This fixes the native declaration by using a
long-backed enum and abytereturn matching Apple's one-byteBoolean. No proxy logic or interpreter implementation changes are needed.Adds six Apple-only theory cases to the existing HTTP unit-test project. They evaluate an in-memory PAC script and exercise the source-linked production
CFProxy.PortNumberimplementation, covering ports 1, 80, 443, 8080, 65535, andDIRECT. They require neither system proxy changes nor network connections.Validation
MacProxyPAC callback. The new regression also crashed against the unfixed declaration. With the fix, the original repro completed all ten lookups.Resolves #134617
Note
This pull request was prepared with GitHub Copilot.