[Pcsclite-muscle] Problem (sigsegv) on reconnect.

Ludovic Rousseau ludovic.rousseau
Fri Jun 12 07:33:54 PDT 2015


2015-06-11 17:39 GMT+02:00  <luc.mazardo at orange.com>:
> Hello,

Hello,

> We've got some troubles with "libpcsclite". Perhaps, you could help us.
>
> Context :
> ----------
> We use 3 card readers (SCM SCR 3310) with pcscd on Debian Linux with
> java environment.
>
> We 've made a regular backport from latest release of 1.8.13 (remove
> dependencies
> to systemd named bpo60+1oab2) on squeeze (debian 6) Linux machines.
>
> Here is a description of our environment, we are in a Java environment
> (1.6.0_31) :
> * Frontal : Apache / Tomcat
> * Backend : Web application with API javax.smartcardio initialized with :
>     System.setProperty("sun.security.smartcardio.library",
> /usr/lib/libpcsclite.so);
>
> At the frequency of 5 seconds, we monitor cards on reader (haproxy check).
>
> The problem :
> Sometimes, a sigsegv occurs on libpcsclite on winscard_clnt.c:979
>     (void)pthread_mutex_unlock(&currentContextMap->mMutex);
>
> This sigsegv implies sudden death of Tomcat (cf java_frames).
>
> This part of code ( winscard_clnt.c:971) seems a bit strange :
>
>               /* the hCard handle is now invalid
>                  * -> another thread may have called SCardReleaseContext
>                  *    so the mMutex has been unlocked (and is now invalid)
>                  * -> another thread may have called SCardDisconnect
>                  *    so the mMutex is STILL locked
>                  * since we don't know just unlock the mutex */
>
> Why releasing mutex since "mMutex has been unlocked (and is now invalid)" ?

Good point. I will check that again.

Are you using threads in your application?
Does each thread use its own PC/SC context (SCardEstablishContext)?

>
>
> Here is the configuration of the machine.
>
> CCID driver version     (dpkg -l | grep -i ccid)
> -------------------------
> libccid                                            1.3.11-2
>
> pcsc-lite version
> ---------------------
> ii  libpcsclite-dev    1.8.13~bpo60+1oab2           Middleware to access a
> smart card using PC/SC (development files)
> ii  libpcsclite1         1.8.13~bpo60+1oab2           Middleware to access a
> smart card using PC/SC (library)
> ii  libpcsclite1-dbg  1.8.13~bpo60+1oab2           Middleware to access a
> smart card using PC/SC (debugging symbols)
> ii  pcscd                 1.8.13~bpo60+1oab2           Middleware to access
> a smart card using PC/SC (daemon side)
>
> smart card reader name
> --------------------------------
> 0: SCM SCR 3310 [CCID Interface] 00 00
> 1: SCM SCR 3310 [CCID Interface] 01 00
> 2: SCM SCR 3310 [CCID Interface] 02 00
>
> the output of the command "/usr/sbin/pcscd --version"
> ------------------------------------
> pcsc-lite version 1.8.13.
> Copyright (C) 1999-2002 by David Corcoran <corcoran at musclecard.com>.
> Copyright (C) 2001-2011 by Ludovic Rousseau <ludovic.rousseau at free.fr>.
> Copyright (C) 2003-2004 by Damien Sauveron <sauveron at labri.fr>.
> Report bugs to <muscle at lists.musclecard.com>.
> Enabled features: Linux x86_64-pc-linux-gnu serial usb libudev
> usbdropdir=/usr/lib/pcsc/drivers ipcdir=/var/run/pcscd
> configdir=/etc/reader.conf.d
>
> configuration of pcscd : /etc/default/pcscd
> -----------------------------
> DAEMON_ARGS="--max-card-handle-per-reader 1"

Why do you use this configuration?

Bye

-- 
 Dr. Ludovic Rousseau




More information about the pcsclite-muscle mailing list