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

lsof on FreeBSD might emit warnings and fail component_test_cmake_out_of_source #5731

Closed
gilles-peskine-arm opened this issue Apr 13, 2022 · 2 comments · Fixed by #5582
Closed
Labels
bug component-test Test framework and CI scripts

Comments

@gilles-peskine-arm
Copy link
Contributor

gilles-peskine-arm commented Apr 13, 2022

In Mbed TLS 2.x, component_test_cmake_out_of_source in tests/scripts/all.sh runs a test case from tests/ssl-opt.sh and checks that there are no error messages. This has been broken for a while due to an incorrect dependency in ssl-opt.sh: the test case only runs if requires_openssl_with_fallback_scsv, which depends on the version of openssl. We never noticed until now, but the test case is skipped on our FreeBSD CI because its openssl is too recent — it's still running as expected on Linux because we run it with an older openssl.

#5730 fixes the dependency of the test case, and so it now runs on FreeBSD as expected. But all.sh test_cmake_out_of_source then fails on Arm FreeBSD instances due to a warning message from lsof. Seen in https://jenkins-mbedtls.oss.arm.com/blue/organizations/jenkins/mbed-tls-pr-merge/detail/PR-5730-merge/3/pipeline/420:

Fallback SCSV: beginning of list ....................................... PASS
------------------------------------------------------------------------
PASSED (1 / 1 tests (0 skipped))
lsof: WARNING: compiled for FreeBSD release 12.2-RELEASE-p10; this is 12.2-RELEASE-p7.
lsof: WARNING: access /home/ec2-user/.lsof_freebsd: No such file or directory
lsof: WARNING: created device cache file: /home/ec2-user/.lsof_freebsd
^^^^test_cmake_out_of_source: test: cmake 'out-of-source' build: [ ! -s ssl-opt.err ] -> 1^^^^
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 15, 2022
This both simplifies parsing a little, and suppresses warnings. Suppressing
warnings is both good and bad: on the one hand it resolves problems such as
Mbed-TLS#5731, on the other hand it may
hide clues as to why lsof wouldn't be working as expected.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm
Copy link
Contributor Author

Tentatively worked around in fd426fa (#5730) by using lsof -t, which suppresses warnings.

gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 16, 2022
This both simplifies parsing a little, and suppresses warnings. Suppressing
warnings is both good and bad: on the one hand it resolves problems such as
Mbed-TLS#5731, on the other hand it may
hide clues as to why lsof wouldn't be working as expected.

Signed-off-by: Gilles Peskine <[email protected]>
gilles-peskine-arm added a commit to gilles-peskine-arm/mbedtls that referenced this issue Apr 16, 2022
This both simplifies parsing a little, and suppresses warnings. Suppressing
warnings is both good and bad: on the one hand it resolves problems such as
Mbed-TLS#5731, on the other hand it may
hide clues as to why lsof wouldn't be working as expected.

Signed-off-by: Gilles Peskine <[email protected]>
@gilles-peskine-arm
Copy link
Contributor Author

I tried my FreeBSD VM that has the same FreeBSD version but not necessarily exactly the same configuration and the same version of ports, and it has the same issue with lsof warning messages. So this isn't just some oddity in Arm's setup, it's a problem with FreeBSD (I guess, with the lsof port, or with it not being updated exactly at the same time as the FreeBSD kernel). Therefore it does make sense to work around it in the test scripts, and not make it the problem of the infrastructure. Hence I consider the workaround in #5730 to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug component-test Test framework and CI scripts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant