JDK-8179307 : Java_sun_nio_ch_KQueue_keventPoll throws an exception with "kqueue failed" instead of "kevent poll failed".
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2017-04-24
  • Updated: 2018-03-28
  • Resolved: 2018-02-12
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 Availability Release.

To download the current JDK release, click here.
JDK 11
11 b01Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
$ java -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
$ uname -a
Darwin dhcp-whq501ip-3rd-and-4th-floor-gen-off-10-213-55-175.usdhcp.oraclecorp.com 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
if the call to kevent in Java_sun_nio_ch_KQueue_keventPoll fails, the exception thrown contains the message string ""kqueue failed".

E.g., 
http://cafebabe.uk.oracle.com/lxr/source/jdk/src/java.base/macosx/native/libnio/ch/KQueue.c?v=Java_1.9.0_b65#086
086 JNIEXPORT jint JNICALL
087 Java_sun_nio_ch_KQueue_keventPoll(JNIEnv *env, jclass c,
088                                   jint kqfd, jlong address, jint nevents)
089 {
....
093     RESTARTABLE(kevent(kqfd, NULL, 0, events, nevents, NULL), res);
094     if (res < 0) {
095         JNU_ThrowIOExceptionWithLastError(env, "kqueue failed");
....

I think the message string should say "kevent failed", so people do not think this is the same failure as line 67, in Java_sun_nio_ch_KQueue_kqueue.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Look at the code.  I do not know how to cause a kevent failure.


REPRODUCIBILITY :
This bug can be reproduced rarely.