Your message dated Tue, 14 Aug 2007 18:02:02 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#430492: fixed in pcsc-lite 1.4.4-1
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
Package: pcscd
Version: 1.4.3-1.1
Severity: important
Tags: patch
I am using pcsc with a USB CCID reader. Every so often it hangs.
The reason is revealed by this backtrace, which was captured
while it was hung:
#0 0x4012a321 in pthread_setcanceltype () from /lib/tls/libc.so.6
#1 0x4011a05f in syslog () from /lib/tls/libc.so.6
#2 0x0804d59e in log_msg (priority=1075286924,
fmt=0xfffffffc <Address 0xfffffffc out of bounds>) at debuglog.c:74
#3 0x08050b43 in signal_reload (sig=10) at pcscdaemon.c:603
#4 <signal handler called>
#5 0x4006e969 in __libc_sigaction () from /lib/tls/libc.so.6
#6 0x4006ea52 in sigaction () from /lib/tls/libc.so.6
#7 0x4011a481 in vsyslog () from /lib/tls/libc.so.6
#8 0x4011a05f in syslog () from /lib/tls/libc.so.6
#9 0x0804d59e in log_msg (priority=2, fmt=0x0) at debuglog.c:74
#10 0x0804e4c9 in EHStatusHandlerThread (rContext=0x80e8008) at
eventhandler.c:301
#11 0x4002fb63 in start_thread () from /lib/tls/libpthread.so.0
#12 0x4011e18a in clone () from /lib/tls/libc.so.6
The other thread was also hung in syslog(). Notice what has
happened here. syslog() was called within another call to
syslog() - something I imagine syslog() doesn't expect. The
underlying reason is how hotplug events are being handled.
They are being processed by a signal() handler, which can
happen at any time.
The attached patch fixes the problem by forcing hotplug reload
events to be handled synchronously. Unfortunately it probably
isn't acceptable in its current form as it is very Unix dependant,
and pcscd is obviously meant to be multi-platform. To make it
multi-platform it would have to be a polling loop which is
something I dislike, or your would have to abstract
pthread_cond_wait in your thread_*.c libraries.
-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.17-8.1-lube-686-smp
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Versions of packages pcscd depends on:
ii libasedrive-usb [pcsc 2.2-1 PC/SC driver for the Athena ASEDri
ii libc6 2.3.2.ds1-22sarge6 GNU C Library: Shared libraries an
ii libccid [pcsc-ifd-han 1.3.0-2.1 PC/SC driver for USB CCID smart ca
ii libtowitoko2 [pcsc-if 2.0.7-3 Towitoko smartcard reader PCSC and
ii libusb-0.1-4 2:0.1.12-2.1 userspace USB programming library
ii lsb-base 3.0-11 Linux Standard Base 3.0 init scrip
-- no debconf information
diff -Nur pcsc-lite-1.4.3/src/hotplug_libusb.c pcsc-lite-1.4.3-new/src/hotplug_libusb.c
--- pcsc-lite-1.4.3/src/hotplug_libusb.c 2007-06-25 12:24:37.581244425 +1000
+++ pcsc-lite-1.4.3-new/src/hotplug_libusb.c 2007-06-25 12:27:20.222429918 +1000
@@ -56,6 +56,7 @@
static PCSCLITE_THREAD_T usbNotifyThread;
static int driverSize = -1;
static char AraKiriHotPlug = FALSE;
+static int rescan_pipe[2] = { -1, -1 };
extern int HPForceReaderPolling;
/* values of ifdCapabilities bits */
@@ -380,6 +381,7 @@
void HPEstablishUSBNotifications(void)
{
int i, do_polling;
+ char dummy;
/* libusb default is /dev/bus/usb but the devices are not yet visible there
* when a hotplug is requested */
@@ -411,10 +413,26 @@
do_polling = TRUE;
}
- while (do_polling)
+ if (do_polling)
{
- SYS_Sleep(HPForceReaderPolling);
- HPRescanUsbBus();
+ while (!AraKiriHotPlug)
+ {
+ SYS_Sleep(HPForceReaderPolling);
+ HPRescanUsbBus();
+ }
+ }
+ else
+ {
+ pipe(rescan_pipe);
+ while (read(rescan_pipe[0], &dummy, sizeof(dummy)) > 0)
+ {
+ Log1(PCSC_LOG_INFO, "Reload serial configuration");
+ HPRescanUsbBus();
+ RFReCheckReaderConf();
+ Log1(PCSC_LOG_INFO, "End reload serial configuration");
+ }
+ close(rescan_pipe[0]);
+ rescan_pipe[0] = -1;
}
}
@@ -439,6 +457,11 @@
LONG HPStopHotPluggables(void)
{
AraKiriHotPlug = TRUE;
+ if (rescan_pipe[1] >= 0)
+ {
+ close(rescan_pipe);
+ rescan_pipe[1] = -1;
+ }
return 0;
}
@@ -535,8 +558,13 @@
void HPReCheckSerialReaders(void)
{
- HPRescanUsbBus();
- RFReCheckReaderConf();
+ char dummy;
+
+ if (rescan_pipe[1] >= 0)
+ {
+ dummy = 0;
+ write(rescan_pipe[1], &dummy, sizeof(dummy));
+ }
}
#endif
diff -Nur pcsc-lite-1.4.3/src/pcscdaemon.c pcsc-lite-1.4.3-new/src/pcscdaemon.c
--- pcsc-lite-1.4.3/src/pcscdaemon.c 2007-06-25 11:41:29.845060776 +1000
+++ pcsc-lite-1.4.3-new/src/pcscdaemon.c 2007-06-25 12:25:25.093995305 +1000
@@ -558,24 +558,10 @@
void signal_reload(int sig)
{
- static int rescan_ongoing = FALSE;
-
if (AraKiri)
return;
- Log1(PCSC_LOG_INFO, "Reload serial configuration");
- if (rescan_ongoing)
- {
- Log1(PCSC_LOG_INFO, "Rescan already ongoing");
- return;
- }
-
- rescan_ongoing = TRUE;
-
HPReCheckSerialReaders();
-
- rescan_ongoing = FALSE;
- Log1(PCSC_LOG_INFO, "End reload serial configuration");
} /* signal_reload */
void signal_trap(int sig)
--- End Message ---
--- Begin Message ---
Source: pcsc-lite
Source-Version: 1.4.4-1
We believe that the bug you reported is fixed in the latest version of
pcsc-lite, which is due to be installed in the Debian FTP archive:
libpcsclite-dev_1.4.4-1_i386.deb
to pool/main/p/pcsc-lite/libpcsclite-dev_1.4.4-1_i386.deb
libpcsclite1_1.4.4-1_i386.deb
to pool/main/p/pcsc-lite/libpcsclite1_1.4.4-1_i386.deb
pcsc-lite_1.4.4-1.diff.gz
to pool/main/p/pcsc-lite/pcsc-lite_1.4.4-1.diff.gz
pcsc-lite_1.4.4-1.dsc
to pool/main/p/pcsc-lite/pcsc-lite_1.4.4-1.dsc
pcsc-lite_1.4.4.orig.tar.gz
to pool/main/p/pcsc-lite/pcsc-lite_1.4.4.orig.tar.gz
pcscd_1.4.4-1_i386.deb
to pool/main/p/pcsc-lite/pcscd_1.4.4-1_i386.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Ludovic Rousseau <[EMAIL PROTECTED]> (supplier of updated pcsc-lite package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [EMAIL PROTECTED])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.7
Date: Tue, 14 Aug 2007 19:43:36 +0200
Source: pcsc-lite
Binary: libpcsclite-dev libpcsclite1 pcscd
Architecture: source i386
Version: 1.4.4-1
Distribution: unstable
Urgency: low
Maintainer: Ludovic Rousseau <[EMAIL PROTECTED]>
Changed-By: Ludovic Rousseau <[EMAIL PROTECTED]>
Description:
libpcsclite-dev - Middleware to access a smart card using PC/SC (development
files)
libpcsclite1 - Middleware to access a smart card using PC/SC (library)
pcscd - Middleware to access a smart card using PC/SC (daemon side)
Closes: 430492
Changes:
pcsc-lite (1.4.4-1) unstable; urgency=low
.
* New upstream release
- Closes: #430492 "pcscd: daemon freezes when USB reader inserted or
removed"
Files:
665d8f037ed7008a5b069a4eaf89647d 646 misc extra pcsc-lite_1.4.4-1.dsc
6710141d878c12d3b701dc88b9c688c0 627128 misc extra pcsc-lite_1.4.4.orig.tar.gz
4851b7430913157608d5b869bf1c6b40 11868 misc extra pcsc-lite_1.4.4-1.diff.gz
3905a61a89d73693a48d23655702377c 68310 misc extra pcscd_1.4.4-1_i386.deb
507980814d1920f2481e069f848d2b26 52300 libdevel optional
libpcsclite-dev_1.4.4-1_i386.deb
c64a6a65abaacadf58ad356c9b4eef7f 38710 libs optional
libpcsclite1_1.4.4-1_i386.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFGwerHP0qKj+B/HPkRAlrrAKCGmvwbotEqY7emTkOHHonUrsOnpACcDSyr
tJyK+tH9+UBI7tu2S/ufA2k=
=/7J+
-----END PGP SIGNATURE-----
--- End Message ---