Hi Ludovic,

this is the backtrace from the original debian package pccsd 1.7.0-2 at the
time I plug in the reader:

(gdb) run -f -d -a
Starting program: /usr/sbin/pcscd -f -d -a
[Thread debugging using libthread_db enabled]
00000000 debuglog.c:277:DebugLogSetLevel() debug level=debug
00000046 debuglog.c:306:DebugLogSetCategory() Debug options: APDU
00000282 configfile.l:245:DBGetReaderListDir() Parsing conf directory: 
/etc/reader.conf.d
00000032 configfile.l:287:DBGetReaderList() Parsing conf file: 
/etc/reader.conf.d/libccidtwin
00000073 configfile.l:287:DBGetReaderList() Parsing conf file: 
/etc/reader.conf.d/0comments
00000056 pcscdaemon.c:550:main() pcsc-lite 1.7.0 daemon ready.
00001631 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000179 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000179 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
00000162 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000160 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000157 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000156 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000138 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
[New Thread 0x7faaeec47700 (LWP 12450)]
06587572 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x076B, PID: 0x3021, path: (null)
00000026 hotplug_libudev.c:309:HPAddDevice() Adding USB device: Generic CCID 
Reader

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7faaeec47700 (LWP 12450)]
__strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:31
31      ../sysdeps/x86_64/multiarch/../strlen.S: No such file or directory.
        in ../sysdeps/x86_64/multiarch/../strlen.S
(gdb) bt full
#0  __strlen_sse2 () at ../sysdeps/x86_64/multiarch/../strlen.S:31
No locals.
#1  0x00007faaeecc3856 in __strdup (s=0x0) at strdup.c:42
        len = <value optimized out>
#2  0x000000000040d502 in HPAddDevice (dev=<value optimized out>, parent=<value 
optimized out>, devpath=0x0)
    at hotplug_libudev.c:368
        i = 0
        deviceName = "usb:076b/3021:libudev:0:(null)", '\000' <repeats 26 
times>"\200, 
\004\240\357\252\177\000\000\260m\304\356\252\177\000\000\310m\304\356\252\177\000\000\000\000\000\000\001\000\000\000(\024@",
 '\000' <repeats 85 times>"\200, 
\363<\357\252\177\000\000p\331\237\357\252\177\000\000\000\000\000\000\000\000\000\000\377\377\377\377",
 '\000' <repeats 12 times>, "\005\000\000\000\000\000\000\000\030\235a", '\000' 
<repeats 13 times>"\340, \242-\002\000\000\000\000\003\000\000\000\000\000"
        fullname = "Generic CCID Reader", '\000' <repeats 21 times>"\200, 
\363<\357\252\177", '\000' <repeats 11 times>, 
"WE\201\272\353\v\231\a\000\000\000\000\000\000\000\200\236-\002\000\000\000\000\200\236-\002\000\000\000\000&\\A\000\000\000\000\000
 \314,\002"
        driver = 0x22e8878
        sSerialNumber = <value optimized out>
        sInterfaceName = 0x0
        ret = <value optimized out>
        bInterfaceNumber = 0
        __FUNCTION__ = "HPAddDevice"
#3  0x000000000040d9bc in HPEstablishUSBNotifications (udev=0x22ccc20) at 
hotplug_libudev.c:551
        dev = 0x22da2e0
        parent = 0x22d9e80
        action = <value optimized out>
        devpath = 0x22df300 "Generic CCID Reader"
        udev_monitor = <value optimized out>
        r = <value optimized out>
        i = <value optimized out>
        __FUNCTION__ = "HPEstablishUSBNotifications"
#4  0x00007faaeefb08ba in start_thread (arg=<value optimized out>) at 
pthread_create.c:300
        __res = <value optimized out>
        pd = 0x7faaeec47700
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140372127020800, 
4829300242478025963, 140734631163088, 
                140372127020800, 140372141404224, 3, -4877183497628005141, 
-4877183932424237845}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = 
{prev = 0x0, cleanup = 0x0, 
              canceltype = 0}}}
        not_first_call = <value optimized out>
---Type <return> to continue, or q <return> to quit---
        freesize = <value optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#5  0x00007faaeed173cd in clone () at 
../sysdeps/unix/sysv/linux/x86_64/clone.S:112
No locals.
#6  0x0000000000000000 in ?? ()
No symbol table info available.
======
As you can see, devpath == 0

On Wed, Mar 23, 2011 at 06:28:40PM +0100, Ludovic Rousseau wrote:

> But I would like a have a complete pcscd log using "pcscd
> --foreground --debug --apdu"
 
> Also I can't find a line:
>       parent = udev_device_get_devnode(parent);
> 
> What I have is:
>       devpath = udev_device_get_devnode(parent);

Yes, sorry, this was a typo on my behalf.

> Try with the attached patch.

With your patch, pcscd no longer crashes at hot-plug time... but it also
fails to use the reader:

laforge@nataraja%pts/6 (21:25) projects/svn/pcsc-lite/src > sudo gdb ./pcscd    
             107/0/0
GNU gdb (GDB) 7.2-debian
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/laforge/projects/svn/pcsc-lite/src/pcscd...done.
(gdb) run --foreground --debug --apdu
Starting program: /home/laforge/projects/svn/pcsc-lite/src/pcscd --foreground 
--debug --apdu
[Thread debugging using libthread_db enabled]
00000000 debuglog.c:277:DebugLogSetLevel() debug level=debug
00000047 debuglog.c:306:DebugLogSetCategory() Debug options: APDU
00000327 configfile.l:287:DBGetReaderList() Parsing conf file: 
/usr/etc/reader.conf.d
00000028 pcscdaemon.c:550:main() pcsc-lite 1.7.0 daemon ready.
00001763 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000181 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000161 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
00000140 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000137 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000138 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000138 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000140 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
[New Thread 0x7ffff7245700 (LWP 18767)]

This is with a Omnikey 3121:

05027845 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x076B, PID: 0x3021, path: (null)
00000046 hotplug_libudev.c:309:HPAddDevice() Adding USB device: Generic CCID 
Reader
00000106 readerfactory.c:934:RFInitializeReader() Attempting startup of Generic 
CCID Reader 00 00 using 
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so
00017296 dyn_unix.c:81:DYN_GetAddress() IFDHCreateChannelByName: 
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so: undefined 
symbol: IFDHCreateChannelByName
00000043 readerfactory.c:792:RFBindFunctions() Loading IFD Handler 2.0
Error: can't open /var/run/openct/status: No such file or directory
00000133 readerfactory.c:965:RFInitializeReader() Open Port 0x200000 Failed 
(usb:076b/3021:libudev:0:(null))
00000013 readerfactory.c:275:RFAddReader() Generic CCID Reader init failed.
00000025 readerfactory.c:985:RFUnInitializeReader() Attempting shutdown of 
Generic CCID Reader 00 00.
00000012 readerfactory.c:861:RFUnloadReader() Unloading reader driver.
00006561 hotplug_libudev.c:378:HPAddDevice() Failed adding USB device: Generic 
CCID Reader

This is with a REINER-SCT Cyberjack USB

48241215 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x0C4B, PID: 0x0100, path: (null)
00000042 hotplug_libudev.c:309:HPAddDevice() Adding USB device: Cyberjack Reader
00000081 readerfactory.c:934:RFInitializeReader() Attempting startup of 
Cyberjack Reader 00 00 using 
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so
00008153 dyn_unix.c:81:DYN_GetAddress() IFDHCreateChannelByName: 
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so: undefined 
symbol: IFDHCreateChannelByName
00000040 readerfactory.c:792:RFBindFunctions() Loading IFD Handler 2.0
Error: can't open /var/run/openct/status: No such file or directory
00000138 readerfactory.c:965:RFInitializeReader() Open Port 0x200000 Failed 
(usb:0c4b/0100:libudev:0:(null))
00000016 readerfactory.c:275:RFAddReader() Cyberjack Reader init failed.
00000015 readerfactory.c:985:RFUnInitializeReader() Attempting shutdown of 
Cyberjack Reader 00 00.
00000014 readerfactory.c:861:RFUnloadReader() Unloading reader driver.
00003003 hotplug_libudev.c:378:HPAddDevice() Failed adding USB device: 
Cyberjack Reader


So, as it seems, somehow, if openct is installed (and not running), pcscd will
not try to use its internal CCID driver?  Is this intentional?

After applying your patch _and_ removing openct (no 
/usr/lib/pcsc/drivers/openct-ifd.bundle/Contents/Linux/openct-ifd.so present 
anymore), I was able to make it work:

00000000 debuglog.c:277:DebugLogSetLevel() debug level=debug
00000043 debuglog.c:306:DebugLogSetCategory() Debug options: APDU
00000356 configfile.l:287:DBGetReaderList() Parsing conf file: 
/usr/etc/reader.conf.d
00000030 pcscdaemon.c:550:main() pcsc-lite 1.7.0 daemon ready.
00001445 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000167 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000166 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
00000159 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000140 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000139 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000139 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0001, path: (null)
00000146 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x1D6B, PID: 0x0002, path: (null)
[New Thread 0x7ffff7245700 (LWP 19356)]
03387101 hotplug_libudev.c:258:get_driver() Looking for a driver for VID: 
0x076B, PID: 0x3021, path: (null)
00000039 hotplug_libudev.c:309:HPAddDevice() Adding USB device: OmniKey CardMan 
3121
00000110 readerfactory.c:934:RFInitializeReader() Attempting startup of OmniKey 
CardMan 3121 00 00 using 
/usr/lib/pcsc/drivers/ifd-ccid.bundle/Contents/Linux/libccid.so
00035622 readerfactory.c:824:RFBindFunctions() Loading IFD Handler 3.0
00000090 ifdhandler.c:1732:init_driver() Driver version: 1.4.2
00001122 ifdhandler.c:1750:init_driver() LogLevel: 0x0003
00000025 ifdhandler.c:1771:init_driver() DriverOptions: 0x0000
00000273 ifdhandler.c:79:IFDHCreateChannelByName() lun: 0, device: 
usb:076b/3021:libudev:0:(null)
00000991 ccid_usb.c:267:OpenUSBByName() ifdManufacturerString: Ludovic Rousseau 
(ludovic.rouss...@free.fr)
00000021 ccid_usb.c:268:OpenUSBByName() ifdProductString: Generic CCID driver
00000016 ccid_usb.c:269:OpenUSBByName() Copyright: This driver is protected by 
terms of the GNU Lesser General Public License version 2.1, or (at your option) 
any later version.
00002151 ccid_usb.c:502:OpenUSBByName() Found Vendor/Product: 076B/3021 
(OmniKey CardMan 3121)
00000022 ccid_usb.c:504:OpenUSBByName() Using USB bus/device: 5/31
00022128 ccid_usb.c:952:get_data_rates() Got 256 data rates but was expecting 
106
[...]

So the patch seems to fix the segfault, but still the question remains: Why is
pcscd not using its internal CCID driver if OpenCT is installed (but not even
running) ?

Thanks again!

Regards,
        Harald

-- 
- Harald Welte <lafo...@gnumonks.org>           http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
                                                  (ETSI EN 300 175-7 Ch. A6)



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to