JDK-4619326 : (so) Selector.wakeup() throws IOException: Resource temporarily unavailable (lnx
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: core-libs
  • Sub-Component: java.nio
  • Priority: P4
  • Affected Version: 1.4.0
  • OS: linux
  • CPU: x86
  • Submit Date: 2002-01-04
  • Updated Date: 2002-03-28
  • Resolved Date: 2002-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
1.4.1 hopperFixed
Description

Name: nt126004			Date: 01/03/2002


FULL PRODUCT VERSION :
java version "1.4.0-beta3"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) Client VM (build 1.4.0-beta3-b84, mixed mode)

FULL OPERATING SYSTEM VERSION :
RedHat Linux 7.1 (Linux Kernel 2.4.2-2)


A DESCRIPTION OF THE PROBLEM :
After 4096 calls to a Selector instance's wakeup method, subsequent
calls to the instance's wakeup method throw an IOException with the
message "Resource temporarily unavailable".

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Make a Selector, call wakeup() on it 4096 times, and then call wakeup() on
it again.

EXPECTED VERSUS ACTUAL BEHAVIOR :
Expected Result: no exception thrown, no output
Actual Result:
exception thrown, stack trace dumped

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread "main" java.io.IOException: Resource temporarily
unavailable
        at sun.nio.ch.PollArrayWrapper.interrupt(Native Method)
        at sun.nio.ch.PollArrayWrapper.interrupt(PollArrayWrapper.java:101)
        at sun.nio.ch.AbstractPollSelectorImpl.wakeup(AbstractPollSelectorImpl.java:56)
        at SelectorRepeatedWakeupTest.main(SelectorRepeatedWakeupTest.java:7)

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.nio.channels.*;

public class
SelectorRepeatedWakeupTest {
	public static void main( String[] args ) throws Exception {
		Selector selector = Selector.open();
		for( int i = 0; i < 4097; i++ ) {
			selector.wakeup();
		}
	}
}
---------- END SOURCE ----------
(Review ID: 137664) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic hopper FIXED IN: hopper INTEGRATED IN: hopper VERIFIED IN: hopper
2004-06-14

EVALUATION Reproducible on Solaris with a higher number of iterations. If select is never called the interrupt pipe's buffer can fill up causing this exception. ###@###.### 2002-02-19
2002-02-19