Skip to content

[windows-x86] SafeNCryptHandle ownership assertion in System.Security.Cryptography.Tests #130760

Closed

Description

@kotlarmilos

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1507906
Leg Name: Libraries Test Run checked coreclr windows x86 Debug

Error Details

Process terminated.
Assertion failed.
_ownershipState != OwnershipState.Duplicate
   at Microsoft.Win32.SafeHandles.SafeNCryptHandle.set_Holder(SafeNCryptHandle value) in /_/src/libraries/System.Security.Cryptography/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs:line 120
   at Microsoft.Win32.SafeHandles.SafeNCryptHandle.DuplicateOwnerHandle[T]() in /_/src/libraries/System.Security.Cryptography/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs:line 286
   at Microsoft.Win32.SafeHandles.SafeNCryptHandle.Duplicate[T]() in /_/src/libraries/System.Security.Cryptography/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs:line 219
   at Microsoft.Win32.SafeHandles.SafeNCryptKeyHandle.Duplicate() in /_/src/libraries/System.Security.Cryptography/src/Microsoft/Win32/SafeHandles/NCryptSafeHandles.cs:line 364
   at System.Security.Cryptography.CngKey.get_Handle() in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/CngKey.StandardProperties.cs:line 93
   at System.Security.Cryptography.DSACng.GetDuplicatedKeyHandle() in /_/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/DSACng.Key.cs:line 51
   at System.Security.Cryptography.DSACng.ComputeQLength() in /_/src/libraries/Common/src/System/Security/Cryptography/DSACng.SignVerify.cs:line 147
   at System.Security.Cryptography.Dsa.Tests.DsaSpanSignatureFormatTests.SignData(KeyDescription key, Byte[] data, HashAlgorithmName hashAlgorithm, DSASignatureFormat signatureFormat) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DSASignatureFormatTests.cs:line 292
   at System.Security.Cryptography.Algorithms.Tests.DsaFamilySignatureFormatTests.SignatureFormatsAreNotCompatible(DSASignatureFormat signFormat, DSASignatureFormat verifyFormat) in /_/src/libraries/Common/tests/System/Security/Cryptography/AlgorithmImplementations/DSA/DsaFamilySignatureFormatTests.cs:line 288

Error Message

{
  "ErrorMessage": [
    "Assertion failed.",
    "_ownershipState != OwnershipState.Duplicate",
    "Microsoft.Win32.SafeHandles.SafeNCryptHandle.set_Holder"
  ],
  "BuildRetry": true,
  "ExcludeConsoleLog": false
}

Note

This issue was generated with GitHub Copilot.

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1507906
Error message validated: [Assertion failed. _ownershipState != OwnershipState.Duplicate Microsoft.Win32.SafeHandles.SafeNCryptHandle.set_Holder]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/15/2026 8:54:21 AM UTC

Report

Build Repository Test Pull Request
1507906 dotnet/runtime System.Security.Cryptography.Tests.WorkItemExecution #130670

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 1 1

Activity

  1. dotnet-policy-service commented on Jul 15, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security
    See info in area-owners.md if you want to be subscribed.

  2. self-assigned this
    on Jul 15, 2026
  3. locked and limited conversation to collaborators on Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions