I suspect a possible bug in pcsc-lite-0.4.0 or slb_rf60-drv (appear to be
dated Dec 13).

If I compile pcsc-lite with RPC support, ./test segfaults, but if I
recompile it without RPC support, it works.

With either set of DEFS, ./testrpc says "The read is (null)", and the
"Curent Read Name      H�o@H�o@" which don't appear correct.

I have just ventured into MUSCLE, so all this is very new to me, I have
quite possibly made a mistake myself along the way....

Hardware/Software: Schlumberger Reflex 60, Schlumberger 3K Multiflex Card
(from _Smart Card Developer's Kit_), Linux 2.2.13, using serial port
ttyS0 which is shared with X-10 Firecracker.

-----------------------------------------------------------------------


The slb_rf60 driver's tets appears to work, ./test output:
Successfull Initialize 
Successfull Reset/Set Mode 
Successfull Get Challenge
Response Size: a 
e7 21 df cd d7 a1 c1 42 90 0 
Successfull
Verify Status: 90 0

-----------------------------------------------------------------------

pcsc-lite-0.4.0 (with DEFS = -DPCSC_DEBUG=1 # -DATR_DEBUG=1)

[root@zut pcsc-lite-0.4.0]# gdb ./test
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux"...
(gdb) run
Starting program: /home/mctaylor/smartcard/pcsc-lite-0.4.0/test 

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 

Program received signal SIGSEGV, Segmentation fault.
0x4001c7b8 in RFListReaders (lpcReaders=0x0, pdwReaderNum=0xbffffaa4)
    at readerfactory.c:143
143       for ( i=0; i < *dwNumContexts; i++ ) {
(gdb) print dwNumContexts
$1 = (DWORD *) 0x0

-----------------------------------------------------------------------

[root@zut pcsc-lite-0.4.0]# /usr/local/pcsc/bin/pcscserver 
winscard_rpc_svc.c 214: PC/SC Lite Server Ready

[mctaylor@zut pcsc-lite-0.4.0]$ ./testrpc 

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 
Allocated 24 space for readers
Reader 01: Schlumberger Reflex 62
Enter the desired reader number : 1

Status before 4
Status after 584
Testing SCardConnect 
SCardConnect Returns 1
Testing SCardStatus 
The reader is (null)
The reader size 0
Current Reader Name      H�o@H�o@
Current Reader State     0
Current Reader Protocol  0
Current Reader Size ATR  0

Testing SCardTransmit 
SCardTransmit Returns 1
Bytes Received 2
6e 0 
Testing SCardDisconnect 
Testing SCardReleaseContext 

(under pcscserver):
winscard_rpc_server.c 509: SCardCollectZombies: Collecting Zombies
winscard_rpc_server.c  56: scardestablishcontext_1_svc: Current Channel: 0
winscard.c  71: SCardConnect: Attempting Connect to Schlumberger Reflex 62
winscard.c 122: SCardConnect: hCard Identity: 50000000
winscard.c 221: SCardConnect: Active Protocol: 0
winscard.c 416: SCardGetStatusChange: Event Loop Start
winscard.c 496: SCardGetStatusChange: Event Loop End
winscard.c 259: SCardDisconnect: Active Contexts: 1
winscard.c  71: SCardConnect: Attempting Connect to Schlumberger Reflex 62
winscard.c 122: SCardConnect: hCard Identity: 50000000
winscard.c 221: SCardConnect: Active Protocol: 0
winscard_rpc_server.c 210: SCardStatus 4
winscard.c 556: SCardTransmit: Send Protocol: 0
winscard.c 259: SCardDisconnect: Active Contexts: -1
winscard_rpc_server.c  76: scardreleasecontext_1_svc: Release Channel:
-1073744792

-----------------------------------------------------------------------


[mctaylor@zut pcsc-lite-0.4.0]$ ./event

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 
Allocated 24 space for readers
Reader 01: Schlumberger Reflex 62
Enter the desired reader number : 1

Status before 4
Press 'Y' then <ENTER> to unblock GetStatusChange
Status after 584
y
Cancelling the pending operation
Testing SCardReleaseContext 

(under pcscserver):
winscard_rpc_server.c 509: SCardCollectZombies: Collecting Zombies
winscard_rpc_server.c  56: scardestablishcontext_1_svc: Current Channel: 0
winscard.c  71: SCardConnect: Attempting Connect to Schlumberger Reflex 62
winscard.c 122: SCardConnect: hCard Identity: 50000000
winscard.c 221: SCardConnect: Active Protocol: 0
winscard.c 416: SCardGetStatusChange: Event Loop Start
winscard.c 496: SCardGetStatusChange: Event Loop End
winscard.c 259: SCardDisconnect: Active Contexts: 1
winscard_rpc_server.c  76: scardreleasecontext_1_svc: Release Channel:
-1073744792

-----------------------------------------------------------------------
-----------------------------------------------------------------------

Now if I recompile pcsc-lite-0.4.0 with DEFS = -DPCSCLITE_LOCAL_LINK=1 
#-DPCSC_DEBUG=1

[root@zut pcsc-lite-0.4.0]# cp libpcsclite-core.so /usr/local/pcsc/lib/

[root@zut pcsc-lite-0.4.0]# ./test

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 
Allocated 24 space for readers
Reader 01: Schlumberger Reflex 62
Enter the desired reader number : 1

Status before 4
Status after 584
Testing SCardConnect 
SCardConnect Returns 1
Testing SCardStatus 
Current Reader Name      Schlumberger Reflex 62
Current Reader State     0
Current Reader Protocol  0
Current Reader Size ATR  0

Testing SCardTransmit 
SCardTransmit Returns 1
Bytes Received 2
6e 0 
Testing SCardDisconnect 
Testing SCardReleaseContext 

-----------------------------------------------------------------------

[mctaylor@zut pcsc-lite-0.4.0]$ ./testrpc 

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 
Allocated 24 space for readers
Reader 01: Schlumberger Reflex 62
Enter the desired reader number : 1

Status before 4
Status after 584
Testing SCardConnect 
SCardConnect Returns 1
Testing SCardStatus 
The reader is (null)
The reader size 0
Current Reader Name      H�o@H�o@
Current Reader State     0
Current Reader Protocol  0
Current Reader Size ATR  0

Testing SCardTransmit 
SCardTransmit Returns 1
Bytes Received 2
6e 0 
Testing SCardDisconnect 
Testing SCardReleaseContext 

(under pcscserver):
winscard_rpc_svc.c 214: PC/SC Lite Server Ready
winscard_rpc_server.c 509: SCardCollectZombies: Collecting Zombies
winscard_rpc_server.c  56: scardestablishcontext_1_svc: Current Channel: 0
winscard_rpc_server.c 210: SCardStatus 4
winscard_rpc_server.c  76: scardreleasecontext_1_svc: Release Channel:
-1073744792

-----------------------------------------------------------------------

[mctaylor@zut pcsc-lite-0.4.0]$ ./event

Winscard PC/SC Lite Test Program

Testing SCardEstablishContext 
Testing SCardListReaders 
Allocated 24 space for readers
Reader 01: Schlumberger Reflex 62
Enter the desired reader number : 1

Status before 4
Press 'Y' then <ENTER> to unblock GetStatusChange
Status after 584
y
Cancelling the pending operation
Testing SCardReleaseContext 

(under pcscserver):
winscard_rpc_server.c 509: SCardCollectZombies: Collecting Zombies
winscard_rpc_server.c  56: scardestablishcontext_1_svc: Current Channel: 0
winscard_rpc_server.c  76: scardreleasecontext_1_svc: Release Channel:
-1073744792

-----------------------------------------------------------------------
-----------------------------------------------------------------------





***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************

Reply via email to