Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Nov 2017 11:14:08 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        =?UTF-8?Q?Jairo_Montes_Gonz=c3=a1lez?= <j.montes@bally-wulff.de>, ludovic.rousseau@free.fr, freebsd-current@freebsd.org, "Fernandez-Cueto, Roberto" <r.fernandez-cueto@bally-wulff.de>
Subject:   Re: pcsc-lite hangs up after unplugging an USB card reader
Message-ID:  <d6cafb7d-7bc1-558c-93ab-12a6dcaf051a@selasky.org>
In-Reply-To: <27dc1898-074f-4e4b-849b-4985138eec1b@BW-EX-CASHUB.bally-wulff.de>
References:  <a45490b0-8a3e-4897-8b04-eb709d99411e@BW-EX-CASHUB.bally-wulff.de> <9b50e911-4a19-8f2c-75e9-17fa1b455edd@selasky.org> <27dc1898-074f-4e4b-849b-4985138eec1b@BW-EX-CASHUB.bally-wulff.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d6cafb7d-7bc1-558c-93ab-12a6dcaf051a>