Project

Profile

Help

Bug #3444

closed

IllegalStateException: local variable whose binding has been deleted, after eliminating common subexpressions in a pattern predicate

Added by Michael Kay over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2017-09-13
Due date:
% Done:

100%

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

Description

Branched from issue #3443:

I now tried running with -TP:profile.html and got an exception:

java.lang.IllegalStateException: *** Internal Saxon error: local variable encountered whose binding has been deleted

The problem seems to be with the group-starting-with pattern in

<xsl:for-each-group select="$versionsXML/*"

                        group-starting-with="*[not(preceding-sibling::*[1]/@digest = 

                                 @digest and int:nextDay(preceding-sibling::*[1]/@validToDate) = @validFromDate)]">

at sharedFunctions.xsl#251

(Note this is a compile-time problem; it typically arises because the extra code injected into the expression tree to support run-time profiling makes the optimizer's job more difficult).

Actions #1

Updated by Michael Kay over 6 years ago

Both BasePatternWithPredicate and BooleanExpressionPattern have the predicate as a local variable in the Expression instance, rather than fetching it via an Operand object. This means that when the optimizer rewrites the predicate, for example by introducing a local variable during common subexpression elimination, the parent expression/pattern still points to the old value - which means that the newly created LetExpression is not actually present on the tree.

Actions #2

Updated by Michael Kay over 6 years ago

  • Status changed from New to Resolved
  • Fix Committed on Branch 9.8 added

Fixed both the affected Pattern classes to use Operand objects properly.

Also changed the CommonSubexpressionPromoter to reset cached properties on the affected subtree, ensuring that all nodes recalculate their properties next time they are needed (there may be new or dropped dependencies on local variables).

Actions #3

Updated by O'Neil Delpratt over 6 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.8.0.5 added

Bug fix applied in the Saxon 9.8.0.5 maintenance release.

Please register to edit this issue

Also available in: Atom PDF