Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LongyuZhang opened this issue Feb 8, 2021 · 12 comments
Open

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

LongyuZhang opened this issue Feb 8, 2021 · 12 comments

Comments

@LongyuZhang
Copy link
Contributor

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

  • java/net/MulticastSocket/Test.java
  • java/net/MulticastSocket/Promiscuous.java
  • java/net/MulticastSocket/B6427403.java
  • java/net/MulticastSocket/NoLoopbackPackets.java
  • java/net/MulticastSocket/SetLoopbackMode.java

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
@karianna karianna added the bug label Feb 10, 2021
@LongyuZhang
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

smlambert commented Feb 23, 2021

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Another idea -

See: openhab/openhab-addons@f3219ac and search for private void handleRead(SelectionKey key) throws IOException {

  • FYI: with IPv6 addresses active - results are the same

@smlambert
Copy link
Contributor

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
Copy link
Contributor

smlambert commented Mar 3, 2021

possibly related: #1011
and
#1650

@sophia-guo
Copy link
Contributor

one more java/net/MulticastSocket/SetOutgoingIf.java

@aixtools
Copy link
Contributor

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
Copy link
Contributor

smlambert commented Feb 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

5 participants