Bug #4523
closed"XError: looping???" from tokenize
0%
Description
Syd Bauman shared issue on saxon-help list:
"If I try to access a variable that has a long string I get an "XError: looping???" error. [...]
To see a nicely set up (if I do say so myself) demonstration and description of the bug (1), see https://bauman.zapto.org/~syd/temp/transfer/bug_demo.tgz
That tarball includes three files:
- bug_demo.html: a host HTML file with a detailed description,
- bug_demo.xml: a source XML document designed to make it easy to see how many words should be reported, and
- bug_demo.xslt: an XSLT program that does very little above and beyond what is necessary to throw the error.
P.S. Just accessing the string isn't the problem, of course. E.g., string-length() seems to work."
Files
Updated by Debbie Lockett over 4 years ago
- File bug_demo.html bug_demo.html added
- File bug_demo.xml bug_demo.xml added
- File bug_demo.xslt bug_demo.xslt added
Updated by Debbie Lockett over 4 years ago
- Status changed from New to In Progress
The error is thrown from the analyze
function in Expr.js in Saxon-JS 1.2.0:
if (loops++ > 1000) {
throw XError("looping???", "SXJS0004");
}
This analyze
function is called from analyze-string
and tokenize
in CoreFn.js, and formatNumberSeq
in Numberer.js.
Note that the error still exists in Saxon-JS 2.0 code, but has been slightly updated. The relevant analyze
function in now found in Push.js:
if (loops++ > input.length * 10) {
throw new XError("analyze-string looping???", "SXJS0004");
}
I see the error thrown running the demo with Saxon-JS 1.2.0, but not with Saxon-JS 2.0; I guess because of the loops++ >
condition change.
Updated by Michael Kay over 4 years ago
That would be the problem then: Syd says he was using a very long string; if it contains more than 1,000 tokens then we're going to get this error, and the 2.0 change should fix it.
Updated by Debbie Lockett over 4 years ago
- Status changed from In Progress to Resolved
- Fix Committed on JS Branch 1.0 added
Copied 2.0 change for loops++ >
condition to Saxon-JS 1 branch, and committed. (The error message is just left as is, because the error shouldn't ever actually happen...)
Updated by Norm Tovey-Walsh almost 4 years ago
- Status changed from Resolved to Closed
Please register to edit this issue
Also available in: Atom PDF Tracking page