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

luc.mazardo at orange.com luc.mazardo
Thu Jun 11 08:39:50 PDT 2015


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)" ?


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"

-- 
Luc Mazardo
Orange Applications for Business


_________________________________________________________________________________________________________________________

Ce message et ses pieces jointes peuvent contenir des informations confidentielles ou privilegiees et ne doivent donc
pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce message par erreur, veuillez le signaler
a l'expediteur et le detruire ainsi que les pieces jointes. Les messages electroniques etant susceptibles d'alteration,
Orange decline toute responsabilite si ce message a ete altere, deforme ou falsifie. Merci.

This message and its attachments may contain confidential or privileged information that may be protected by law;
they should not be distributed, used or copied without authorisation.
If you have received this email in error, please notify the sender and delete this message and its attachments.
As emails may be altered, Orange is not liable for messages that have been modified, changed or falsified.
Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pcsclite-muscle/attachments/20150611/7420a5f1/attachment.html>
-------------- next part --------------

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.security.smartcardio.PCSC.SCardStatus(J[B)[B+0
J  com.multimediabs.card.connection.CardSelector.cardsByAtr()Ljava/util/Map;
j  com.multimediabs.card.connection.CardSelector.atrs()Ljava/util/Set;+0
j  com.multimediabs.tsm.fns.monitoring.MonitoringServlet.getAvailableAtrs()Ljava/util/List;+5
j  com.multimediabs.tsm.fns.monitoring.MonitoringServlet.getAtrs()Ljava/lang/String;+6
j  com.multimediabs.tsm.fns.monitoring.MonitoringServlet.monitoring()Lcom/multimediabs/nfc/common/web/monitoring/MonitoringBuilder$Builder;+10
j  com.multimediabs.tsm.fns.monitoring.MonitoringServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+31
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V+35
j  javax.servlet.http.HttpServlet.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+30
j  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+376
j  org.apache.catalina.core.ApplicationFilterChain.doFilter(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V+101
j  org.apache.catalina.core.StandardWrapperValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+804
j  org.apache.catalina.core.StandardContextValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+365
j  org.apache.catalina.core.StandardHostValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+64
j  org.apache.catalina.valves.ErrorReportValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+6
j  org.apache.catalina.core.StandardEngineValve.invoke(Lorg/apache/catalina/connector/Request;Lorg/apache/catalina/connector/Response;)V+42
j  org.apache.catalina.connector.CoyoteAdapter.service(Lorg/apache/coyote/Request;Lorg/apache/coyote/Response;)V+158
j  org.apache.jk.server.JkCoyoteHandler.invoke(Lorg/apache/jk/core/Msg;Lorg/apache/jk/core/MsgContext;)I+123
j  org.apache.jk.common.HandlerRequest.invoke(Lorg/apache/jk/core/Msg;Lorg/apache/jk/core/MsgContext;)I+374
j  org.apache.jk.common.ChannelSocket.invoke(Lorg/apache/jk/core/Msg;Lorg/apache/jk/core/MsgContext;)I+191
J  org.apache.jk.common.ChannelSocket.processConnection(Lorg/apache/jk/core/MsgContext;)V
j  org.apache.jk.common.ChannelSocket$SocketConnection.runIt([Ljava/lang/Object;)V+8
j  org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run()V+167
j  java.lang.Thread.run()V+11
v  ~StubRoutines::call_stub




More information about the pcsclite-muscle mailing list