severity 1069539 serious
found 1069539 2.6.1-2.1
tags 1069539 patch
thanks
Hi. The most recent failure rate I've calculated for this package is around 50%,
which exceeds the common thresholds used by the RT.
Fortunately I found an explanation and a fix here:
https://github.com/softhsm/SoftHSMv2/pull/783/commits/d42b94763eb16c75dba227d6b670eee7ab84585e
which I'm attaching to this message (to be imported by quilt).
I've built the package in my setup with the patch more
than 50 times and now it builds ok, so I believe it's correct.
[ Cc: to Ondřej, the usual uploader. I hope you find some minutes
to apply the patch and make an upload. If you want a VM to
reproduce, the offer still holds ].
Thanks.
From: Jakub Zelenka <[email protected]>
Subject: Fix ForkTest by exiting from child
Origin: https://github.com/softhsm/SoftHSMv2/pull/783/commits/d42b94763eb16c75dba227d6b670eee7ab84585e
Bug-Debian: https://bugs.debian.org/1069539
The ForkTest was causing a race conditions with other tests as the
forked child continued to run. This is fixed by exiting from the
child.
---
src/lib/test/ForkTests.cpp | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/src/lib/test/ForkTests.cpp
+++ b/src/lib/test/ForkTests.cpp
@@ -80,15 +80,17 @@
case 0:
rv = CRYPTOKI_F_PTR( C_Initialize(NULL_PTR) );
CPPUNIT_ASSERT(rv == CKR_CRYPTOKI_ALREADY_INITIALIZED);
+ rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ _exit(0);
break;
default:
rv = CRYPTOKI_F_PTR( C_Initialize(NULL_PTR) );
CPPUNIT_ASSERT(rv == CKR_CRYPTOKI_ALREADY_INITIALIZED);
+ rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
break;
}
-
- rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
- CPPUNIT_ASSERT(rv == CKR_OK);
}
void ForkTests::testResetOnFork()
@@ -119,16 +121,19 @@
/* For the child, the token is expected to be reset on fork */
rv = CRYPTOKI_F_PTR( C_Initialize(NULL_PTR) );
CPPUNIT_ASSERT(rv == CKR_OK);
+ rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
+ _exit(0);
break;
default:
/* For the parent, the token is expected to be still initialized */
rv = CRYPTOKI_F_PTR( C_Initialize(NULL_PTR) );
CPPUNIT_ASSERT(rv == CKR_CRYPTOKI_ALREADY_INITIALIZED);
+ rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
+ CPPUNIT_ASSERT(rv == CKR_OK);
break;
}
- rv = CRYPTOKI_F_PTR( C_Finalize(NULL_PTR) );
- CPPUNIT_ASSERT(rv == CKR_OK);
#ifndef _WIN32
setenv("SOFTHSM2_CONF", "./softhsm2.conf", 1);