On 20/02/2011 19:44, Dimitre Novatchev wrote:
Hi,

When trying to run set.xquery (attached), I get the following error.

I woul appreciate any help in understanding what this error messages
mean and if they are caused by a logic error in my code or they are
due to a bug in Saxon.

This is the same problem as you reported before: Saxon is crashing while reporting a type error (specifically a cardinality error) in the application. The bug is registered here:

http://sourceforge.net/tracker/?func=detail&aid=3174866&group_id=29872&atid=397617

I appreciate that until a maintenance release is available with the patch for this bug, it will be difficult to locate where in your query the error is occurring. You might find that you can obtain useful diagnostics by running with the -T tracing option - the trace should break off at the point where the failure occurs.

Michael Kay
Saxonica

To repro, set.xquery has to be run as the main module,
set-implementation-as-binary-search-tree.xquery must be in a
subdirectory named "implementations", and bintreeModule.xquery must be
in a sibling directory named "BinaryTree".

Additional information that may be useful is that the module
set-implementation-as-binary-search-tree.xquery  is tested well and
all of the functions init behave as expected.


Thanks,
Dimitre Novatchev
----------------------------------------------------------------------

Saxon-EE 9.3.0.4J from Saxonica
Java version 1.6.0_23
****** Saxon evaluation license expires tomorrow! ******
Analyzing query from C:\CVS-DDN\fxsl-xslt3\DataStructures\Set\set.xquery
Analysis time: 739 milliseconds
Processing file:/C:/Program%20Files/Java/jre6/bin/marrowtr.xml
Source document ignored - query does not access the context item
java.lang.ClassCastException:
com.saxonica.functions.hof.CoercedFunction cannot be cast to
net.sf.saxon.om.NodeInfo
	at net.sf.saxon.trans.Err.depict(Err.java:121)
	at net.sf.saxon.expr.CardinalityChecker.depictSequenceStart(CardinalityChecker.java:201)
	at net.sf.saxon.expr.CardinalityChecker.iterate(CardinalityChecker.java:162)
	at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:826)
	at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:143)
	at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:578)
	at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:820)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at com.saxonica.functions.hof.UserFunctionItem.invoke(UserFunctionItem.java:121)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CoercedFunction.invoke(CoercedFunction.java:125)
	at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:166)
	at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:220)
	at net.sf.saxon.expr.ItemChecker.iterate(ItemChecker.java:132)
	at com.saxonica.functions.hof.FunctionSequenceCoercer.iterate(FunctionSequenceCoercer.java:98)
	at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:98)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:407)
	at net.sf.saxon.functions.Empty.effectiveBooleanValue(Empty.java:95)
	at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:233)
	at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:820)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at com.saxonica.functions.hof.UserFunctionItem.invoke(UserFunctionItem.java:121)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CoercedFunction.invoke(CoercedFunction.java:125)
	at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:166)
	at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:220)
	at net.sf.saxon.expr.ItemChecker.iterate(ItemChecker.java:132)
	at com.saxonica.functions.hof.FunctionSequenceCoercer.iterate(FunctionSequenceCoercer.java:98)
	at net.sf.saxon.value.MemoClosure.iterate(MemoClosure.java:98)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:407)
	at net.sf.saxon.functions.Empty.effectiveBooleanValue(Empty.java:95)
	at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:233)
	at net.sf.saxon.expr.instruct.Choose.iterate(Choose.java:820)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at net.sf.saxon.value.Closure.iterate(Closure.java:189)
	at net.sf.saxon.value.Value.getIterator(Value.java:119)
	at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:394)
	at com.saxonica.functions.hof.UserFunctionItem.invoke(UserFunctionItem.java:121)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CurriedFunction.invoke(CurriedFunction.java:112)
	at com.saxonica.functions.hof.CoercedFunction.invoke(CoercedFunction.java:125)
	at com.saxonica.functions.hof.DynamicFunctionCallDefinition$DynamicFunctionCall.call(DynamicFunctionCallDefinition.java:166)
	at net.sf.saxon.functions.IntegratedFunctionCall.iterate(IntegratedFunctionCall.java:220)
	at net.sf.saxon.expr.ItemChecker.iterate(ItemChecker.java:132)
	at com.saxonica.functions.hof.FunctionSequenceCoercer.iterate(FunctionSequenceCoercer.java:98)
	at com.saxonica.config.EnterpriseConfiguration.makeClosure(EnterpriseConfiguration.java:1033)
	at net.sf.saxon.value.Closure.make(Closure.java:94)
	at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:289)
	at net.sf.saxon.expr.UserFunctionCall.evaluateArguments(UserFunctionCall.java:488)
	at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:421)
	at net.sf.saxon.expr.UserFunctionCall.evaluateItem(UserFunctionCall.java:383)
	at net.sf.saxon.expr.TailCallLoop.evaluateItem(TailCallLoop.java:98)
	at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:306)
	at net.sf.saxon.expr.TailCallLoop.tailCallDifferentFunction(TailCallLoop.java:145)
	at net.sf.saxon.expr.TailCallLoop.process(TailCallLoop.java:125)
	at net.sf.saxon.expr.instruct.UserFunction.process(UserFunction.java:368)
	at net.sf.saxon.expr.UserFunctionCall.process(UserFunctionCall.java:453)
	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:571)
	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
	at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:390)
	at net.sf.saxon.Query.runQuery(Query.java:829)
	at net.sf.saxon.Query.doQuery(Query.java:364)
	at net.sf.saxon.Query.main(Query.java:93)
Fatal error during query: java.lang.ClassCastException:
com.saxonica.functions.hof.CoercedFunction cannot be cast to
net.sf.saxon.om.NodeInfo




------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help