I haven't seen this before. I'm always reluctant to adopt this theory, but gut instincts suggest a possible JVM bug. These seem to be much more frequent on 64-bit systems.

Is there any multi-threading going on?

The access$000 method is apparently a reference from an inner class to a private field in an outer class, which fits the pattern of a reference from the ProgressiveIterator class to the reservoir array.

The logic of the class is that a ProgressiveIterator is never allocated until reservoir has been set to a non-null value, and reservoir is never reset to null. It's complex code and although it's been stable and unchanged for many years I wouldn't rule out a bug, but the fact that the problem is unpredictable suggests to me either a threading bug (and that's unlikely given that MemoClosure is dynamically created during a transformation) or a just-in-time compilation error.

Michael Kay

On 14/09/2010 12:10 PM, Jan Stette wrote:
I'm seeing an intermittent problem with Saxon that's causing some real headache for my users; I'm hoping someone could have a look and offer any insights as to what might be going wrong.  The stack trace is given below; as you can see our code calls Transformer.transform(), but it goes wrong at some point.  The exception is intermittent, I can not reliably reproduce it by running this code with the exact same input data.  However, when it does happen, there are indications that it will keep happening on the same data, until the process is restarted (though this isn't 100% certain).  I can't tell from the source code what might have gone wrong, it looks to me there's no way that that line in MemoClosure$ProgressiveIterator could access a null pointer (nor the following line...).  But I don't really know this code at all.

Hoping someone could shed some light on this.


(This is happening with Saxon, Java 1.6.0_17 on 64-bit Linux)

Caused by: java.lang.NullPointerException 
at net.sf.saxon.value.MemoClosure.access$000(MemoClosure.java:48) 
at net.sf.saxon.value.MemoClosure$ProgressiveIterator.next(MemoClosure.java:322) 
at net.sf.saxon.functions.Aggregate.count(Aggregate.java:286) 
at net.sf.saxon.functions.Aggregate.evaluateItem(Aggregate.java:97) 
at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:552) 
at net.sf.saxon.instruct.Choose.evaluateItem(Choose.java:654) 
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:295) 
at net.sf.saxon.instruct.UserFunction.call(UserFunction.java:318) 
at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:389) 
at net.sf.saxon.expr.UserFunctionCall.iterate(UserFunctionCall.java:368) 
at net.sf.saxon.expr.Expression.effectiveBooleanValue(Expression.java:421) 
at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:618) 
at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) 
at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:300) 
at net.sf.saxon.instruct.Template.expand(Template.java:192) 
at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) 
at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) 
at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) 
at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) 
at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) 
at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175) 
at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:343) 
at net.sf.saxon.Controller.transformDocument(Controller.java:1735) 
at net.sf.saxon.Controller.transform(Controller.java:1559) 

------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help