|
Bugzilla – Full Text Bug Listing |
| Summary: | attaching acr38 card reader makes pcscd crash | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | jo de baer <jo.debaer> |
| Component: | Basesystem | Assignee: | Sonja Krause-Harder <skh> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | bart.symons, edward.cheung |
| Version: | Beta 2 | ||
| Target Milestone: | --- | ||
| Hardware: | i386 | ||
| OS: | All | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
updated ACS driver v100705
pcsc-lite-hotplug_libusb.patch |
||
|
Description
jo de baer
2005-08-25 13:07:06 UTC
Sonja, can you please ask the Zetes folks to get bugzilla accounts so we can assign this stuff to them? Thanks! Created attachment 47934 [details]
updated ACS driver v100705
New ACS driver provided. TRying it on beta2 and then on beta3.
With ACR38_LINUX_100705_P (package built locally) I get to: skh@chomsky:~> belpic-tool -l Readers known about: Nr. Driver Name 0 pcsc ACS ACR38U 00 00 Ok to submit the package? Hm, maybe not. I observe slightly different behavior than Jo: When I plug the card reader in first, and then do rcpcscd start, the reader is recognized and listed by belpic-tool, as described above. When pcscd is running and I plug in the reader: - I get the following Error in /var/log/messages twice per second: Aug 29 13:36:15 chomsky pcscd: eventhandler.c:288:EHStatusHandlerThread Error communicating to: ACS ACR38U 00 00 Aug 29 13:36:16 chomsky pcscd: eventhandler.c:288:EHStatusHandlerThread Error communicating to: ACS ACR38U 00 00 - rcpcscd stop doesn't have any effect (but kill -15 works just fine, I'll have a look at this) Jo, can you please add the ZETES and ACS people to the Cc: List of this bug, or have them create bugzilla accounts so that I can do so? Thanks. Forget the second problem, it was fixed with bug 113002. Added testing reveals: 1. pcscd running, no card reader plugged in: skh@chomsky:~> /usr/lib/pcsc-lite/testpcsc MUSCLE PC/SC Lite Test Program Testing SCardEstablishContext : Command successful. Testing SCardGetStatusChange <-- stops here, then I plug in the reader then: Please insert a working reader : Command successful. Testing SCardListReaderGroups : Command successful. Group 01: SCard$DefaultReaders Testing SCardListReaders : Command successful. Reader 01: ACS ACR38U 00 00 Waiting for card insertion : Command successful. Testing SCardConnect : Command successful. Testing SCardControl : Transaction failed. (don't panic) Testing SCardGetAttrib : Transaction failed. (don't panic) Testing SCardSetAttrib : Command successful. Testing SCardStatus : Command successful. Current Reader Name : ACS ACR38U 00 00 Current Reader State : 0x0034 Current Reader Protocol : T=0 Current Reader ATR Size : 13 bytes Current Reader ATR Value : 3B 98 13 40 0A A5 03 01 01 01 AD 13 11 Testing SCardDisconnect : Command successful. Testing SCardReleaseContext : Command successful. PC/SC Test Completed Successfully ! skh@chomsky:~> No errors in /var/log/messages 1. When I remove the reader, plug it in again, and then run the same program: skh@chomsky:~> /usr/lib/pcsc-lite/testpcsc MUSCLE PC/SC Lite Test Program Testing SCardEstablishContext : Command successful. Testing SCardGetStatusChange Please insert a working reader : Command successful. Testing SCardListReaderGroups : Command successful. Group 01: SCard$DefaultReaders Testing SCardListReaders : Command successful. Reader 01: ACS ACR38U 00 00 Waiting for card insertion : Command successful. Testing SCardConnect : Reader/s is unavailable. skh@chomsky:~> Errors in /var/log/messages as in comment #4 I'll submit the package now as it is, as this behaviour is at least better than the crash. I leave the bug open for ZETES and ACS to comment. Please test with beta 4, which will be available thursday, Sept 1. Jo, please make sure this gets tested and add the results to this bug, then close (if everything works) or reassign to me. On behalf of Edward Cheung (ACS):
"
I guess there is something wrong with the gcc (4.0.2) on SuSE10
I used the pcsclite rpm from SuSE10B3 source tree and compiled it on SuSE10B3. I
always got the one of the following two errors:
"eventhandler.c:288:EHStatusHandlerThread Error communicating to: ACS ACR38U 00
00 " <- when I disconnect ACR38 (reason: don't know yet)
or
"pcscd crashed" <- when I connect ACR38
(reason: the pcscd crashed because of an unexpected change to the value of
variable, driverSize, in HPEstablishUSBNotifications() of hotplug_libusb.c
I print out the value at line 268 (just above } /* End of USB bus for ...loop */)
It is originally =1 when the 3rd inner for-loop starts, but it chages to
12xxxxxxx (a big integer) at the end of the loop.
Then a SEGV fault is generated and pcscd crashed!)
I found the occurance of this error is compilation dependant.
Then I used the gcc (3.3.4) compiler on my Slackware to compile the pcscd in
pcsclite src rpm from SuSE10B3. I put the 3.3.4 gcc compiled pcscd back to
SeSU10B3 system and run again. All error were gone, pcscd does not crash anymore.
The I ran [testpcsc]->[remove reader]->[testpcsc] (Sonja's test pattern in
comment #6) and it works.
Therefore, I guess the problem is caused by the gcc compiler of SuSE10B3.
"
Well, for one thing, I'm sure the gcc version isn't the only difference
between a Slackware install and Suse 10.0. Most likely a bunch of libraries
has changed as well.
Second, compiler dependant doesn't necessarily mean that the compiler is
buggy.
Quite often the problem is simply that newer compiler versions will emit
better optimized code, tickling fatal application bugs that were not noticed
with previous compiler versions.
First suspect is HPAddHotPluggable:
{
char deviceName[MAX_DEVICENAME];
[...]
deviceName[sizeof(deviceName)] = '\0';
Don't write a NUL byte past the end of a string buffer. In this case, we
may be corrupting the frame pointer.
Second suspect is the autoconf stuff checking for and defining
PCSCLITE_THREAD_T.
Please create a canary variable before driverSize (just an int with a magic
value) and see whether it gets corrupted. That would point to a problem with
static PCSCLITE_THREAD_T usbNotifyThread;
overflowing.
I added the canary variable and found the magic was modified when the problem occurs. static PCSCLITE_THREAD_T usbNotifyThread (SYS_ThreadCreate()) should be overflowed and corrupt the driverSize variable that follows. So how what type does configure detect for PCSCLITE_THREAD_T? Do we source the declaration from the right header file? I suggest looking at the cpp output. Olaf, you are right.
deviceName[sizeof(deviceName)] = '\0'; is giving problem.
after changing it to
deviceName[sizeof(deviceName)-1] = '\0';
I get the reader working on SuSE10 Beta3.
Fine! Created attachment 48796 [details]
pcsc-lite-hotplug_libusb.patch
Any objections against attached patch fro pcsc-lite? Andreas, can this still go into RC1? Just for the record: The patch fixes an obvious driver bug, and I think it should be included. Go ahead. Submitted for RC1. |