<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2016-04-09 8:06 GMT+02:00 Andre Florath <span dir="ltr"><<a href="mailto:andre@florath.net" target="_blank">andre@florath.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br></blockquote><div><br></div><div>Hello,<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Since some time I have problems with pcscd. I'm using pcscd in<br>
conjunction with online banking and after a short period of working it<br>
stops and jams the banking application.<br>
<br>
A 'strace' to the pcscd showed that it is still running somewhere<br>
deep in the USB stack.<br>
<br>
The problem is, when manually running the the pcscd, there is no<br>
problem at all - only when running from systemd.<br>
Therefore I searched for the differences and found one: the<br>
'--auto-exit'. Downloaded the source and had a closer look.<br>
<br>
What I understand from the source code is, that when '--auto-exit' is<br>
given, a SIGALRM is generated which (should) terminate the process.<br>
<br>
I have noticed that the signal handler 'signal_trap()' uses some<br>
function calls that are not allowed in signal handlers; like:<br>
* syslog()<br>
* gettimeofday()<br>
* remove()<br>
<br>
Using this creates undefined behavior.<br>
(Please see 'man 7 signal' for a complete list of system calls that<br>
are not allowed in signal handlers.)<br>
<br>
<br>
I found a workaround for the issue.<br>
Changed the service file to:<br>
<br>
===<br>
[Unit]<br>
Description=PC/SC Smart Card Daemon<br>
#Requires=pcscd.socket<br>
<br>
[Service]<br>
#ExecStart=/usr/sbin/pcscd --foreground --auto-exit<br>
ExecStart=/usr/sbin/pcscd --foreground --debug -a<br>
ExecReload=/usr/sbin/pcscd --hotplug<br>
<br>
[Install]<br>
Also=pcscd.socket<br>
===<br>
<br>
and disabling the pcscd.socket gives me a stable system.<br>
(Yes - pcscd is now started at boot time and runs the whole time<br>
 - which is fine for me.)<br>
<br>
If you need more information, please drop me a note.<br>
<br></blockquote><div><br></div><div>Thanks for the bug report.<br><br></div><div>Can you test with the proposed version available at <a href="http://ludovic.rousseau.free.fr/softwares/pcsc-lite/pcsc-lite-1.8.16.tar.bz2">http://ludovic.rousseau.free.fr/softwares/pcsc-lite/pcsc-lite-1.8.16.tar.bz2</a><br></div></div><br></div><div class="gmail_extra">It should work but since I was not able to reproduce the problem myself I would like you to confirm the problem is fixed in this version before I commit the modification.<br><br></div><div class="gmail_extra">Thanks<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature"> Dr. Ludovic Rousseau</div>
</div></div>