United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6481709 (se) epoll based Selector throws java.io.IOException: Operation not permitted during load
JDK-6481709 : (se) epoll based Selector throws java.io.IOException: Operation not permitted during load

Details
Type:
Bug
Submit Date:
2006-10-13
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
core-libs
OS:
linux
Sub-Component:
java.nio
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:

Related Reports
Backport:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
robo@troll:~/src/java/RabbIT3$ ~/pkg/java/jdk1.6.0/bin/java -version
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b100)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-rc-b100, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Linux troll 2.6.15-23-amd64-generic #1 SMP PREEMPT Tue May 23 13:45:47 UTC 2006 x86_64 GNU/Linux

A DESCRIPTION OF THE PROBLEM :
Trying to run ab2 to benchmark the rabbit proxy, http://www.khelekore.org/rabbit/

Download the proxy, and start it, then run:
ab2 -n10000 -c50 -X localhost:9666 http://www.khelekore.org/~robo/arcs.png

With java/5 (1.5.0._08) everything works without problems.

With java/6 I get frequent but random:
java.io.IOException: Operation not permitted
        at sun.nio.ch.EPollArrayWrapper.epollCtl(Native Method)
        at sun.nio.ch.EPollArrayWrapper.updateRegistrations(EPollArrayWrapper.java:202)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:183)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at rabbit.proxy.HttpProxy.run(HttpProxy.java:394)
        at java.lang.Thread.run(Thread.java:619)


And ab2 say something like
Benchmarking www.khelekore.org [through localhost:9666] (be patient)
apr_recv:  (104)
  Total of 399 requests completed


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Download the proxy from http://www.khelekore.org/rabbit/   and start it, then run:
ab2 -n10000 -c50 -X localhost:9666 http://www.khelekore.org/~robo/arcs.png



EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No errors.
ACTUAL -
proxy crashes and fails to respond.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
ava.io.IOException: Operation not permitted
        at sun.nio.ch.EPollArrayWrapper.epollCtl(Native Method)
        at sun.nio.ch.EPollArrayWrapper.updateRegistrations(EPollArrayWrapper.java:202)
        at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:183)
        at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:65)
        at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:69)
        at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:80)
        at rabbit.proxy.HttpProxy.run(HttpProxy.java:394)
        at java.lang.Thread.run(Thread.java:619)


REPRODUCIBILITY :
This bug can be reproduced often.

CUSTOMER SUBMITTED WORKAROUND :
stay with java/5

                                    

Comments
EVALUATION

This is really hard to duplicate but the submitter has made strace output available to help diagnose the issue. The bug arises when the file descriptor in a pending registration is recycled as non-pollable file descriptor. The fix requires that the pending registration list be flushed of the add/mod/del commands when the channel is killed. This can be optimized further to avoid removing the file descriptor from epoll (which happens automatically when the file descriptor is closed). As we can't duplicate this issue, the submitter has agreed to help and test out the fix for us in the next few days.
                                     
2006-10-13
EVALUATION

--

We plan to putback the fix for this bug in an early build of jdk7. Once the fix is well baked we will seek to include it in an update release of jdk6.
                                     
2006-11-09



Hardware and Software, Engineered to Work Together