Project

Profile

Help

Bug #2851

closed

XQuery -explain throws NPE: Internal error: expression () has no retained static context

Added by Gunther Rademacher over 8 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2016-07-21
Due date:
% Done:

100%

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

Description

A NullPointerException has been observed, following a filter elimination message, when using the -explain option of command line XQuery, This can be reproduced by

0[1=2]

OPT ======================================

OPT : At line -1 of null

OPT : Filter expression eliminated because predicate is always false

OPT ====== Expression after rewrite ======

java.lang.NullPointerException: Internal error: expression () has no retained static context

    at net.sf.saxon.expr.Expression.getConfiguration(Expression.java:1097)

    at net.sf.saxon.expr.Expression.explain(Expression.java:995)

    at net.sf.saxon.expr.parser.Optimizer.trace(Optimizer.java:400)

    at net.sf.saxon.expr.FilterExpression.optimize(FilterExpression.java:349)

    at net.sf.saxon.query.XQueryExpression.<init>(XQueryExpression.java:85)

    at net.sf.saxon.Configuration.makeXQueryExpression(Configuration.java:3357)

    at net.sf.saxon.query.XQueryParser.makeXQueryExpression(XQueryParser.java:175)

    at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:589)

    at net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:652)

    at net.sf.saxon.s9api.XQueryCompiler.compile(XQueryCompiler.java:606)

    at net.sf.saxon.Query.compileQuery(Query.java:795)

    at net.sf.saxon.Query.doQuery(Query.java:343)

    at net.sf.saxon.Query.main(Query.java:111)

Fatal error during query: java.lang.NullPointerException: Internal error: expression () has no retained static context

Tested on Saxon-HE 9.7.0.7.

Actions #1

Updated by Michael Kay over 8 years ago

  • Category set to Diagnostics
  • Status changed from New to Resolved
  • Assignee set to Michael Kay
  • Priority changed from Low to Normal
  • Applies to branch 9.8 added
  • Fix Committed on Branch 9.7, 9.8 added

I've committed a patch on the 9.7 and 9.8 branches. (In 9.8 the patch is mixed in with other changes I've been making over the last few days to improve optimizer tracing).

Actions #2

Updated by O'Neil Delpratt about 8 years ago

  • % Done changed from 0 to 100

Bug fix applied in the Saxon 9.7.0.8 maintenance release.

Actions #3

Updated by O'Neil Delpratt about 8 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.7.0.8 added
Actions #4

Updated by O'Neil Delpratt over 7 years ago

  • Applies to branch trunk added
  • Applies to branch deleted (9.8)
Actions #5

Updated by O'Neil Delpratt over 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF