Project

Profile

Help

Bug #1738

closed

Null pointer exception when bytecode is on

Added by O'Neil Delpratt almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Byte code generation
Sprint/Milestone:
-
Start date:
2013-04-23
Due date:
% Done:

100%

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

Description

Bug reported by Peter Rushforth:

I've upgraded a project from saxon 9.3.0.8 to 9.4.0.7 and I'm running into an exception that works using using the former but not the latter.

Here's the stack trace

java.lang.NullPointerException

    at CE_atom_entry_28505582.process(:291)

    at com.saxonica.bytecode.CompiledExpression.process(CompiledExpression.java:60)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:617)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:131)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:301)

    at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:254)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:609)

    at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:615)

    at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:212)

    at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1034)

    at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:58)

    at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:1022)

    at net.sf.saxon.Controller.transformDocument(Controller.java:1959)

    at net.sf.saxon.Controller.transform(Controller.java:1805)

    at org.atomserver.abdera.TransformBaseResponseContext.transfrom(TransformBaseResponseContext.java:134)

The xml document and a modified stylesheet are attached.


Files

iso2html.xsl (159 KB) iso2html.xsl Modified xsl to prevent exceeding method length limits in bytecode generation O'Neil Delpratt, 2013-04-23 16:47
iso.xml (47.8 KB) iso.xml O'Neil Delpratt, 2013-04-23 16:47
Actions #1

Updated by O'Neil Delpratt almost 11 years ago

Incidentally what led to this error is in the code snippet below from your stylesheet you pass empty sequence for the last 2 arguments of format-dateTime:

'<xsl:value-of select="format-dateTime(xs:dateTime(atom:updated), '[MNn] [D], [Y]', $lang, (), ())"/>'

I have now committed a fix in the area of format-dateTime.

I am on the trail of another bug which is causing a crash in the stylesheet

Actions #2

Updated by O'Neil Delpratt almost 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100
  • Found in version set to 9.4 9.5

Bug fixed in Saxon 9.4 and 9.5. Committed to subversion.

For the functions: format-date, format-dateTime and format-time they had the wrong expected cardinality of the result to the function. Specifically, the data used to determine the static type gave the result type as (string) rather than (string?), and the byte-code generation was therefore assuming that a null result (indicating empty sequence) could not occur, and was not generating code to check for it.

Actions #3

Updated by O'Neil Delpratt almost 11 years ago

  • Status changed from Resolved to Closed
  • Found in version changed from 9.4 9.5 to 9.5
  • Fixed in version set to 9.5.0.2

Please register to edit this issue

Also available in: Atom PDF