JDK-6730740 : Fix for 6729881 has apparently broken several 64 bit tests: "Bad address"
  • Type: Bug
  • Status: Resolved
  • Resolution: Fixed
  • Component: core-libs
  • Sub-Component: java.net
  • Priority: P2
  • Affected Version: 7
  • OS: generic
  • CPU: generic
  • Submit Date: 2008-07-28
  • Updated Date: 2010-07-09
  • Resolved Date: 2008-08-07
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7
7 b33Resolved
Related Reports
Relates :  
Description
On both linux-amd64 (flicker) solaris-sparcv9 (shimmer), we are now getting the following errors in the regression suite:

TEST: java/net/MulticastSocket/SetLoopbackMode.java
TEST: java/net/MulticastSocket/TestDefaults.java
TEST: java/net/Socket/setReuseAddress/Basic.java
TEST: java/net/Socket/SetSoLinger.java
TEST: java/net/Socket/TrafficClass.java
TEST: java/net/Socket/UrgentDataTest.java
TEST: sun/security/ssl/com/sun/net/ssl/internal/ssl/SSLSocketImpl/NewSocketMethods.java

They pass just fine on the 32 bit equivalent.

There are also a bunch of new failures in the JCK, probably directly related.

Example:
TEST: java/net/MulticastSocket/SetLoopbackMode.java
JDK under test: (/build/solaris-sparcv9/j2sdk-image-complete)
java version "1.7.0-internal"
Java(TM) SE Runtime Environment (build 1.7.0-internal-b99)
Java HotSpot(TM) 64-Bit Server VM (build 14.0-b01, mixed mode)

ACTION: build -- Passed. Build successful
REASON: Named class compiled on demand
TIME:   4.064 seconds
messages:
command: build SetLoopbackMode
reason: Named class compiled on demand
elapsed time (seconds): 4.064

ACTION: compile -- Passed. Compilation successful
REASON: .class file out of date or does not exist
TIME:   4.063 seconds
messages:
command: compile /test/solaris-sparcv9/JDK_TESTS/java/net/MulticastSocket/SetLoopbackMode.java
reason: .class file out of date or does not exist
elapsed time (seconds): 4.063
STDOUT:
STDERR:

ACTION: main -- Failed. Execution failed: `main' threw exception: java.net.Socke
tException: Bad address
REASON: Assumed action based on file name: run main SetLoopbackMode
TIME:   0.544 seconds
messages:
command: main SetLoopbackMode
reason: Assumed action based on file name: run main SetLoopbackMode
elapsed time (seconds): 0.544
STDOUT:

Test will use multicast group: /224.80.80.80

******************

STDERR:
java.net.SocketException: Bad address
        at java.net.PlainDatagramSocketImpl.socketGetOption(Native Method)
        at java.net.AbstractPlainDatagramSocketImpl.getOption(AbstractPlainDatagramSocketImpl.java:324)
        at java.net.MulticastSocket.getLoopbackMode(MulticastSocket.java:580)
        at SetLoopbackMode.test(SetLoopbackMode.java:39)
        at SetLoopbackMode.main(SetLoopbackMode.java:111)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:623)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:
94)
        at java.lang.Thread.run(Thread.java:674)

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

STATUS:Failed.`main' threw exception: java.net.SocketException: Bad address

TEST RESULT: Failed. Execution failed: `main' threw exception: java.net.SocketException: Bad address

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/jsn/jdk/rev/441f88d39988
2008-07-29

EVALUATION The offending changes causes a int* to be cast to socklen_t: -- a/src/solaris/native/java/net/net_util_md.c Sun Jul 27 19:16:15 2008 +0800 +++ b/src/solaris/native/java/net/net_util_md.c Mon Jul 28 13:02:11 2008 +0100 @@ -1086,7 +1085,7 @@ NET_GetSockOpt(int fd, int level, int op } #endif - rv = getsockopt(fd, level, opt, result, len); + rv = getsockopt(fd, level, opt, result, (socklen_t)len); if (rv < 0) { return rv; }
2008-07-29