Description of problem: If the SoftHSM configuration points to a non-existent path, it hangs in deadlock at exit. Version-Release number of selected component (if applicable): softhsm-2.6.0-1.fc33.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create a SoftHSM configuration file with an non-existent path. For example, containing: directories.tokendir = XXX objectstore.backend = file 2. Make SoftHSM to use the configuration file $ export SOFTHSM2_CONF=config 3. run an application using libsofthsm2.so with the bad configuration. For example, using p11tool from gnutls-utils: $ p11tool --list-tokens --provider /lib64/pkcs11/libsofthsm2.so Actual results: - The application hangs after printing: pkcs11_add_provider: PKCS #11 error. Expected results: The application prints the error and exits instead of hanging. Additional info: - The same can be reproduced through pkcs11-tool from opensc: $ pkcs11-tool --list-slots --module /lib64/pkcs11/libsofthsm2.so error: PKCS11 function C_Initialize failed: rv = CKR_GENERAL_ERROR (0x5) Aborting. - An available workaround is to create the missing path pointed by the configuration file.
This bug appears to have been reported against 'rawhide' during the Fedora 33 development cycle. Changing version to 33.
Although I see no related changelog entries for 2.6.1 this does seem to have been resolved: paul@thinkpad:~$ cat /tmp/test.conf directories.tokendir = XXX objectstore.backend = file paul@thinkpad:~$ export SOFTHSM2_CONF=/tmp/test.conf paul@thinkpad:~$ p11tool --list-tokens --provider /lib64/pkcs11/libsofthsm2.so pkcs11_add_provider: PKCS #11 error. paul@thinkpad:~$ pkcs11-tool --list-slots --module /lib64/pkcs11/libsofthsm2.so error: PKCS11 function C_Initialize failed: rv = CKR_GENERAL_ERROR (0x5) Aborting. It does not hang for me.
I can't reproduce the issue with latest version (softhsm-2.6.1-3). It works as expected.