adoptium / aqa-tests

Home of test infrastructure for Adoptium builds
https://adoptium.net/aqavit
Apache License 2.0
131 stars 314 forks source link

MulticastSocket tests failed on aix with jdk 15 and 16 #2246

Open LongyuZhang opened 3 years ago

LongyuZhang commented 3 years ago

Describe the bug Several MulticastSocket test failed on aix with jdk 15 and 16 for both hotspot and openj9. These tests are:

To Reproduce Steps to reproduce the behavior (or Grinder rerun link): https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/6464/testReport/ https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/6463/testReport/ https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/6522/testReport/

Additional context

java/net/MulticastSocket/Test.java

java.net.SocketException: joinGroup failed
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:482)
    at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:329)
    at Test.doTest(Test.java:71)
    at Test.allTests(Test.java:141)
    at Test.main(Test.java:167)
    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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
    at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
    at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1466)
    at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
    ... 10 more
java.lang.Exception: Test failed - see log file for details
    at Test.main(Test.java:179)
    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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
    at java.base/java.lang.Thread.run(Thread.java:832)

JavaTest Message: Test threw exception: java.lang.Exception

java/net/MulticastSocket/Promiscuous.java

java.lang.RuntimeException: 0.0.0.0/0.0.0.0:36590: Expected message not received, Receive timed out
    at Promiscuous.receive(Promiscuous.java:79)
    at Promiscuous.test(Promiscuous.java:140)
    at Promiscuous.main(Promiscuous.java:195)
    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)

JavaTest Message: Test threw exception: java.lang.RuntimeException: 0.0.0.0/0.0.0.0:36590: Expected message not received, Receive timed out

java/net/MulticastSocket/B6427403.java

java.net.SocketException: joinGroup failed
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:482)
    at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:329)
    at B6427403.main(B6427403.java:38)
    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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
    at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
    at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1466)
    at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
    ... 8 more

JavaTest Message: Test threw exception: java.net.SocketException
JavaTest Message: shutting down test

java/net/MulticastSocket/NoLoopbackPackets.java

java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
    at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1466)
    at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
    at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:384)
    at NoLoopbackPackets.main(NoLoopbackPackets.java:94)
    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.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:298)
    at java.base/java.lang.Thread.run(Thread.java:832)

JavaTest Message: Test threw exception: java.lang.IllegalArgumentException

java/net/MulticastSocket/SetLoopbackMode.java

java.net.SocketException: joinGroup failed
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:482)
    at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:329)
    at SetLoopbackMode.main(SetLoopbackMode.java:132)
    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.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
    at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1466)
    at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:479)
    ... 8 more

JavaTest Message: Test threw exception: java.net.SocketException: joinGroup failed
LongyuZhang commented 3 years ago

java/net/MulticastSocket/SetOutgoingIf.java also failed with jdk 11, 15, and 16.

04:20:26  STDERR:
04:20:26  Unexpected exception for MulticastSender(en1): java.net.BindException: The socket name is not available on this system.
04:20:26  java.net.BindException: The socket name is not available on this system.
04:20:26    at java.base/sun.nio.ch.Net.setInterface6(Native Method)
04:20:26    at java.base/sun.nio.ch.DatagramChannelImpl.setOption(DatagramChannelImpl.java:364)
04:20:26    at java.base/sun.nio.ch.DatagramSocketAdaptor.setOption(DatagramSocketAdaptor.java:418)
04:20:26    at java.base/sun.nio.ch.DatagramSocketAdaptor.setNetworkInterface(DatagramSocketAdaptor.java:600)
04:20:26    at java.base/java.net.MulticastSocket.setNetworkInterface(MulticastSocket.java:466)
04:20:26    at MulticastSender.run(SetOutgoingIf.java:244)
04:20:26    at java.base/java.lang.Thread.run(Thread.java:853)
04:20:26  Unexpected exception for MulticastSender(en0): java.net.BindException: The socket name is not available on this system.
04:20:26  java.net.BindException: The socket name is not available on this system.
04:20:26  java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
04:20:26    at java.base/sun.nio.ch.DatagramChannelImpl.innerJoin(DatagramChannelImpl.java:1466)
04:20:26    at java.base/sun.nio.ch.DatagramChannelImpl.join(DatagramChannelImpl.java:1551)
04:20:26    at java.base/sun.nio.ch.DatagramSocketAdaptor.joinGroup(DatagramSocketAdaptor.java:532)
04:20:26    at java.base/java.net.MulticastSocket.joinGroup(MulticastSocket.java:384)
04:20:26    at SetOutgoingIf.run(SetOutgoingIf.java:179)
04:20:26    at SetOutgoingIf.main(SetOutgoingIf.java:72)
04:20:26    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
04:20:26    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
04:20:26    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
04:20:26    at java.base/java.lang.reflect.Method.invoke(Method.java:564)
04:20:26    at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
04:20:26    at java.base/java.lang.Thread.run(Thread.java:853)
04:20:26  
04:20:26    at java.base/sun.nio.ch.Net.setInterface6(Native Method)
04:20:26  JavaTest Message: Test threw exception: java.lang.IllegalArgumentException: IPv6 socket cannot join IPv4 multicast group
04:20:26  JavaTest Message: shutting down test
LongyuZhang commented 3 years ago

Tested java/net/MulticastSocket/Test.java on all Adopt aix machines, including test-osuosl-aix72-ppc64-1, test-ibm-aix71-ppc64-1, test-ibm-aix71-ppc64-2, and build-osuosl-aix71-ppc64-2. All grinders (https://ci.adoptopenjdk.net/view/Test_grinder/job/Grinder/7149 - 7152) failed with the same joinGroup failed error. So this failure is not likely to be machine related.

smlambert commented 3 years ago

Tagging @aixtools as we may need assistance in determining whether we need to update machine configuration or exclude tests depending on what these tests are trying to do (failing with IPv6 socket cannot join IPv4 multicast group... have to check if this is the intent of the test).

My guess from the output "The socket name is not available on this system." is that the test may be expecting an IPv6 socket that is not present on the system, but I have not looked closely.

aixtools commented 3 years ago

The only IPv6 address available, I expect, is ::1

# netstat -ni
Name  Mtu   Network     Address            Ipkts Ierrs    Opkts Oerrs  Coll
en0   1500  link#2      EE.EE.EE.91.9b.2        343243803     0        143053555     0     0
en0   1500  140.211.9   140.NNN.M.O             343243803     0        143053555     0     0
en1   1500  link#3      EE.EE.EE.91.9b.5         67557687     0          1253642     0     0
en1   1500  10.1        10.N.M.O                 67557687     0          1253642     0     0
lo0   16896 link#1                               63115400     0         63115400     0     0
lo0   16896 127         127.0.0.1                63115400     0         63115400     0     0
lo0   16896 ::1%1                                63115400     0         63115400     0     0

Running the test - with save workspace - and I'll try adding some IPv6 interfaces (local only) - and see if that changes anything auto-magically.

aixtools commented 3 years ago

As I do not know where to look in the java code...

does this question and answer offer any ideas? https://stackoverflow.com/questions/39111465/java-datagramchannel-multicast-defaults-to-ipv6

aixtools commented 3 years ago

Another idea -

See: https://github.com/openhab/openhab-addons/commit/f3219acfba52c08a41b1dd8cd6a339d40eaef767 and search for private void handleRead(SelectionKey key) throws IOException {

smlambert commented 3 years ago

For reference here are the links to the test code (for jdk16) which shows what each test is trying to do (also see the @run annotations at the top of the test for what commandline options are used):

smlambert commented 3 years ago

possibly related: https://github.com/AdoptOpenJDK/openjdk-tests/issues/1011 and https://github.com/AdoptOpenJDK/openjdk-tests/issues/1650

sophia-guo commented 2 years ago

one more java/net/MulticastSocket/SetOutgoingIf.java

aixtools commented 2 years ago

Well, my OCA has been processed - so I'll be in a position to look at upstream tests.

So, to aid my focus - please be clear wither these are 'upstream' tests (e.g., PingTest) or adoptium managed (aqua) tests.

Should I ever understand the cause - then I know where to post the patch request.

smlambert commented 2 years ago

The AQA test suite includes the upstream openjdk tests. The test source for these tests lives and is managed upstream, and we pull them in and run them in our suite. We can and sometimes do exclude these tests in exclude files in our repo, but fixes to test source for the "openjdk" tests would occur upstream.

This is why I linked to the source in a comment above, example: java/net/MulticastSocket/Test.java is in the upstream https://github.com/openjdk github organization, not within the https://github.com/adoptium github org.

sophia-guo commented 2 years ago

same failures with jdk17 aix java/net/DatagramSocket/DatagramSocketExample.java.DatagramSocketExample java/net/DatagramSocket/DatagramSocketMulticasting.java.DatagramSocketMulticasting java/net/MulticastSocket/JoinLeave.java.JoinLeave java/net/MulticastSocket/MulticastAddresses.java.MulticastAddresses java/net/MulticastSocket/SetOutgoingIf.java.SetOutgoingIf java/net/MulticastSocket/B6427403.java.B6427403 java/net/MulticastSocket/NoLoopbackPackets.java.NoLoopbackPackets java/net/MulticastSocket/Promiscuous.java.Promiscuous java/net/MulticastSocket/Test.java.Test java/nio/channels/DatagramChannel/AdaptorMulticasting.java