On Wed, 10 Jan 2024 01:53:02 GMT, Alex Menkov <amen...@openjdk.org> wrote:

> The change fixes workaround introduced by 
> [[JDK-8250630]](https://bugs.openjdk.org/browse/JDK-8250630).
> The root cause of the test failure was identified by JDK-8250630:
> On Apline Linux getaddrinfo function returns 2 entries for "any" address - 
> mapped IPv4 (`::ffff:0.0.0.0`) and IPv6 (`::`) and IPv4 is returned first.
> When JDWP agent listens on mapped IPv4, it accepts only connections from IPv4 
> addresses, connections from IPv6 addresses fail with "connection refused" 
> error.
> Fix for JDK-8250630 introduced workaround for the case - if we get 
> `::ffff:0.0.0.0` (`mappedAny`) and `::` (`in6addr_any`) is also returned by 
> getaddrinfo, agent uses `in6addr_any` for listening.
> 
> But the fix had a typo - the loop goes through returned addresses (`ai` 
> variable), but checks if `listenAddr` equals `in6addr_any`. This is always 
> false (because `listenAddr` equals `mappedAny`), so the workaround does not 
> work.
> 
> Submitter confirmed that the fix resolves the issue.
> 
> Testing: tier1, all JDI-related tests 
> (test/hotspot/jtreg/vmTestbase/nsk/jdwp, 
> test/hotspot/jtreg/vmTestbase/nsk/jdi, test/hotspot/jtreg/vmTestbase/nsk/jdb, 
> test/jdk/com/sun/jdi)

This pull request has now been integrated.

Changeset: b530c028
Author:    Alex Menkov <amen...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/b530c0281b5082994065b10addeb8366ffa58e2f
Stats:     2 lines in 1 file changed: 0 ins; 0 del; 2 mod

8317804: com/sun/jdi/JdwpAllowTest.java fails on Alpine 3.17 / 3.18

Reviewed-by: cjplummer, mbaesken

-------------

PR: https://git.openjdk.org/jdk/pull/17334

Reply via email to