-
Bug
-
Resolution: Fixed
-
P4
-
8u60
-
b85
-
x86_64
-
linux
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8142128 | emb-9 | Ivan Gerasimov | P4 | Resolved | Fixed | team |
JDK-8140922 | 8u91 | Ivan Gerasimov | P4 | Resolved | Fixed | b01 |
JDK-8138946 | 8u72 | Ivan Gerasimov | P4 | Resolved | Fixed | b03 |
JDK-8147255 | emb-8u91 | Ivan Gerasimov | P4 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
3.19.0-25-generic #26~14.04.1-Ubuntu SMP
EXTRA RELEVANT SYSTEM CONFIGURATION :
ulimit -n
1024
A DESCRIPTION OF THE PROBLEM :
EPollSelectorImpl doesn't close 2 file descriptors (fd0, fd1) if pollWrapper throws exception:
EPollSelectorImpl(SelectorProvider sp) throws IOException {
super(sp);
long pipeFds = IOUtil.makePipe(false);
fd0 = (int) (pipeFds >>> 32);
fd1 = (int) pipeFds;
pollWrapper = new EPollArrayWrapper();
pollWrapper.initInterrupt(fd0, fd1);
fdToKey = new HashMap<>();
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Open many file descriptors: MAX_OPEN_FILE-2
- Try create epoll selector
- EPollSelectorImpl opens pipe and consume last 2 descriptors
- EPollSelectorImpl calls epoll_create syscall
- EPollSelectorImpl throws IOException without closing pipe
REPRODUCIBILITY :
This bug can be reproduced rarely.
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
3.19.0-25-generic #26~14.04.1-Ubuntu SMP
EXTRA RELEVANT SYSTEM CONFIGURATION :
ulimit -n
1024
A DESCRIPTION OF THE PROBLEM :
EPollSelectorImpl doesn't close 2 file descriptors (fd0, fd1) if pollWrapper throws exception:
EPollSelectorImpl(SelectorProvider sp) throws IOException {
super(sp);
long pipeFds = IOUtil.makePipe(false);
fd0 = (int) (pipeFds >>> 32);
fd1 = (int) pipeFds;
pollWrapper = new EPollArrayWrapper();
pollWrapper.initInterrupt(fd0, fd1);
fdToKey = new HashMap<>();
}
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Open many file descriptors: MAX_OPEN_FILE-2
- Try create epoll selector
- EPollSelectorImpl opens pipe and consume last 2 descriptors
- EPollSelectorImpl calls epoll_create syscall
- EPollSelectorImpl throws IOException without closing pipe
REPRODUCIBILITY :
This bug can be reproduced rarely.
- backported by
-
JDK-8138946 (se) File descriptor leak when Selector.open fails
-
- Resolved
-
-
JDK-8140922 (se) File descriptor leak when Selector.open fails
-
- Resolved
-
-
JDK-8142128 (se) File descriptor leak when Selector.open fails
-
- Resolved
-
-
JDK-8147255 (se) File descriptor leak when Selector.open fails
-
- Resolved
-