Closed GoogleCodeExporter closed 9 years ago
The reporter seems to have reported an issue that can/should be fixed in the
common code than the OEM adaptation layer. However, reporter didn't really
give a good explanation on the root cause analysis and what exact situation
(multiple threads/multiple process) and the most simplify steps that leads to
the issue.
Would the reporter please elaborate and clarify a bit more about the root cause
and why this solution?
Original comment by tommypo...@gmail.com
on 13 Jun 2013 at 7:59
Hi,
I don't know if I can make the steps easier. Run Isis Testsuite 1.3.2 a number
of times. OM w/ permission, APDU section. By running it a couple of times in a
row, it should be trigggered - but of course it is timing sensitive.
The reason it happens is a race condition between two locks. Some methods are
synchronized and some use synchronized object lock.
A.
transmit(...) locks on mLock
protocolTransmit(...) is synchronized on UiccTerminal
B.
AraController.initialize is synchronized method on UiccTerminal
[... calls]
Terminal.openLogicalChannel() which tries to aquire mLock.
1 A. starts with taking mLock in transmit()
2 B. has/takes UiccTerminal
3 A. has mLock and waits UiccTerminal to execute protocolTransmit(...)
4 B. has UiccTerminal and waits for mLock to execute openLogicalChannel(...)
--
I just moved the mLock aquirement into protocolTransmit. That ensures that A.
gets the UiccTerminal lock before it requests the mLock, thereby avoiding the
race-condition.
Hope this is more clear.
Original comment by mats2.ak...@sonymobile.com
on 14 Jun 2013 at 7:36
other than the first paragraph being confusing, the info given afterward seems
to help illustrate the situation and the root issue of the code. is that
enough info for SEEK to accept the error and provide a patch?
Original comment by tommypo...@gmail.com
on 14 Jun 2013 at 3:18
Thx Mats!
Patch for SCAPI-3.0.0 that includes the proposed change. Further SEEK updates
will include the patch.
Can someone verify & close?
Original comment by Daniel.A...@gi-de.com
on 5 Jul 2013 at 2:29
Attachments:
Original issue reported on code.google.com by
mats2.ak...@sonymobile.com
on 13 Jun 2013 at 2:32Attachments: