Project

Profile

Help

Exception during execution in Saxon-HE-9.5.1-2

Added by Vladimir Nesterovsky over 10 years ago

Hello!

Recently I've updated to Saxon-HE-9.5.1-2 from Saxon 9.2, and started to get an exception during the execution. I cannot immediately find XSLT code that fails, as it runs in a batch, but stack trace might help:

 [java]  java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
 [java] 	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
 [java] 	at java.util.ArrayList.get(ArrayList.java:411)
 [java] 	at net.sf.saxon.om.Chain$ChainIterator.next(Chain.java:300)
 [java] 	at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:59)
 [java] 	at net.sf.saxon.expr.CardinalityCheckingIterator.next(CardinalityCheckingIterator.java:88)
 [java] 	at net.sf.saxon.value.SequenceExtent.<init>(SequenceExtent.java:112)
 [java] 	at net.sf.saxon.value.SequenceExtent.makeSequenceExtent(SequenceExtent.java:158)
 [java] 	at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:338)
 [java] 	at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:355)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:478)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:439)
 [java] 	at net.sf.saxon.expr.SlashExpression.map(SlashExpression.java:811)
 [java] 	at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:61)
 [java] 	at net.sf.saxon.tree.iter.HomogeneityCheckerIterator.next(HomogeneityCheckerIterator.java:67)
 [java] 	at net.sf.saxon.expr.instruct.BlockIterator.next(BlockIterator.java:51)
 [java] 	at net.sf.saxon.value.SequenceExtent.<init>(SequenceExtent.java:112)
 [java] 	at net.sf.saxon.value.SequenceExtent.makeSequenceExtent(SequenceExtent.java:158)
 [java] 	at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:338)
 [java] 	at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:355)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:478)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:439)
 [java] 	at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:338)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.evaluateArguments(UserFunctionCall.java:537)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:467)
 [java] 	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:439)
 [java] 	at net.sf.saxon.functions.StringJoin.evaluateItem(StringJoin.java:117)
 [java] 	at net.sf.saxon.functions.StringJoin.evaluateItem(StringJoin.java:34)
 [java] 	at net.sf.saxon.expr.Expression.evaluateAsString(Expression.java:546)
 [java] 	at net.sf.saxon.expr.instruct.SimpleNodeConstructor.processLeavingTail(SimpleNodeConstructor.java:215)
 [java] 	at net.sf.saxon.expr.instruct.ValueOf.processLeavingTail(ValueOf.java:254)
 [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138)
 [java] 	at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:535)
 [java] 	at net.sf.saxon.Configuration.processResultDocument(Configuration.java:1749)
 [java] 	at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:476)
 [java] 	at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:471)
 [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660)
 [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613)
 [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660)
 [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613)
 [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660)
 [java] 	at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:239)
 [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1057)

...

To me it seems like a bug in Saxon itself, as I see no reason to have IndexOutOfBoundsException out from transformation.

Thank you.


Replies (5)

Please register to reply

RE: Exception during execution in Saxon-HE-9.5.1-2 - Added by Michael Kay over 10 years ago

You're absolutely right that it's without doubt a Saxon bug, but we may have difficulty solving it without a repro.

RE: Exception during execution in Saxon-HE-9.5.1-2 - Added by Vladimir Nesterovsky over 10 years ago

This is as simple, as I could get it:



  
    
    

    
      
        
        
        

        
      
    
  



The stack trace is:

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
	at java.util.ArrayList.get(ArrayList.java:411)
	at net.sf.saxon.om.Chain$ChainIterator.next(Chain.java:300)
	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:461)
	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613)
	at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:239)
	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1057)
	at net.sf.saxon.Controller.transformDocument(Controller.java:2080)
	at net.sf.saxon.Controller.transform(Controller.java:1903)

Input is not relevant.

RE: Exception during execution in Saxon-HE-9.5.1-2 - Added by Michael Kay over 10 years ago

Many thanks for the repro. It's a nasty bug, which I have described here:

https://saxonica.plan.io/issues/1924

Will now work on a fix.

I've taken the liberty of adding the test case to the W3C test suite; if you have any licensing concerns on this, please let me know and I will withdraw it.

RE: Exception during execution in Saxon-HE-9.5.1-2 - Added by Vladimir Nesterovsky over 10 years ago

I've taken the liberty of adding the test case to the W3C test suite; if you have any licensing concerns on this, please let me know and I will withdraw it.

No licensing at all here. My concern is to run my code with latest build, otherwise I have to go backward. So, please issue a new build as soon as you can.

Thank you.

RE: Exception during execution in Saxon-HE-9.5.1-2 - Added by Michael Kay over 10 years ago

You're lucky with the timing, because we're about to start building/testing a maintenance release. Our criterion for issuing a new maintenance release is a complex and unpublished formula based on the number and severity of bugs since the last one, and the commercial clout of the users suffering from those bugs ;-)

    (1-5/5)

    Please register to reply