Project

Profile

Help

Bug #1991

closed

recursion error, or stack overflow, on match() or analyze-string

Added by Liam Quin almost 11 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Performance
Sprint/Milestone:
-
Start date:
2014-01-28
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I'm getting fatal errors and exceptions with anchored regular expressions when running 9.5.1-4 which I did not get with earlier versions; it applies to both HE and EE as shipped in Oxygen 15.2 and also to HE as downloaded today.

Exception in thread "main" java.lang.StackOverflowError

    at net.sf.saxon.z.IntHashMap.hash(IntHashMap.java:180)

    at net.sf.saxon.z.IntHashMap.indexOf(IntHashMap.java:184)

    at net.sf.saxon.z.IntHashMap.get(IntHashMap.java:90)

    at net.sf.saxon.regex.REMatcher.beenHereBefore(REMatcher.java:458)

    at net.sf.saxon.regex.Operation$OpStar.exec(Operation.java:228)

    at net.sf.saxon.regex.REMatcher.matchNodes(REMatcher.java:413)

    at net.sf.saxon.regex.Operation$OpStar.exec(Operation.java:235)

    at net.sf.saxon.regex.REMatcher.matchNodes(REMatcher.java:413)

    at net.sf.saxon.regex.Operation$OpStar.exec(Operation.java:235)

    at net.sf.saxon.regex.REMatcher.matchNodes(REMatcher.java:413)

    at net.sf.saxon.regex.Operation$OpStar.exec(Operation.java:235)

    at net.sf.saxon.regex.REMatcher.matchNodes(REMatcher.java:413)

and so on.

<xsl:value-of select="replace($boy, '.m[^,],.*', 'blue', 's')" />

where $boy is a few kilobytes in length.

I've enclosed a greatly stripped down example that still goes wrong.

Running with java -Xss512m does make the problem go away for this input.


Files

saxonbug.xsl (7.79 KB) saxonbug.xsl Liam Quin, 2014-01-29 02:29

Related issues

Has duplicate Saxon - Bug #1859: SXLM0001: Too many nested apply-templates calls. The stylesheet may be looping.ClosedMichael Kay2013-08-06

Actions

Please register to edit this issue

Also available in: Atom PDF