[ 
https://issues.apache.org/jira/browse/XERCESJ-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504083
 ] 

Michael Glavassevich commented on XERCESJ-589:
----------------------------------------------

The number of recursive calls to matchString() is proportional to the length of 
the input.  Increasing the stack size can be used to avoid the problem, but as 
Christiaan pointed out the string could be of any length so regardless of how 
large a stack you specify there will always be an input which is large enough 
that will cause it to overflow.  

For folks watching this bug report who wonder why it's has been open so long 
without a fix, it's primarily been because none of the current developers know 
this part of the code particularly well (a lot of it is older than Xerces 
itself and not well commented; 8+ years) and haven't had the time to the learn 
details well enough to do the re-design (recursion -> iteration).  Likely it 
will be fixed one day, but probably only in the near future if someone from the 
community contributes a patch with a description of the changes and some unit 
tests to help verify it.

> Bug with pattern restriction on long strings
> --------------------------------------------
>
>                 Key: XERCESJ-589
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-589
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema Structures
>    Affects Versions: 2.3.0
>         Environment: Operating System: All
> Platform: All
>            Reporter: Mark Woon
>         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.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to