JDK-8250630 : test/jdk/com/sun/jdi/JdwpListenTest.java fails on Alpine Linux
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: repo-portola
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: other
  • CPU: unknown
  • Submitted: 2020-07-27
  • Updated: 2024-11-20
  • Resolved: 2020-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 16
16 b14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
Run test test/jdk/com/sun/jdi/JdwpListenTest.java on Alpine Linux.

The test fails:
{code}
[debuggee] Listening for transport dt_socket at address: 34727
Debuggee is listening on *:34727
Connecting to fe80:0:0:0:5054:ff:feb6:e5ba%2, expected: SUCCESS
STDERR:
java.io.IOException: Bad file descriptor
	at java.base/java.io.FileInputStream.available0(Native Method)
	at java.base/java.io.FileInputStream.available(FileInputStream.java:322)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:244)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:343)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:106)
	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:832)
java.lang.RuntimeException: ERROR: failed to attach
	at JdwpListenTest.listenTest(JdwpListenTest.java:106)
	at JdwpListenTest.main(JdwpListenTest.java:81)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	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:127)
	at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.net.ConnectException: Connection refused
	at java.base/sun.nio.ch.Net.connect0(Native Method)
	at java.base/sun.nio.ch.Net.connect(Net.java:572)
	at java.base/sun.nio.ch.Net.connect(Net.java:561)
	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:333)
	at java.base/java.net.Socket.connect(Socket.java:648)
	at jdk.jdi/com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:261)
	at jdk.jdi/com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:119)
	at jdk.jdi/com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:83)
	at JdwpListenTest.attach(JdwpListenTest.java:125)
	at JdwpListenTest.listenTest(JdwpListenTest.java:99)
	... 7 more
{code}

Comments
I assigned this back to Alexandr Scherbatiy. I think the re-assignment to Liam Miller-Cushon was inadvertent in intended for JDK-8313804.
20-09-2023

URL: https://hg.openjdk.java.net/jdk/jdk/rev/d7707af10c98 User: dsamersoff Date: 2020-08-30 12:53:24 +0000
30-08-2020

To reproduce the issue in docker it is necessary to enable IPv6: ---------------------- > docker run --rm --privileged -it alpine:3.11.6 ash > sudo sysctl -w net.ipv6.conf.eth0.disable_ipv6=0 ---------------------- ------------- getaddrinfo() for node: "localhost", service: NULL, family: AF_UNSPEC, hints: AI_CANONNAME AF_INET6 IPv6 addr '::1' AF_INET IPv4 addr '127.0.0.1' getaddrinfo() for node: NULL, service: "33833", family: AF_INET6, hints: AI_PASSIVE | AI_V4MAPPED | AI_ALL AF_INET6 IPv6 addr '::ffff:0.0.0.0' AF_INET6 IPv6 addr '::' -------------
30-07-2020

getaddrinfo(3) on Alpine Linux returns IPv4 address mapped to IPv6 first: ------------ family: AF_INET6, flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL AF_INET6 IPv6 addr '::ffff:0.0.0.0' AF_INET6 IPv6 addr '::' ------------ getaddrinfo(3) on Ubuntu returns only IPv6 address: ------------ family: AF_INET6, flags: AI_PASSIVE | AI_V4MAPPED | AI_ALL AF_INET6 IPv6 addr '::' ------------ The attache addr_info.c source code is attached. See discussion the difference of getaddrinfo(3) behaviour on musl alias: https://www.openwall.com/lists/musl/2020/02/27/3
27-07-2020