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

com/sun/tools/attach/BasicTests.java fails with "SocketException: Permission denied: connect"

XMLWordPrintable

    • b02

      In some configurations (for example with active VPN) the test fails due SocketException:
      [runApplication] Exception in thread "Attach Listener" java.lang.reflect.InvocationTargetException
      [runApplication] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
      [runApplication] at java.base/java.lang.reflect.Method.invoke(Method.java:580)
      [runApplication] at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:562)
      [runApplication] at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:582)
      [runApplication] Caused by: java.net.SocketException: Permission denied: connect
      [runApplication] at java.base/sun.nio.ch.Net.connect0(Native Method)
      [runApplication] at java.base/sun.nio.ch.Net.connect(Net.java:589)
      [runApplication] at java.base/sun.nio.ch.Net.connect(Net.java:578)
      [runApplication] at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583)
      [runApplication] at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
      [runApplication] at java.base/java.net.Socket.connect(Socket.java:760)
      [runApplication] at java.base/java.net.Socket.connect(Socket.java:695)
      [runApplication] at Agent.agentmain(Agent.java:41)
      [runApplication] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
      [runApplication] ... 3 more

      The test listens and connects using wildcard addresses.
      The test should be updated to use loopback addresses

            amenkov Alex Menkov
            amenkov Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: