Skip to content
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

[macOS-arm64] CoreCLR System.Security.Cryptography.OpenSsl.Tests fail on M1 Helix queues #49083

Closed
Tracked by #64488
sdmaclea opened this issue Mar 3, 2021 · 25 comments · Fixed by #72294
Closed
Tracked by #64488
Assignees
Labels
arch-arm64 area-System.Security disabled-test The test is disabled in source code against the issue os-macos-bigsur (macOS11)
Milestone

Comments

@sdmaclea
Copy link
Contributor

sdmaclea commented Mar 3, 2021

From https://dev.azure.com/dnceng/public/_build/results?buildId=1019012&view=results

No usable version of libssl was found

----- start Tue Mar 2 10:20:41 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/A43F08FC/p/dotnet exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing 
popd
===========================================================================================================
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e /private/tmp/helix/working/A43F08FC/w/C8540A7F/e
  Discovering: System.Security.Cryptography.OpenSsl.Tests (method display = ClassAndMethod, method display options = None)
No usable version of libssl was found
./RunTests.sh: line 162: 59272 Abort trap: 6           (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing $RSP_FILE
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e
----- end Tue Mar 2 10:20:43 PST 2021 ----- exit code 134 ----------------------------------------------------------
----- start Wed Mar 3 17:37:29 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/C24F0A5F/p/dotnet exec --runtimeconfig System.Security.Cryptography.Algorithms.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Algorithms.Tests.deps.json xunit.console.dll System.Security.Cryptography.Algorithms.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=failing 
popd
===========================================================================================================
/private/tmp/helix/working/C24F0A5F/w/B80F0986/e /private/tmp/helix/working/C24F0A5F/w/B80F0986/e
  Discovering: System.Security.Cryptography.Algorithms.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Security.Cryptography.Algorithms.Tests (found 1595 of 1601 test cases)
  Starting:    System.Security.Cryptography.Algorithms.Tests (parallel test collections = on, max threads = 8)
    System.Security.Cryptography.Encryption.TripleDes.Tests.TripleDESContractTests.Windows7DoesNotSupportCFB64 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Dsa.Tests.DSAImportExport.Import_2048 [SKIP]
      Condition(s) not met: "SupportsFips186_3"
    System.Security.Cryptography.Dsa.Tests.DSAImportExport.ExportAutoKey [SKIP]
      Condition(s) not met: "SupportsKeyGeneration"
    System.Security.Cryptography.Encryption.Des.Tests.DesContractTests.Windows7DoesNotSupportCFB [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Encryption.Aes.Tests.AesModeTests.Windows7DoesNotSupportCFB128 [SKIP]
      Condition(s) not met: "IsWindows7"
No usable version of libssl was found
./RunTests.sh: line 162: 37821 Abort trap: 6           (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Security.Cryptography.Algorithms.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Algorithms.Tests.deps.json xunit.console.dll System.Security.Cryptography.Algorithms.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=failing $RSP_FILE
/private/tmp/helix/working/C24F0A5F/w/B80F0986/e
----- end Wed Mar 3 17:37:37 PST 2021 ----- exit code 134 ----------------------------------------------------------

/cc @directhex

@ghost
Copy link

ghost commented Mar 3, 2021

Tagging subscribers to this area: @safern, @ViktorHofer, @Anipik
See info in area-owners.md if you want to be subscribed.

Issue Details

From https://dev.azure.com/dnceng/public/_build/results?buildId=1019012&view=results

No usable version of libssl was found

----- start Tue Mar 2 10:20:41 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/A43F08FC/p/dotnet exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing 
popd
===========================================================================================================
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e /private/tmp/helix/working/A43F08FC/w/C8540A7F/e
  Discovering: System.Security.Cryptography.OpenSsl.Tests (method display = ClassAndMethod, method display options = None)
No usable version of libssl was found
./RunTests.sh: line 162: 59272 Abort trap: 6           (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing $RSP_FILE
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e
----- end Tue Mar 2 10:20:43 PST 2021 ----- exit code 134 ----------------------------------------------------------

/cc @directhex

Author: sdmaclea
Assignees: -
Labels:

arch-arm64, area-Infrastructure-libraries, os-mac-os-x-big-sur

Milestone: 6.0.0

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Mar 3, 2021
@safern
Copy link
Member

safern commented Mar 4, 2021

cc: @bartonjs

@ilyas1974 does the M1 machines have libssl installed?

@sdmaclea
Copy link
Contributor Author

sdmaclea commented Mar 4, 2021

More specifically arm64 libssl.

@sdmaclea
Copy link
Contributor Author

I am seeing the same error on my local M1. These libraries are present...

% pkg-config --list-all | grep ssl
libssl                              OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
openssl                             OpenSSL - Secure Sockets Layer and cryptography libraries and tools
libevent_openssl                    libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Mar 24, 2021
@sdmaclea sdmaclea added the disabled-test The test is disabled in source code against the issue label Apr 8, 2021
@elahmo
Copy link

elahmo commented May 30, 2021

Is there any workaround for this at the moment? I am getting this error as well and [email protected] is installed via Homebrew. on non-M1 machines I was able to fix it via symlinking, but on M1 it doesn't seem to work.

@ViktorHofer
Copy link
Member

@sdmaclea do you know what should be done here? It's unclear to me with the current amount of information if this in an infrastructure issue that we should own.

@bartonjs
Copy link
Member

bartonjs commented Aug 6, 2021

@elahmo I think you're having the problem from #54597 (and our CI might, too).

Basically, Homebrew is giving you the arm64 OpenSSL, but you're running x64 .NET. You need to get the arm64 .NET (assuming it's ready to be used) or the x64 OpenSSL.

@elahmo
Copy link

elahmo commented Aug 8, 2021

@bartonjs yeah, this was the case. Unfortunately, for the project I am using, there is no arm64 dotnet version (3.1), but at least I am able to run the stack locally now.

@ViktorHofer
Copy link
Member

@bartonjs is there anything left to do as part of this issue?

@bartonjs
Copy link
Member

@ViktorHofer I haven't seen reports of tests failing, other than this issue... so... maybe everything's good? But I don't know authoritatively, and don't really know how to see if the tests have been running.

@ViktorHofer
Copy link
Member

ViktorHofer commented Aug 20, 2021

and don't really know how to see if the tests have been running.

Just checked our platform matrix and rolling builds, we don't run OSX arm64 libraries tests in CI. Assuming that is intentional, moving to 7.0.

@ViktorHofer ViktorHofer modified the milestones: 6.0.0, 7.0.0 Aug 20, 2021
@danmoseley danmoseley modified the milestones: 7.0.0, 6.0.0 Sep 9, 2021
@danmoseley
Copy link
Member

@ViktorHofer per my onenote table, we do test macOS 11 w/Apple Silicon on both PR and rolling. Can you double check? And confirm that we're not running on Rosetta? We fully support M1's.

macOS 11.00 (ARM64)   PR + rolling Nightly

@ghost
Copy link

ghost commented Sep 9, 2021

Tagging subscribers to this area: @bartonjs, @vcsjones, @krwq, @GrabYourPitchforks
See info in area-owners.md if you want to be subscribed.

Issue Details

From https://dev.azure.com/dnceng/public/_build/results?buildId=1019012&view=results

No usable version of libssl was found

----- start Tue Mar 2 10:20:41 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/A43F08FC/p/dotnet exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing 
popd
===========================================================================================================
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e /private/tmp/helix/working/A43F08FC/w/C8540A7F/e
  Discovering: System.Security.Cryptography.OpenSsl.Tests (method display = ClassAndMethod, method display options = None)
No usable version of libssl was found
./RunTests.sh: line 162: 59272 Abort trap: 6           (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -nocolor -trait category=OuterLoop -notrait category=IgnoreForCI -notrait category=failing $RSP_FILE
/private/tmp/helix/working/A43F08FC/w/C8540A7F/e
----- end Tue Mar 2 10:20:43 PST 2021 ----- exit code 134 ----------------------------------------------------------
----- start Wed Mar 3 17:37:29 PST 2021 =============== To repro directly: =====================================================
pushd .
/tmp/helix/working/C24F0A5F/p/dotnet exec --runtimeconfig System.Security.Cryptography.Algorithms.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Algorithms.Tests.deps.json xunit.console.dll System.Security.Cryptography.Algorithms.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=failing 
popd
===========================================================================================================
/private/tmp/helix/working/C24F0A5F/w/B80F0986/e /private/tmp/helix/working/C24F0A5F/w/B80F0986/e
  Discovering: System.Security.Cryptography.Algorithms.Tests (method display = ClassAndMethod, method display options = None)
  Discovered:  System.Security.Cryptography.Algorithms.Tests (found 1595 of 1601 test cases)
  Starting:    System.Security.Cryptography.Algorithms.Tests (parallel test collections = on, max threads = 8)
    System.Security.Cryptography.Encryption.TripleDes.Tests.TripleDESContractTests.Windows7DoesNotSupportCFB64 [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Dsa.Tests.DSAImportExport.Import_2048 [SKIP]
      Condition(s) not met: "SupportsFips186_3"
    System.Security.Cryptography.Dsa.Tests.DSAImportExport.ExportAutoKey [SKIP]
      Condition(s) not met: "SupportsKeyGeneration"
    System.Security.Cryptography.Encryption.Des.Tests.DesContractTests.Windows7DoesNotSupportCFB [SKIP]
      Condition(s) not met: "IsWindows7"
    System.Security.Cryptography.Encryption.Aes.Tests.AesModeTests.Windows7DoesNotSupportCFB128 [SKIP]
      Condition(s) not met: "IsWindows7"
No usable version of libssl was found
./RunTests.sh: line 162: 37821 Abort trap: 6           (core dumped) "$RUNTIME_PATH/dotnet" exec --runtimeconfig System.Security.Cryptography.Algorithms.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.Algorithms.Tests.deps.json xunit.console.dll System.Security.Cryptography.Algorithms.Tests.dll -xml testResults.xml -nologo -nocolor -notrait category=IgnoreForCI -notrait category=failing $RSP_FILE
/private/tmp/helix/working/C24F0A5F/w/B80F0986/e
----- end Wed Mar 3 17:37:37 PST 2021 ----- exit code 134 ----------------------------------------------------------

/cc @directhex

Author: sdmaclea
Assignees: -
Labels:

arch-arm64, area-System.Security, disabled-test, os-mac-os-x-big-sur

Milestone: 6.0.0

@danmoseley
Copy link
Member

Running this query

WorkItems 
| where FriendlyName == "System.Security.Cryptography.Algorithms.Tests"
| join kind= inner (
   Jobs  | project  QueueName , JobId, Build, Type, Source,
    Branch,
  Pipeline = tostring(parse_json(Properties).DefinitionName),
  Pipeline_Configuration = tostring(parse_json(Properties).configuration),
  OS = QueueName,
  Arch = tostring(parse_json(Properties).architecture)
  | where QueueName contains "arm" and QueueName  contains "osx"
) on JobId
| where Queued > ago (7d)
| summarize count() by ExitCode, Pipeline, Pipeline_Configuration, Arch,QueueName, FriendlyName, PassCount, FailCount, ConsoleUri  //  bin(Finished, 1d), 
| order by ExitCode asc

I seem to find Catalyst etc tests only.

@ViktorHofer
Copy link
Member

ViktorHofer commented Sep 10, 2021

Only the runtime tests currently test on arm64:

- OSX_arm64
which leverages the OSX.1100.ARM64.Open queue:

I don't think we yet run libraries tests on OSX 11 arm64.

@danmoseley
Copy link
Member

We should..

@ViktorHofer
Copy link
Member

ViktorHofer commented Sep 10, 2021

Who usually tracks adding these configurations? That person might have some more knowledge on why it isn't there yet. Would that be @wfurt?

@wfurt
Copy link
Member

wfurt commented Sep 10, 2021

I can take a look. I have ARM macBook so I can easily do local test runs before we jumping to CI.

@wfurt
Copy link
Member

wfurt commented Sep 10, 2021

BTW this may be separate issue but since we don't use openssl for SSL/TLS is there specific reason why we cannot use the libressl that comes with OS? It would be nice IMHO to not have brew dependency and/or make it optional.

@bartonjs
Copy link
Member

is there specific reason why we cannot use the libressl that comes with OS?

The types that have OpenSSL in their names shouldn't use libressl, since they're not pointer-compatible.

We could possibly use libressl for CCM/GCM/ChaCha-Poly, but that's orthogonal to the tests that are for types specifically using OpenSSL.

@danmoseley
Copy link
Member

I can take a look. I have ARM macBook so I can easily do local test runs before we jumping to CI.

That would help for sure!

@danmoseley
Copy link
Member

@bartonjs @wfurt -- I noticed these two test libraries are entirely disabled on M1's - which seems a bit of a precarious place to be. Is this is a significant hole - we apparently shipped this way?

@bartonjs
Copy link
Member

It's certainly not a pleasing state to be in, but I'm not expecting a lot of major issues.

Our use of OpenSSL on macOS is limited to RSAOpenSsl, DSAOpenSsl, ECDsaOpenSsl, ECDiffieHellmanOpenSsl, AesGcm, and AesCcm. The first four are pretty obvious that OpenSSL is required, and no platform code will instantiate them on macOS. The latter two aren't instantiated by platform code, and use the static IsSupported pattern to indicate that they're not always available.

The problem at the time was that the libssl/libcrypto that the test machines get from Homebrew weren't the same architecture as the dotnet process. Assuming that we can solve the architecture mismatch on our test rigs (presumably there are architecture-specific library load paths, and we need to a) download two copies of OpenSSL via homebrew and b) link them in with the arch paths instead of the common path) we can turn the tests back on.

If it's the case that Homebrew doesn't offer OpenSSL arm64 then the lightup features that depend on OpenSSL are just not available on that platform.

@wfurt
Copy link
Member

wfurt commented Jul 15, 2022

This should be workable now IMHO

furt@Tomass-MacBook-Pro ~ % arch --arm64 brew install  [email protected]
....
....
==> Installing [email protected]
==> Pouring [email protected]_big_sur.bottle.tar.gz

and

furt@Tomass-MacBook-Pro ~ % file /opt/homebrew/opt/[email protected]/lib/*
/opt/homebrew/opt/[email protected]/lib/engines-1.1:         directory
/opt/homebrew/opt/[email protected]/lib/libcrypto.1.1.dylib: Mach-O 64-bit dynamically linked shared library arm64
/opt/homebrew/opt/[email protected]/lib/libcrypto.a:         current ar archive random library
/opt/homebrew/opt/[email protected]/lib/libcrypto.dylib:     Mach-O 64-bit dynamically linked shared library arm64
/opt/homebrew/opt/[email protected]/lib/libssl.1.1.dylib:    Mach-O 64-bit dynamically linked shared library arm64
/opt/homebrew/opt/[email protected]/lib/libssl.a:            current ar archive random library
/opt/homebrew/opt/[email protected]/lib/libssl.dylib:        Mach-O 64-bit dynamically linked shared library arm64
/opt/homebrew/opt/[email protected]/lib/pkgconfig:           directory

@wfurt
Copy link
Member

wfurt commented Jul 15, 2022

at least, all the tests seems to pass locally.

 /Users/furt/github/wfurt-runtime/artifacts/bin/testhost/net7.0-OSX-Debug-arm64/dotnet exec --runtimeconfig System.Security.Cryptography.OpenSsl.Tests.runtimeconfig.json --depsfile System.Security.Cryptography.OpenSsl.Tests.deps.json xunit.console.dll System.Security.Cryptography.OpenSsl.Tests.dll -xml testResults.xml -nologo -notrait category=OuterLoop -notrait category=failing
  popd
  ===========================================================================================================
  ~/github/wfurt-runtime/artifacts/bin/System.Security.Cryptography.OpenSsl.Tests/Debug/net7.0-unix ~/github/wfurt-runtime/src/libraries/System.Security.Cryptography.OpenSsl/tests
    Discovering: System.Security.Cryptography.OpenSsl.Tests (method display = ClassAndMethod, method display options = None)
    Discovered:  System.Security.Cryptography.OpenSsl.Tests (found 823 of 829 test cases)
    Starting:    System.Security.Cryptography.OpenSsl.Tests (parallel test collections = on, max threads = 8)
      System.Security.Cryptography.Rsa.Tests.KeyGeneration.GenerateMaxKey [SKIP]
        Condition(s) not met: "IsStressModeEnabled"
    Finished:    System.Security.Cryptography.OpenSsl.Tests
  === TEST EXECUTION SUMMARY ===
     System.Security.Cryptography.OpenSsl.Tests  Total: 1187, Errors: 0, Failed: 0, Skipped: 1, Time: 10.631s

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 15, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Aug 3, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-arm64 area-System.Security disabled-test The test is disabled in source code against the issue os-macos-bigsur (macOS11)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants