Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8194262

jdk.net.hosts.file malfunctions on Mac OSX 10.13

    XMLWordPrintable

    Details

      Description

      I can reproduce with JDK 10 build (attempted b01, b11, b21 and b37) , though there are slightly difference on test outputs.
      No such failure on other Mac 10.11.6 environment.

      It looks setting jdk.net.hosts.file doesn't take effect.
      Affected:
      java/net/URLPermission/nstest/LookupTest.java
      java/net/SocketPermission/rebind/Test.java
      java/net/InetAddress/InternalNameServiceTest.java
      sun/net/InetAddress/nameservice/simple/CacheTest.java
      sun/net/InetAddress/nameservice/simple/DefaultCaching.java

      This is output from LookupTest.java:

      Connecting to http://allowedAndFound.com:50374/foo
      Unexpected IOException:allowedAndFound.com
      java.lang.RuntimeException: java.net.UnknownHostException: allowedAndFound.com
      at LookupTest.test(LookupTest.java:80)
      at LookupTest.main(LookupTest.java:121)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
      at java.base/java.lang.Thread.run(Thread.java:844)
      Caused by: java.net.UnknownHostException: allowedAndFound.com
      at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:221)
      at java.base/java.net.Socket.connect(Socket.java:591)
      at java.base/java.net.Socket.connect(Socket.java:540)
      at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:182)
      at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:474)
      at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:569)
      at java.base/sun.net.www.http.HttpClient.<init>(HttpClient.java:242)
      at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:341)
      at java.base/sun.net.www.http.HttpClient.New(HttpClient.java:362)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1242)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1210)
      at java.base/sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1065)
      at java.base/sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1063)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:793)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1062)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:1009)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1581)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:97)
      at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1501)
      at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1499)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:793)
      at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
      at LookupTest.test(LookupTest.java:71)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              michaelm Michael McMahon
              Reporter:
              xiaofeya Xiaofeng Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: