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

[11u] GHA macos-13 builder is unable to resolve local hostname

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: External
    • Icon: P4 P4
    • None
    • 8, 11
    • infrastructure
    • None
    • generic
    • os_x

      Reverse lookups are broken on Macos runners https://github.com/actions/runner-images/issues/8649 since, at least, Oct. 2023.

      On GHA macos-13 builders `getaddrinfo` fails when resolving $(hostname -f) (an address that usually ends with ".local", such as "Mac-1720772009454.local").

      This makes the following JDI / JDWP tests to fail

      ❌ macos-x64 / test (jdk/tier1 part 3)
      ❌ macos-x64 / test (langtools/tier1)

      Since JDI's socketTransport.c [1], that uses `getaddrinfo` fails to resolve local hostname and no JDI transports can then be initialized:

      ```
      ERROR: transport error 202: getaddrinfo: unknown host
      ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
      JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c:745]
      ```

      Adding the local hostname to `/etc/hosts` is a workaround that would allow macos builds to run on jdk11. By doing this the function `getaddrinfo` correctly resolves the hostname.

      An alternate solution would consist to avoid resolving the hostname by using network addresses (IPs) instead of host names.

      The problem does not affect JDK versions 17 and above, because JDK-8223104 JDWP support for IPv6 (that requires a CSR, JDK-8184770, JDK-8224159) that was introduced in version 13 solves the problem.


      [1]
      https://github.com/openjdk/jdk11u-dev/blob/697d8566b1d4801cb7926fa35bbf471f8f4ba066/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c#L329

            avieiro Antonio Vieiro
            avieiro Antonio Vieiro
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: