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

FreeBSD: dlopen in the integration tests does not work after upgrade from FreeBSD 14.0 to 14.1 #2907

Closed
JuergenReppSIT opened this issue Oct 21, 2024 · 0 comments

Comments

@JuergenReppSIT
Copy link
Member

JuergenReppSIT commented Oct 21, 2024

If the integration tests are configured for the swtpm or mssim TCTI, errors are produced by the device TCTI file, which should not be loaded.
The integration tests did work on FreeBSD 14.0. As a workaround I have created a PR (#2906) with a a commit where the configure option --enable-nodl (78abea0) is used and fixed a nodl problem (5911e66)
Theused TCTI is loaded with dlopen. The handle returned by dlopen is used to determine the TCTI init function. In FreeBSD 14.1 init function from the first TCTI in the list lib_LTLIBRARIES is used. In 14.0 the init function from the loaded so file was used.

ERROR: test/integration/fapi-provisioning-cert-error
====================================================

Trying to start simulator mssim
Starting simulator on port 50582
successfully started daemon: tpm_server with PID: 19857
/tmp/cirrus-ci-build
simulator PID: 19857
root     tpm_server 19857 4   tcp4   *:50582               *:*
root     tpm_server 19857 6   tcp4   *:50583               *:*
Simulator with PID 19857 bound to port 50582 and  50583 successfully.
TPM20TEST_TCTI=mssim:host=127.0.0.1,port=50582
Execute the test script
ERROR:tcti:src/tss2-tcti/tcti-device.c:454:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file host=127.0.0.1,port=50582: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: mssim 
ERROR:tcti:src/tss2-tcti/tctildr.c:478:tctildr_init_context_data() Failed to instantiate TCTI 
ERROR:test:test/integration/test-common.c:447:test_esys_setup() Error loading TCTI: mssim:host=127.0.0.1,port=50582 
Script returned 99

The problem was cause because the macro gl_LD_VERSION_SCRIPT does not set the variable HAVE_LD_VERSION_SCRIPT. Nevertheless, --enable-ld-version-script can be used and the tests work.

@JuergenReppSIT JuergenReppSIT changed the title FreeBSD: Dynamic Linking fails after upgrade from FreeBSD 14.0 to 14.1 FreeBSD: dlopen in the integration tests does not work after upgrade from FreeBSD 14.0 to 14.1 Oct 22, 2024
JuergenReppSIT added a commit to JuergenReppSIT/tpm2-tss that referenced this issue Oct 30, 2024
dlopen for swtpm failed after the upgrade from FreeBsd 14.0 to 14.1
Addresses: tpm2-software#2907

Signed-off-by: Juergen Repp <[email protected]>
JuergenReppSIT added a commit to JuergenReppSIT/tpm2-tss that referenced this issue Oct 30, 2024
dlopen for swtpm failed after the upgrade from FreeBsd 14.0 to 14.1
Addresses: tpm2-software#2907

Signed-off-by: Juergen Repp <[email protected]>
JuergenReppSIT added a commit that referenced this issue Oct 31, 2024
dlopen for swtpm failed after the upgrade from FreeBsd 14.0 to 14.1
Addresses: #2907

Signed-off-by: Juergen Repp <[email protected]>
JuergenReppSIT added a commit to JuergenReppSIT/tpm2-tss that referenced this issue Nov 2, 2024
* The test macro gl_LD_VERSION_SCRIPT which not work on FreeBSD 14.1
  is simplified and works now also on FreeBSD 14.1
* The option --enable-nodl, which was used as a workaround for this
  problem in the cirrus CI, is removed.

Fixes: tpm2-software#2907

Signed-off-by: Juergen Repp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant