You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2007/08/25 18:33:31 UTC

[jira] Updated: (XERCESJ-380) stackOverflow with maxOccurs over 5000 and less than unbounded

     [ https://issues.apache.org/jira/browse/XERCESJ-380?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich updated XERCESJ-380:
-----------------------------------------

    Fix Version/s: 2.9.1

> stackOverflow with maxOccurs over 5000 and less than unbounded
> --------------------------------------------------------------
>
>                 Key: XERCESJ-380
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-380
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema Structures
>    Affects Versions: 2.0.2
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: afuqua
>            Assignee: Michael Glavassevich
>             Fix For: 2.9.1
>
>
> 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( .... )) );

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org