United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6585239 Regression: 2 DNS tests fail with JDK 5.0u13 b01 and pass with 5.0u12fcs
JDK-6585239 : Regression: 2 DNS tests fail with JDK 5.0u13 b01 and pass with 5.0u12fcs

Details
Type:
Bug
Submit Date:
2007-07-25
Status:
Closed
Updated Date:
2010-12-06
Project Name:
JDK
Resolved Date:
2007-09-26
Component:
core-libs
OS:
generic,solaris_10
Sub-Component:
javax.naming
CPU:
sparc,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2_15,1.4.2_24,5.0u13,6u15
Fixed Versions:
5.0u14 (b02)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
Two DNS testcases fail with JDK 5.0u13 b01 and pass with 5.0u12fcs, look like regression introduced in 5.0u13 b01. The tests fail at all platforms. 

The following tests fail:

# ListTests/index.html#ListInteriorCached: index_ListInteriorCached
# NameClassPairTests/index.html#GetNameInNamespace: index_GetNameInNamespace

Both with java.lang.NullPointerException. but pass with prev update. 

= Results can be accessed: 

http://latte.ireland/results/1.5.0_13/Build01/jndi/x86-Nevada-32jvm/SunOS_5.11_x86/DNS/07250950/report/report.html

http://latte.ireland/results/1.5.0_13/Build01/jndi/x86-Nevada-32jvm/SunOS_5.11_x86/DNS/07250950/ListTests/index_ListInteriorCached.jtr

http://latte.ireland/results/1.5.0_13/Build01/jndi/x86-Nevada-32jvm/SunOS_5.11_x86/DNS/07250950/NameClassPairTests/index_GetNameInNamespace.jtr

= How to reproduce:
 
1. log on to jqa-sf1.ireland as root (pasw in comments)

2. set JAVA_HOME 

export JAVA_HOME=/export/home/JDKS/jdk1.5.0_13 

3. execute script 

/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/run_jndi_stand_alone.sh $JAVA_HOME "-client -Xint" DNS

4. find results in /export/home/JQA/ts150/jndi/SunOS_5.11_x86/DNS

= Test log:

#Test Results (version 2)
#Wed Jul 25 09:53:19 BST 2007
#checksum:74e1e15a364e2c4b
#-----testdescription-----
$file=/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/NameClassPairTests/index.html
$root=/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests
executeArgs=$Properties
executeClass=GetNameInNamespace
id=GetNameInNamespace
source=GetNameInNamespace.java

#-----environment-----
CODEMGR_WS=/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI
DNS_DOMAIN=domain1.com.
DNS_PORT=53
DNS_SERVER=bablu.india.sun.com
DNS_V6_SERVER=::FFFF:10.12.151.60
FILEBASE=file:$CODEMGR_WS/testjndi/dns/tests/config
FOREIGN_DOMAIN=Central.Sun.COM.
FOREIGN_LEAF=sunweb
JAVA_HOME=/export/home/JDKS/jdk1.5.0_13
POLICY_FILE=-Djava.security.policy=file://$CODEMGR_WS/testjndi/dns/tests/config/act_policy
Properties=-DDNS_SERVER=$DNS_SERVER -DDNS_V6_SERVER=$DNS_V6_SERVER -DDNS_DOMAIN=$DNS_DOMAIN -DDNS_PORT=$DNS_PORT -DSEC_DNS_SERVER=$SEC_DNS_SERVER -DSEC_DNS_PORT=$SEC_DNS_PORT -DFOREIGN_DOMAIN=$FOREIGN_DOMAIN -DFOREIGN_LEAF=$FOREIGN_LEAF -DFILEBASE=$FILEBASE -Djava.naming.factory.initial=com.sun.jndi.dns.DnsContextFactory 
SEC_DNS_PORT=1053
SEC_DNS_SERVER=bablu.india.sun.com
UTIL=$CODEMGR_WS/testjndi/dns/tests/config
bootClasspath=-client
command.compile.java=javasoft.sqe.javatest.lib.ProcessCommand CLASSPATH=$javatestClassDir:.:$testWorkDir:$UTIL $JAVA_HOME/bin/javac -d $testWorkDir $testSource
command.execute=javasoft.sqe.javatest.lib.ExecJCKTestOtherJVMCmd CLASSPATH=.:$javatestClassDir:$testWorkDir:$UTIL $JAVA_HOME/bin/java $bootClasspath $POLICY_FILE $testExecuteClass $Properties

#-----testresult-----
description=file:///net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/NameClassPairTests/index.html#GetNameInNamespace
end=Wed Jul 25 09:53:19 BST 2007
environment=DNS
execStatus=Failed. Failed: java.lang.NullPointerException
javatestOS=SunOS 5.11 (x86)
javatestVersion=2.1.5
script=javasoft.sqe.javatest.lib.StdTestScript -compile -execute
sections=script_messages compile.java execute
start=Wed Jul 25 09:53:17 BST 2007
status=Failed. Failed: java.lang.NullPointerException
test=NameClassPairTests/index.html#GetNameInNamespace
timeoutSeconds=600
work=/export/home/JQA/ts150/jndi/SunOS_5.11_x86/DNS/07250950/NameClassPairTests

#section:script_messages
----------messages:(0/0)----------

#section:compile.java
----------messages:(1/432)----------
command: javasoft.sqe.javatest.lib.ProcessCommand CLASSPATH=/export/home/JDKS/jdk1.5.0_13/jre/lib/ext/javatest.jar:.:/export/home/JQA/ts150/jndi/SunOS_5.11_x86/DNS/07250950/NameClassPairTests:/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config /export/home/JDKS/jdk1.5.0_13/bin/javac -d /export/home/JQA/ts150/jndi/SunOS_5.11_x86/DNS/07250950/NameClassPairTests NameClassPairTests/GetNameInNamespace.java
----------ref:(0/0)----------
----------log:(15/1072)----------
/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config/TestUtils.java:41: warning: non-varargs call of varargs method with inexact argument type for last parameter;
cast to java.lang.Class for a varargs call
cast to java.lang.Class[] for a non-varargs call and to suppress this warning
			"platformServersAvailable", null);
                                                    ^
/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config/TestUtils.java:43: warning: non-varargs call of varargs method with inexact argument type for last parameter;
cast to java.lang.Object for a varargs call
cast to java.lang.Object[] for a non-varargs call and to suppress this warning
		((Boolean) psa.invoke(null, null)).booleanValue();
                                            ^
Note: NameClassPairTests/GetNameInNamespace.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 warnings
result: Passed. exit code 0

#section:execute
----------messages:(1/847)----------
command: javasoft.sqe.javatest.lib.ExecJCKTestOtherJVMCmd CLASSPATH=.:/export/home/JDKS/jdk1.5.0_13/jre/lib/ext/javatest.jar:/export/home/JQA/ts150/jndi/SunOS_5.11_x86/DNS/07250950/NameClassPairTests:/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config /export/home/JDKS/jdk1.5.0_13/bin/java -client -Djava.security.policy=file:///net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config/act_policy GetNameInNamespace -DDNS_SERVER=bablu.india.sun.com -DDNS_V6_SERVER=::FFFF:10.12.151.60 -DDNS_DOMAIN=domain1.com. -DDNS_PORT=53 -DSEC_DNS_SERVER=bablu.india.sun.com -DSEC_DNS_PORT=1053 -DFOREIGN_DOMAIN=Central.Sun.COM. -DFOREIGN_LEAF=sunweb -DFILEBASE=file:/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config -Djava.naming.factory.initial=com.sun.jndi.dns.DnsContextFactory
----------ref:(43/1815)----------
Environment  : {java.naming.provider.url=dns://bablu.india.sun.com:53/domain1.com., java.naming.factory.initial=com.sun.jndi.dns.DnsContextFactory, FOREIGN_LEAF=sunweb, DNS_V6_SERVER=::FFFF:10.12.151.60, SEC_DNS_SERVER=bablu.india.sun.com, SEC_DNS_PORT=1053, FOREIGN_DOMAIN=Central.Sun.COM., FILEBASE=file:/net/jqa.ireland/jqa6/dtf/dtf_ws/suites/150_JNDI_RMI/testjndi/dns/tests/config, DNS_SERVER=bablu.india.sun.com, DNS_PORT=53, DNS_DOMAIN=domain1.com.}
Domain Name : subdomain.domain1.com.
No of sub test cases : 4
Test -> list(keyStr)
=====================
Name from getName() :host9
Golden Full Name : host9.subdomain.domain1.com.
From getNameInNamespace() : host9.subdomain.domain1.com.

Name from getName() :host8
Golden Full Name : host8.subdomain.domain1.com.
From getNameInNamespace() : host8.subdomain.domain1.com.

Name from getName() :host7
Golden Full Name : host7.subdomain.domain1.com.
From getNameInNamespace() : host7.subdomain.domain1.com.

Name from getName() :host6
Golden Full Name : host6.subdomain.domain1.com.
From getNameInNamespace() : host6.subdomain.domain1.com.

Name from getName() :host5
Golden Full Name : host5.subdomain.domain1.com.
From getNameInNamespace() : host5.subdomain.domain1.com.

Name from getName() :host4
Golden Full Name : host4.subdomain.domain1.com.
From getNameInNamespace() : host4.subdomain.domain1.com.

Name from getName() :host3
Golden Full Name : host3.subdomain.domain1.com.
From getNameInNamespace() : host3.subdomain.domain1.com.

Name from getName() :host2
Golden Full Name : host2.subdomain.domain1.com.
From getNameInNamespace() : host2.subdomain.domain1.com.

Name from getName() :host1
Golden Full Name : host1.subdomain.domain1.com.
From getNameInNamespace() : host1.subdomain.domain1.com.

Test->listBindings(keyName)
============================
----------log:(12/766)----------
java.lang.NullPointerException
	at com.sun.jndi.dns.Resolver.query(Resolver.java:64)
	at com.sun.jndi.dns.Resolver.findSoa(Resolver.java:135)
	at com.sun.jndi.dns.DnsContext.isZoneCurrent(DnsContext.java:893)
	at com.sun.jndi.dns.DnsContext.getNameNode(DnsContext.java:807)
	at com.sun.jndi.dns.DnsContext.c_listBindings(DnsContext.java:313)
	at com.sun.jndi.toolkit.ctx.ComponentContext.p_listBindings(ComponentContext.java:576)
	at com.sun.jndi.toolkit.ctx.PartialCompositeContext.listBindings(PartialCompositeContext.java:312)
	at javax.naming.InitialContext.listBindings(InitialContext.java:411)
	at GetNameInNamespace.run(GetNameInNamespace.java:114)
	at GetNameInNamespace.main(GetNameInNamespace.java:55)
STATUS:Failed. Failed: java.lang.NullPointerException
result: Failed. Failed: java.lang.NullPointerException


test result: Failed. Failed: java.lang.NullPointerException

                                    

Comments
EVALUATION

regression caused through fix for 5053708. dnsClient causes NPE through it being set to null on Resolver.close() method.
                                     
2007-07-31
EVALUATION

According to PDE the two best choices for implementation are the following: (we are contacting the cu, Ericsson, to see which they prefer)

1) The (Dns) Context controls closing of itself. It keeps track of all enumerations obtained from it. If an enumeration over the context is done, that's marked as done by the context and the context is not closed unless its close() method is explicitly called. The context is not closed even if context.close() is called by the application when one of the enumeration is still being used. This allows any number of enumerations to be launched over the context and results in safe closing of the context. This required explicit calling context.close() for closing the connection.

or the current situation: (if the cu is happy with the fix we made then all we have to do is update the testcase in this case)

2) The enumeration (once done) closes the context automatically, even if the application does not explicitly call context.close(). For performing any new operation, a new context needs to be obtained. This would let the applications handle close() for them automatically. However, it won't allow more than one enumeration to be obtained from the given context. This is the current implementation of DNS Provider. 

Obviously option 2) would be preferable as it is a simple enough change to the testcase but we will wait on a customer response.
                                     
2007-08-16



Hardware and Software, Engineered to Work Together