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 "Andy O'Brien (JIRA)" <xe...@xml.apache.org> on 2005/03/18 23:28:20 UTC
[jira] Updated: (XERCESJ-589) Bug with pattern restriction on long strings
[ http://issues.apache.org/jira/browse/XERCESJ-589?page=history ]
Andy O'Brien updated XERCESJ-589:
---------------------------------
Attachment: test.zip
I'm also getting StackOverflow exceptions for this issue. I'm using Xerces 2.6.2, Java 1.3.1_06
Here's my element definition, where large values cause stack problems:
<!-- Test digit tokens w/o beginning, trailing, or adjacent spaces -->
<xsd:element name="foo">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="([0-9] ?)*[0-9]" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
With 10,000 digits for <foo> above, I get a StackOverflow:
Exception in thread "main" java.lang.StackOverflowError
at org.apache.xerces.impl.xpath.regex.Op$UnionOp.elementAt(Unknown Sourc
e)
at org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unkn
own Source)
at org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unkn
own Source)
. . . . . .
My attachment has a simple instance (10,000 digits for <foo> above) and its schema.
A variable size causes exceptions.
Note that another very popular GUI XML tool has problems here too. In their case, they seem to limit the data to 1000 chars. (for <foo> above). Maybe they're avoiding stack issues with such a static value?
In another XML parser though, I get no stack overflow exceptions, nor am I limited in size (at least I haven't seen a problem with it yet).
Sounds like this is still an issue.
> Bug with pattern restriction on long strings
> --------------------------------------------
>
> Key: XERCESJ-589
> URL: http://issues.apache.org/jira/browse/XERCESJ-589
> Project: Xerces2-J
> Type: Bug
> Components: XML Schema Structures
> Versions: 2.3.0
> Environment: Operating System: All
> Platform: All
> Reporter: Mark Woon
> Assignee: Xerces-J Developers Mailing List
> Attachments: test.xml, test.xsd, test.zip
>
> There is a bug with applying a pattern restriction on long strings while trying
> to validate an XML file against a schema. I'm including an xml file and xsd
> file that demonstrates this problem. One character less in <sequence> and the
> problem does not occur.
> As it is, I'm getting
> java.lang.StackOverflowError
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> at
> org.apache.xerces.impl.xpath.regex.RegularExpression.matchString(Unknown Source)
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org