JDK-7192849 : Potential race condition in AbstractSelectableChannel
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2012-08-21
  • Updated: 2013-04-04
  • Resolved: 2012-08-22
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
code inspection of the AbstractSelectableChannel class shows that a timing window exists between the channel close and cancellation of the key. Which can lead to following consequences
1. Selector registered on this channel can select the key while the channel is closed or is being closed
2. A new key can be added to the channel while the it is closed or is being closed
3. configureBlocking() can be invoked while the channel is closed or is being closed

One might be able to construct a testcase using a test-specific subclass of AbstractSelectableChannel, which has a synchronization point in its implementation of implCloseSelectableChannel() so that tests can be performed there. However, it would be quite an involved thing to write with clarity.


REPRODUCIBILITY :
This bug can be reproduced rarely.

Comments
EVALUATION This appears to be a duplicate of 7132889.
21-08-2012