JDK-6207830 : JCK: /api/java_net/URI/[Ctor, Components,Create] Tests failing with [-server -Xcomp] in Linux
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 1.4.2,5.0u2,6
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris_8,windows_2000
  • CPU: generic,x86
  • Submitted: 2004-12-13
  • Updated: 2012-02-01
  • Resolved: 2005-02-01
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.
Other JDK 6
5.0u3Fixed 6 b22Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
JDK/JRE        : Fail - Mustang b13,14(Flag -server -Xcomp)
                 Pass - Mustang b13, 14(Flag -Xint)
JCK            : jck1.5
Platform[s]    : Linux(RedHat 3.0AS and Quicksilver)
switch/Mode    : Fail: -server -Xcomp
                 Pass: -Xint
JCK test owner : http://javaweb.sfbay/jcce/tcks/jck/docs/others/owners.jto

Failing Tests   : 
==================
1:/api/java_net/URI/index.html#Ctor
2:/api/java_net/URI/index.html#create
3./api/java_net/URI/index.html#components

Test source location:
=====================
All Tests Source Attached

jtr file location:
==================

All jtr files Attached


How to reproduce:
====================

script with .sh extension attached


Tests Output:
-------------
CTOR:
-------
[dtftest@circuslv rajesh]$ ksh repro.sh

URI2004: Failed. unexpected java.net.URISyntaxException: Expected IPv4 address at index 17: ftp://[1234:2345::ABCD]:1234/dir/file#ABC with ftp://[1234:2345::ABCD]:1234/dir/file#ABC

URI2013: Failed. Unexpected: java.net.URISyntaxException: Malformed IPv6 address at index 7: abc://[::0001]/home/root#Xwith (abc,::0001,/home/root,X)

URI2015: Failed. Unexpected: java.net.URISyntaxException: Expected IPv4 address at index 20: abc://me@[0001:ABCD::0001]/home/root?a=b;x=ywith (abc,me@[0001:ABCD::0001],/home/root,a=b;x=y,null)

STATUS:Failed.test cases: 19; passed: 16; failed: 3; first test case failure: URI200

-------------------------------------------------------
Create:
-------
[dtftest@circuslv rajesh]$ ksh repro.sh

URI2004: Failed. unexpected java.net.URISyntaxException: Expected IPv4 address at index 17: ftp://[1234:2345::ABCD]:1234/dir/file#ABC with ftp://[1234:2345::ABCD]:1234/dir/file#ABC

URI2013: Failed. Unexpected: java.net.URISyntaxException: Malformed IPv6 address at index 7: abc://[::0001]/home/root#Xwith (abc,::0001,/home/root,X)

URI2015: Failed. Unexpected: java.net.URISyntaxException: Expected IPv4 address at index 20: abc://me@[0001:ABCD::0001]/home/root?a=b;x=ywith (abc,me@[0001:ABCD::0001],/home/root,a=b;x=y,null)

STATUS:Failed.test cases: 19; passed: 16; failed: 3; first test case failure: URI2004
[dtftest@circuslv rajesh]$ vi repro.sh
[dtftest@circuslv rajesh]$ ksh repro.sh


URI2036: Failed. unexpected java.net.URISyntaxException: Expected IPv4 address at index 17: ftp://[1234:2345::ABCD]:1234/dir/file#ABC with ftp://[1234:2345::ABCD]:1234/dir/file#ABC
URI2037: Passed. OKAY
 ============== URI0005 ============== 
java.lang.NullPointerException thrown as expected
STATUS:Failed.test cases: 8; passed: 7; failed: 1; first test case failure: URI2036

------------------------
Components:
------------
[dtftest@circuslv rajesh]$ ksh repro.sh
java.lang.IllegalArgumentException
	at java.net.URI.create(Unknown Source)
	at javasoft.sqe.tests.api.java.net.URI.componentsTests.URI2053(componentsTests.java:220)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at javasoft.sqe.javatest.lib.MultiTest.invokeTestCase(MultiTest.java:399)
	at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:195)
	at javasoft.sqe.javatest.lib.MultiTest.run(MultiTest.java:127)
	at javasoft.sqe.tests.api.java.net.URI.componentsTests.main(componentsTests.java:27)
Caused by: java.net.URISyntaxException: Expected IPv4 address at index 13: http://[1080::8:800:200C:417A]
	at java.net.URI$Parser.fail(Unknown Source)
	at java.net.URI$Parser.failExpecting(Unknown Source)
	at java.net.URI$Parser.takeIPv4Address(Unknown Source)
	at java.net.URI$Parser.parseIPv6Reference(Unknown Source)
	at java.net.URI$Parser.parseServer(Unknown Source)
	at java.net.URI$Parser.parseAuthority(Unknown Source)
	at java.net.URI$Parser.parseHierarchical(Unknown Source)
	at java.net.URI$Parser.parse(Unknown Source)
	at java.net.URI.<init>(Unknown Source)
	... 10 more
URI2053: Failed. Test case throws exception: java.lang.IllegalArgumentException

STATUS:Failed.test cases: 15; passed: 14; failed: 1; first test case failure: URI2053


Specific Machine Info:
----------------------
Linux-QuickSilver:
------------------
Linux jck-win4 2.4.19-4GB #1 Fri Apr 2 19:59:17 UTC 2004 i686 unknown

Linux- Red Hat:
----------------
Linux circuslv 2.6.9-1.648_EL #1 Tue Oct 26 12:39:58 EDT 2004 i686 i686 i386 GNU/Linux


If i use Flag (-server -Xcomp) this particular tests Failed on B13,b14(mustang)
With Flag -Xint ... the same tests passed.






###@###.### 2004-12-13 20:40:51 GMT

Comments
SUGGESTED FIX Preliminary fix: remove this line from split_Rematerialize in reg-split.cpp in the neighborhood of line 269: if( in->outcnt() == 1 ) continue; // Only 1 user (def) ###@###.### 2005-1-20 00:05:08 GMT See PRT webrev: file:/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2005/20050126154610.rasbold.c2_baseline5/workspace/webrevs/webrev-2005.01.26/index.html ###@###.### 2005-03-01 18:01:29 GMT
20-01-2005

EVALUATION Reproduce the bug with attached scripts in Cinnabar (JDS 3), kernel version 2.6.5-7.97-smp. Remember to change the script to use -server -Xcomp flag; it'll show the bug. The code fails at line 2849 of src/share/classes/java/net/URI.java : private boolean at(int start, int end, String s) { int p = start; int sn = s.length(); if (sn > end - p) return false; int i = 0; while (i < sn) { if (charAt(p++) != s.charAt(i)) { break; } i++; } return (i == sn); } But if I change the code to: ...... while (i < sn) { if (charAt(p++) != s.charAt(i++)) { return false; } } ...... The bug gone. Sematically, these two code snippets are the same. So I think this is a VM bug. Reassign it to VM team. ###@###.### 2004-12-16 03:04:53 GMT The HotSpot server compiler is generating bad code. Running with java_g causes the VM to fail an assertion. The root cause of the problem is in live range splitting in the register allocator. In this somewhat unusual case, a basic block has been created that has three definitions of the one live range: a PhiNode at the top, a conditional move at the bottom, and, immediately preceding the cmov, another def because the cmov is a two_adr instruction. Additionally, there is a compare instruction immediately after the Phi, which has the Phi as an input. The register allocator spills the compare instruction, which is then rematerialized between the cmov and its two_adr input. The split_Rematerialize() fails to recognize that an extra spillCopy node is needed for the Phi input to the rematerialized compare, and thus in the generated code, the compare uses the a value that is not defined by the PhiNode. ###@###.### 2005-1-20 00:05:07 GMT More simply, split_Rematerialize() has a bogus single definition check. The bad code falsely indicates that an LRG has a single def in cases when "in" could be a Phi. ###@###.### 2005-1-26 19:06:03 GMT
13-12-2004