JDK-7059542 : JNDI name operations should be locale independent
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 6,7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-26
  • Updated: 2017-02-22
  • Resolved: 2012-05-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 Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 JDK 8 Other
6u105Fixed 7u91Fixed 8 b04Fixed openjdk7uFixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
This test has failed a couple of times for me when running the jtreg tests in -agentvm mode. The JDK under test is a build of jdk8/tl/jdk, which is currently about the same as jdk7-b146. I have not studied the failure, it doesn't happen every time, and could very well be a VM bug.


#Test Results (version 2)
#Sun Jun 26 11:36:08 IST 2011
#checksum:7d5d94ffdeaead11
#-----testdescription-----
$file=/export/Users/ab23780/ws/jdk8/tl/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java
$root=/export/Users/ab23780/ws/jdk8/tl/jdk/test
keywords=bug4635618
run=ASSUMED_ACTION main CompareToEqualsTests\n
source=CompareToEqualsTests.java
title=Support for manipulating LDAP Names

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

#-----testresult-----
description=file:/export/Users/ab23780/ws/jdk8/tl/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java
elapsed=284 0:00:00.284
end=Sun Jun 26 11:36:08 IST 2011
environment=regtest
execStatus=Failed. Execution failed: `main' threw exception: java.lang.Exception: hashCode test failed for name1:cn=config name2:Cn=COnFIG
hostname=finglas
javatestOS=Linux 2.6.31-14-generic (i386)
javatestVersion=4.1.4
script=com.sun.javatest.regtest.RegressionScript 
sections=script_messages build compile main
start=Sun Jun 26 11:36:08 IST 2011
test=javax/naming/ldap/LdapName/CompareToEqualsTests.java
work=/u/alanb/tmp/JTwork/javax/naming/ldap/LdapName

#section:script_messages
----------messages:(4/208)----------
JDK under test: (/u/alanb/tmp/jdk1.8)
java version "1.8.0-internal"
Java(TM) SE Runtime Environment (build 1.8.0-internal-201106241632.ab23780.jdk-b00)
Java HotSpot(TM) Server VM (build 21.0-b16, mixed mode)

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

#section:compile
----------messages:(3/192)----------
command: compile /export/Users/ab23780/ws/jdk8/tl/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java
reason: .class file out of date or does not exist
elapsed time (seconds): 0.135
----------direct:(2/189)----------
Note: /export/Users/ab23780/ws/jdk8/tl/jdk/test/javax/naming/ldap/LdapName/CompareToEqualsTests.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
result: Passed. Compilation successful

#section:main
----------messages:(3/139)----------
command: main CompareToEqualsTests
reason: Assumed action based on file name: run main CompareToEqualsTests 
elapsed time (seconds): 0.121
----------System.out:(6/352)----------
Checking name1: ou=Sales+cn=Bob and name2: ou=Sales+cn=Bob
Checking name1: ou=Sales+cn=Bob and name2: cn=Bob+ou=Sales
Checking name1: ou=Sales+cn=Bob and name2: ou=Sales+cn=Scott
Checking name1: ou=Sales+cn=Scott+c=US and name2: ou=Sales+cn=Scott
Checking name1: cn=config and name2: Cn=COnFIG
name1.hashCode(): 1993513894 name2.hashCode(): 1993506733
----------System.err:(13/717)----------
java.lang.Exception: hashCode test failed for name1:cn=config name2:Cn=COnFIG
	at CompareToEqualsTests.checkResults(CompareToEqualsTests.java:118)
	at CompareToEqualsTests.main(CompareToEqualsTests.java:65)
	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:601)
	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.Exception
JavaTest Message: shutting down test

result: Failed. Execution failed: `main' threw exception: java.lang.Exception: hashCode test failed for name1:cn=config name2:Cn=COnFIG


test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: hashCode test failed for name1:cn=config name2:Cn=COnFIG

Comments
SUGGESTED FIX Reserve and rollback the system default local setting in the following tests: test/closed/sun/nio/cs/sunio/Test4206507.java test/javax/crypto/Cipher/Turkish.java test/java/security/Provider/Turkish.java test/java/util/jar/JarFile/TurkCert.java Make hashCode() and compareTo() locale independent in the following source code: src/share/classes/javax/naming/ldap/Rdn.java
08-07-2011

EVALUATION The unexpected result of String.toUpperCase() may be the underlying of the issue. In agentvm mode, when running thousands of tests, other tese case may override the default locale, and the result of String.toUpperCase() may not be reliable in hashCode() and compareTo() methods. See CR 7063702 for similar cases.
07-07-2011