Bug #5095
closedTracing with -T fails on overriden global variable (AssertionError: no select expression for global variable)
100%
Description
Running test case accept-040 with the -T option fails with the error
AssertionError: no select expression for global variable
With -T, we attempt early evaluation of global variables (so that the trace makes more sense), and it's probably this that's causing the failure. The variable in question is declared in one package and overridden in another.
Updated by Michael Kay over 2 years ago
We're trying to evaluate a variable $v1 that has visibility="abstract"
which of course is not possible.
It's easy enough to eliminate abstract variables from the pre-evaluation logic in Controller.preEvaluateGlobals()
. The problem is that the variable is being evaluated by virtue of a reference from another global variable ($v1-proxy). This should be evaluating the overriding variable, but the logic to achieve this in the pre-evaluation pass seems to be absent.
Updated by Michael Kay over 2 years ago
The only solution I've been able to find for this is to abandon the attempt to pre-evaluate global variables when tracing.
It was always a bit questionable anyway - there's an argument that tracing should change the execution plan as little as possible.
The reason it's tricky is that the bindings from a global variable to other components depend on where it was called from. In the language of the spec, a global variable V in a used package results in a corresponding global variable V' in the using package, and their values may be different if V references components that are overridden in the using package. In terms of the implementation, a global variable can only really be evaluated in the context of a global variable reference, which provides the "current component" in the context. We're doing this pre-evaluation without setting a current component, and that's essentially why it crashes.
Removing the pre-evaluation reduces the number of test failures when running the test suite with -T to 55 (many of them in test set on-empty).
Updated by Michael Kay over 2 years ago
- Status changed from New to Resolved
- Fix Committed on Branch 10, trunk added
Updated by Debbie Lockett about 2 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 10.7 added
Bug fix applied in the Saxon 10.7 maintenance release.
Please register to edit this issue