Project

Profile

Help

Bug #4522

closed

NullPointerException in Atomizer.iterate

Added by Michael Kay about 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2020-04-17
Due date:
% Done:

100%

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

Description

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

Caused by: java.lang.NullPointerException at net.sf.saxon.expr.Atomizer.iterate(Atomizer.java:353) at net.sf.saxon.expr.AtomicSequenceConverter.iterate(AtomicSequenceConverter.java:297) at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:276) at net.sf.saxon.expr.ItemChecker.evaluateItem(ItemChecker.java:250) at net.sf.saxon.expr.instruct.Choose.evaluateItem(Choose.java:947) at net.sf.saxon.expr.parser.Evaluator$5.evaluate(Evaluator.java:191)

Actions #1

Updated by Michael Kay about 4 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 about 4 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 almost 4 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 over 3 years ago

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

Bug fix applied on the Saxon 9.9.1.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF