From owner-freebsd-current@freebsd.org Mon Nov 6 12:28:56 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 724D7E5CACD for ; Mon, 6 Nov 2017 12:28:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C57B6D15F for ; Mon, 6 Nov 2017 12:28:56 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B03AC260397; Mon, 6 Nov 2017 13:28:54 +0100 (CET) Subject: Re: pcsc-lite hangs up after unplugging an USB card reader To: Roberto Fernandez Cueto Cc: Ludovic Rousseau , freebsd-current@FreeBSD.org References: <9b50e911-4a19-8f2c-75e9-17fa1b455edd@selasky.org> <27dc1898-074f-4e4b-849b-4985138eec1b@BW-EX-CASHUB.bally-wulff.de> <20171106082707.GA927@BWEPCFERNANDEZ> <94e6c712-5c56-544e-77c3-bc6fc6f833bc@selasky.org> <20171106121141.GA1437@BWEPCFERNANDEZ> From: Hans Petter Selasky Message-ID: Date: Mon, 6 Nov 2017 13:26:14 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171106121141.GA1437@BWEPCFERNANDEZ> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Nov 2017 12:28:56 -0000 On 11/06/17 13:11, Roberto Fernandez Cueto wrote: > Roberto Fernandez-Cueto schrieb am 06.11.2017 13:11 > _____________________________________________________________________ > > On Mon, Nov 06, 2017 at 12:55:20PM +0100, Hans Petter Selasky wrote: >> On 11/06/17 09:27, Roberto Fernandez Cueto wrote: >>> Roberto Fernandez-Cueto schrieb am 06.11.2017 09:27 >>> _____________________________________________________________________ >>> >>> Hi people, >>> >>> the original person who wrote this email has left our company so I will >>> retake it from here. >>> >> >> Hi Roberto, >> >> Have you read through this thread in the mailing list archives? >> >> --HPS > > Hi Hans, > > I have recently read the thread and I am trying to get all the > information I can before digging more into the matter. > > It is a complex matter and I just one to try every single possible > solution and be advised from the experts in the matter. > > Thanks in advance, > Roberto > Hi, In FreeBSD there is a special function that the application can use to check if the USB device is still present: libusb_check_connected() Checking this function regularly and then closing the USB handles might fix the problem you are experiencing. At least for debugging, try to print the value from this function in a separated thread, and check if there are any differences when you experience the hang. Try to use GDB to collect all backtraces for apps using the USB handle. --HPS