Bug 205192 - java/openjdk8 possible wrong mapping of /dev/fd vs. /proc/self/fd
Summary: java/openjdk8 possible wrong mapping of /dev/fd vs. /proc/self/fd
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Jung-uk Kim
URL:
Keywords: needs-patch, regression
Depends on:
Blocks:
 
Reported: 2015-12-10 13:54 UTC by Tobias Feldhaus
Modified: 2015-12-11 07:57 UTC (History)
3 users (show)

See Also:


Attachments
Java Stacktrace (2.04 KB, text/plain)
2015-12-10 13:56 UTC, Tobias Feldhaus
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Feldhaus 2015-12-10 13:54:21 UTC
While trying to port Facebook's Presto (https://prestodb.io/) to FreeBSD 10.2, I got an Exception with the following stacktrace (running openjdk8-8.60.24_1):


javax.management.RuntimeErrorException: java.lang.InternalError: errno: 2 error: Unable to open directory /proc/self/fd

	at sun.management.OperatingSystemImpl.getOpenFileDescriptorCount(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
	at com.sun.jmx.mbeanserver.PerInterface.getAttribute(PerInterface.java:83)
	at com.sun.jmx.mbeanserver.MBeanSupport.getAttribute(MBeanSupport.java:206)
	at com.sun.jmx.mbeanserver.MBeanSupport.getAttributes(MBeanSupport.java:213)
	at javax.management.StandardMBean.getAttributes(StandardMBean.java:390)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttributes(DefaultMBeanServerInterceptor.java:709)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttributes(JmxMBeanServer.java:705)
	at com.facebook.presto.connector.jmx.JmxRecordSetProvider.getAttributes(JmxRecordSetProvider.java:171)
	at com.facebook.presto.connector.jmx.JmxRecordSetProvider.getRecordSet(JmxRecordSetProvider.java:73)
	at com.facebook.presto.connector.jmx.TestJmxSplitManager.testRecordSetProvider(TestJmxSplitManager.java:110)

After investigating the code it seems like OpenJDK8 is using the wrong path to check for open file descriptors on FreeBSD. Could this be an OpenJDK bug?
Comment 1 Tobias Feldhaus 2015-12-10 13:56:06 UTC
Created attachment 164047 [details]
Java Stacktrace
Comment 2 Jung-uk Kim freebsd_committer freebsd_triage 2015-12-10 18:31:52 UTC
This problem seems to be introduced in r372338, i.e., mis-merged fix for JDK-8031581:

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/c44d84c6774d
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-12-10 18:44:12 UTC
A commit references this bug:

Author: jkim
Date: Thu Dec 10 18:43:51 UTC 2015
New revision: 403464
URL: https://svnweb.freebsd.org/changeset/ports/403464

Log:
  Fix regression introduced in r372338, i.e., mis-merged fix for JDK-8031581.

  PR:		205192

Changes:
  head/java/openjdk8/Makefile
  head/java/openjdk8/files/patch-jdk_src_solaris_native_sun_management_OperatingSystemImpl.c
Comment 4 Jung-uk Kim freebsd_committer freebsd_triage 2015-12-10 18:45:38 UTC
Fixed in r403464.  Thanks!