-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
SslStreamNetworkStreamTest failures on Mac #53597
Comments
Tagging subscribers to this area: @dotnet/ncl, @vcsjones Issue DetailsThere are severeal SslStream test failures on Mac which seem to be similar to the Windows failures tracked by #29683 (same tests failing with an exception coming from the PAL) Test class:
Test cases:
Message:
Stack trace:
Sample Kusto query
/cc @wfurt @aik-jahoda
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks Issue DetailsThere are severeal SslStream test failures on Mac which seem to be similar to the Windows failures tracked by #29683 (same tests failing with an exception coming from the PAL) Test class:
Test cases:
Message:
Stack trace:
Sample Kusto query
/cc @wfurt @aik-jahoda
|
I have some suspicion that #51976 may be related, I will try to reproduce and bisect. |
Looks like this is still happening:
The latter exception is caused by the first, so it's ignorable. The first exception callstack:
That same callstack (including throwing from Interop.X509.macOS.cs#277) also manifests with a different message:
For SslStream_TargetHostName_Succeeds this fires about once a week (not consistently enough to be "aha! it's a Sunday afternoon maintenance bug!", or anything like that). |
I spent some time trying to reproduce it with no luck.
This feels very reminiscent of #39603. Not immediately suggesting it’s related or the same cause, just connecting two dots that may have nothing to do with each other. Do we capture macOS system logs during CI at all? I seem to remember the keychain giving nice logs for that particular issue, but I was looking at the logs locally since I could reproduce it on my machine. |
I am not aware that we capture system logs on Mac. But probably here is the place that we would capture them |
It would be nice if there was an xunit mechanism to do this but there isn't. |
Assuming I'm interpreting the data correctly, literally every test failure involving a CopyWithPrivateKey operation comes from the networking tests CertificateSetup fixture. So either it's doing something wrong, or it's uncovering a weird GC hole, or something. |
I should have time to look at this today. |
OK, I was able to coerce failure. 3 of them, all at the same time.
RSA eeKey = endEntity.GetRSAPrivateKey();
endEntity = intermediateAuthority3.CreateEndEntity(
$"CN=\"A SSL Test\", O=\"testName\"",
eeKey,
extensions);
// You lose the lottery. the previous endEntity just got finalized.
/// Since cert+key always lives in a keychain, and we just destroyed the keychain, eeKey is now reference to a destroyed key.
endEntity = endEntity.CopyWithPrivateKey(eeKey); Sure enough, if I save the reference to the previous endEntity and dispose it where that comment goes, this moves to deterministic failure. Shortest workaround, save a reference to endEntity and keep it alive past the rebind with GC.KeepAlive. @wfurt is there a reason that you did all the rework for the long chain, instead of CertificateAuthority.BuildPrivatePki(
PkiOptions.IssuerRevocationViaCrl,
out RevocationResponder responder,
out CertificateAuthority root,
- out CertificateAuthority intermediate,
+ out CertificateAuthority[] intermediateAuthorities,
out X509Certificate2 endEntity,
+ intermediateAuthorityCount: longChain ? 2 : 1,
subjectName: targetName,
testName: testName,
keySize: keySize,
extensions: extensions); |
There was no specific reason besides getting longer chain (if I remember well, this was added in work to make sure the chain is sent correctly on Ssl) If the |
OK, if it's just for the longer chain I'll put up a PR to convert it to just pass the longer path count. |
There are severeal SslStream test failures on Mac which seem to be similar to the Windows failures tracked by #29683 (same tests failing with an exception coming from the PAL)
Tests:
System.Net.Security.Tests.SslStreamNetworkStreamTest
SslStream_TargetHostName_Succeeds
SslStream_NestedAuth_Throws
SslStream_RandomSizeWrites_OK
Failures 6/13-8/13 (incl. PRs):
Failure:
Sample Kusto query
/cc @wfurt @aik-jahoda
The text was updated successfully, but these errors were encountered: