[jboss-jira] [JBoss JIRA] Commented: (JGRP-976) JGroups testsuite failures with link-local IPv6 addresses

Richard Achmatowicz (JIRA) jira-events at lists.jboss.org
Tue May 12 15:15:47 EDT 2009


    [ https://jira.jboss.org/jira/browse/JGRP-976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12467080#action_12467080 ] 

Richard Achmatowicz commented on JGRP-976:
------------------------------------------

I have attached a small program  BuggyServerSocketSender.java which reproduces ther error:

> java -cp . BuggyServerSocketSender  -localhost fe80:0:0:0:215:58ff:fec8:81a8%eth0  -remotehost fe80:0:0:0:215:58ff:fec8:81a8%eth0 -port 1234

When I run this program on Sun JDK 1.6.0_13, I can reproduce the error which is occurring in the JGroups testsuite (the Socket construction is the same as used by RouterStub).
If I run the same program on OpenJDK 1.7, the error does not appear.


By running the program with strace, which displays how the JDK calls the kernel (in particular, how the JDK makes calls to the socket function), you can see that in the Sun JDK case, an incorrect scope id is being used (lo). It is "incorrect", because I am passing a  scoped link-local address to the socket call, which specifies the zone id of "%eth0".  Here is the relevant section of the trace:

> strace -f -e trace=network java -cp . BuggyServerSocketSender -localhost fe80:0:0:0:215:58ff:fec8:81a8%eth0 -remotehost fe80:0:0:0:215:58ff:fec8:81a8%eth0 -port 1234

[snip]
[pid  3656] socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 4
[pid  3656] bind(4, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("eth0")}, 28) = 0
[pid  3656] getsockname(4, {sa_family=AF_INET6, sin6_port=htons(43780), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("eth0")}, [28]) = 0
[pid  3656] connect(4, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("lo")}, 28) = -1 EINVAL (Invalid argument)
exception connecting to host: /fe80:0:0:0:215:58ff:fec8:81a8%eth0, port: 0java.net.SocketException: Invalid argument or cannot assign requested address
java.net.SocketException: Invalid argument or cannot assign requested address
        at java.net.PlainSocketImpl.socketConnect(Native Method)

Note that the sin6_scope is set to "lo", and not "eth0". This is the root cause of not being able to connect. But because I specified %eth0, this should get picked up by thye JDK.


By running the same program with strace and OpenJDK, you can see that the correct zoneid is being picked up. Here is the same relevant section of the trace:

[snip]
[pid  2889] socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 5
[pid  2889] bind(5, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("eth0")}, 28) = 0
[pid  2889] getsockname(5, {sa_family=AF_INET6, sin6_port=htons(47388), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("eth0")}, [28]) = 0
[pid  2889] connect(5, {sa_family=AF_INET6, sin6_port=htons(0), inet_pton(AF_INET6, "fe80::215:58ff:fec8:81a8", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=if_nametoindex("eth0")}, 28) = -1 ECONNREFUSED (Connection refused)
exception connecting to host: /fe80:0:0:0:215:58ff:fec8:81a8%eth0, port: 0java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)

Note that here we have a connection refused (which should be the case, as I don't have a server running).

So, on Sun JDK 1.6.0_13 with link-local addresses, we have a problem it seems.


> JGroups testsuite failures with link-local IPv6 addresses 
> ----------------------------------------------------------
>
>                 Key: JGRP-976
>                 URL: https://jira.jboss.org/jira/browse/JGRP-976
>             Project: JGroups
>          Issue Type: Bug
>         Environment: Sun JDK 1.6.0_13, Fedora 8, IPv6 link-local addresses
>            Reporter: Richard Achmatowicz
>            Assignee: Bela Ban
>            Priority: Minor
>         Attachments: BuggyServerSocketSender.java
>
>
> These failures is turning up when we run the JGroups 2.4.6.GA testsuite with scoped link-local addresses -  MergeTest / DisconnectTest and MultiplexerMergeTest are failing with this exception:
>     [junit] 4603 [DEBUG] NAKACK.handleMessage(): - fe80:0:0:0:215:58ff:fec8:81a8%eth0:35158: received fe80:0:0:0:215:58ff:fec8:81a8%eth0:35158#0
>     [junit] 4603 [DEBUG] NAKACK.handleMessage(): - fe80:0:0:0:215:58ff:fec8:81a8%eth0:35158: received fe80:0:0:0:215:58ff:fec8:81a8%eth0:35158#0
>     [junit] 4607 [DEBUG] RouterStub.reconnect(): - failed reconnecting
>     [junit] java.net.SocketException: Invalid argument or cannot assign requested address
>     [junit]     at java.net.PlainSocketImpl.socketConnect(Native Method)
>     [junit]     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>     [junit]     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>     [junit]     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>     [junit]     at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>     [junit]     at java.net.Socket.connect(Socket.java:519)
>     [junit]     at java.net.Socket.connect(Socket.java:469)
>     [junit]     at java.net.Socket.<init>(Socket.java:366)
>     [junit]     at java.net.Socket.<init>(Socket.java:240)
>     [junit]     at org.jgroups.stack.RouterStub.connect(RouterStub.java:143)
>     [junit]     at org.jgroups.stack.RouterStub.reconnect(RouterStub.java:363)
>     [junit]     at org.jgroups.stack.RouterStub.reconnect(RouterStub.java:379)
>     [junit]     at org.jgroups.protocols.TUNNEL$Reconnector.run(TUNNEL.java:446)
> I believe this may be a Sun JDK bug. Commenst to follow will explain.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list