Project

Profile

Help

Bug #4500

ArrayIndexOutOfBounds exception processing XDM Arrays in XSLT

Added by Michael Kay over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2020-03-25
Due date:
% Done:

100%

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

Description

Failure reported by Ruud Grossmann on saxon-help mailing list. Reproduced as XSLT3 test case arrays-304.

StackTrace:

java.lang.IndexOutOfBoundsException: Requested 2, actual size 1
       at net.sf.saxon.ma.parray.ImmList.outOfBounds(ImmList.java:194)
       at net.sf.saxon.ma.parray.ImmList1.subList(ImmList1.java:95)
       at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:114)
       at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:112)
       at net.sf.saxon.ma.parray.ImmList2.subList(ImmList2.java:114)

History

#1 Updated by Michael Kay over 1 year ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 10, 9.9 added

There's an error in the logic for array:subarray(). Probably not worth going into the detail. Arrays are implemented using an immutable binary tree structure, and the implementation for subarray() make recursive calls to extract and concatenate parts of the subtrees, as can be seen on the stack trace.

Patch applies to ImmList2.subList().

#2 Updated by Michael Kay over 1 year ago

Looking at the QT3 tests for array:subarray, they have the problem that none of the arrays used as arguments to array:subarray() have been through any kind of incremental modification process. This means that the internal structure is likely to be very "clean". Some implementations might even use a completely different data structure for an array that is incrementally modified and an array that is static and unchanging after initialisation. The same criticism can also be applied to other array tests in QT3.

Added an XSLT3 test arrays-305 to exercise the code a bit more heavily.

#3 Updated by O'Neil Delpratt over 1 year ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 10.1 added

Bug fix committed in the Saxon 10.1 maintenance release.

#4 Updated by O'Neil Delpratt about 1 year ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 10.2, 9.9.1.8 added
  • Fixed in Maintenance Release deleted (10.1)

Bug fix applied on the Saxon 9.9.1.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF