Project

Profile

Help

Bug #1924

closed

ArrayIndexOutOfBounds in Chain.ChainIterator

Added by Michael Kay over 10 years ago. Updated over 10 years ago.

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

100%

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

Description

One of the data structures used for implementing a Sequence in Saxon is the "Chain" structure. This is used in cases where (cursory) static analysis suggests that appending/prepending to the sequence is a likely operation. The data structure is therefore optimized for appending/prepending items, at the cost of finding items by position. If there is then an attempt to find an item by position, the data structure is consolidated to make this efficient. This is intended to work well for situations where a sequence is built incrementally, one item at a time, and is then processed using direct access (integer subscripting). However, the operation of consolidating the structure does not take account of the fact that there might be open iterators working on the original linked list. When the chain is consolidated, a subsequent use of such an iterator is liable to crash. Note that this does not require multi-threading, because it is quite possible for multiple iterators to be active on the same structure even within a single thread.

Please register to edit this issue

Also available in: Atom PDF