Skip to content

Demonstrate sun.nio.ch.EPollArrayWrapper bug where EPollArrayWrapper.epollWait(...) may return events for file descriptors that were previously removed.

Notifications You must be signed in to change notification settings

cedric780/EPollArrayWrapper-bug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EPollArrayWrapper.epollWait(...) issue

These maven projects demonstrate that sun.nio.ch.EPollArrayWrapper bug where EPollArrayWrapper.epollWait(...) may return events for file descriptors that were previously removed.

The consequences are:

  1. Selector.select() returns immediately with 0 event
  2. Jetty then spins into infinite loops and consumes one CPU core at 100% for nothing.

I have reproduced this issue with many JDK 8, and seems to be fixed on JDK 11.

It is registered in Java bug system at [JDK-8238279] EPollArrayWrapper.epollWait() may return events for removed file descriptors - Java Bug System.

This repository contains 2 projects:

  • demonstrator : reproduces the bug
  • jre-patch : this is a java agent that patches the EPollArrayWrapper JDK class to fix the issue

How to execute the demonstator

  1. Clone or download the repository
  2. Go to the demonstrator directory
  3. Execute maven package
  4. Execute java -jar './target/org.modelio.jre.epollarray.test-0.0.1-jar-with-dependencies.jar

How to test the patch

Warn: This patch has only been quickly tested, I make absolutly no guaranty !

Under no circumstances will myself nor Modeliosoft be held liable for any damage whatsoever resulting from the use or performance of this software.

It also dumps some debug logs directly to System.out.

  1. Clone or download the repository
  2. Go to the demonstrator directory
  3. Execute maven package
  4. Add the following parameter to you JVM command line: -javaagent:.....demonstrator/target/org.modelio.jre.epollarray.patch-0.0.1.jar

Possibly related issues

This issue may be the cause of the following ones:

Possible cause

This web page explains a possible cause the JDK issue: https://idea.popcount.org/2017-03-20-epoll-is-fundamentally-broken-22/

About

Demonstrate sun.nio.ch.EPollArrayWrapper bug where EPollArrayWrapper.epollWait(...) may return events for file descriptors that were previously removed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages