Bug? Local variable has not been allocated a stack frame slot
Wednesday, 8 April 2015 · 4 messages · last reply 9 Apr 2015
MG
Marc van Grootel8 Apr 2015 14:18 #
Hi,
I have hit something which is related to Saxon XSLT. The XSLT in question runs fine standalone (via Oxygen). But when hooked up via RESTXQ I get the type of tracebacks (i've listed all traceback from where it enters Saxon code below).
Although I don't have a full repro case I did manage to make it run by modyfing the expr inside the "group-starting-with".
The code below uses a local variable $i in a predicate. This causes the error below.
<xsl:for-each-group select="$v"
group-starting-with="v[xs:integer(@c) eq $i][text()]">
...
</xsl:for-each-group>The code below runs without problems. Here it's not accessing the local variable inside the grouping attribute.
<xsl:for-each-group select="$v"
group-starting-with="v[text()]">
...
</xsl:for-each-group>Any idea if this is Saxon or BaseX issue?
--Marc
This is the top of the traceback.
Version: BaseX 8.1
Java: Oracle Corporation, 1.7.0_25
OS: Windows 7, amd64
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: Local variable $i
has not been allocated a stack frame slot
at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:102)
at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:453)
at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:173)
at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:36)
at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:692)
at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:139)
at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:131)
at net.sf.saxon.expr.sort.GroupStartingIterator.advance(GroupStartingIterator.java:47)
at net.sf.saxon.expr.sort.GroupMatchingIterator.next(GroupMatchingIterator.java:75)
at net.sf.saxon.expr.instruct.ForEachGroup.processLeavingTail(ForEachGroup.java:743)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138)
at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:382)
at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:507)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:662)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:431)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:373)
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.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:519)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:349)
at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:323)
at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:56)
at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:328)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:398)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:604)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660)
at net.sf.saxon.expr.instruct.Template.expand(Template.java:258)
at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:536)
at net.sf.saxon.Controller.transformDocument(Controller.java:2082)
at net.sf.saxon.Controller.transform(Controller.java:1903)
at org.basex.query.func.xslt.XsltTransform.transformCG
Christian Grün8 Apr 2015 14:23 #
Hi Marc,
I would tend to say it's a Saxon issue. We have no Saxon-specific code in our XSLT functions, and the complete stack trace seems to indicate that something is going wrong in Saxon. – However, I can also have a look at this if you send me an SSCCE for that bug.
Best,
Christian
Quoted text · Marc van Grootel · 76 lines
On Wed, Apr 8, 2015 at 2:18 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Hi, > > I have hit something which is related to Saxon XSLT. The XSLT in > question runs fine standalone (via Oxygen). But when hooked up via > RESTXQ I get the type of tracebacks (i've listed all traceback from > where it enters Saxon code below). > > Although I don't have a full repro case I did manage to make it run by > modyfing the expr inside the "group-starting-with". > > The code below uses a local variable $i in a predicate. This causes > the error below. > > <xsl:for-each-group select="$v" > group-starting-with="v[xs:integer(@c) eq $i][text()]"> > ... > </xsl:for-each-group> > > The code below runs without problems. Here it's not accessing the > local variable inside the grouping attribute. > > <xsl:for-each-group select="$v" > group-starting-with="v[text()]"> > ... > </xsl:for-each-group> > > Any idea if this is Saxon or BaseX issue? > > --Marc > > This is the top of the traceback. > > Version: BaseX 8.1 > Java: Oracle Corporation, 1.7.0_25 > OS: Windows 7, amd64 > Stack Trace: > java.lang.ArrayIndexOutOfBoundsException: Local variable $i > has not been allocated a stack frame slot > at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:102) > at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:453) > at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:173) > at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:36) > at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:692) > at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:139) > at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:131) > at net.sf.saxon.expr.sort.GroupStartingIterator.advance(GroupStartingIterator.java:47) > at net.sf.saxon.expr.sort.GroupMatchingIterator.next(GroupMatchingIterator.java:75) > at net.sf.saxon.expr.instruct.ForEachGroup.processLeavingTail(ForEachGroup.java:743) > at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) > at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) > at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:382) > at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:507) > at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:662) > at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) > at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:431) > at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:373) > 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.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:519) > at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:349) > at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:323) > at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:56) > at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:328) > at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:398) > at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:604) > at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) > at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613) > at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) > at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660) > at net.sf.saxon.expr.instruct.Template.expand(Template.java:258) > at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:536) > at net.sf.saxon.Controller.transformDocument(Controller.java:2082) > at net.sf.saxon.Controller.transform(Controller.java:1903) > at org.basex.query.func.xslt.XsltTransform.transform
MG
Marc van Grootel8 Apr 2015 14:27 #
Sure, I'm going to try this evening. If it's indeed Saxon we would probably need one anyways.
--Marc
Quoted text · Christian Grün · 90 lines
On Wed, Apr 8, 2015 at 2:23 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Marc, > > I would tend to say it's a Saxon issue. We have no Saxon-specific code > in our XSLT functions, and the complete stack trace seems to indicate > that something is going wrong in Saxon. – However, I can also have a > look at this if you send me an SSCCE for that bug. > > Best, > Christian > > > > On Wed, Apr 8, 2015 at 2:18 PM, Marc van Grootel > <marc.van.grootel at gmail.com> wrote: >> Hi, >> >> I have hit something which is related to Saxon XSLT. The XSLT in >> question runs fine standalone (via Oxygen). But when hooked up via >> RESTXQ I get the type of tracebacks (i've listed all traceback from >> where it enters Saxon code below). >> >> Although I don't have a full repro case I did manage to make it run by >> modyfing the expr inside the "group-starting-with". >> >> The code below uses a local variable $i in a predicate. This causes >> the error below. >> >> <xsl:for-each-group select="$v" >> group-starting-with="v[xs:integer(@c) eq $i][text()]"> >> ... >> </xsl:for-each-group> >> >> The code below runs without problems. Here it's not accessing the >> local variable inside the grouping attribute. >> >> <xsl:for-each-group select="$v" >> group-starting-with="v[text()]"> >> ... >> </xsl:for-each-group> >> >> Any idea if this is Saxon or BaseX issue? >> >> --Marc >> >> This is the top of the traceback. >> >> Version: BaseX 8.1 >> Java: Oracle Corporation, 1.7.0_25 >> OS: Windows 7, amd64 >> Stack Trace: >> java.lang.ArrayIndexOutOfBoundsException: Local variable $i >> has not been allocated a stack frame slot >> at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:102) >> at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:453) >> at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:173) >> at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:36) >> at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:692) >> at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:139) >> at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:131) >> at net.sf.saxon.expr.sort.GroupStartingIterator.advance(GroupStartingIterator.java:47) >> at net.sf.saxon.expr.sort.GroupMatchingIterator.next(GroupMatchingIterator.java:75) >> at net.sf.saxon.expr.instruct.ForEachGroup.processLeavingTail(ForEachGroup.java:743) >> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >> at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) >> at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:382) >> at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:507) >> at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:662) >> at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) >> at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:431) >> at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:373) >> 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.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:519) >> at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:349) >> at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:323) >> at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:56) >> at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:328) >> at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:398) >> at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:604) >> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >> at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613) >> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >> at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660) >> at net.sf.saxon.expr.instruct.Template.expand(Template.java:258) >> at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:536) >> at net.sf.saxon.Controller.transformDocument(Controller.java:2082) >> at net.sf.saxon.Controller.transform(Controller.java:1903) >> at org.basex.query.func.xslt.XsltTransform.transform
--
--Marc
MG
Marc van Grootel9 Apr 2015 10:27 #
Bummer, it's very tricky to isolate/repro in a minimal case. At the moment don't have the time to pursue this further.
Maybe later.
--Marc
Quoted text · Marc van Grootel · 101 lines
On Wed, Apr 8, 2015 at 2:27 PM, Marc van Grootel <marc.van.grootel at gmail.com> wrote: > Sure, I'm going to try this evening. If it's indeed Saxon we would > probably need one anyways. > --Marc > > On Wed, Apr 8, 2015 at 2:23 PM, Christian Grün > <christian.gruen at gmail.com> wrote: >> Hi Marc, >> >> I would tend to say it's a Saxon issue. We have no Saxon-specific code >> in our XSLT functions, and the complete stack trace seems to indicate >> that something is going wrong in Saxon. – However, I can also have a >> look at this if you send me an SSCCE for that bug. >> >> Best, >> Christian >> >> >> >> On Wed, Apr 8, 2015 at 2:18 PM, Marc van Grootel >> <marc.van.grootel at gmail.com> wrote: >>> Hi, >>> >>> I have hit something which is related to Saxon XSLT. The XSLT in >>> question runs fine standalone (via Oxygen). But when hooked up via >>> RESTXQ I get the type of tracebacks (i've listed all traceback from >>> where it enters Saxon code below). >>> >>> Although I don't have a full repro case I did manage to make it run by >>> modyfing the expr inside the "group-starting-with". >>> >>> The code below uses a local variable $i in a predicate. This causes >>> the error below. >>> >>> <xsl:for-each-group select="$v" >>> group-starting-with="v[xs:integer(@c) eq $i][text()]"> >>> ... >>> </xsl:for-each-group> >>> >>> The code below runs without problems. Here it's not accessing the >>> local variable inside the grouping attribute. >>> >>> <xsl:for-each-group select="$v" >>> group-starting-with="v[text()]"> >>> ... >>> </xsl:for-each-group> >>> >>> Any idea if this is Saxon or BaseX issue? >>> >>> --Marc >>> >>> This is the top of the traceback. >>> >>> Version: BaseX 8.1 >>> Java: Oracle Corporation, 1.7.0_25 >>> OS: Windows 7, amd64 >>> Stack Trace: >>> java.lang.ArrayIndexOutOfBoundsException: Local variable $i >>> has not been allocated a stack frame slot >>> at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:102) >>> at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:453) >>> at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:173) >>> at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:36) >>> at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:692) >>> at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:139) >>> at net.sf.saxon.pattern.PatternWithPredicate.matches(PatternWithPredicate.java:131) >>> at net.sf.saxon.expr.sort.GroupStartingIterator.advance(GroupStartingIterator.java:47) >>> at net.sf.saxon.expr.sort.GroupMatchingIterator.next(GroupMatchingIterator.java:75) >>> at net.sf.saxon.expr.instruct.ForEachGroup.processLeavingTail(ForEachGroup.java:743) >>> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >>> at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) >>> at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:382) >>> at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:507) >>> at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:662) >>> at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:138) >>> at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:431) >>> at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:373) >>> 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.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:519) >>> at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:349) >>> at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:323) >>> at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:56) >>> at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:328) >>> at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:398) >>> at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:604) >>> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >>> at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:613) >>> at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:875) >>> at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:660) >>> at net.sf.saxon.expr.instruct.Template.expand(Template.java:258) >>> at net.sf.saxon.expr.instruct.CallTemplate$CallTemplatePackage.processLeavingTail(CallTemplate.java:536) >>> at net.sf.saxon.Controller.transformDocument(Controller.java:2082) >>> at net.sf.saxon.Controller.transform(Controller.java:1903) >>> at org.basex.query.func.xslt.XsltTransform.transform > > > > -- > --Marc
--
--Marc
Written for BaseX 8.1. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery