Hi Michael, and thanks for a quick reply.  I was wondering about a possible JVM bug myself but was hoping there would be a simpler explanation...  There is some threading going on in the sense that there are other threads in our application, but as you say, the objects involved in this stack trace are created dynamically for this transform so I can't see how this bit could interact with other threads.

I'll have a look down the JIT route anyway and see what I can find.

Thanks,
Jan

On 14 September 2010 12:55, Michael Kay <mike@saxonica.com> wrote:
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
Saxonica


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.

Regards,
Jan

(This is happening with Saxon 9.0.0.3, 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


------------------------------------------------------------------------------
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