DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10764>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10764

stackOverflow with maxOccurs over 5000 and less than unbounded

           Summary: stackOverflow with maxOccurs over 5000 and less than
                    unbounded
           Product: Xerces2-J
           Version: 2.0.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


On Windows XP and NT and 2000, when validating a document with the schema 
below, I get a stackOverflow. I've seen the overflow report in 2 different 
locations for different schemas:

java.lang.StackOverflowError
        at org.apache.xerces.impl.xs.models.XSDFACM.postTreeBuildInit
(XSDFACM.java:899)
        ....

java.lang.StackOverflowError
        at org.apache.xerces.impl.xs.models.XSDFACM.calcFollowList
(XSDFACM.java:732)
        ....


Here's an example schema to reproduce the problem:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema";
                targetNamespace="http://www.iss.net/cpe/stackOverflow";
                xmlns:stackOverflow="http://www.iss.net/cpe/stackOverflow";
                elementFormDefault="qualified"
                attributeFormDefault="unqualified">
        
        <element name="policy" type="stackOverflow:PolicyType"/>

        <complexType name="PolicyType">
                <sequence>
                        <!-- fails for me as low as 5000 and up -->
                        <element name='sensitivity' 
type='stackOverflow:sensitivityType' minOccurs='0' maxOccurs='65535'/>
                </sequence>
        </complexType>
        
        <complexType name="sensitivityType">
                <attribute name="sensitivity" type="int" use="required"/>
        </complexType>
</schema>


Here's a code excerpt:
DOMParser domParser = new DOMParser();
domParser.setErrorHandler( errorHandler );
domParser.setFeature( "http://xml.org/sax/features/namespaces";, true );
domParser.setFeature( "http://apache.org/xml/features/validation/schema";, 
true );
domParser.setFeature( "http://xml.org/sax/features/validation";, true );
domParser.setProperty( "http://apache.org/xml/properties/schema/external-
schemaLocation", ....);
domParser.parse( new InputSource( new StringReader( .... )) );

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to