Re: pcsc-lite hangs up after unplugging an USB card reader

From: Hans Petter Selasky <hps_at_selasky.org>
Date: Wed, 1 Nov 2017 11:14:08 +0100
On 11/01/17 12:05, Jairo Montes González wrote:
> Jairo Montes schrieb am 01.11.2017 11:04
> _____________________________________________________________________
> 
> The output from "procstat -ak" is attached to this email.
> 

Here are the relevant bits:

>   898 100592 pcscd               -                   mi_switch sleepq_switch sleepq_catch_signals sleepq_timedwait_sig _cv_timedwait_sig_sbt seltdwait kern_select sys_select amd64_syscall Xfast_syscall 
>   898 100699 pcscd               -                   mi_switch sleepq_switch sleepq_catch_signals sleepq_wait_sig _sleep pipe_read dofileread kern_readv sys_read amd64_syscall Xfast_syscall 
>   898 100700 pcscd               -                   mi_switch sleepq_switch sleepq_catch_signals sleepq_wait_sig _sleep umtxq_sleep do_wait __umtx_op_wait amd64_syscall Xfast_syscall 
>   898 100702 pcscd               -                   mi_switch sleepq_switch sleepq_catch_signals sleepq_wait_sig _cv_wait_sig seltdwait kern_poll sys_poll amd64_syscall Xfast_syscall 


BTW: I see no USB processes hanging.

It looks like pcscd is stuck:

1) waiting for select to complete (normal)

2) waiting on a mutex operation (might be an indication of deadlock)

Try to do:

thread 100700
bt

I'm not sure how you can extend the backtrace into userspace.

Maybe you need to do:

gdb -p 898
thread 100700
bt

To figure out where this software is stuck.

It might look like a missed mutex unlock in some error path inside pcscd.

--HPS
Received on Wed Nov 01 2017 - 09:16:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC