[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
  Web www.spinics.net

RE: Coolkey hanging?

Title: RE: Coolkey hanging?



Today I installed RHEL5, which includes Coolkey-1.0.1, pcsc-lite-1.3.1, and ccid-1.0.1 in the base system.


I compiled and built the attached program, which calls C_Initialize(), C_Finalize(), and optionally calls syslog() before C_Initialize().


This is the output I get:


$ uname -a

Linux dodo.vintela.com 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 athlon i386 GNU/Linux

$ rpm -q coolkey


$ rpm -q pcsc-lite


$ rpm -q ccid



$ gcc -c –I/usr/local/include/pkcs11 test_pkcs11_syslog.c

$ gcc -o test-pksc11-syslog test_pkcs11_syslog.o -ldl


$ ./test-pksc11-syslog /usr/lib/pkcs11/libcoolkeypk11.so

## calling C_Initialize() ... ok

## calling C_Finalize() ... ok


$ ./test-pksc11-syslog --syslog /usr/lib/pkcs11/libcoolkeypk11.so

## calling syslog ... ok

## calling C_Initialize() ... ^C


Note that the C_Initialize() call hangs. But if I link with lpthread, it will work:

$ gcc -o test-pksc11-syslog test_pkcs11_syslog.o -ldl -lpthread


$ ./test-pksc11-syslog /usr/lib/pkcs11/libcoolkeypk11.so

## calling C_Initialize() ... ok

## calling C_Finalize() ... ok


$ ./test-pksc11-syslog --syslog /usr/lib/pkcs11/libcoolkeypk11.so

## calling syslog ... ok

## calling C_Initialize() ... ok

## calling C_Finalize() ... ok


Theoretically, a reader and/or card should not be necessary for C_Initialize() and C_Finalize() calls, but I attached various readers anyway and observed the same results.


I also installed Coolkey-1.1.0, and the latest Coolkey from CVS, with the same results.


I also installed pcsc-lite-1.4.3, but I still get the test program to hang when syslog() is called.


Can anyone else reproduce this problem? I see this consistently on RHEL platforms, but googling shows no one else with this issue. It seems like a trivial test case that I wonder why no one else has mentioned it. Maybe I’m doing something wrong?


The only way I can get around this issue is to modify my applications by linking “-lpthread” (which is not a viable solution or a requirement I can impose on customers) or modify Coolkey’s configure.in by checking for the pthread library and making the necessary RPMs for distribution.


But I’m hoping that I have just overlooked something trivial so that this is not necessary.


-- Geoff


From: coolkey-devel-bounces@xxxxxxxxxx [mailto:coolkey-devel-bounces@xxxxxxxxxx] On Behalf Of Geoff Elgey
Sent: Wednesday, 18 April 2007 4:03 PM
To: Robert Relyea
Cc: coolkey-devel@xxxxxxxxxx
Subject: RE: Coolkey hanging?



> I haven't which version of the OS are you seeing this on?

This latest issue is on RHEL4.0.0, with kernal 2.6.9-5, although I have noted previously that I also found this on RHEL 4.0.3.

I wrote a simple app that dlopens() coolkey, optionally calls syslog(), then calls C_Initialize().

If there is no syslog call, then C_Initialize() returns. If there is a syslog() call, then C_Initialize() does not return. But if I link my simple application with -lpthread, then C_Initialize() will return after a syslog() call.

So somehow the syslog() call is tickling some thread logic (in libc, I assume) that causes problems when coolkey wants to use threading. I vaguely recall something about libc changing behaviour based on the presence of threading (but I may be wrong about this).

In any case, it's not possible to link my production code with -lpthread just in case it uses CoolKey PKCS#11.

-- Geoff

Attachment: test_pkcs11_syslog.c
Description: test_pkcs11_syslog.c

Coolkey-devel mailing list

[Home]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Red Hat 9 Bible]     [Fedora Bible]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

Powered by Linux

  Web www.spinics.net