Bug #4522


NullPointerException in Atomizer.iterate

Added by Michael Kay over 2 years ago. Updated almost 2 years ago.

Start date:
Due date:
% Done:


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


Reported on saxon-help mailing list by Norm Tovey-Walsh (with repro), against Saxon

Caused by: java.lang.NullPointerException at net.sf.saxon.expr.Atomizer.iterate( at net.sf.saxon.expr.AtomicSequenceConverter.iterate( at net.sf.saxon.expr.CardinalityChecker.evaluateItem( at net.sf.saxon.expr.ItemChecker.evaluateItem( at net.sf.saxon.expr.instruct.Choose.evaluateItem( at net.sf.saxon.expr.parser.Evaluator$5.evaluate(

Actions #1

Updated by Michael Kay over 2 years ago

  • Status changed from New to In Progress

The original error is detected during JIT compilation of the template rule, that is, when the rule first fires. The catch block in TemplateRuleInitializer#81 does rule.setBody(new ErrorExpression(e)) causing run-time failure when the template is executed. But here e is the vanilla message Errors were reported during stylesheet compilation (which is not even accurate), which has no associated error code.

Looks as if we need to improve the handling of static errors that are detected during lazy compilation of template rules when JIT is in force.

Actions #2

Updated by Michael Kay over 2 years ago

  • Status changed from In Progress to Resolved
  • Applies to branch 10, 9.9 added
  • Fix Committed on Branch 10, 9.9 added

Made two changes to the code:

(a) Atomizer.iterate() becomes resilient to the caught exception having no error code

(b) Improvements to the diagnostics when static errors are detected during JIT compilation

Note that the crash does not occur in 10.0, but I have applied the diagnostic improvements (b) to the 10.0 branch as well as 9.9

Actions #3

Updated by O'Neil Delpratt over 2 years ago

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

Bug fix committed in the Saxon 10.1 maintenance release.

Actions #4

Updated by O'Neil Delpratt almost 2 years ago

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

Bug fix applied on the Saxon maintenance release.

Please register to edit this issue

Also available in: Atom PDF