Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4788015
Votes 0
Synopsis multiple unmarshalling/validation/marshalling cause jdk1.3.1 core dump error
Category jaxb-xsd:runtime
Reported Against fcs1.0
Release Fixed 1.0(fcs1.0)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs 4479571 , 4532134
Submit Date 04-DEC-2002
Description



unmarshalling/validation/marshalling of a single xml document in a single JVM
with large number of different context paths causes jdk1.3.1 core dump or 
"Exception in thread "main"" failure.
The same schema was compiled 800 times with different packages specified. 
Then the test is run that unmarshalls, validates and marshalls a single document
in a single JVM. Each time the test used classes from different package.
jdk1.3.1 VM exits either with core dump or "Exception in thread "main"" message 
definitely on 510-th iteration independently on whether -Xmx512m or -Xmx256m or 
no -Xmx option is specified for JVM.

Here is the failure log:

novo81% runtest.sh
...
step 509 Passed. test cases: 3; all passed
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns1:root str10-?="b" str07A?="a" str19-?="b" str28?="c" str06A?="a" str13-?="b" 
str00A?="a" str17-?="b" str01A?="a" str11-?="b" str20?="c" str23?="c" str04A?="a" 
str29?="c" str27?="c" str16-?="b" str26?="c" str22?="c" str21?="c" str09A?="a" 
str05A?="a" str08A?="a" str02A?="a" str15-?="b" str18-?="b" str12-?="b" str03A?="a" 
str25?="c" xmlns:ns1="AttrDecl/name"></ns1:root>

unmarshal: Passed. OK
unmarshalThenValidate: Passed. OK
marshal: Passed. OK
step 510 Passed. test cases: 3; all passed
unmarshal: Failed. no error events are handled but javax.xml.bind.JAXBException: 
Provider com.sun.xml.bind.ContextFactory could not be instantiated: 
java.lang.reflect.InvocationTargetException   - with linked exception:
[java.lang.reflect.InvocationTargetException] is thrown
unmarshalThenValidate: Failed. javax.xml.bind.JAXBException: 
Provider com.sun.xml.bind.ContextFactory could not be instantiated: 
java.lang.reflect.InvocationTargetException   - with linked exception: 
[java.lang.reflect.InvocationTargetException]
marshal: Failed. javax.xml.bind.JAXBException: Provider com.sun.xml.bind.ContextFactory 
could not be instantiated: java.lang.reflect.InvocationTargetException   - with linked 
exception: [java.lang.reflect.InvocationTargetException]
step 511...

...

step 516 Failed. test cases: 3; all failed; first test case failure: unmarshal
#
# HotSpot Virtual Machine Error, Internal Error
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Error ID: 4349254E560E43505000F4 01
#
# Problematic Thread: prio=5 tid=0xa74e8 nid=0xb runnable 
#
novo81%


800 iteration test successfully passes on jdk1.4.1.

The attached .tgz archive contains:

AD_name00108m5.xsd    - schema to compile.
AD_name00108m5_p.xml  - document to unmarshall/validate/marshall

SchemaTest.java       - the base class which compiles specified schema specified number 
                        of times in a cycle in a single VM.
Xjc.java              - the class which compiles an .xsd file with schema compiler,
                        then, compiles generated java sources.
runschema.sh          - the script which compiles SchemaTest.java, Xjc.java then 
                        runs SchemaTest.
                        
JAXBTest.java         - the class which unmarshalls/validates/marshalls specified document.
JAXBTestBase.java     - the base class of JAXBTest, parses arguments.
ErrorCollector.java   - auxilary class.
RunTest.java          - the class which runs unmarshalling/validation/marshalling of the 
                        document specified number of times in a cycle in a single JVM.
runtest.sh            - the script which compiles JAXBTest.java, JAXBTestBase.java, 
                        ErrorCollector.java, RunTest.java then runs RunTest.
jttck.jar             - contains some JavaTest-specific classes.

Xjc.java, JAXBTest.java, JAXBTestBase.java, ErrorCollector.java are taken from
JAXB TCK as is (only package decalrations are removed).

The archive was packed:
tar cvf - jdk131_core_bug | gzip -c9 > jdk131_core_bug.tgz

To reproduce the bug:
1. Unpack attached .tgz archive.
2. Specify your JAVA_HOME and JAXB_HOME values in runschema.sh and runtest.sh.
3. Run runschema.sh and wait for approximately 1000-th schema compilation iteration
   (this may take several days). To speed-up 1000 schema compilation process you
   can start several runschema.sh scripts concurrently specifying different range
   of integer values (RunTest arguments) in each runschema.sh.
4. Run runtest.sh.

Due to this bug JAXB TCK QA runs in a singleJVM mode fail on jdk1.3.1.


======================================================================
Work Around


Found workaround is to use -server option. jdk1.3.1 Server VM passes this 
stress test.


======================================================================
Evaluation
This is a documented out of memory problem with hot spot 1.3.0 and 1.3.1 as documented
in bugtraq #:
4532134 HotSpot virtual machine error
4479571 JVM core dumps after receiving out of memory messages

  xxxxx@xxxxx   2002-12-04


Running XJC unit test with the "-verbose:gc" VM option revealed that the Class objects
of the generated classes are not properly reclaimed. This means it will cause a memory
leak if JAXB is used in Servlet/EJB where classes can be deployed and re-deployed.

  xxxxx@xxxxx   2003-01-09
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang