Skip to content

DataContractCacheOverflow in GetIdForInitialization for nullable tuples #119486

Closed as duplicate

Description

@imcarolwang

Description

Deserializing nullable tuples (e.g., (double,string)?) in WCF triggers a DataContractCacheOverflow exception. The root cause is in DataContract.GetIdForInitialization (runtime source), where the fallback loop incorrectly references id instead of the loop variable i, so existing contracts are never properly scanned.

Reproduction Steps

See the detailed repro in the WCF issue: dotnet/wcf#5833.

Expected behavior

The existing contract for the nullable tuple type is found in the cache, deserialization succeeds without throwing DataContractCacheOverflow, and the WCF client receives non-null tuple operation result.

Actual behavior

DataContractCacheOverflow is thrown.

Regression?

Yes, works on .NET Framework, the issue appears in .NET.

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Sep 9, 2025
  2. added
    needs-area-label
    on Sep 9, 2025
  3. removed
    needs-area-label
    on Sep 11, 2025
  4. StephenMolloy commented on May 22, 2026

    @StephenMolloy
    Contributor

    Looks like a duplicate of #126873

  5. removed
    untriaged
    on May 22, 2026
  6. locked and limited conversation to collaborators on Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions