-
Bug
-
Resolution: Fixed
-
P3
-
6u20
-
b21
-
x86
-
windows
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2198433 | 7u2 | Miroslaw Niemiec | P4 | Resolved | Fixed | b08 |
JDK-2209222 | 6u27 | Miroslaw Niemiec | P3 | Closed | Fixed | b01 |
JDK-2209883 | 6u26-rev | Miroslaw Niemiec | P3 | Resolved | Fixed | b21 |
When trying to check from a thread whether a smartcard has been already
removed while a read/write operation is taking place in another thread
the following exception occurs:
javax.smartcardio.CardException: wait mismatch
at sun.security.smartcardio.TerminalImpl.waitForCard(TerminalImpl.java:103)
at sun.security.smartcardio.TerminalImpl.waitForCardAbsent(TerminalImpl.java:120)
at TerminalImplExample.run(TerminalImplExample.java:116)
This is an exception which should never happen, please see the source code
of waitForCard() in
/ws/j2se/src/share/classes/sun/security/smartcardio/TerminalImpl.java
// should never happen
if (wantPresent != present) {
throw new CardException("wait mismatch");
Since it does happen, I'd consider this a bug. A test case is available.
See the attached zip file TerminalImplExample.zip. It requires a card reader.
The reason why the exception occured is that waitForCard() is not prepared to
handle other card state changes than SCARD_STATE_PRESENT = 0x0020;
With the test case we can see that for example 0x0122 occurs, which means
CHANGED PRESENT INUSE.
removed while a read/write operation is taking place in another thread
the following exception occurs:
javax.smartcardio.CardException: wait mismatch
at sun.security.smartcardio.TerminalImpl.waitForCard(TerminalImpl.java:103)
at sun.security.smartcardio.TerminalImpl.waitForCardAbsent(TerminalImpl.java:120)
at TerminalImplExample.run(TerminalImplExample.java:116)
This is an exception which should never happen, please see the source code
of waitForCard() in
/ws/j2se/src/share/classes/sun/security/smartcardio/TerminalImpl.java
// should never happen
if (wantPresent != present) {
throw new CardException("wait mismatch");
Since it does happen, I'd consider this a bug. A test case is available.
See the attached zip file TerminalImplExample.zip. It requires a card reader.
The reason why the exception occured is that waitForCard() is not prepared to
handle other card state changes than SCARD_STATE_PRESENT = 0x0020;
With the test case we can see that for example 0x0122 occurs, which means
CHANGED PRESENT INUSE.
- backported by
-
JDK-2209883 smartcardio is not mt safe - javax.smartcardio.CardException: wait mismatch
-
- Resolved
-
-
JDK-2198433 smartcardio is not mt safe - javax.smartcardio.CardException: wait mismatch
-
- Resolved
-
-
JDK-2209222 smartcardio is not mt safe - javax.smartcardio.CardException: wait mismatch
-
- Closed
-