JDK-7098037 : java/net/DatagramSocket/ChangingAddress.java fail on Windows Vista and Windows 2008
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 8
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2011-10-05
  • Updated: 2013-03-01
  • Resolved: 2011-10-20
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 8
8Resolved
Related Reports
Relates :  
Description
#Test Results (version 2)
#Tue Oct 04 19:43:23 PDT 2011
#checksum:498f1d1262043eab
#-----testdescription-----
$file=C:\\Users\\aurora\\sandbox\\testbase\\test\\java\\net\\DatagramSocket\\ChangingAddress.java
$root=C:\\Users\\aurora\\sandbox\\testbase\\test
keywords=bug7084030
run=ASSUMED_ACTION main ChangingAddress\r\n
source=ChangingAddress.java
title=Tests that DatagramSocket.getLocalAddress returns the right local address after connect/disconnect.

#-----environment-----

#-----testresult-----
description=file:/C:/Users/aurora/sandbox/testbase/test/java/net/DatagramSocket/ChangingAddress.java
elapsed=94 0:00:00.094
end=Tue Oct 04 19:43:23 PDT 2011
environment=regtest
execStatus=Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected:sfx2100-06/169.254.189.161 Actual/a9fe:bda1:0:0:9891:7004:80fa:ffff
hostname=sfx2100-06
javatestOS=Windows Vista 6.0 (amd64)
javatestVersion=4.1.4
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build compile main
start=Tue Oct 04 19:43:23 PDT 2011
test=java/net/DatagramSocket/ChangingAddress.java
work=C:\\Users\\aurora\\sandbox\\gresults\\testoutput\\jdk_net\\JTwork\\java\\net\\DatagramSocket

#section:script_messages
----------messages:(4/196)*----------
JDK under test: (C:\\Users\\aurora\\sandbox\\jdk)
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b9277)
Java HotSpot(TM) 64-Bit Server VM (build 22.0-b03, mixed mode)

#section:build
----------messages:(3/103)----------
command: build ChangingAddress
reason: Named class compiled on demand
elapsed time (seconds): 0.016
result: Passed. Build successful

#section:compile
----------messages:(3/192)*----------
command: compile C:\\Users\\aurora\\sandbox\\testbase\\test\\java\\net\\DatagramSocket\\ChangingAddress.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.016
result: Passed. Compilation successful

#section:main
----------messages:(3/132)----------
command: main ChangingAddress
reason: Assumed action based on file name: run main ChangingAddress 
elapsed time (seconds): 0.078
----------System.err:(13/736)----------
java.lang.RuntimeException: Expected:sfx2100-06/169.254.189.161 Actual/a9fe:bda1:0:0:9891:7004:80fa:ffff
	at ChangingAddress.check(ChangingAddress.java:36)
	at ChangingAddress.main(ChangingAddress.java:50)
	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:474)
	at com.sun.javatest.regtest.MainAction$SameVMRunnable.run(MainAction.java:680)
	at java.lang.Thread.run(Thread.java:722)

JavaTest Message: Test threw exception: java.lang.RuntimeException
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expected:sfx2100-06/169.254.189.161 Actual/a9fe:bda1:0:0:9891:7004:80fa:ffff


test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Expect

Comments
EVALUATION ChangingAddress.java was added as part of the changes for CR 7084030. This test fails on Windows Vista and Windows 2008. Both these Windows versions support the "new" Dual TCP/IP stack and therefore use the DualStackPlainDatagramSocketImpl implementation ( as opposed to the older TwoStacksPlainDatagramSocketImpl ). It seems that on these platforms the dual TCP/IP stack will bind the DatagramSocket to an IPv6 address even if it is connected to an IPv4 address. The test would appear to be overly restrictive.
05-10-2011